CN109660573B - Data transmission method and device - Google Patents

Data transmission method and device Download PDF

Info

Publication number
CN109660573B
CN109660573B CN201710934953.9A CN201710934953A CN109660573B CN 109660573 B CN109660573 B CN 109660573B CN 201710934953 A CN201710934953 A CN 201710934953A CN 109660573 B CN109660573 B CN 109660573B
Authority
CN
China
Prior art keywords
component
monitoring
client
request
heterogeneous language
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
CN201710934953.9A
Other languages
Chinese (zh)
Other versions
CN109660573A (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.)
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology 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 Beijing Jingdong Century Trading Co Ltd, Beijing Jingdong Shangke Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN201710934953.9A priority Critical patent/CN109660573B/en
Publication of CN109660573A publication Critical patent/CN109660573A/en
Application granted granted Critical
Publication of CN109660573B publication Critical patent/CN109660573B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/51Discovery or management thereof, e.g. service location protocol [SLP] or web services
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources

Landscapes

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

Abstract

The embodiment of the application discloses a data transmission method and device. One embodiment of the method comprises: responding to the detection that the heterogeneous language component initiates a service calling request containing request parameters, packaging the request parameters, and sending the packaged request parameters to a monitoring component so as to obtain data indicated by the service calling request from the target server through the monitoring component; and transmitting the data acquired by the monitoring component to the heterogeneous language component. This embodiment increases the flexibility of service invocation.

Description

