Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

Network communication system and method based on TCP/IP communication protocol

A technology of network communication and IP communication, which is applied in the field of network communication system based on TCP/IP communication protocol, can solve the problems of large memory overhead, system error, difficult to meet massive user connections and concurrent communication, etc., and achieve the improvement of hardware resources Effect

Active Publication Date: 2017-02-01
SHENZHEN INST OF ADVANCED TECH
View PDF5 Cites 6 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0003] At present, most of the servers that can realize mutual communication between clients are written in java or c#, and most of them run under the window system. For occasions where the number of clients is small and the data throughput requirements are not high, this method can be used , but the window itself is an operating system that consumes system resources (such as relatively large memory overhead), and a certain copyright fee needs to be paid for commercial applications. Difficult to meet the requirements of massive user connections and concurrent communications
[0004] For the management of online clients, most of them use a fixed memory unit to save online client information. This method cannot make full use of the memory space, because the number of online clients changes dynamically. error or waste of memory space

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Network communication system and method based on TCP/IP communication protocol
  • Network communication system and method based on TCP/IP communication protocol
  • Network communication system and method based on TCP/IP communication protocol

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0092] Example 1 - A new client initiates a TCP connection request

[0093] see Figure 4 , a flow chart of steps for the event processing of a new client initiating a TCP connection request provided by this application, including the following steps:

[0094] S11: The epoll_wait function finds that the event to be processed is exactly equal to the listening socket descriptor socket_fd;

[0095] S12: Call the accept function according to socket_fd to return a new socket socket descriptor, denoted as fd;

[0096] S13: Add the monitored fd to the epoll handle through the epoll_ctl function.

[0097] It can be understood that the occurrence of this client event does not immediately complete the online work of the client (requires the online command below), but only requires the client to initiate a TCP connection request before obtaining the fd assigned to it by the server, because the client who has already established a connection The terminal must pass fd to transmit data w...

Embodiment 2

[0098] Example 2 - The client that has established a connection initiates an online command

[0099] see Figure 5 , which is a flow chart of the server processing when the connection has been established and the client sends an online command to the server provided by this application, including the following steps:

[0100] S21: The epoll_wait function finds that the triggering event to be processed is a socket descriptor, denoted as fd;

[0101]S22: calling the read function according to fd;

[0102] S23: judge whether the read return value is greater than 0, if so, go to the next step; if not, go to exception handling;

[0103] S24: Determine whether the data packet is in the format of HEL;xxxxxxxxxxx;@, wherein, HEL is the abbreviation of hello, xxxxxxxxxxxx is the ID of the client, separated by a semicolon ";", and ends with @, if so, go to the next step ; If not, process other data packets or commands according to the protocol;

[0104] S25: Extract the xxxxxxxxxxxx...

Embodiment 3

[0108] Embodiment 3 - protocol for communication between clients

[0109] see Figure 8 , which is a flow chart of server processing when online clients communicate with each other provided by this application, including the following steps:

[0110] S31: The epoll_wait function finds that the triggering event to be processed is a socket descriptor, denoted as fd;

[0111] S32: call the read function according to fd;

[0112] S33: judge whether the read return value is greater than 0, if so, go to the next step; if not, go to other processing;

[0113] S34: Determine whether the data packet is DATA; ID_send; ID_rec; content; @ format, wherein ID_send represents the ID number of the sender, which is recorded as the ID of client I, and ID_rec represents the ID number of the receiver, which is recorded as the client ID of II, if yes, proceed to the next step; if not, process other data packets or commands according to the protocol;

[0114] S35: extract ID_send, ID_rec, conte...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention provides a network communication system based on a TCP / IP communication protocol. The network communication system comprises a server and at least one client side; the server is used for creating a dynamic chain table; the dynamic chain table comprises a head node and a plurality of child nodes; starting from the head node, the nodes are sequentially connected in series through a pointer field next, so that the dynamic chain table is formed; the server judges whether a communication event is triggered at the client side or not by calling an epoll_wait function; if so, the server quits the epoll_wait function, and traverses and processes the communication event; and if not, a blocking mode is adopted to wait for the triggering of the communication event at the client side. According to the network communication system disclosed by the invention, by utilization of an epoll server communication model, online and offline states of the client side, communication between the client side and the server, and communication between the client side and another client side can be realized through the dynamic chain table; the defect that large-scale user connection cannot be satisfied by a general server can be solved; and furthermore, the memory utilization rate of the server is increased by utilization of computer hardware resources.

Description

technical field [0001] The invention relates to the technical field of network communication, in particular to a network communication system and method based on the TCP / IP communication protocol. Background technique [0002] Mobile remote monitoring based on smartphone APPs or other portable mobile devices with operating systems is becoming more and more popular, such as using smartphones for remote positioning and monitoring of movement and physiological data of wards, and remote control of household appliances through smartphones. As far as the server is concerned, whether it is a smart phone APP that acts as a monitoring terminal or various wearable and professional devices that provide data sources, they are all clients. It is necessary to solve the problem of mutual data transmission between a specific guardian object and a specific guardian object. It is to solve the problem of communication between any clients in the server system. At present, most of the communica...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
IPC IPC(8): H04L29/06
CPCH04L69/162
Inventor 宁运琨赵国如李慧奇梁升云
Owner SHENZHEN INST OF ADVANCED TECH
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products