CN109327521B - Network communication method and device - Google Patents

Network communication method and device Download PDF

Info

Publication number
CN109327521B
CN109327521B CN201811229051.6A CN201811229051A CN109327521B CN 109327521 B CN109327521 B CN 109327521B CN 201811229051 A CN201811229051 A CN 201811229051A CN 109327521 B CN109327521 B CN 109327521B
Authority
CN
China
Prior art keywords
session
data
buffer area
read
function
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
CN201811229051.6A
Other languages
Chinese (zh)
Other versions
CN109327521A (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 CN201811229051.6A priority Critical patent/CN109327521B/en
Publication of CN109327521A publication Critical patent/CN109327521A/en
Application granted granted Critical
Publication of CN109327521B publication Critical patent/CN109327521B/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/14Session management
    • H04L67/141Setup of application sessions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/16Implementing security features at a particular protocol layer
    • H04L63/168Implementing security features at a particular protocol layer above the transport layer
    • 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/146Markers for unambiguous identification of a particular session, e.g. session cookie or URL-encoding
    • 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/56Provisioning of proxy services
    • H04L67/568Storing data temporarily at an intermediate stage, e.g. caching
    • H04L67/5681Pre-fetching or pre-delivering data based on network characteristics
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
    • H04L69/161Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields
    • H04L69/162Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields involving adaptations of sockets based mechanisms

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer And Data Communications (AREA)

Abstract

The invention discloses a network communication method and a device, wherein the method comprises the steps of obtaining the SESSION, wherein the SESSION comprises the configuration information of the SESSION and a function pointer of the SESSION, initializing the function pointer of the SESSION according to the configuration information of the SESSION, and calling a function pointed by the function pointer of the SESSION according to the initialized function pointer of the SESSION. The technical scheme can be compatible with different link types and connection establishing modes at the same time and meets the requirement of safe transmission.

Description

Network communication method and device
Technical Field
The present invention relates to the field of data processing, and in particular, to a method and an apparatus for network communication.
Background
The link modes between the bank systems are very diverse, and include simplex, duplex, active, and passive. In the prior art, different systems adopt different link modes to realize communication link, which increases much development and maintenance work. With the improvement of the requirement of secure transmission, data encryption transmission becomes more and more the basic requirement of the existing communication program. At present, a set of communication system which can be compatible with different link types and link establishing modes and can meet the requirement of safe transmission needs to be designed.
Disclosure of Invention
The embodiment of the invention provides a network communication method and device, which can be compatible with different link types and link establishing modes and meet the requirement of safe transmission.
The network communication method provided by the embodiment of the invention comprises the following steps:
acquiring a SESSION, wherein the SESSION comprises configuration information of the SESSION and a function pointer of the SESSION;
initializing a function pointer of the SESSION according to the configuration information of the SESSION;
and calling a function pointed by the function pointer of the SESSION according to the initialized function pointer of the SESSION.
In the above technical solution, the function pointer of the SESSION is initialized according to the configuration information of the SESSION, and the function pointed by the function pointer of the SESSION is called, that is, the corresponding function is called according to the configuration information of different SESSIONs, so that the link type and the link establishing mode under the configuration information of different SESSIONs can be compatible at the same time, and the requirement of safe transmission can be met.
Optionally, the SESSION includes a link pair, and after the function pointed by the function pointer of the SESSION is called according to the initialized function pointer of the SESSION, the method further includes:
managing the linked pair of the SESSION based on a Reactor Reactor mode.
Optionally, the managing the link pair of SESSION based on the Reactor mode includes:
when data is to be read, sending the data to be read to a ring-shaped receiving buffer area; judging whether the data to be read in the annular receiving buffer area accords with a data communication protocol or not, if so, processing the data to be read in the annular receiving buffer area; if not, whether the data to be read in the annular receiving buffer area accords with the data communication protocol is judged again, and the data to be read in the annular receiving buffer area is processed until the data to be read in the annular receiving buffer area accords with the data communication protocol;
when data to be sent exist, sending the data to be sent to an annular sending buffer area; judging whether an external network is blocked, if so, judging whether the external network is blocked again, and writing the data to be sent in the annular sending buffer area into the external network until the external network is determined not to be blocked; otherwise, directly writing the data to be sent in the annular sending buffer area into the external network.
In the technical scheme, the connection pairs in the SESSION are managed through the Reactor mode, the asynchronous mode of network event detection and the asynchronous mode of network event operation are realized, the influence of non-standard or incomplete data on the system is reduced, the system is more stable to operate, and the mutual influence between the link pairs is further solved.
Optionally, the configuration information of the SESSION includes one or any combination of the following information:
ID (Identity) of SESSION, out-link handle, in-link handle, link type, link establishing mode, data protocol and secure transmission protocol;
wherein the ID of the SESSION is stored in a memory, and the memory is used for managing a preset number of SESSIONs.
In the above technical solution, the configuration information of the SESSION includes an ID of the SESSION, an out-link handle, an in-link handle, a link type, a link establishing mode, a data protocol, and a secure transmission protocol, and the corresponding function is called according to the configuration information of the SESSION, which is equivalent to calling the corresponding function according to different link types, link establishing modes, data protocols, and secure transmission protocols, that is, the different link types, link establishing modes, data protocols, and secure transmission protocols can be compatible. Meanwhile, a single memory is arranged for storing the ID of the SESSION, so that management of a large number of SESSIONs is realized, and management of a large number of link pairs is also realized.
Correspondingly, the embodiment of the invention also provides a network communication device, which comprises:
the device comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring the SESSION, and the SESSION comprises configuration information of the SESSION and a function pointer of the SESSION;
the first processing unit is used for initializing a function pointer of the SESSION according to the configuration information of the SESSION;
and the second processing unit is used for calling the function pointed by the function pointer of the SESSION according to the initialized function pointer of the SESSION.
Optionally, the SESSION includes a link pair, and after the function pointed by the function pointer of the SESSION is called according to the initialized function pointer of the SESSION, the second processing unit is further configured to:
and managing the linkage pair of the SESSION based on a Reactor mode.
Optionally, the second processing unit is specifically configured to:
when data is to be read, sending the data to be read to a ring-shaped receiving buffer area; judging whether the data to be read in the annular receiving buffer area accords with a data communication protocol or not, if so, processing the data to be read in the annular receiving buffer area; if not, whether the data to be read in the annular receiving buffer area accords with the data communication protocol is judged again, and the data to be read in the annular receiving buffer area is processed until the data to be read in the annular receiving buffer area accords with the data communication protocol;
when data to be sent exist, sending the data to be sent to an annular sending buffer area; judging whether an external network is blocked, if so, judging whether the external network is blocked again, and writing the data to be sent in the annular sending buffer area into the external network until the external network is determined not to be blocked; otherwise, directly writing the data to be sent in the annular sending buffer area into the external network.
Optionally, the configuration information of the SESSION includes one or any combination of the following information:
ID of SESSION, out-link handle, in-link handle, link type, connection establishing mode, data protocol and secure transmission protocol;
wherein the ID of the SESSION is stored in a memory, and the memory is used for managing a preset number of SESSIONs.
Correspondingly, an embodiment of the present invention further provides a computing device, including:
a memory for storing program instructions;
and the processor is used for calling the program instruction stored in the memory and executing the network communication method according to the obtained program.
Accordingly, embodiments of the present invention further provide a computer-readable non-volatile storage medium, which includes computer-readable instructions, and when the computer reads and executes the computer-readable instructions, the computer is enabled to execute the above network communication method.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic diagram of a system architecture according to an embodiment of the present invention;
fig. 2 is a schematic flow chart illustrating a network communication method according to an embodiment of the present invention;
fig. 3 is a schematic diagram illustrating a SESSION allocated to a worker thread according to an embodiment of the present invention;
FIG. 4 is a diagram illustrating a management link pair according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of a network communication device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer, the present invention will be described in further detail with reference to the accompanying drawings, and it is apparent that the described embodiments are only a part of the embodiments of the present invention, not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Fig. 1 illustrates an exemplary system architecture, which may be a server 100, including a processor 110, a communication interface 120, and a memory 130, to which embodiments of the present invention are applicable.
The processor 110 is a control center of the server 100, connects various parts of the entire server 100 using various interfaces and lines, and performs various functions of the server 100 and processes data by running or executing software programs and/or modules stored in the memory 130 and calling data stored in the memory 130. Alternatively, processor 110 may include one or more processing units.
The communication interface 120 is used for communication and provides communication between banking systems.
The memory 130 may be used to store software programs and modules, and the processor 110 executes various functional applications and data processing by operating the software programs and modules stored in the memory 130. The memory 130 may mainly 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, and the like; the storage data area may store data created according to a business process, and the like. Further, the memory 130 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
It should be noted that the structure shown in fig. 1 is only an example, and the embodiment of the present invention is not limited thereto.
Based on the above description, fig. 2 exemplarily illustrates a flow of a method for network communication according to an embodiment of the present invention, where the flow may be performed by a network communication device, which may be located in a server, and may be the server. As shown in fig. 2, the process specifically includes:
step 201, SESSION is acquired.
Here, the SESSION includes configuration information of the SESSION, a function pointer of the SESSION, and a link pair of the SESSION, where the link pair is an out link and an in link, and the link pair may also be said to include two SOCKET handles.
In the embodiment of the present invention, in order to monitor the simplex mode and the duplex mode in the link mode, both the simplex mode and the duplex mode may be regarded as two SOCKET handles, where the two SOCKET handles in the duplex mode are the same, and the two SOCKET handles in the simplex mode are different. Two SOCKET handles and associated configuration information are packaged as one SESSION. Specifically, the configuration information of SESSION includes one or any combination of the following information: the ID number ID, the out-link handle, the in-link handle, the link type, the association mode, the data protocol, and the secure transport protocol of SESSION may be specifically shown in table 1. The ID of the SESSION (SESSION _ ID) is a number of the SESSION, and the SESSION is managed based on the ID of the SESSION.
TABLE 1
Serial number Properties Type (B)
1 SESSION_ID Numerical type
2 Out-link handle Numerical type
3 In-link handler Numerical type
4 Type of link Numerical type
5 Building connection mode Numerical type
6 Data protocol Numerical type
7 Secure transmission Numerical type
When managing SESSIONs based on their IDs, as one way of implementing the present invention, the IDs of SESSIONs may be stored in a memory for managing a predetermined number of SESSIONs. Specifically, the ID of one SESSION occupies 1 BIT, the value of the BIT may be 1 or 0, when the value of the BIT is 1, it indicates that the SESSION corresponding to the BIT is already allocated, and when the value of the BIT is 0, it indicates that the SESSION corresponding to the BIT is not allocated. For example, the size of the memory for storing the IDs of the SESSIONs is 1MB, and the 1MB of memory can store 8388608 IDs of SESSIONs, which is equivalent to 8388608 SESSIONs, that is, 16777216 SOCKET handles.
Step 202, initializing a function pointer of the SESSION according to the configuration information of the SESSION;
the obtained SESSION is allocated to a certain working thread of the thread pool, which may be specifically shown in fig. 3. The working thread is a manager of the SESSION, and the SESSION is loaded according to the configuration information in the SESSION. In order to enable the SESSION to support all link types and link modes and meet the requirement of secure transmission, all operations of the SESSION need to be abstracted into function pointers, as shown in table 2.
TABLE 2
Function pointer Description of functions
open_session_in() Opening a snoop port
open_session_out() Actively initiating a connection with the outside
load_data_protocol() Loading communication protocol
load_ssl_certificate() Loading and installing communication certificate
ssl_shake_hand() Establishing SSL security lines
read_session_data() Reading network data in SESSION
send_session_data() Sending data into the network through the SESSION
Initializing the function pointer of the SESSION according to the configuration information of the SESSION may be understood as providing a uniform function interface to the user through the abstracted function pointer, and initializing the function pointer of the SESSION according to the configuration information of the SESSION.
Step 203, calling a function pointed by the function pointer of the SESSION according to the initialized function pointer of the SESSION.
Here, the function pointed by the function pointer of SESSION is called according to the initialized function pointer of SESSION, thereby realizing different functions. Therefore, the adaptability of the communication mode can be realized, namely, the compatibility with different link types and connection establishing modes is realized, and the requirement of safe transmission is met.
After the function pointed by the function pointer of the SESSION is called according to the initialized function pointer of the SESSION, the working thread can manage the link pair of the SESSION based on the Reactor mode. Each SESSION is decoupled from the application layer by an internal ring queue.
When data is to be read, the data to be read is sent to the annular receiving buffer area, whether the data to be read in the annular receiving buffer area accords with a data communication protocol or not is judged, and if yes, the data to be read in the annular receiving buffer area is processed. Otherwise, whether the data to be read in the annular receiving buffer area accords with the data communication protocol is judged again until the data to be read in the annular receiving buffer area accords with the data communication protocol is determined, and the data to be read in the annular receiving buffer area is processed.
When data to be sent exist, sending the data to be sent to an annular sending buffer area, judging whether an external network is blocked, if so, judging whether the external network is blocked again, and writing the data to be sent in the annular sending buffer area into the external network until the external network is determined not to be blocked; otherwise, directly writing the data to be sent in the annular sending buffer area into an external network.
For a better explanation of the above embodiments, reference may be made to fig. 4. When the asynchronous mode detects that data are to be read, the data to be read are sent to the annular receiving buffer area, whether the data to be read meet a data communication protocol or not is not detected in the process, and therefore even if the received data to be read are incomplete data, the working thread cannot be blocked. When the data to be read stored in the annular receiving buffer area is read, starting a data analysis event, judging whether the data to be read accords with a data communication protocol, and if so, informing an application processing thread to process the data. If not, no processing is carried out, namely, the data is continuously kept in the annular receiving buffer area, whether the data to be read accords with the data communication protocol is judged again, and the application processing thread is informed to process the data until the data accords with the data communication protocol. Here, the application processing thread may be understood as a thread of a user or a user. Therefore, the asynchronization of network interaction is ensured, and the normal network interaction cannot be influenced by the processing of communication data.
And when detecting that data to be sent exists through the asynchronous mode, sending the data to be sent to the annular sending buffer area. When the data to be read stored in the annular sending buffer area is sent, if the external network is not blocked, the data is directly written into the external network; when the external network is blocked due to overlarge data amount or other reasons, whether the external network is blocked or not is judged again until the external network is determined to be not blocked, namely when the situation that the external network can write data again is detected through the asynchronous mode, the data is written into the external network again.
In the above embodiment, by initializing the function pointer of the SESSION and calling the function according to the initialized function pointer of the SESSION, different link types and link establishment modes can be compatible at the same time and the requirement of secure transmission can be met, and the beneficial effects are achieved: (1) the ID of the SESSION is stored in a memory to realize the management of a large number of SESSIONs, namely, a large number of link pairs are managed; (2) the pointer mode is used for managing the SESSION link pair, network event detection asynchronization and network data operation asynchronization are achieved, the problem that mass links are influenced mutually is solved thoroughly, and the stability of network communication is improved.
Based on the same inventive concept, fig. 5 exemplarily shows a structure of a network communication device according to an embodiment of the present invention, and the device can execute a flow of a network communication method.
An obtaining unit 501, configured to obtain a SESSION, where the SESSION includes configuration information of the SESSION and a function pointer of the SESSION;
a first processing unit 502, configured to initialize a function pointer of the SESSION according to configuration information of the SESSION;
the second processing unit 503 is configured to call a function pointed by the function pointer of the SESSION according to the initialized function pointer of the SESSION.
Optionally, the SESSION includes a link pair, and the second processing unit 503 is further configured to:
and managing the linkage pair of the SESSION based on a Reactor mode.
Optionally, the second processing unit 503 is specifically configured to:
when data is to be read, sending the data to be read to a ring-shaped receiving buffer area; judging whether the data to be read in the annular receiving buffer area accords with a data communication protocol or not, if so, processing the data to be read in the annular receiving buffer area; if not, whether the data to be read in the annular receiving buffer area accords with the data communication protocol is judged again, and the data to be read in the annular receiving buffer area is processed until the data to be read in the annular receiving buffer area accords with the data communication protocol;
when data to be sent exist, sending the data to be sent to an annular sending buffer area; judging whether an external network is blocked, if so, judging whether the external network is blocked again, and writing the data to be sent in the annular sending buffer area into the external network until the external network is determined not to be blocked; otherwise, directly writing the data to be sent in the annular sending buffer area into the external network.
Optionally, the configuration information of the SESSION includes one or any combination of the following information:
ID of SESSION, out-link handle, in-link handle, link type, connection establishing mode, data protocol and secure transmission protocol;
wherein the ID of the SESSION is stored in a memory, and the memory is used for managing a preset number of SESSIONs.
Based on the same inventive concept, an embodiment of the present invention further provides a computing device, including:
a memory for storing program instructions;
and the processor is used for calling the program instruction stored in the memory and executing the network communication method according to the obtained program.
Based on the same inventive concept, the embodiment of the present invention further provides a computer-readable non-volatile storage medium, which includes computer-readable instructions, and when the computer reads and executes the computer-readable instructions, the computer is enabled to execute the above network communication method.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the invention.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.

Claims (10)

1. A method of network communication, comprising:
acquiring a SESSION, wherein the SESSION comprises configuration information of the SESSION and a function pointer of the SESSION;
initializing a function pointer of the SESSION according to the configuration information of the SESSION;
calling a function pointed by the function pointer of the SESSION according to the initialized function pointer of the SESSION;
initializing the function pointer of the SESSION according to the configuration information of the SESSION, including:
abstracting all operations of the SESSION into function pointers, providing a uniform function interface for a user through the abstracted function pointers, and initializing the function pointers of the SESSION according to the configuration information of the SESSION.
2. The method of claim 1, wherein the SESSION comprises a linked pair, and after the function pointed to by the function pointer of the SESSION is called according to the initialized function pointer of the SESSION, the method further comprises:
managing the linked pair of the SESSION based on a Reactor Reactor mode.
3. The method of claim 2, wherein the managing the linked pair of SESSION based on the Reactor mode comprises:
when data is to be read, sending the data to be read to a ring-shaped receiving buffer area; judging whether the data to be read in the annular receiving buffer area accords with a data communication protocol or not, if so, processing the data to be read in the annular receiving buffer area; if not, whether the data to be read in the annular receiving buffer area accords with the data communication protocol is judged again, and the data to be read in the annular receiving buffer area is processed until the data to be read in the annular receiving buffer area accords with the data communication protocol;
when data to be sent exist, sending the data to be sent to an annular sending buffer area; judging whether an external network is blocked, if so, judging whether the external network is blocked again, and writing the data to be sent in the annular sending buffer area into the external network until the external network is determined not to be blocked; otherwise, directly writing the data to be sent in the annular sending buffer area into the external network.
4. The method according to any of claims 1 to 3, wherein the configuration information of the SESSION comprises one or any combination of the following information:
ID of SESSION, out-link handle, in-link handle, link type, connection establishing mode, data protocol and secure transmission protocol;
wherein the ID of the SESSION is stored in a memory, and the memory is used for managing a preset number of SESSIONs.
5. A network communication device, comprising:
the device comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring a SESSION, and the SESSION comprises configuration information of the SESSION and a function pointer of the SESSION;
the first processing unit is used for initializing a function pointer of the SESSION according to the configuration information of the SESSION;
the second processing unit is used for calling a function pointed by the function pointer of the SESSION according to the initialized function pointer of the SESSION;
the first processing unit is specifically configured to:
abstracting all operations of the SESSION into function pointers, providing a uniform function interface for a user through the abstracted function pointers, and initializing the function pointers of the SESSION according to the configuration information of the SESSION.
6. The apparatus of claim 5, wherein the SESSION comprises a linked pair, and after the function pointed to by the function pointer of the SESSION is called according to the initialized function pointer of the SESSION, the second processing unit is further configured to:
managing the linked pair of the SESSION based on a Reactor Reactor mode.
7. The apparatus as claimed in claim 6, wherein the second processing unit is specifically configured to:
when data is to be read, sending the data to be read to a ring-shaped receiving buffer area; judging whether the data to be read in the annular receiving buffer area accords with a data communication protocol or not, if so, processing the data to be read in the annular receiving buffer area; if not, whether the data to be read in the annular receiving buffer area accords with the data communication protocol is judged again, and the data to be read in the annular receiving buffer area is processed until the data to be read in the annular receiving buffer area accords with the data communication protocol;
when data to be sent exist, sending the data to be sent to an annular sending buffer area; judging whether an external network is blocked, if so, judging whether the external network is blocked again, and writing the data to be sent in the annular sending buffer area into the external network until the external network is determined not to be blocked; otherwise, directly writing the data to be sent in the annular sending buffer area into the external network.
8. The apparatus according to any one of claims 5 to 7, wherein the configuration information of SESSION comprises one or any combination of the following information:
ID of SESSION, out-link handle, in-link handle, link type, connection establishing mode, data protocol and secure transmission protocol;
wherein the ID of the SESSION is stored in a memory, and the memory is used for managing a preset number of SESSIONs.
9. A computing device, comprising:
a memory for storing program instructions;
a processor for calling program instructions stored in said memory to execute the method of any one of claims 1 to 4 in accordance with the obtained program.
10. A computer-readable non-transitory storage medium including computer-readable instructions which, when read and executed by a computer, cause the computer to perform the method of any one of claims 1 to 4.
CN201811229051.6A 2018-10-22 2018-10-22 Network communication method and device Active CN109327521B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811229051.6A CN109327521B (en) 2018-10-22 2018-10-22 Network communication method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811229051.6A CN109327521B (en) 2018-10-22 2018-10-22 Network communication method and device

Publications (2)

Publication Number Publication Date
CN109327521A CN109327521A (en) 2019-02-12
CN109327521B true CN109327521B (en) 2021-03-23

Family

ID=65262713

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811229051.6A Active CN109327521B (en) 2018-10-22 2018-10-22 Network communication method and device

Country Status (1)

Country Link
CN (1) CN109327521B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102023856A (en) * 2010-10-21 2011-04-20 杭州万格网络科技有限公司 Method for outputting and operating data at server in formatting way according to demands of user
CN103077145A (en) * 2012-12-28 2013-05-01 Tcl集团股份有限公司 Method and system for transmitting and receiving data
CN103095646A (en) * 2011-10-28 2013-05-08 浙江大华技术股份有限公司 Network data receiving method

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8411665B2 (en) * 2007-12-11 2013-04-02 At&T Intellectual Property I, L.P. System and method of routing voice communications via peering networks
US9203936B2 (en) * 2013-10-07 2015-12-01 At&T Intellectual Property I, Lp Method and apparatus for initiating communication sessions

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102023856A (en) * 2010-10-21 2011-04-20 杭州万格网络科技有限公司 Method for outputting and operating data at server in formatting way according to demands of user
CN103095646A (en) * 2011-10-28 2013-05-08 浙江大华技术股份有限公司 Network data receiving method
CN103077145A (en) * 2012-12-28 2013-05-01 Tcl集团股份有限公司 Method and system for transmitting and receiving data

Also Published As

Publication number Publication date
CN109327521A (en) 2019-02-12

Similar Documents

Publication Publication Date Title
CA2942619C (en) Host device coupled to a mobile phone and method of operating the same
EP3007066A1 (en) Method for using shared device in apparatus capable of operating two operating systems
CN109729106B (en) Method, system and computer program product for processing computing tasks
CN107430549A (en) Based on united memory management
CN108011909B (en) Communication method and system, electronic device and computer cluster
CN103455380A (en) Multi-process communication system and establishment and communication method thereof
CN110062041B (en) Method and device for changing IOT (input/output) equipment based on block chain
KR101856486B1 (en) Method for bi-direction calling between open system and mainframe system
CN109923547B (en) Program behavior monitoring device, distributed object generation management device, storage medium, and program behavior monitoring system
CN111061685A (en) Log query method and device, node equipment and storage medium
US20170286140A1 (en) Java-based offload service in a mainframe environment
CN116860391A (en) GPU computing power resource scheduling method, device, equipment and medium
US10313450B2 (en) Method for transparently connecting augmented network socket operations
US20220188467A1 (en) Cloud server and method for controlling cloud server thereof
CN109327521B (en) Network communication method and device
CN109791502B (en) Peer-to-peer distributed computing system for heterogeneous device types
CN101617322B (en) Information processing device, information processing method, and program
CN115454576B (en) Virtual machine process management method and system and electronic equipment
EP2673704A1 (en) Method and apparatus for moving a software object
US9430338B2 (en) Method and computing device for recording log entries
US10678744B2 (en) Method and system for lockless interprocessor communication
CN111858020A (en) User resource limiting method, device and computer storage medium
CN108632321A (en) Treating method and apparatus based on scheduling of resource under big data platform
US9348667B2 (en) Apparatus for managing application program and method therefor
CN115665265A (en) Request processing method, device, equipment, storage medium and system

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