Data transmission method and device
Technical Field
The application relates to the technical field of computers, in particular to the technical field of internet, and particularly relates to a data transmission method and device.
Background
With the development of computer technology, each internet company is usually developed by using a development language (e.g., Java language) and an RPC (Remote Procedure Call protocol) framework (e.g., open-source Dubbo, an RPC framework developed by the enterprise itself, etc.) which can satisfy the development of main business of the company. However, as The kinds of services increase, internet companies generally introduce more development languages (such as Lua Language or gold (Go Language), etc.), which cannot directly call services through a service interface because The RPC framework used does not support The call of The development languages.
In the existing method, an HTTP (HyperText Transfer Protocol) gateway is usually built in an RPC framework or in a separate machine, and service call is performed through the HTTP gateway. However, if the HTTP gateway is deployed in the RPC framework, there is a problem that the response time is too long under the conditions of cross-regional machine room and cross-national network call; if the HTTP gateway is built in a separate machine, not only is the burden of machine resources increased, but also a separate operation cost is required to ensure the availability of the HTTP gateway at high traffic load. Therefore, the existing method has the problem of low flexibility of service calling.
Disclosure of Invention
An object of the embodiments of the present application is to provide an improved data transmission method and apparatus, so as to solve the technical problems mentioned in the above background.
In a first aspect, an embodiment of the present application provides a data transmission method for a first client, where the first client runs a heterogeneous language component and a monitoring component, the heterogeneous language component is used to initiate a service invocation request through a heterogeneous language that is not supported by a service interface of a target server, and the monitoring component is used to monitor a TCP port; the method comprises the following steps: responding to the detected heterogeneous language component to initiate a service calling request containing request parameters, packaging the request parameters, and sending the packaged request parameters to a monitoring component so as to obtain data indicated by the service calling request from a target server through the monitoring component; and transmitting the data acquired by the monitoring component to the heterogeneous language component.
In some embodiments, prior to initiating the service invocation request containing the request parameters in response to detecting the foreign language component, the method further comprises: starting a monitoring component and a heterogeneous language component in sequence; and analyzing the preset monitoring address list, and determining a local TCP monitoring address to be connected with the heterogeneous language component so as to enable the heterogeneous language component to establish a connection pool with the local TCP monitoring address, wherein the local TCP monitoring address comprises an Internet Protocol (IP) address of the first client and a port number of a TCP port monitored by the monitoring component.
In some embodiments, after the listening component and the heterogeneous language component are started in sequence, the method further comprises: and analyzing the monitoring address list, and determining a TCP monitoring address of a second client to be connected with the heterogeneous language component so as to enable the heterogeneous language component to establish a connection pool with the TCP monitoring address of the second client, wherein the TCP monitoring address of the second client comprises the IP address of the second client and the port number of a TCP port monitored by the monitoring component operated by the second client.
In some embodiments, after initiating a service invocation request containing request parameters in response to detecting the foreign language component, the method further comprises: and if so, determining that a local connection pool established by the heterogeneous language component and the local TCP monitoring address can be used, transmitting the request parameter to the local connection pool, so that the local connection pool encapsulates the request parameter, and transmitting the encapsulated request parameter to the monitoring component, so as to acquire data indicated by the service calling request from the target server through the monitoring component.
In some embodiments, after initiating a service invocation request containing request parameters in response to detecting the foreign language component, the method further comprises: and in response to determining that the local TCP port does not support connection, transmitting the request parameters to a connection pool of the heterogeneous language component and the second client, so as to package the request parameters through the connection pool of the second client, transmit the packaged request parameters to a monitoring component operated by the second client, and acquire data indicated by the service call request from the target server through the monitoring component operated by the second client.
In a second aspect, an embodiment of the present application provides a data transmission apparatus for a first client, where the first client runs a heterogeneous language component and a listening component, the heterogeneous language component is used to initiate a service invocation request through a heterogeneous language that is not supported by a service interface of a target server, and the listening component is used to listen to a TCP port, the apparatus includes: the sending unit is configured to respond to the detection that the heterogeneous language component initiates a service calling request containing the request parameter, package the request parameter, and send the packaged request parameter to the monitoring component so as to obtain data indicated by the service calling request from the target server through the monitoring component; and the first transmission unit is configured to transmit the data acquired by the monitoring component to the heterogeneous language component.
In some embodiments, the apparatus further comprises: the starting unit is configured for starting the monitoring component and the heterogeneous language component in sequence; the first establishing unit is configured to analyze a preset monitoring address list, determine a local TCP monitoring address to be connected with the heterogeneous language component, and enable the heterogeneous language component to establish a connection pool with the local TCP monitoring address, where the local TCP monitoring address includes an internet protocol IP address of the first client and a port number of a TCP port monitored by the monitoring component.
In some embodiments, the apparatus further comprises: and the second establishing unit is configured to analyze the monitoring address list, determine a TCP monitoring address of a second client to be connected with the heterogeneous language component, and establish a connection pool with the TCP monitoring address of the second client by the heterogeneous language component, wherein the TCP monitoring address of the second client includes an IP address of the second client and a port number of a TCP port monitored by the monitoring component operated by the second client.
In some embodiments, the apparatus further comprises: and the second transmission unit is configured to determine whether the local TCP port supports connection, determine that a local connection pool established by the heterogeneous language component and the local TCP monitoring address can be used if the local TCP port supports connection, transmit the request parameter to the local connection pool, so that the local connection pool encapsulates the request parameter, and send the encapsulated request parameter to the monitoring component, so that data indicated by the service invocation request is acquired from the target server through the monitoring component.
In some embodiments, the apparatus further comprises: and the third transmission unit is configured to transmit the request parameter to a connection pool of the heterogeneous language component and the second client in response to the determination that the local TCP port does not support connection, to encapsulate the request parameter through the connection pool of the second client, transmit the encapsulated request parameter to a monitoring component operated by the second client, and acquire data indicated by the service invocation request from the target server through the monitoring component operated by the second client.
In a third aspect, an embodiment of the present application provides a client, including: one or more processors; the running heterogeneous language component is used for calling the service of the target server through the heterogeneous language which is not supported by the service interface of the target server; the monitoring component is used for monitoring a Transmission Control Protocol (TCP) port; a storage device to store one or more programs that, when executed by one or more processors, cause the one or more processors to implement a method as in any embodiment of the data transmission method.
In a fourth aspect, embodiments of the present application provide a computer-readable storage medium on which a computer program is stored, where the computer program, when executed by a processor, implements a method as in any of the embodiments of the data transmission method.
According to the data transmission method and device provided by the embodiment of the application, the request parameter is packaged by detecting that the heterogeneous language component initiates the service calling request containing the request parameter, the packaged request parameter is sent to the monitoring component, so that the data indicated by the service calling request is obtained from the target server through the monitoring component, and then the data obtained by the monitoring component is transmitted to the heterogeneous language component, so that the client can access the RPC framework through the internal monitoring component, the problems of cross-regional machine rooms and cross-national networks can be avoided, and the service calling performance is improved; in addition, by multiplexing the locally deployed monitoring component, additional machine resources are saved, the monitoring component directly initiates the call of the service related to the RPC framework, a flow convergence process does not exist, and the flexibility of the service call is improved.
Drawings
Other features, objects and advantages of the present application will become more apparent upon reading of the following detailed description of non-limiting embodiments thereof, made with reference to the accompanying drawings in which:
FIG. 1 is an exemplary system architecture diagram in which the present application may be applied;
FIG. 2 is a flow diagram of one embodiment of a data transmission method according to the present application;
FIG. 3 is a schematic diagram of an application scenario of a data transmission method according to the present application;
FIG. 4 is a flow diagram of yet another embodiment of a data transmission method according to the present application;
FIG. 5 is a schematic block diagram of one embodiment of a data transmission device according to the present application;
FIG. 6 is a block diagram of a computer system suitable for use in implementing a client of an embodiment of the present application.
Detailed Description
The present application will be described in further detail with reference to the following drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the relevant invention and not restrictive of the invention. It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings.
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
Fig. 1 shows an exemplary system architecture 100 to which the data transmission method or data transmission apparatus of the present application may be applied.
As shown in FIG. 1, system architecture 100 may include clients 101, network 102, and servers 103. Network 102 serves as a medium for providing communication links between clients 101 and servers 103. Network 102 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
A user may use a client 101 to interact with a server 103 over a network 102 to receive or send messages and the like. Various messaging client applications, such as a web browser application, a shopping-like application, a search-like application, an instant messaging tool, a mailbox client, social platform software, etc., may be installed on the client 101.
The client 101 may be a variety of electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablets, laptop portable computers, desktop computers, and the like.
The server 103 may be a server providing various services, and the server 103 may issue a service interface (e.g., an issue order query interface) based on an RPC framework, and the client 101 may call a corresponding service (e.g., a query order) through the RPC framework.
It should be noted that the data transmission method provided in the embodiment of the present application is generally executed by the client 101, and accordingly, the data transmission apparatus is generally disposed in the client 101.
It should be understood that the number of clients, networks, and servers in FIG. 1 is merely illustrative. There may be any number of clients, networks, and servers, as desired for an implementation.
With continued reference to fig. 2, a flow 200 of one embodiment of a data transmission method for a first client according to the present application is shown. The first client runs a heterogeneous language component and a monitoring component, and the data transmission method comprises the following steps:
step 201, in response to detecting that the heterogeneous language component initiates a service invocation request containing a request parameter, encapsulating the request parameter, and sending the encapsulated request parameter to the monitoring component, so as to obtain data indicated by the service invocation request from the target server through the monitoring component.
In this embodiment, an electronic device (e.g., the client 101 shown in fig. 1) on which the information transmission method operates may operate with a heterogeneous language component and a listening component. The electronic device, in response to detecting that the heterogeneous language component initiates a service invocation request including a request parameter (for example, the request parameter for invoking an order query service may include an order number, a timestamp, and other parameters), may encapsulate the request parameter, and send the encapsulated request parameter to the monitoring component, so as to obtain, by the monitoring component, data indicated by the service invocation request from the target server. The heterogeneous language component may be configured to initiate a service call request for a service provided by the target server (e.g., the server 103 shown in fig. 1) through a heterogeneous language (e.g., Lua language or gold) that is not supported by a service interface (service interface) of the target server. Here, the heterogeneous language component may be a package of a method for implementing a service invocation function, and the service invocation function is written in a heterogeneous language. The target server may be a server (e.g., a server providing an order query service) providing a service based on an RPC framework (e.g., Dubbo of open source, RPC framework developed by the enterprise itself, etc.). In practice, the RPC framework is a framework for implementing cross-machine, cross-process service calls to program code. The service provider can publish the service based on the RPC framework, and the service user can call the service through the RPC framework. Since the RPC framework usually maintains only one development language (e.g., Java language) version, and both the issuing service and the calling service need to be performed using the maintained development language and cannot be performed using a different language different from the maintained development language, the service interface of the target server only supports the service calling request of the development language (e.g., Java language) that is consistent with the language used by the RPC framework, and does not support the service calling request of the different language.
It should be noted that the above-mentioned snooping component may be a component (e.g., a TCPListener component) for snooping a Transmission Control Protocol (TCP) port (e.g., TCP: 8899). The listening component may support the TCP protocol, which may maintain long connections and reliable transmission of data. The snooping component can be developed using the same language (e.g., Java language) as the RPC framework, and can internally initiate a snoop port using the existing TCP protocol. After the monitoring component monitors the request parameters, the remote service of the RPC framework can be called, so that the data indicated by the service calling request can be acquired from the target server.
It should be noted that the electronic device may encapsulate the request parameter in various ways. As an example, the request parameter may be encapsulated into JSON (JSON Object Notation) format; or packaging the request parameters into a plain text format; the request parameters can be packaged into a binary format and the like.
Step 202, the data acquired by the monitoring component is transmitted to the heterogeneous language component.
In this embodiment, the electronic device may transmit the data acquired by the listening component to a heterogeneous language component.
With continued reference to fig. 3, fig. 3 is a schematic diagram of an application scenario of the data transmission method according to the present embodiment. In the application scenario of fig. 3, a first client 301 runs a heterogeneous language component 302 and a listening component 303. In response to detecting that the heterogeneous language component 302 initiates the service invocation request containing the request parameter, the first client 301 encapsulates the request parameter, and sends the encapsulated request parameter to the listening component 303, so as to obtain the data indicated by the service invocation request from the target server 304 through the listening component 303. Finally, the first client 301 transmits the data acquired by the listening component 303 to the heterogeneous language component 302.
According to the method provided by the embodiment of the application, the request parameter is packaged by detecting that the heterogeneous language component initiates the service calling request containing the request parameter, the packaged request parameter is sent to the monitoring component, so that the data indicated by the service calling request is obtained from the target server through the monitoring component, and then the data obtained by the monitoring component is transmitted to the heterogeneous language component, so that the client can access the RPC framework through the internal monitoring component, the problems of cross-regional machine rooms and cross-national networks can be avoided, and the service calling performance is improved; in addition, by multiplexing the locally deployed monitoring component, additional machine resources are saved, the monitoring component directly initiates the call of the service related to the RPC framework, a flow convergence process does not exist, and the flexibility of the service call is improved.
With further reference to fig. 4, a flow 400 of yet another embodiment of a data transmission method is shown. The first client runs a heterogeneous language component and a monitoring component, and the process 400 of the data transmission method includes the following steps:
and step 401, starting the monitoring component and the heterogeneous language component in sequence.
In this embodiment, an electronic device (e.g., the client 101 shown in fig. 1) on which the information transmission method operates may operate with a heterogeneous language component and a listening component. The electronic device may first activate the listening component, which may listen to a designated TCP port (e.g., TCP:8899) after activation. Then, the electronic device can start the heterogeneous language component.
Step 402, resolving a preset monitoring address list, and determining a local TCP monitoring address to be connected with the heterogeneous language component, so that the heterogeneous language component establishes a connection pool with the local TCP monitoring address.
In this embodiment, the electronic device may parse a preset list of snooping addresses, and determine a local TCP snooping address (e.g., "127.0.0.1: 8899") to which the heterogeneous language component is to be connected, so that the heterogeneous language component establishes a connection pool with the local TCP snooping address, where the local TCP snooping address includes an internet protocol IP address (e.g., 127.0.0.0.1) of the first client and a port number (e.g., 8899) of a TCP port snooped by the snooping component. It should be noted that the connection pool and the method for establishing the connection pool are well-known technologies that are widely researched and applied at present, and are not described herein again.
In this embodiment, the snoop address list may include a local TCP snoop address. The electronic device may resolve the listening address list in various ways. As an example, the electronic device may query a specified symbol (e.g., comma, colon, period, etc.) in the snoop address list by means of string matching, and then may perform operations such as separating and extracting strings from information in the snoop address list based on the identified specified symbol, thereby obtaining a local TCP snoop address.
Step 403, parsing the monitoring address list, and determining a TCP monitoring address of the second client to which the heterogeneous language component is to be connected, so that the heterogeneous language component establishes a connection pool with the TCP monitoring address of the second client.
In this embodiment, the listening address list may further include a listening address of the second client (e.g., "127.0.0.1: 8899, the first client: 8899, and the second client: 8899"). The second client may be a client running the same heterogeneous language component (i.e., a copy of the heterogeneous language component) and the same listening component (i.e., a copy of the listening component). The electronic device may parse the listening address list by using the same parsing method, and determine a TCP listening address of a second client to which the heterogeneous language component is to be connected, so that the heterogeneous language component establishes a connection pool with the TCP listening address of the second client, where the TCP listening address of the second client includes an IP address (e.g., 127.0.0.1) of the second client and a port number (e.g., 8899) of a TCP port listened by the listening component operated by the second client.
It should be noted that step 402 and step 403 may be executed simultaneously.
In response to detecting that the foreign language component initiates a service invocation request containing the request parameter, step 404 determines whether the local TCP port supports a connection.
In this embodiment, in response to detecting that the heterogeneous language component initiates the service invocation request including the request parameter, the electronic device may determine whether the local TCP port supports connection, that is, whether normal connection is possible. In response to determining whether the local TCP port supports a connection, the electronic device may perform step 405; in response to determining whether the local TCP port does not support a connection, the electronic device may perform step 406.
Step 405, in response to determining that the local TCP port supports connection, determining that a local connection pool established by the heterogeneous language component and the local TCP monitoring address can be used, transmitting the request parameter to the local connection pool, so that the local connection pool encapsulates the request parameter, and sending the encapsulated request parameter to the monitoring component, so as to obtain data indicated by the service invocation request from the target server through the monitoring component.
In this embodiment, in response to determining that the local TCP port supports connection, the electronic device may determine that the local connection pool established by the heterogeneous language component and the local TCP snooping address is usable, transmit the request parameter to the local connection pool, so that the local connection pool encapsulates the request parameter, and send the encapsulated request parameter to the snooping component, so as to obtain data indicated by the service invocation request from the target server through the snooping component.
Step 406, in response to determining that the local TCP port does not support connection, transmitting the request parameter to the heterogeneous language component and the connection pool of the second client, so as to encapsulate the request parameter through the connection pool of the second client, transmit the encapsulated request parameter to the monitoring component operated by the second client, and obtain data indicated by the service invocation request from the target server through the monitoring component operated by the second client.
In this embodiment, in response to determining that the local TCP port does not support connection, the electronic device may transmit the request parameter to a connection pool between the heterogeneous language component and the second client, so as to encapsulate the request parameter through the connection pool, transmit the encapsulated request parameter to a monitoring component operated by the second client, and obtain data indicated by the service invocation request from the target server through the monitoring component operated by the second client.
Step 407, the data acquired by the monitoring component is transmitted to the heterogeneous language component.
In this embodiment, the electronic device may transmit the data acquired by the listening component to the heterogeneous language component. The monitoring component here is a monitoring component that acquires the data indicated by the service invocation request.
As can be seen from fig. 4, compared with the embodiment corresponding to fig. 2, the flow 400 of the data transmission method in this embodiment highlights the step of making a service call through the listening component of the second client in the case that the local TCP port cannot be connected. Therefore, according to the scheme described in the embodiment, the heterogeneous language component can complete the calling of the PPC framework through the monitoring components on other machines under the condition that the local monitoring component fails, and the availability of data transmission is improved.
With further reference to fig. 5, as an implementation of the methods shown in the above-mentioned figures, the present application provides an embodiment of a data transmission apparatus, where the embodiment of the apparatus corresponds to the embodiment of the method shown in fig. 2, and the apparatus may be specifically applied to various electronic devices, where the electronic devices may run a heterogeneous language component and a listening component, the heterogeneous language component is used to initiate a service invocation request through a heterogeneous language that is not supported by a service interface of a target server, and the listening component is used to listen to a TCP port.
As shown in fig. 5, the data transmission apparatus 500 of the present embodiment includes: a sending unit 501, configured to, in response to detecting that the heterogeneous language component initiates a service invocation request including a request parameter, encapsulate the request parameter, and send the encapsulated request parameter to the monitoring component, so as to obtain, by the monitoring component, data indicated by the service invocation request from the target server; a first transmission unit 502 configured to transmit the data acquired by the listening component to the heterogeneous language component.
In this embodiment, in response to detecting that the heterogeneous language component initiates a service invocation request including a request parameter, the sending unit 501 may encapsulate the request parameter, and send the encapsulated request parameter to the listening component, so as to obtain data indicated by the service invocation request from the target server through the listening component.
In this embodiment, the first transmission unit 502 can transmit the data acquired by the listening component to the heterogeneous language component.
In some optional implementations of the present embodiment, the data transmission apparatus 500 may further include a starting unit (not shown in the figure). Wherein, the starting unit can be configured to start the monitoring component and the heterogeneous language component in sequence; a first establishing unit, configured to analyze a preset monitoring address list, and determine a local TCP monitoring address to be connected to the heterogeneous language component, so that the heterogeneous language component establishes a connection pool with the local TCP monitoring address, where the local TCP monitoring address includes an internet protocol IP address of the first client and a port number of a TCP port monitored by the monitoring component.
In some optional implementations of the present embodiment, the data transmission apparatus 500 may further include a second establishing unit (not shown in the figure). The second establishing unit may be configured to analyze the monitoring address list, determine a TCP monitoring address of a second client to which the heterogeneous language component is to be connected, and establish a connection pool of the TCP monitoring address of the second client by the heterogeneous language component, where the TCP monitoring address of the second client includes an IP address of the second client and a port number of a TCP port monitored by the monitoring component operated by the second client.
In some optional implementations of the present embodiment, the data transmission apparatus 500 may further include a second transmission unit (not shown in the figure). The second transmission unit may be configured to determine whether the local TCP port supports connection, and if so, determine that a local connection pool established by the heterogeneous language component and the local TCP snooping address is usable, transmit the request parameter to the local connection pool, so that the local connection pool encapsulates the request parameter, and send the encapsulated request parameter to the snooping component, so as to obtain data indicated by the service invocation request from the target server through the snooping component.
In some optional implementations of the present embodiment, the data transmission apparatus 500 may further include a third transmission unit (not shown in the figure). The third transmission unit may be configured to, in response to determining that the local TCP port does not support connection, transmit the request parameter to a connection pool of the heterogeneous language component and the second client, encapsulate the request parameter through the connection pool of the second client, transmit the encapsulated request parameter to a monitoring component operated by the second client, and obtain data indicated by the service invocation request from the target server through the monitoring component operated by the second client.
In the apparatus provided in the embodiment of the present application, it is detected by the sending unit 501 that a heterogeneous language component initiates a service invocation request including a request parameter, the request parameter is encapsulated, and the encapsulated request parameter is sent to the monitoring component, so as to obtain data indicated by the service invocation request from the target server through the monitoring component, and then the first transmission unit 502 transmits the data obtained by the monitoring component to the heterogeneous language component, so that a client can access an RPC framework through an internal monitoring component, a problem of a cross-regional machine room and a cross-national network does not exist, and service invocation performance is improved; in addition, by multiplexing the locally deployed monitoring component, additional machine resources are saved, the monitoring component directly initiates the call of the service related to the RPC framework, a flow convergence process does not exist, and the flexibility of the service call is improved.
Referring now to FIG. 6, shown is a block diagram of a computer system 600 suitable for use in implementing a client of an embodiment of the present application. The client shown in fig. 6 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present application.
As shown in fig. 6, the computer system 600 includes a Central Processing Unit (CPU)601 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)602 or a program loaded from a storage section 608 into a Random Access Memory (RAM) 603. In the RAM 603, various programs and data necessary for the operation of the system 600 are also stored. The CPU 601, ROM 602, and RAM 603 are connected to each other via a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
The following components are connected to the I/O interface 605: an input portion 606 including a keyboard, a mouse, and the like; an output portion 607 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 608 including a hard disk and the like; and a communication section 609 including a network interface card such as a LAN card, a modem, or the like. The communication section 609 performs communication processing via a network such as the internet. The driver 610 is also connected to the I/O interface 605 as needed. A removable medium 611 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 610 as necessary, so that a computer program read out therefrom is mounted in the storage section 608 as necessary.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 609, and/or installed from the removable medium 611. The computer program performs the above-described functions defined in the method of the present application when executed by a Central Processing Unit (CPU) 601. It should be noted that the computer readable medium described herein can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present application, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In this application, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present application may be implemented by software or hardware. The described units may also be provided in a processor, and may be described as: a processor includes a sending unit and a first transmission unit. The names of these units do not in some cases constitute a limitation on the unit itself, and for example, the first transmission unit may also be described as a "unit that transmits data acquired by the listening component to a heterogeneous language component".
As another aspect, the present application also provides a computer-readable medium, which may be contained in the apparatus described in the above embodiments; or may be present separately and not assembled into the device. The computer readable medium carries one or more programs which, when executed by the apparatus, cause the apparatus to: responding to the detection that the heterogeneous language component initiates a service calling request containing request parameters, packaging the request parameters, and sending the packaged request parameters to a monitoring component so as to obtain data indicated by the service calling request from the target server through the monitoring component; and transmitting the data acquired by the monitoring component to the heterogeneous language component.
The above description is only a preferred embodiment of the application and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention herein disclosed is not limited to the particular combination of features described above, but also encompasses other arrangements formed by any combination of the above features or their equivalents without departing from the spirit of the invention. For example, the above features may be replaced with (but not limited to) features having similar functions disclosed in the present application.

