CN111343239A - Communication request processing method, communication request processing device and transaction system - Google Patents

Communication request processing method, communication request processing device and transaction system Download PDF

Info

Publication number
CN111343239A
CN111343239A CN202010085211.5A CN202010085211A CN111343239A CN 111343239 A CN111343239 A CN 111343239A CN 202010085211 A CN202010085211 A CN 202010085211A CN 111343239 A CN111343239 A CN 111343239A
Authority
CN
China
Prior art keywords
communication
communication request
thread group
processing
data
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.)
Granted
Application number
CN202010085211.5A
Other languages
Chinese (zh)
Other versions
CN111343239B (en
Inventor
易师
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Unionpay Co Ltd
Original Assignee
China Unionpay 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 China Unionpay Co Ltd filed Critical China Unionpay Co Ltd
Priority to CN202010085211.5A priority Critical patent/CN111343239B/en
Publication of CN111343239A publication Critical patent/CN111343239A/en
Application granted granted Critical
Publication of CN111343239B publication Critical patent/CN111343239B/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/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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/141Setup of application sessions

Landscapes

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

Abstract

The application discloses a communication request processing method, a communication request processing device and a transaction system, wherein the communication request processing method comprises the following steps: creating a communication request object, wherein the communication request object comprises a communication thread group and a work thread group; under the condition of obtaining the communication request, creating an object service according to a communication request object; the object service calls the communication thread group to establish communication connection and sends communication data in the communication connection to the working thread group; and the working thread group processes the communication data to obtain a communication result. The concurrency capability is improved by decoupling the establishment of the communication connection and the processing of the communication data. The number of threads is reduced, the requirement of resources in an application layer is reduced, stable and reliable communication processing capacity is provided for transaction systems, and the communication response speed is high.

Description

Communication request processing method, communication request processing device and transaction system
Technical Field
The invention belongs to the field of internet communication, and particularly relates to the field of communication request processing.
Background
This section is intended to provide a background or context to the embodiments of the invention that are recited in the claims. The description herein is not admitted to be prior art by inclusion in this section.
With the continuous increase of transaction amount between transaction systems of the mobile internet, communication access between the transaction systems is more and more. However, since the concurrency capability of the communication requests in each transaction system is limited, when a large number of concurrent communication requests are requested, the response of the communication service becomes slow, the demand of hardware resources is large, and resources are excessively consumed.
Disclosure of Invention
In view of the above problems in the prior art, a communication request processing method, a communication request processing apparatus, a transaction system, and an electronic device are provided to solve one or more technical problems in the prior art.
In a first aspect, a method for processing a communication request is provided, including:
creating a communication request object, wherein the communication request object comprises a communication thread group and a work thread group;
under the condition of obtaining the communication request, creating an object service according to a communication request object;
the object service calls the communication thread group to establish communication connection and sends communication data in the communication connection to the working thread group;
and the working thread group processes the communication data to obtain a communication result.
In the present embodiment, the concurrency capability is improved by decoupling the establishment of communication connection and the processing of communication data. The number of threads is reduced, the requirement of resources in an application layer is reduced, stable and reliable communication processing capacity is provided for transaction systems, and the communication response speed is high.
In one embodiment, the method further comprises:
after the working thread group processes the communication data, under the condition of waiting for a communication result, the working thread group sets a communication request object to be in a waiting state;
and under the condition that the working thread group receives response data, awakening the communication request object again, wherein the response data is generated by the server according to the communication result.
In the embodiment, the occupation of the thread is converted into the occupation of the memory, so that the utilization rate of the thread is improved, and massive communication request processing can be completed by using fewer communication threads and fewer working threads.
In one embodiment, the method further comprises:
and the working thread group receives the response data and sends the response data and the communication result to the transaction service node so that the transaction service node performs transaction processing by using the response data.
In one embodiment, the method further comprises:
and when the communication result is communication failure or communication overtime, the working thread group recalls the communication request according to the preset calling times.
In this embodiment, by setting the preset call frequency, it can be determined whether to call the communication request again and the call frequency again under the condition of communication failure or communication timeout, so as to ensure the success of the communication request.
In one embodiment, the method further comprises:
and counting communication performance indexes, wherein the communication performance indexes comprise the total number of the communication requests, the success number of the communication requests, the failure number of the communication requests, the time consumption of single processing of the communication requests and the communication success rate in a preset time period.
In this embodiment, the statistical result may be used to assist in statistical analysis of the communication quality of the communication service node over a period of time, and may be used in daily monitoring, performance testing, and other scenarios.
In a second aspect, a communication method is provided, including:
creating an asynchronous communication request processing component, wherein the asynchronous communication request processing component is used for executing the communication request processing method of any one of the above items;
and the transaction service node calls the asynchronous communication request processing component to establish communication connection with the service end.
In a third aspect, there is provided a communication request processing apparatus, including:
the communication request object creating module is used for creating a communication request object, and the communication request object comprises a communication thread group and a work thread group;
the object service creating module is used for creating an object service according to a communication request object under the condition of acquiring the communication request;
the communication connection module is used for calling the communication thread group by the object service to establish communication connection and sending communication data in the communication connection to the working thread group;
and the communication request processing module is used for processing the communication data by the working thread group to obtain a communication result.
In one embodiment, the method further comprises:
the communication request object state setting module is used for setting the communication request object into a waiting state by the working thread group under the condition of waiting for a communication result after the working thread group processes the communication data;
and the communication request object awakening module is used for awakening the communication request object again under the condition that the working thread group receives response data, and the response data is generated by the server according to the communication result.
In one embodiment, the method further comprises:
and the response data sending module is used for receiving the response data by the working thread group and sending the response data and the communication result to the transaction service node so that the transaction service node can utilize the response data to perform transaction processing.
In one embodiment, the method further comprises:
and the communication request readjusting module is used for readjusting the communication request according to the preset calling times by the working thread group under the condition that the communication result is communication failure or communication overtime.
In one embodiment, the method further comprises:
and the communication performance index counting module is used for counting communication performance indexes, wherein the communication performance indexes comprise the total number of the communication requests, the success number of the communication requests, the failure number of the communication requests, the time consumption of single processing of the communication requests and the communication success rate in a preset time period.
In a fourth aspect, there is provided a transaction system comprising:
an asynchronous communication request processing component including any of the communication request processing apparatuses described above;
and the transaction service node is used for calling the asynchronous communication request processing component and establishing communication connection with the service end.
In one embodiment, the system further comprises a plurality of computing nodes, and the computing nodes are mutually called through a unified communication service calling protocol.
In one embodiment, the asynchronous communication request processing component includes an interface adapted to a communication service invocation protocol.
One embodiment in the above application has the following advantages or benefits: because the communication connection is established by adopting the communication thread group at the client, and the communication data is processed by adopting the working thread group to obtain the technical means of the communication result, the technical problem that the concurrence quantity completely depends on the size of a thread pool because the communication connection establishment and the communication data processing are all exclusively completed by one thread is solved, the concurrence processing capacity of a single communication service node in the client is further obviously improved, the stable and reliable communication processing capacity is provided for transaction systems, and the technical effect of higher communication response speed is achieved.
It should be understood that the above description is only an overview of the technical solutions of the present invention, so as to clearly understand the technical means of the present invention, and thus can be implemented according to the content of the description. In order to make the aforementioned and other objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in detail below.
Drawings
The advantages and benefits described herein, as well as other advantages and benefits, will be apparent to those of ordinary skill in the art upon reading the following detailed description of the exemplary embodiments. The drawings are only for purposes of illustrating exemplary embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to refer to like elements throughout. In the drawings:
fig. 1 is a schematic flowchart of a communication request processing method according to an embodiment of the present application;
fig. 2 is a scene diagram of a communication request processing method according to an embodiment of the present application;
fig. 3 is a schematic flow chart of another communication request processing method provided in an embodiment of the present application;
fig. 4 is a flowchart illustrating a communication method according to an embodiment of the present application;
fig. 5 is a block diagram of a communication system according to an embodiment of the present application;
fig. 6 is a block diagram of a communication request processing apparatus according to an embodiment of the present application;
fig. 7 is a block diagram of another communication request processing apparatus according to an embodiment of the present application;
fig. 8 is a block diagram of an electronic device for implementing a communication request processing method according to an embodiment of the present application.
In the drawings, the same or corresponding reference numerals indicate the same or corresponding parts.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
In the present invention, it is to be understood that terms such as "including" or "having," or the like, are intended to indicate the presence of the disclosed features, numbers, steps, behaviors, components, parts, or combinations thereof, and are not intended to preclude the possibility of the presence of one or more other features, numbers, steps, behaviors, components, parts, or combinations thereof.
It should be noted that the embodiments and features of the embodiments may be combined with each other without conflict. The present invention will be described in detail below with reference to the embodiments with reference to the attached drawings.
Example one
In one embodiment, as shown in fig. 1, a flowchart of a communication request processing method is provided, where the communication request processing method includes:
step S10: creating a communication request object, wherein the communication request object comprises a communication thread group and a work thread group;
step S20: under the condition of obtaining the communication request, creating an object service according to a communication request object;
step S30: the object service calls the communication thread group to establish communication connection and sends communication data in the communication connection to the working thread group;
step S40: and the working thread group processes the communication data to obtain a communication result.
Under the scenes of network transaction activity and the like, a communication connection (communication link) needs to be established between a client and a server, and after the communication connection (communication link) is established, data which needs to be transmitted in the communication request is transmitted, namely, the communication request is completed. The client may include a browser, a bank transaction system, and the like. The server may include a third party payment system, another banking transaction system, etc. The communication request may include an Http (hypertext Transfer Protocol) request, an Http (Http Protocol over secure session Layer) request, or the like. Particularly, in the case where highly concurrent communication requests need to be processed in a large-scale network marketing campaign, the present embodiment provides a communication request processing method applied to a client. As shown in fig. 2, a specific communication request processing flow is as follows:
after the TCP (Transmission Control Protocol) handshake establishes a connection successfully, the client starts to send a communication request to the server.
First, in an application layer of a communication service node of a client, a communication request object is created. The communication request object may include an asynchronous httpclient instance (AsyncHttpClient instance) for asynchronously processing Http requests. The asynchronous Http client provides a client programming toolkit supporting Http protocol, including Http request address, content, request type, Http Head (request page header), etc. The types of Http requests may include two types, GET and POST. The GET (GET) type is that the client GETs data from the server, and the POST (submit) type is that the client submits data to the server.
In the process of creating the asynchronous httpclient instance, the creation of a thread pool, the setting of Http request parameters, the creation of a communication request retransmission mechanism and the addition of an interceptor are completed.
In one example, two thread groups are set in the thread pool: a communication thread group and a work thread group. The communication thread group is responsible for the establishment and maintenance of the communication connection. For example, a Reactor mode is used to manage communication connection, and is responsible for creating, using and recycling the connection, and communication threads are allocated to establish the connection when Socket underlying communication is established. The working thread group is responsible for reading and writing communication data from the communication thread group and correspondingly processing the communication data on the communication connection. Such as protocol parsing, message content parsing, etc.
The Http request parameter may be set by a transaction service node of the client according to a transaction requirement. Http request parameters may include: the maximum number of threads of the thread pool, the maximum number of communication connections usable by a single communication service node, parameters related to Socket underlying communication, communication connection timeout time, communication processing timeout time, parameters in Http Head (request page header), the maximum number of allowed waiting communication requests, and the like. When the transaction service node does not set the above parameters, default parameters are provided. For example, default parameters may include a maximum connection count of 1 ten thousand, a default timeout connection time of 10 seconds, a default communication timeout time of 10 seconds, and the like.
And creating a communication request retransmission mechanism, judging whether the communication request needs to be retransmitted or not according to the communication result, and retransmitting the times of the communication request. The interceptor is used for performing corresponding encoding and decoding operations on data to be transmitted. For example: and (3) carrying out URL (Uniform Resource Locator) encoding on the content of the Http request, and carrying out URL decoding on the received response data.
Then, an Http request of a type such as POST (submit) or GET (GET) is called and is transmitted into a class implementing a PostBack interface, and the PostBack interface is mainly used for calling back a communication request success or a communication request failure. Since the communication request object defines the processing logic of the communication request, after the Http request is invoked, a set of object services, such as an asynchttp request instance, is created based on the content of the communication request contained in the communication request object. The AsyncHttpRequest instance implements a Runnable (Runnable state) interface for sending Http requests. And submitting the AsyncHttpRequest instance to a thread pool for processing.
The AsyncHttpRequest instance calls the express method of the DefaultHttpClient to complete the processing of the Http request. The specific process is as follows: the object service extracts the communication request object to the working thread group, and the working thread group analyzes the communication request object to obtain the address and the content of the communication request. And the object service calls the communication thread group according to the address of the communication request, establishes communication connection and writes or reads communication data in the communication connection. After the working thread is started, the communication data returned from the communication connection is continuously scanned, every time the communication data is scanned, the communication thread group sends the communication data to the working thread group, the working thread group correspondingly processes the scanned communication data, and the process is continued until the communication service process stops. And the working thread group processes the communication data to obtain a communication result. The communication result includes communication success, communication failure, communication timeout, a successful response message, a reason of the communication failure, and the like.
After the communication request processing is completed, the ResponseHandlerInterface instance receives the communication result. And calling a sendResponseMessage (communication result sending) method, sending the communication result to the transaction service node, and completing a communication request. The release of the memory of the virtual machine, such as the release of the communication request object and the release of the communication thread group and the working thread group, is completed.
In the embodiment, under the scene of high concurrent access of communication requests, the asynchronous httpparent instance separates the establishment of communication connection and data processing, and solves the technical problems that the establishment of communication connection is exclusively completed by one thread for data transmission and data reception, and the concurrence quantity completely depends on the size of a thread pool. The concurrency capability is improved by decoupling the establishment of the communication connection and the processing of the communication data. The number of threads is reduced, the requirement of resources in an application layer is reduced, a communication service node can bear massive communication requests and access concurrently, and great support is provided for processing massive concurrent transactions. The concurrent processing capacity of a single communication service node is obviously improved, stable and reliable communication processing capacity is provided for transaction systems, and the communication response speed is higher.
In one embodiment, as shown in fig. 3, the method further includes:
step S50: after the working thread group processes the communication data, under the condition of waiting for a communication result, the working thread group sets a communication request object to be in a waiting state;
step S60: and under the condition that the working thread group receives response data, awakening the communication request object again, wherein the response data is generated by the server according to the communication result.
Because the thread and the communication link need to be occupied when waiting for the communication result, the thread and the communication link are not released until the whole processing is finished. In this embodiment, the logic of Http communication processing may be encapsulated in a communication request object, such as a Handler (asynchronous message processing), and a Handler object may be instantiated in a virtual machine each time a communication request is obtained. And when one worker thread in the worker thread group finishes processing the Handler object and waits for a communication result, the worker thread group sets the Handler object to be in a waiting state. The specific operation mode may be to set the states of the occupied communication threads in the communication thread group and the working threads in the working thread group to idle states, so as to mark the communication threads and the working threads as available. So that the worker thread is released and the next Handler object can be processed. And when the worker threads in the worker thread group receive the response data, the Handler object is awakened again for subsequent processing.
In the embodiment, the occupation of the thread is converted into the occupation of the memory, so that the utilization rate of the thread is improved, and massive communication request processing can be completed by using fewer communication threads and fewer working threads.
In one embodiment, as shown in fig. 3, the method further includes:
step S70: and the working thread group receives the response data and sends the response data and the communication result to the transaction service node so that the transaction service node performs transaction processing by using the response data.
In one example, a communication service node and a transaction service node are included in the client. The communication service node comprises a computing node which completes the function of external communication service in the client and is a communication bridge between the client and the server. The transaction service nodes include computing nodes for processing transaction logic, e.g., creating orders, creating transaction pipelines, transaction authorization checks, etc. And after receiving the request, the server analyzes the Http request, processes the transaction logic, and returns response data to the client. The transaction service node needs to use the response data for transaction processing.
In one embodiment, as shown in fig. 3, the method further includes:
step S80: and when the communication result is communication failure or communication overtime, the working thread recalls the communication request according to the preset calling times.
In one example, the preset number of calls of the communication request can be set according to the convention of the client and the server. And when the communication result is that the Http request fails to communicate or the communication is overtime, the client judges whether to continuously readjust the communication request, and if the communication request needs to be readjusted, the client calls the communication request again for multiple times within a preset time period until the communication request is successfully processed.
In this embodiment, by setting the preset call frequency, it can be determined whether to call the communication request again and the call frequency again under the condition of communication failure or communication timeout, so as to ensure the success of the communication request.
In one embodiment, the method further comprises:
and counting communication performance indexes, wherein the communication performance indexes comprise the total number of the communication requests, the success number of the communication requests, the failure number of the communication requests, the time consumption of single processing of the communication requests and the communication success rate in a preset time period.
In one example, during the process from the initiation of the Http request to the receipt of the response data, the communication performance indexes are collected in real time, and the statistics module performs summary statistics and calculation. The communication performance index may be obtained by calling an API (application programming Interface) Interface.
The specific process of the communication performance index statistics is as follows: firstly, a global counter set is set, and the counters are used for counting communication data in a preset time period and in the global state. In the data acquisition phase, the preset time period may be set to 3 seconds by default, that is, the data is acquired once every 3 seconds, or may be set to other time periods, or the total number of communication requests, the success number of the communication requests, and the failure number of the communication requests are acquired from the start of the server. When each Http request object is created, recording the time when Http request acquisition is started as the start time of communication request processing, recording the time when communication processing is completed as the end time of communication request processing, and subtracting to obtain the consumed time of single processing of communication request. Then, in the data calculation stage, various data within plus 3 seconds or overall are counted according to the communication processing result, for example, the number of communication requests in the global counter, the success number, the failure number of the communication requests, and the time consumption of single processing of the communication requests. And calculating the total communication time according to the time consumed by the single processing of the communication request and the time period. The total number of communication requests, total amount of work, total amount of failure, success rate, average elapsed time, TP95, TP99, etc. are calculated using the statistical data. TP95 is the lowest time consuming requirement to satisfy ninety-five percent of network requests. TP99 is the lowest time consuming requirement to satisfy ninety-nine percent of network requests. The statistical result can be used for assisting in statistical analysis of communication quality of the communication service node within a period of time, and can be used for daily monitoring, performance testing and other scenes.
In one embodiment, the method further comprises:
when creating the communication request object, the security check module is used to perform security check on the Http request, such as access right check, white list control of external system IP, flow control for domain name, etc. The verification of the Http request includes verifying a server-side certificate, verifying a two-way certificate, not verifying a certificate, and the like.
Example two
In another embodiment, as shown in fig. 4, there is provided a communication method including:
step S100: creating an asynchronous communication request processing component for executing any one of the communication request processing methods;
step S200: and the transaction service node calls the asynchronous communication request processing component to establish communication connection with the service end.
As shown in fig. 5, the transaction system (client) includes a transaction service node (communication service invoker) and a communication service node, and the transaction service node establishes a communication connection between the transaction system and an external transaction system (external system, server) by invoking an asynchronous communication request processing component in the communication service node.
The transaction system can be divided into a front layer, a gateway layer, a service layer and a communication layer, wherein each layer consists of a certain number of computing nodes, and corresponding applications are deployed on the computing nodes. The computing nodes are mutually called through an internal protocol, the specific communication service calling protocol can be UPHEAD and MAGPIE, and the transaction service nodes can be selected as required. The trading system uses the service of the internal protocol for the inside and uses the Http Client for the outside.
In one example, the communication service node performs unified dependency management on resources of the client through a management component. The management component comprises the following functions:
and adopting an asynchronous communication request processing component for realizing the communication access of the bottom layer and executing the communication request processing method in the first embodiment. The asynchronous communication request processing component may be a related functional component to the asynchronous communication request processing component being Apache (Apache) Http Async Client, and includes: an Http Core component, an Http Components component, an Http client component, and packaging of these Components. The Http Core component and Http Components are a set of implementations of Http protocol, are used for creating and customizing Http clients, and support non-blocking IO (input/output) models. The Http Core, Http Components and Http Client realize Http communication call based on NIO (brand new IO stream), directly use a large amount of Http protocol and related parameters of a bottom Socket protocol which need to be set, write a corresponding callback function to process communication response, and process abnormal conditions such as communication connection failure establishment, communication processing timeout and the like.
The functions of the management component may be published as Http services or TCP services. The Http request parser and the TCP request parser are embodied when a communication service invocation protocol (UPHEAD, MAGPIE) call is received.
Of course, in this embodiment, an NIO (new IO stream) packet of JDK (Java SE Development kit) may also be used to implement Http service or TCP service.
In the embodiment, the communication service node introduces the asynchronous communication request processing component, and the transaction service node can complete the communication connection to the external system only by carrying out service calling once according to the provided internal protocol interface. Therefore, the transaction service node does not need to know implementation details of the Http communication protocol, and how to provide high-volume concurrent Http communication load capacity is all completed by the communication service node. The asynchronous communication request processing component does not need complex coding, and encapsulates a calling interface which accords with the internal calling specification of the client, so that various application computing nodes can conveniently call the calling interface, and the communication connection between the asynchronous communication request processing component and an external transaction system is more conveniently completed.
EXAMPLE III
In another embodiment, as shown in fig. 6, there is provided a communication request processing apparatus 10 including:
a communication request object creating module 110, configured to create a communication request object, where the communication request object includes a communication thread group and a work thread group;
an object service creation module 120 configured to create an object service according to a communication request object in a case where the communication request is acquired;
the communication connection module 130 is used for the object service to call the communication thread group to establish communication connection and send communication data in the communication connection to the work thread group;
and the communication request processing module 140 is configured to process the communication data by the worker thread group to obtain a communication result.
In one embodiment, as shown in fig. 7, there is provided a communication request processing apparatus 20, further comprising:
a communication request object state setting module 150, configured to set, in a case where the worker thread group waits for a communication result after processing the communication data, the worker thread group sets a communication request object to a waiting state;
and a communication request object awakening module 160, configured to awaken the communication request object again when the work thread group receives response data, where the response data is generated by the server according to the communication result.
In one embodiment, as shown in fig. 7, the method further includes:
and the response data sending module 170 is configured to receive the response data by the working thread group, and send the response data and the communication result to the transaction service node, so that the transaction service node performs transaction processing by using the response data.
In one embodiment, as shown in fig. 7, the method further includes:
and the communication request re-dispatching module 180 is configured to, when the communication result is a communication failure or a communication timeout, re-dispatch the communication request by the working thread group according to the preset dispatch number.
In one embodiment, the method further comprises:
and the communication performance index counting module is used for counting communication performance indexes, wherein the communication performance indexes comprise the total number of the communication requests, the success number of the communication requests, the failure number of the communication requests, the time consumption of single processing of the communication requests and the communication success rate in a preset time period.
Example four
In one embodiment, there is provided a transaction system, as shown in fig. 5, comprising:
an asynchronous communication request processing component including any of the communication request processing apparatuses described above;
and the transaction service node is used for calling the asynchronous communication request processing component and establishing communication connection with the service end.
In one embodiment, the system further comprises a plurality of computing nodes, and the computing nodes are mutually called through a unified communication service calling protocol.
In one embodiment, the asynchronous communication request processing component includes an interface adapted to a communication service invocation protocol.
The functions of each module in each apparatus in the embodiments of the present invention may refer to the corresponding description in the above method, and are not described herein again.
According to an embodiment of the present application, an electronic device and a readable storage medium are also provided.
Fig. 8 is a block diagram of an electronic device according to a communication request processing method according to an embodiment of the present application. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the present application that are described and/or claimed herein.
As shown in fig. 8, the electronic apparatus includes: one or more processors 801, memory 802, and interfaces for connecting the various components, including a high speed interface and a low speed interface. The various components are interconnected using different buses and may be mounted on a common motherboard or in other manners as desired. The processor may process instructions for execution within the electronic device, including instructions stored in or on the memory to display Graphical information for a Graphical User Interface (GUI) on an external input/output device, such as a display device coupled to the Interface. In other embodiments, multiple processors and/or multiple buses may be used, along with multiple memories and multiple memories, as desired. Also, multiple electronic devices may be connected, with each device providing portions of the necessary operations (e.g., as a server array, a group of blade servers, or a multi-processor system). Fig. 8 illustrates an example of a processor 801.
The memory 802 is a non-transitory computer readable storage medium as provided herein. The memory stores instructions executable by at least one processor to cause the at least one processor to perform a communication request processing method provided by the present application. A non-transitory computer-readable storage medium of the present application stores computer instructions for causing a computer to execute a communication request processing method provided by the present application.
The memory 802, as a non-transitory computer-readable storage medium, may be used to store non-transitory software programs, non-transitory computer-executable programs, and modules, such as program instructions/modules corresponding to a communication request processing method in the embodiments of the present application (e.g., the communication request object creation module 110, the object service creation module 120, the communication connection module 130, and the communication request processing module 140 shown in fig. 6). The processor 801 executes various functional applications of the server and data processing by running non-transitory software programs, instructions, and modules stored in the memory 802, that is, implements one of the communication request processing methods in the above-described method embodiments.
The memory 802 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created by use of the electronic device according to one communication request processing method, and the like. Further, the memory 802 may include high speed random access memory and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid state storage device. In some embodiments, the memory 802 may optionally include memory located remotely from the processor 801, which may be connected to the electronics of the communication request processing method via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The electronic device of the communication request processing method may further include: an input device 803 and an output device 804. The processor 801, the memory 802, the input device 803, and the output device 804 may be connected by a bus or other means, and are exemplified by a bus in fig. 8.
The input device 803 may receive input numeric or character information and generate key signal inputs related to user settings and function control of an electronic apparatus of a communication request processing method, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, a pointing stick, one or more mouse buttons, a track ball, a joystick, or the like. The output devices 804 may include a display device, auxiliary lighting devices (e.g., LEDs), and haptic feedback devices (e.g., vibrating motors), among others. The display device may include, but is not limited to, a Liquid Crystal Display (LCD) such as a Liquid Cr10 star display 10, a Light Emitting Diode (LED) display, and a plasma display. In some implementations, the display device can be a touch screen.
Various implementations of the systems and techniques described here can be realized in digital electronic circuitry, Integrated circuitry, Application Specific Integrated Circuits (ASICs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
These computer programs (also known as programs, software applications, or code) include machine instructions for a programmable processor, and may be implemented using high-level procedural and/or object-oriented programming languages, and/or assembly/machine languages. As used herein, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, apparatus, and/or device (e.g., magnetic discs, optical disks, memory, Programmable Logic Devices (PLDs)) used to provide machine instructions and/or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal used to provide machine instructions and/or data to a programmable processor.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (Cathode ray Tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), Wide Area Networks (WANs), and the internet.
The computer system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present application may be executed in parallel, sequentially, or in different orders, and the present invention is not limited thereto as long as the desired results of the technical solutions disclosed in the present application can be achieved.
The above-described embodiments should not be construed as limiting the scope of the present application. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims (16)

1. A method for processing a communication request, comprising:
creating a communication request object, wherein the communication request object comprises a communication thread group and a work thread group;
under the condition of acquiring a communication request, creating an object service according to the communication request object;
the object service calls the communication thread group to establish communication connection and sends communication data in the communication connection to the working thread group;
and the working thread group processes the communication data to obtain a communication result.
2. The method of claim 1, further comprising:
after the working thread group processes the communication data, under the condition of waiting for the communication result, the working thread group sets the communication request object to be in a waiting state;
and under the condition that the working thread group receives response data, awakening the communication request object again, wherein the response data is generated by the server according to the communication result.
3. The method of claim 1, further comprising:
and the working thread group receives response data and sends the response data and the communication result to a transaction service node so that the transaction service node performs transaction processing by using the response data.
4. The method of claim 1, further comprising:
and when the communication result is communication failure or communication overtime, the working thread group recalls the communication request according to the preset calling times.
5. The method of claim 1, further comprising:
and counting communication performance indexes, wherein the communication performance indexes comprise the total number of the communication requests, the success number of the communication requests, the failure number of the communication requests, the time consumption of single processing of the communication requests and the communication success rate in a preset time period.
6. A method of communication, comprising:
creating an asynchronous communication request processing component for executing the communication request processing method of any one of claims 1 to 5;
and the transaction service node calls the asynchronous communication request processing component to establish communication connection with the service end.
7. A communication request processing apparatus, comprising:
the communication request object creating module is used for creating a communication request object, and the communication request object comprises a communication thread group and a work thread group;
the object service creating module is used for creating an object service according to the communication request object under the condition of acquiring the communication request;
the communication connection module is used for the object service to call the communication thread group so as to establish communication connection and send communication data in the communication connection to the working thread group;
and the communication request processing module is used for processing the communication data by the working thread group to obtain a communication result.
8. The apparatus of claim 7, further comprising:
a communication request object state setting module, configured to set, by the worker thread group, the communication request object to a waiting state in a case where the worker thread group waits for the communication result after processing the communication data;
and the communication request object awakening module is used for awakening the communication request object again under the condition that the working thread group receives response data, and the response data is generated by the server according to the communication result.
9. The apparatus of claim 7, further comprising:
and the response data sending module is used for receiving response data by the working thread group and sending the response data and the communication result to the transaction service node so that the transaction service node utilizes the response data to perform transaction processing.
10. The apparatus of claim 7, further comprising:
and the communication request readjusting module is used for readjusting the communication request according to preset invoking times by the working thread group under the condition that the communication result is communication failure or communication overtime.
11. The apparatus of claim 7, further comprising:
and the communication performance index counting module is used for counting communication performance indexes, wherein the communication performance indexes comprise the total number of the communication requests, the success number of the communication requests, the failure number of the communication requests, the time consumption of single processing of the communication requests and the communication success rate in a preset time period.
12. A transaction system, comprising:
an asynchronous communication request processing component comprising the communication request processing apparatus of any of claims 7 to 11;
and the transaction service node is used for calling the asynchronous communication request processing component and establishing communication connection with the service end.
13. The system of claim 12, further comprising a plurality of computing nodes, wherein the computing nodes are mutually invoked via a unified communication service invocation protocol.
14. The system of claim 13, wherein the asynchronous communication request processing component comprises an interface adapted to the communication service invocation protocol.
15. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-6.
16. A non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method of any one of claims 1-6.
CN202010085211.5A 2020-02-10 2020-02-10 Communication request processing method, communication request processing device and transaction system Active CN111343239B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010085211.5A CN111343239B (en) 2020-02-10 2020-02-10 Communication request processing method, communication request processing device and transaction system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010085211.5A CN111343239B (en) 2020-02-10 2020-02-10 Communication request processing method, communication request processing device and transaction system

Publications (2)

Publication Number Publication Date
CN111343239A true CN111343239A (en) 2020-06-26
CN111343239B CN111343239B (en) 2022-11-04

Family

ID=71183402

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010085211.5A Active CN111343239B (en) 2020-02-10 2020-02-10 Communication request processing method, communication request processing device and transaction system

Country Status (1)

Country Link
CN (1) CN111343239B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112015559A (en) * 2020-09-03 2020-12-01 深圳虹川科技有限公司 Asynchronous real-time data updating system and method based on http protocol
CN114629885A (en) * 2021-01-05 2022-06-14 亚信科技(中国)有限公司 Service request processing method and device, electronic equipment and storage medium

Citations (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6782537B1 (en) * 1999-09-23 2004-08-24 International Business Machines Corporation Establishing a communicator across multiple processes in a multithreaded computing environment
US7373640B1 (en) * 2003-07-31 2008-05-13 Network Appliance, Inc. Technique for dynamically restricting thread concurrency without rewriting thread code
CN102025650A (en) * 2010-06-04 2011-04-20 西本新干线股份有限公司 Message processing system and message processing method of enterprise service bus
US20110213949A1 (en) * 2010-03-01 2011-09-01 Sonics, Inc. Methods and apparatus for optimizing concurrency in multiple core systems
CN102916953A (en) * 2012-10-12 2013-02-06 青岛海信传媒网络技术有限公司 Method and device for realizing concurrent service on basis of TCP (transmission control protocol) connection
US8392669B1 (en) * 2008-03-24 2013-03-05 Nvidia Corporation Systems and methods for coalescing memory accesses of parallel threads
US20130232322A1 (en) * 2012-03-05 2013-09-05 Michael Fetterman Uniform load processing for parallel thread sub-sets
CN103428272A (en) * 2013-07-16 2013-12-04 无限极(中国)有限公司 System and method for monitoring and scheduling of middleware threads
CN105786447A (en) * 2014-12-26 2016-07-20 乐视网信息技术(北京)股份有限公司 Method and apparatus for processing data by server and server
CN106886453A (en) * 2017-02-20 2017-06-23 恒生电子股份有限公司 Information processing method, device and system for asynchronous multiple tracks
CN108647104A (en) * 2018-05-15 2018-10-12 北京五八信息技术有限公司 request processing method, server and computer readable storage medium
CN108965359A (en) * 2017-05-19 2018-12-07 北京京东尚科信息技术有限公司 Communication means, communication device, readable medium and electronic equipment
US20190065246A1 (en) * 2017-08-24 2019-02-28 Dropbox, Inc. Large-scale asynchronous event processor
CN110113374A (en) * 2019-03-15 2019-08-09 平安科技(深圳)有限公司 Streaming media server executes multitask method, device and storage medium, terminal device
CN110457119A (en) * 2019-07-19 2019-11-15 上海易点时空网络有限公司 Asynchronous process callback method and device

Patent Citations (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6782537B1 (en) * 1999-09-23 2004-08-24 International Business Machines Corporation Establishing a communicator across multiple processes in a multithreaded computing environment
US7373640B1 (en) * 2003-07-31 2008-05-13 Network Appliance, Inc. Technique for dynamically restricting thread concurrency without rewriting thread code
US8392669B1 (en) * 2008-03-24 2013-03-05 Nvidia Corporation Systems and methods for coalescing memory accesses of parallel threads
US20110213949A1 (en) * 2010-03-01 2011-09-01 Sonics, Inc. Methods and apparatus for optimizing concurrency in multiple core systems
CN102025650A (en) * 2010-06-04 2011-04-20 西本新干线股份有限公司 Message processing system and message processing method of enterprise service bus
US20130232322A1 (en) * 2012-03-05 2013-09-05 Michael Fetterman Uniform load processing for parallel thread sub-sets
CN102916953A (en) * 2012-10-12 2013-02-06 青岛海信传媒网络技术有限公司 Method and device for realizing concurrent service on basis of TCP (transmission control protocol) connection
CN103428272A (en) * 2013-07-16 2013-12-04 无限极(中国)有限公司 System and method for monitoring and scheduling of middleware threads
CN105786447A (en) * 2014-12-26 2016-07-20 乐视网信息技术(北京)股份有限公司 Method and apparatus for processing data by server and server
CN106886453A (en) * 2017-02-20 2017-06-23 恒生电子股份有限公司 Information processing method, device and system for asynchronous multiple tracks
CN108965359A (en) * 2017-05-19 2018-12-07 北京京东尚科信息技术有限公司 Communication means, communication device, readable medium and electronic equipment
US20190065246A1 (en) * 2017-08-24 2019-02-28 Dropbox, Inc. Large-scale asynchronous event processor
CN108647104A (en) * 2018-05-15 2018-10-12 北京五八信息技术有限公司 request processing method, server and computer readable storage medium
CN110113374A (en) * 2019-03-15 2019-08-09 平安科技(深圳)有限公司 Streaming media server executes multitask method, device and storage medium, terminal device
CN110457119A (en) * 2019-07-19 2019-11-15 上海易点时空网络有限公司 Asynchronous process callback method and device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112015559A (en) * 2020-09-03 2020-12-01 深圳虹川科技有限公司 Asynchronous real-time data updating system and method based on http protocol
CN114629885A (en) * 2021-01-05 2022-06-14 亚信科技(中国)有限公司 Service request processing method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN111343239B (en) 2022-11-04

Similar Documents

Publication Publication Date Title
CN111831420B (en) Method for task scheduling, related device and computer program product
US9794334B2 (en) Systems and methods to process a request received at an application program interface
EP1308844B1 (en) System and method for monitoring an application on a server
Rotem-Gal-Oz SOA patterns
CA3000422C (en) Workflow service using state transfer
CN111741026B (en) Cross-chain transaction request processing method, device, equipment and storage medium
US8291047B2 (en) Screen scraping interface
CN110083455B (en) Graph calculation processing method, graph calculation processing device, graph calculation processing medium and electronic equipment
US20020156930A1 (en) System, method, and article of manufacture for facilitating communication between an IMS process and CORBA process
US8538793B2 (en) System and method for managing real-time batch workflows
US20070033640A1 (en) Generic context service in a distributed object environment
CN111352705B (en) Transaction processing method, device, equipment and medium of block chain
CN110458468A (en) A kind of task processing method, device, electronic equipment and storage medium
CN111343239B (en) Communication request processing method, communication request processing device and transaction system
CN110413822A (en) Offline image structural workflow net, device, system and storage medium
US10970141B2 (en) Integrating transaction processing system interfaces with event-driven polyglot runtime modules
CN111260474A (en) Cross-block-chain asset transaction method, device, equipment, system and storage medium
US8380788B2 (en) System and method for providing user context support in a native transaction platform
CN111200606A (en) Deep learning model task processing method, system, server and storage medium
US20210218622A1 (en) Dynamic service creation for microservice-based integration service
WO2005050406A2 (en) Server visualization and control
CN111339187A (en) Data processing method, device, equipment and storage medium based on intelligent contract
US11210205B2 (en) Application debugging
CN114637583A (en) Long transaction processing method, device, equipment and storage medium
CN108234349A (en) The method and apparatus for improving SOA system robustness

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