Claims (12)

1. A data transmission method for a first client, wherein the first client runs a heterogeneous language component and a listening component, the heterogeneous language component is used for initiating a service call request through a heterogeneous language not supported by a service interface of a target server, and the listening component is used for listening to a transmission control protocol TCP port, the method comprises:
responding to the detection that the heterogeneous language component initiates a service calling request containing request parameters, packaging the request parameters, and sending the packaged request parameters to the monitoring component so as to obtain data indicated by the service calling request from the target server through the monitoring component;
and transmitting the data acquired by the monitoring component to the heterogeneous language component.
2. The data transmission method according to claim 1, wherein prior to the initiating of the service invocation request containing request parameters in response to detecting the heterogeneous language component, the method further comprises:
the monitoring component and the heterogeneous language component are started in sequence;
resolving a preset monitoring address list, and determining a local TCP monitoring address to be connected with the heterogeneous language component so as to enable the heterogeneous language component to establish a connection pool with the local TCP monitoring address, wherein the local TCP monitoring address comprises an Internet Protocol (IP) address of the first client and a port number of a TCP port monitored by the monitoring component.
3. The data transmission method according to claim 2, wherein after said sequentially starting said listening component and said heterogeneous language component, said method further comprises:
and analyzing the monitoring address list, and determining a TCP monitoring address of a second client to be connected with the heterogeneous language component so as to enable the heterogeneous language component to establish a connection pool with the TCP monitoring address of the second client, wherein the TCP monitoring address of the second client comprises the IP address of the second client and the port number of a TCP port monitored by the monitoring component, and the second client runs.
4. The data transmission method according to claim 3, wherein after the initiating of the service invocation request containing request parameters in response to detecting the heterogeneous language component, the method further comprises:
and if so, determining that a local connection pool established by the heterogeneous language component and the local TCP monitoring address can be used, transmitting the request parameter to the local connection pool, so that the local connection pool encapsulates the request parameter, and transmitting the encapsulated request parameter to the monitoring component, so as to acquire the data indicated by the service calling request from the target server through the monitoring component.
5. The data transmission method according to claim 4, wherein after the initiating of the service invocation request containing request parameters in response to detecting the heterogeneous language component, the method further comprises:
and in response to determining that the local TCP port does not support connection, transmitting the request parameters to a connection pool of the heterogeneous language component and the second client, so as to package the request parameters through the connection pool of the second client, transmit the packaged request parameters to a monitoring component operated by the second client, and acquire data indicated by the service invocation request from the target server through the monitoring component operated by the second client.
6. A data transmission apparatus for a first client, wherein the first client runs a heterogeneous language component and a listening component, the heterogeneous language component is used for initiating a service call request through a heterogeneous language not supported by a service interface of a target server, the listening component is used for listening to a transmission control protocol TCP port, the apparatus comprises:
a sending unit, configured to, in response to detecting that the heterogeneous language component initiates a service invocation request including a request parameter, encapsulate the request parameter, and send the encapsulated request parameter to the monitoring component, so as to obtain, by the monitoring component, data indicated by the service invocation request from the target server;
a first transmission unit configured to transmit the data acquired by the listening component to the heterogeneous language component.
7. The data transmission apparatus of claim 6, wherein the apparatus further comprises:
the starting unit is configured to start the monitoring component and the heterogeneous language component in sequence;
the first unit of establishing, the configuration is used for resolving preset monitoring address list, confirms the local TCP monitoring address that the xenogenesis language subassembly is waited to connect, so that the xenogenesis language subassembly establish with the connection pool of local TCP monitoring address, wherein, local TCP monitoring address includes the internet protocol IP address of first customer end with the port number of the TCP port that monitoring subassembly monitored.
8. The data transmission apparatus of claim 7, wherein the apparatus further comprises:
and the second establishing unit is configured to analyze the monitoring address list and determine a TCP monitoring address of a second client to be connected with the heterogeneous language component, so that the heterogeneous language component establishes a connection pool with the TCP monitoring address of the second client, wherein the TCP monitoring address of the second client comprises the IP address of the second client and the port number of a TCP port monitored by the monitoring component, and the second client runs.
9. The data transmission apparatus of claim 8, wherein the apparatus further comprises:
and the second transmission unit is configured to determine whether the local TCP port supports connection, and if so, determine that a local connection pool established by the heterogeneous language component and the local TCP listening address can be used, transmit the request parameter to the local connection pool, so that the local connection pool encapsulates the request parameter, and send the encapsulated request parameter to the listening component, so as to obtain data indicated by the service invocation request from the target server through the listening component.
10. The data transmission apparatus of claim 9, wherein the apparatus further comprises:
and the third transmission unit is configured to transmit the request parameter to a connection pool of the heterogeneous language component and the second client in response to determining that the local TCP port does not support connection, so as to encapsulate the request parameter through the connection pool of the second client, transmit the encapsulated request parameter to a monitoring component operated by the second client, and acquire data indicated by the service invocation request from the target server through the monitoring component operated by the second client.
11. A client, comprising:
one or more processors;
the running heterogeneous language component is used for calling the service of the target server through a heterogeneous language which is not supported by the service interface of the target server;
the monitoring component is used for monitoring a Transmission Control Protocol (TCP) port;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-5.
12. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1-5.
CN201710934953.9A 2017-10-10 2017-10-10 Data transmission method and device Active CN109660573B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710934953.9A CN109660573B (en) 2017-10-10 2017-10-10 Data transmission method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710934953.9A CN109660573B (en) 2017-10-10 2017-10-10 Data transmission method and device

Publications (2)

Publication Number Publication Date
CN109660573A CN109660573A (en) 2019-04-19
CN109660573B true CN109660573B (en) 2021-10-15

Family

ID=66108702

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710934953.9A Active CN109660573B (en) 2017-10-10 2017-10-10 Data transmission method and device

Country Status (1)

Country Link
CN (1) CN109660573B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111158777B (en) * 2019-12-12 2023-10-27 中移(杭州)信息技术有限公司 Component calling method, device and computer readable storage medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101206648A (en) * 2006-12-20 2008-06-25 鸿富锦精密工业(深圳)有限公司 Network service generating system and method
CN102098296A (en) * 2010-12-29 2011-06-15 北京新媒传信科技有限公司 Method and system for realizing remote call
CN104951275A (en) * 2015-06-18 2015-09-30 湖北盛天网络技术股份有限公司 Computer instruction data processing method and system
CN105005608A (en) * 2015-07-07 2015-10-28 中国科学院遥感与数字地球研究所 OpenSearch based distributed cooperative service system for lightweight satellite data
CN106020963A (en) * 2016-06-07 2016-10-12 中国建设银行股份有限公司 Cross-system internal service calling method and device
CN106648940A (en) * 2017-03-13 2017-05-10 北京百悟科技有限公司 Remote procedure call method and device
CN106686021A (en) * 2015-11-05 2017-05-17 北京京东尚科信息技术有限公司 Service invoking method and gateway
CN107179951A (en) * 2016-03-09 2017-09-19 北京京东尚科信息技术有限公司 Remote procedure calling (PRC) method and device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8812285B2 (en) * 2010-08-31 2014-08-19 The Regents Of The University Of California Designing digital processors using a flexibility metric

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101206648A (en) * 2006-12-20 2008-06-25 鸿富锦精密工业(深圳)有限公司 Network service generating system and method
CN102098296A (en) * 2010-12-29 2011-06-15 北京新媒传信科技有限公司 Method and system for realizing remote call
CN104951275A (en) * 2015-06-18 2015-09-30 湖北盛天网络技术股份有限公司 Computer instruction data processing method and system
CN105005608A (en) * 2015-07-07 2015-10-28 中国科学院遥感与数字地球研究所 OpenSearch based distributed cooperative service system for lightweight satellite data
CN106686021A (en) * 2015-11-05 2017-05-17 北京京东尚科信息技术有限公司 Service invoking method and gateway
CN107179951A (en) * 2016-03-09 2017-09-19 北京京东尚科信息技术有限公司 Remote procedure calling (PRC) method and device
CN106020963A (en) * 2016-06-07 2016-10-12 中国建设银行股份有限公司 Cross-system internal service calling method and device
CN106648940A (en) * 2017-03-13 2017-05-10 北京百悟科技有限公司 Remote procedure call method and device

Also Published As

Publication number Publication date
CN109660573A (en) 2019-04-19

Similar Documents

Publication Publication Date Title
CN107277153B (en) Method, device and server for providing voice service
CN110120917B (en) Routing method and device based on content
WO2019015272A1 (en) Information processing method and device
CN111159614B (en) Webpage resource acquisition method and device
CN109815107B (en) Method and device for automatic testing
CN111045833A (en) Interface calling method and device
CN110704200A (en) Method and device for converting call interface
CN114979295B (en) Gateway management method and device
CN111786939A (en) Method, device and system for testing management platform of Internet of things
CN110896362B (en) Fault detection method and device
CN114513552B (en) Data processing method, device, equipment and storage medium
CN109981546B (en) Method and device for acquiring remote call relation between application modules
CN112748962B (en) Application loading method, device, electronic equipment and computer readable medium
CN109660573B (en) Data transmission method and device
CN116561013B (en) Testing method and device based on target service framework, electronic equipment and medium
CN116737662A (en) Method, device, electronic equipment and storage medium for processing business data
US11972252B2 (en) Docker installed software/hardware discovery
CN113407229B (en) Method and device for generating offline scripts
CN113132447A (en) Reverse proxy method and system
CN110909269B (en) Log reporting method and device
CN113760693A (en) Method and apparatus for local debugging of microservice systems
CN113326060A (en) Service request processing method, device and system and service configuration method and device
CN112579447A (en) Browser testing method and device
CN113779018A (en) Data processing method and device
CN115118765B (en) Service processing method, device, electronic equipment and storage medium

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