CN114679484A - Server, client, TCP/IP Ethernet communication system, medium, and device - Google Patents

Server, client, TCP/IP Ethernet communication system, medium, and device Download PDF

Info

Publication number
CN114679484A
CN114679484A CN202210299255.7A CN202210299255A CN114679484A CN 114679484 A CN114679484 A CN 114679484A CN 202210299255 A CN202210299255 A CN 202210299255A CN 114679484 A CN114679484 A CN 114679484A
Authority
CN
China
Prior art keywords
client
attribute
module
event
server
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
CN202210299255.7A
Other languages
Chinese (zh)
Other versions
CN114679484B (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.)
Jike Science and Technology Co Ltd
Original Assignee
Jike Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Jike Science and Technology Co Ltd filed Critical Jike Science and Technology Co Ltd
Priority to CN202210299255.7A priority Critical patent/CN114679484B/en
Publication of CN114679484A publication Critical patent/CN114679484A/en
Application granted granted Critical
Publication of CN114679484B publication Critical patent/CN114679484B/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
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/143Termination or inactivation of sessions, e.g. event-controlled end of session
    • 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]
    • 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 And Data Communications (AREA)

Abstract

The invention discloses a server, a client, a TCP/IP Ethernet communication system, a medium and equipment, wherein the server comprises a TCP/IP server visual component which is configured to be a first attribute configuration module, a first event configuration module and a first background method module, and the first background method module is associated with the first attribute configuration module and the first event configuration module. The client comprises a TCP/IP client visual component which is configured to be a second attribute configuration module, a second event configuration module and a second background method module, and the second background method module is associated with the second attribute configuration module and the second event configuration module. The visual components of the server and the visual components of the client are respectively packaged into independent components, can be flexibly combined and configured according to actual requirements in the development process of communication software based on TCP/IP Ethernet, can realize the multiplexing of the development process of communication application software with different purposes, and can enhance the usability, reliability and stability of a communication system.

Description

Server, client, TCP/IP Ethernet communication system, medium, and device
Technical Field
The invention relates to the field of digital information transmission of a new generation of information technology industry, in particular to a server, a client, a TCP/IP Ethernet communication system, a medium and equipment.
Background
The TCP/IP protocol is the most basic protocol of Ethernet, the basic transmission unit of the TCP/IP protocol is a data packet, the TCP protocol is responsible for dividing data into a plurality of data packets, each data packet is added with a packet header, the packet header is provided with a corresponding number so as to ensure that a data receiving end can restore the data to the original format, the IP protocol is added with a receiving end host address on each packet header, therefore, the data is found to the place where the data needs to go, and if the situations of data loss, data distortion and the like occur in the transmission process, the TCP protocol automatically requires the data to be retransmitted and repackaged. Thus, the IP protocol guarantees the transmission of data, and the TCP protocol guarantees the quality of data transmission.
The TCP/IP protocol is reliable transmission oriented to a connection protocol, is connected point to point, and is complex in protocol application, so that the TCP/IP protocol is widely used in various application programs based on the characteristic of reliable transmission, but the TCP/IP protocol is complex in application, and a multithreading technology and a network communication related underlying technology are considered.
The existing common software development tools do not have ready Ethernet communication components based on TCP/IP protocol, customized development is needed, developers mostly adopt bottom layer codes to realize development based on server or client application programs, and the server or client communication components based on TCP/IP protocol are not packaged, so that the problems of low reliability, difficulty in transplanting from different application software, nonstandard software modules, large development workload, large operation and maintenance difficulty and the like are caused.
Disclosure of Invention
In order to solve the problems in the background art, the invention provides a server, a client, a TCP/IP Ethernet communication system, a medium and equipment.
One aspect of the present invention provides a server, comprising
The TCP/IP server visual component is configured to be a first attribute configuration module, a first event configuration module and a first background method module;
the first attribute configuration module is used for configuring communication parameters of the server visual component in front-end visual design and/or calling in a background program in TCP/IP Ethernet-based server application program development;
the first event configuration module is used for visually configuring and processing corresponding events and/or background program configuration calling events at the front end in the application program development based on the TCP/IP Ethernet server;
the first background method module is associated with the first attribute configuration module and the first event configuration module;
automatically triggering events of the first event configuration module after the first background method module is started, and/or
And calling the first background method module to perform data and service logic processing after each event of the first event configuration module is triggered.
Optionally, the first attribute configuration module is a server communication parameter attribute set, where the server communication parameter attribute set includes an IP address attribute, a port number attribute, a packet size attribute, a maximum client connection number attribute, a monitoring state attribute, and a connected client list attribute of a server;
the port number attribute, the data packet size attribute and the maximum client connection number attribute of the server are read-write attributes, and the read-write attribute values are configured and obtained according to application needs;
the monitoring state attribute and the connected client list attribute of the server are read-only attributes.
Optionally, the first event configuration module is configured to configure the first client connection success event, the first client disconnection success event, the client data receiving event, and the client error event processing;
the first background method module comprises a monitoring starting method module, a monitoring stopping method module, a first data sending method module, a first data receiving method module and a first error processing method module, wherein the first error processing method module is used for processing the abnormal information thrown out when the monitoring starting method module, the monitoring stopping method module, the first data sending method module and the first data receiving method module generate errors, and calling an error processing method to perform service logic processing;
initializing a service end socket by using an IP address attribute, a port number attribute, a data packet size attribute, a maximum client connection number attribute and a data packet size attribute value of a service end, calling the monitoring starting method module by a service end background to start a monitoring process, waiting for and accepting connection of the client, and setting a monitoring state attribute as a starting state;
when the first client connection success event is automatically triggered after the client connection succeeds, adding the client to the connected client list attribute value in the first client connection success event;
stopping the connection of the client by using a monitoring stopping method module, setting the attribute of the monitoring state as a non-starting state, and clearing the attribute value of a connected client list;
removing the disconnected client from the connected client list attribute value in the client disconnection success event;
calling the first error processing method module to throw out client abnormal information in the event of processing the client error, and performing abnormal error service logic processing;
calling a first data receiving method module in the data event of the receiving client to receive data sent by the client;
and when the communication state of the client is judged to be the connection state, calling the first data sending method module according to the logic requirement of the application program to send data to the client.
One aspect of the present invention provides a client, including:
the TCP/IP client visual component is configured to be a second attribute configuration module, a second event configuration module and a second background method module;
the second attribute configuration module is used for configuring the client communication parameters in the front-end visual design or/and calling the configuration of the client communication parameters in a background program in the TCP/IP Ethernet-based client application program development;
the second event configuration module is used for visually configuring and processing corresponding events at the front end and/or configuring and calling events at a background program in the development of the TCP/IP Ethernet-based client application program;
the second background method module is associated with the second attribute configuration module and the second event configuration module;
automatically triggering each event of the second event configuration module after the second background method module is started, and/or
And calling the second background method module to perform data and service logic processing after each event of the second event configuration module is triggered.
Optionally, the second event configuration module is configured to configure the second client to connect a successful event, receive a server data event, and disconnect the successful event;
the second background method module is configured to be a connection method module, a disconnection method module, a second data sending method module, a second data receiving method module and a second error processing method module, and the second error processing method module is used for processing the abnormal information thrown out when the connection method module, the disconnection method module, the second data sending method module and the second data receiving method module generate errors and calling an error processing method to perform service logic processing;
calling the connection method module, and automatically triggering the second client connection success event after the connection method module starts successful connection;
calling the second data receiving method module to process the data sent by the server in the data event of the receiving server;
calling the disconnection method module, and automatically triggering the client disconnection success event after the disconnection method module starts disconnection;
and calling the second data sending method module to send data to the server according to the requirement of the application program under the condition of judging that the communication state of the client is the connection state.
Optionally, the second attribute configuration module configures a communication parameter attribute set for a client that needs to communicate, where the client communication parameter attribute set includes an IP address attribute, a port number attribute, a packet size attribute, and a communication state attribute of the client;
the IP address attribute, the port number attribute and the data packet size attribute of the client are read-write attributes, and attribute values are configured and obtained according to application requirements;
the communication state attribute of the client is a read-only attribute, and the setting way of the attribute value is to connect the successful event module from the second client or disconnect the successful event module from the second client.
Optionally, the client communication parameter attribute set is configured in a front-end design or set in a background program, and the client communication parameter attribute set is used to initialize the client ethernet communication socket;
calling the connection method module, and setting a communication state as a connection state after the connection is successful;
and calling the disconnection method module, releasing the Ethernet communication socket of the client, and setting the communication state to be a disconnection state.
The invention also provides a TCP/IP Ethernet communication system, which comprises a server and a client, wherein the server and the client are respectively packaged into independent visual components;
the server is applied to an application scene with a client lacking the server;
the client is applied to an application scene with a server lacking a client; and/or
The server side and the client side are in interactive communication, and the method is applied to application scenes which are not provided by the client side and the server side.
The invention also provides a storage medium for storing the computer program of the server; and/or
For storing a computer program for the above-mentioned client.
In another aspect, the present invention further provides an electronic device, including a processor, a memory, and a program or an instruction stored on the memory and executable on the processor, where the program or the instruction implements the steps of the computer program of the server and/or implements the steps of the computer program of the client when executed by the processor.
Compared with the prior art, the invention has prominent substantive characteristics and remarkable progress, particularly:
the server and the client are designed as visual components based on TCP/IP Ethernet communication, and are configured to be corresponding attribute configuration modules, event configuration modules and background method modules to respectively carry out modularized configuration on communication parameters, concerned events and a background scheduling processing method of the events of the server or the client, the communication components of the server or the client based on a TCP/IP protocol are packaged, the communication components of the server or the client are directly dragged to a development environment in the software development process, the component communication parameter configuration and the concerned events are compiled into a logic program in a visual mode, then the method is modularized, the development function of the application program of the server or the client can be realized, and the method has important significance for simplifying the workload of software developers and improving the low-code development, standardization and modularization of the application program, the method can be widely applied to application software programs based on TCP/IP Ethernet communication in different industry fields, and has remarkable technical progress.
Meanwhile, the visual server and the client component based on TCP/IP Ethernet communication respectively encapsulate the server component and the client component into independent visual components, can be flexibly configured according to actual needs in a software development process, can be freely applied to integration development with third-party application software according to needs, and can also be used for application program development in the aspect of data communication by mutually cooperating networking, so that the visual server and the client component based on TCP/IP Ethernet communication have great application flexibility and convenience, the multiplexing of different communication application software is realized, and the usability, reliability and stability of a communication system are enhanced.
Drawings
FIG. 1 is a schematic block diagram of the overall structure of the server according to the present invention;
FIG. 2 is a schematic block diagram of a detailed structure of a server side of the present invention;
FIG. 3 is a schematic block diagram of the overall structure of the client of the present invention;
FIG. 4 is a schematic block diagram of a detailed structure of a client of the present invention;
FIG. 5 is a schematic block diagram of the overall architecture of a TCP/IP Ethernet communication system of the present invention;
FIG. 6 is a schematic diagram of the overall structure of the electronic device of the present invention;
wherein:
1-a server;
10-TCP/IP server visualization component;
11-a first attribute configuration module;
12-a first event configuration module;
121-first client connection success event;
122-first client disconnect success event;
123-receive client data events;
124-handling client error events;
13-a first background method module;
131-starting a monitoring method module;
132-stop listening method module;
133-a first send data method module;
134-first receive data method module;
135-a first error handling method module;
2-a server;
20-TCP/IP client visualization component;
21-a second attribute configuration module;
22-a second event configuration module;
221-a second client connection success event;
222-receive server data event;
223-a second client disconnect success event;
23-a second background method module;
231-a connection module;
232-disconnect method module;
233-a second send data method module;
234-a second receive data method module;
235-second error handling method module.
Detailed Description
In order to make the aforementioned features and effects of the present invention more comprehensible, embodiments accompanied with figures are described in detail below.
As described above, the prior art does not implement the encapsulation of the server or the client as a visual component, and cannot flexibly configure as required. In view of the above, the present invention provides a server and a client.
Specifically, referring to fig. 1 and fig. 2, fig. 1 is a diagram illustrating an overall architecture of a server according to an embodiment of the present invention; figure 2 shows a detailed architecture diagram of the service end component.
A server side, comprising
The TCP/IP server visualization component 10 is configured as a first attribute configuration module 11, a first event configuration module 12, and a first background method module 13, where:
the first attribute configuration module 11 is configured to configure in a front-end visualization design and/or invoke configuration of communication parameters of a server visualization component in a background program in TCP/IP-based ethernet server application development;
the first event configuration module 12 is configured to configure and process a corresponding event and/or a daemon configuration calling event in a front-end visualization manner in TCP/IP-based ethernet server application development;
the first background method module 13 is in communication with the first attribute configuration module 11 and the first event configuration module 12, and after the first background method module is started, each event of the first event configuration module is automatically triggered, and/or
And calling the first background method module to perform data and service logic processing after each event of the first event configuration module is triggered.
In a specific implementation, one use of the visualization component 10 is to visualize configuration attributes and select a required event in a development server tool, and perform business logic processing in the event; another purpose is that the code can be used in the background to configure the attributes of the service end and select the event, so as to realize the service logic processing. For a first attribute configuration module, the first attribute configuration module is a server communication parameter attribute set, and the server communication parameter attributes include an IP address attribute, a port number attribute, a packet size attribute, a maximum client connection number attribute, a monitoring state attribute, and a connected client list attribute of a server. The port number attribute, the data packet size attribute and the maximum client connection number attribute of the server are read-write attributes, and attribute values are configured and obtained according to application needs; the monitoring state attribute and the connected client list attribute of the server are read-only attributes.
With respect to the first event configuration module 12 and the first background method module 13, the first event configuration module 12 is configured to a first client connect success event 121, a first client disconnect success event 122, a receive client data event 123, and a process client error event 124. The first background method module 13 includes a monitoring starting method module 131, a monitoring stopping method module 132, a first data sending method module 133, a first data receiving method module 134, and a first error processing method module 135, where the first error processing method module is configured to process that abnormal information is thrown out when an error occurs in the monitoring starting method module, the monitoring stopping method module, the first data sending method module, and the first data receiving method module, and call an error processing method to perform service logic processing.
In the embodiment, a service end socket is initialized by using an IP address attribute, a port number attribute, a data packet size attribute, a maximum client connection number attribute and a data packet size attribute value of a service end, a service end background calls a monitoring starting method module to start a monitoring process, wait and accept the connection of a client, and sets a monitoring state attribute as a starting state; when the first client connection success event is automatically triggered when the client connection is successful, adding the client into the connected client list attribute value in the first client connection success event; stopping the connection of the client by using the monitoring stopping method module, setting the attribute of the monitoring state as a non-starting state, and clearing the attribute value of the connected client list; removing the disconnected client from the connected client list attribute value in the client disconnection success event; calling the first error processing method module to throw out client abnormal information in the event of processing the client error, and performing abnormal error service logic processing; calling a first data receiving method module in the data event of the receiving client to receive data sent by the client; and when the communication state of the client is judged to be the connection state, calling the first data sending method module according to the logic requirement of the application program to send data to the client.
The server provided by this embodiment is packaged as an independent visualization component, can be independently applied to an application scenario with a client lacking a server, is designed as a TCP/IP-based communication server visualization component, and is configured as a first attribute configuration module, a first event configuration module, and a first background method module to perform modular configuration on communication parameters, events of interest, and a background scheduling processing method of the events of the server, respectively, and packages the TCP/IP-based server communication component to implement that the communication component is directly dragged to a development environment in a software development process, and a logic program is written in the communication parameter configuration and the events of interest of the component in a visualization manner, and then the method is modularized to implement a function of development of a server application program, and can be freely applied to integrated development with third-party application software according to needs, the method has important significance for simplifying the workload of software developers and improving the low-code development, standardization and modularization of the application program, and the modularization and standardization design can be applied to the application software programs based on Ethernet communication in different industry fields, so that the method has great application flexibility, convenience and remarkable technical progress.
Specifically, referring to fig. 3 and 4, fig. 3 shows an overall architecture diagram of a client according to a second embodiment of the present invention; FIG. 4 shows a detailed architecture diagram of the client component.
A client, comprising:
a TCP/IP client visualization component 20 configured as a second attribute configuration module 21, a second event configuration module 22 and a second background method module 23;
the second attribute configuration module 21 is configured to configure the client communication parameters in a front-end visual design or/and invoke the client communication parameter configuration in a background program in the TCP/IP ethernet-based client application development;
the second event configuration module 22 is configured to configure and process a corresponding event in a front-end visualization manner and/or configure and invoke an event in a background program in the TCP/IP-based ethernet client application development;
the second background method module 23 is associated with the second attribute configuration module 21 and the second event configuration module 22;
automatically triggering events of the second event configuration module 22 after the second background method module 23 is started, and/or
After each event of the second event configuration module 22 is triggered, the second background method module 23 is called to perform data and service logic processing.
In a specific implementation, one use of the visualization component 20 is to visualize configuration attributes and select required events in a development client tool, and perform business logic processing in the events; another purpose is that the code can be used in the background to configure the client attribute and select the event, so as to realize the service logic processing. For the second attribute configuration module 21, configuring a communication parameter attribute set for the client needing communication, where the client communication parameter attribute includes an IP address attribute, a port number attribute, a packet size attribute, and a communication state attribute of the client; the IP address attribute, the port number attribute and the data packet size attribute of the client are read-write attributes, and attribute values are configured and obtained according to application requirements; the communication state attribute of the client is a read-only attribute, and the setting way of the attribute value is to connect a successful event module from the second client or disconnect the successful event module from the second client, namely, the attribute value is set from an event, and only a value can be obtained in a visual configuration attribute or a background program, but a value cannot be set.
For the second event configuration module 22 and the second background method module 23, the second event configuration module 22 is configured to configure a second client connection success event 221, a receiving server data event 222, and a second client disconnection success event 223. The second background method module 23 is configured to be a connection module 231, a disconnection method module 232, a second data sending method module 233, a second data receiving method module 234, and a second error processing method module 235, where the second error processing method module 235 is configured to process the exception information thrown when an error occurs in the connection module 231, the disconnection method module 232, the second data sending method module 233, and the second data receiving method module 234, and call an error processing method to perform service logic processing.
In this embodiment, the client communication parameter attribute set is configured in a front-end design or set in a background program, and the client communication parameter attribute set is used to initialize the client ethernet communication socket. When communication connection with a server is needed, the connection method module is called, after the connection method module is started to be successfully connected, the connection success event of the second client is automatically triggered, and the communication state is set to be the connection state; calling the second data sending method module to send data to the server according to the requirement of an application program under the condition of judging that the communication state of the client is the connection state; and calling the second data receiving method module to process the data sent by the server in the data event of the receiving server. And when the communication connection with the server side is required to be disconnected, the disconnection method module is called, after the disconnection method module starts the disconnection, the successful disconnection event of the client side is automatically triggered, meanwhile, the Ethernet communication socket of the client side is released, and the communication state is set to be the disconnection state.
The client provided by the embodiment is packaged into an independent visual component, can be independently applied to an application scene with a server lacking the client, is designed into a visual component based on a TCP/IP Ethernet communication client, is configured into a second attribute configuration module, a second event configuration module and a second background method module, and respectively carries out modularized configuration on communication parameters, attention events and a background scheduling processing method of the events of the client, packages the client communication component based on a TCP/IP protocol, realizes that the communication component is directly dragged to a development environment in a software development process, carries out component communication parameter configuration and writes logic programs in the attention events in a visual mode, then can realize the development function of the client application program by a method modularized method, can be freely applied to integration development with third-party application software according to needs, the method has important significance for simplifying the workload of software developers and improving the low-code development, standardization and modularization of the application program, and the modularization and standardization design can be applied to the application software programs based on Ethernet communication in different industry fields, so that the method has great application flexibility, convenience and remarkable technical progress.
It should be noted that, in the visual server and the client component based on TCP/IP ethernet communication provided in the above embodiments of the present invention, the server component and the client component are respectively packaged as independent visual components, and can be flexibly configured according to actual needs in a software development process, and can be freely applied to integrated development with third-party application software according to needs, and also can be cooperatively networked to develop an application program in data communication, so that the present invention has great application flexibility and convenience, realizes multiplexing of different communication applications, and enhances the stability of a communication system.
Meanwhile, the server and the client terminal devices in the above embodiments of the present invention may include a personal terminal, an upper computer terminal, and the like, which is not limited in this embodiment of the present invention. The terminal can support operating systems such as Windows, Android, IOS and Windows Phone.
Meanwhile, an embodiment of the present invention provides a TCP/IP ethernet communication system based on the server in fig. 1 and fig. 2 and the client in fig. 3 and fig. 4, as shown in fig. 5, and as shown in the overall architecture diagram of the system; the communication system comprises a server 1 and a client 2;
the server 1 can be independently applied to an application scene with a client lacking a server and is independently used in a software development process; the client 2 can be independently applied to an application scene with a server lacking a client and can be independently used in a software development process; or the server 1 and the client 2 can be used in combination, and are suitable for scenes that neither the client nor the server has, so that the communication between different client and server software is realized.
The server 1 at least includes:
the TCP/IP server visualization component 10 is configured as a first attribute configuration module 11, a first event configuration module 12 and a first background method module 13;
the first attribute configuration module 11 is configured to configure in a front-end visualization design and/or invoke configuration of communication parameters of a server visualization component in a background program in TCP/IP-based ethernet server application development;
the first event configuration module 12 is configured to configure and process a corresponding event and/or a daemon configuration calling event in a front-end visualization manner in TCP/IP-based ethernet server application development;
the first background method module 13 is associated with the first attribute configuration module 11 and the first event configuration module 12;
automatically triggering events of the first event configuration module 12 after the first background method module 13 is started, and/or
After each event of the first event configuration module 12 is triggered, the first background method module 13 is called to perform data and service logic processing.
Optionally, the first attribute configuration module is a server communication parameter attribute set, where the server communication parameter attribute set includes an IP address attribute, a port number attribute, a packet size attribute, a maximum client connection number attribute, a monitoring state attribute, and a connected client list attribute of a server;
the port number attribute, the data packet size attribute and the maximum client connection number attribute of the server are read-write attributes, and read-write attribute values are configured and obtained according to application needs;
the monitoring state attribute and the connected client list attribute of the server are read-only attributes.
Optionally, the first event configuration module 12 is configured to configure a first client connection success event 121, a first client disconnection success event 122, a receive client data event 123, and a process client error event 124. The first background method module 13 includes a monitoring starting method module 131, a monitoring stopping method module 132, a first data sending method module 133, a first data receiving method module 134, and a first error handling method module 135, where the first error handling method module is configured to process that exception information is thrown when an error occurs in the monitoring starting method module, the monitoring stopping method module, the first data sending method module, and the first data receiving method module, and call an error handling method to perform service logic processing;
initializing a service end socket by using an IP address attribute, a port number attribute, a data packet size attribute, a maximum client connection number attribute and a data packet size attribute value of a service end, calling the monitoring starting method module by a service end background to start a monitoring process, waiting for and accepting connection of the client, and setting a monitoring state attribute as a starting state;
when the first client connection success event is automatically triggered when the client connection is successful, adding the client into the connected client list attribute value in the first client connection success event;
stopping the connection of the client by using the monitoring stopping method module, setting the attribute of the monitoring state as a non-starting state, and clearing the attribute value of the connected client list;
removing the disconnected client from the connected client list attribute value in the client disconnection success event;
calling the first error processing method module to throw out client abnormal information in the event of processing the client error, and performing abnormal error service logic processing;
calling a first data receiving method module in the data event of the receiving client to receive data sent by the client;
and when the communication state of the client is judged to be the connection state, calling the first data sending method module to send data to the client according to the logic requirement of the application program.
The client 2 includes:
a TCP/IP client visualization component 20 configured as a second attribute configuration module 21, a second event configuration module 22 and a second background method module 23;
the second attribute configuration module 21 is configured to configure the client communication parameters in a front-end visual design or/and invoke the configuration of the client communication parameters in a background program in the TCP/IP ethernet client application development;
the second event configuration module 22 is configured to configure and process a corresponding event in a front-end visualization manner and/or configure and invoke an event in a background program in the TCP/IP-based ethernet client application development;
the second background method module 23 is in communication with the second attribute configuration module 21 and the second event configuration module 22 in association with each other,
automatically triggering each event of the second event configuration module after the second background method module is started, and/or
And calling the second background method module to perform data and service logic processing after each event of the second event configuration module is triggered.
Alternatively to this, the first and second parts may,
the second event configuration module 22 is configured to configure a second client connection success event 221, a receiving server data event 222, and a second client disconnection success event 223;
the second background method module 23 is configured to be a connection module 231, a disconnection method module 232, a second data sending method module 233, a second data receiving method module 234, and a second error processing method module 235, where the second error processing method module 235 is configured to process that exception information is thrown when an error occurs in the connection module 231, the disconnection method module 232, the second data sending method module 233, and the second data receiving method module 234, and call an error processing method to perform service logic processing;
calling the connection method module, and automatically triggering the second client connection success event after the connection method module starts successful connection;
calling the second data receiving method module to process the data sent by the server in the data event of the receiving server;
calling the disconnection method module, and automatically triggering the client disconnection success event after the disconnection method module starts disconnection;
and calling the second data sending method module to send data to the server according to the requirement of the application program under the condition of judging that the communication state of the client is the connection state.
Optionally, the second attribute configuration module configures a communication parameter attribute set for a client that needs to communicate, where the client communication parameter attribute set includes an IP address attribute, a port number attribute, a packet size attribute, and a communication state attribute of the client;
the IP address attribute, the port number attribute and the data packet size attribute of the client are read-write attributes, and attribute values are configured and obtained according to application requirements;
the communication state attribute of the client is a read-only attribute, and the setting way of the attribute value is to connect the successful event module from the second client or disconnect the successful event module from the second client.
Optionally, the client communication parameter attribute set is configured in a front-end design or set in a background program, and the client communication parameter attribute set is used to initialize the client ethernet communication socket;
calling the connection method module, and setting a communication state as a connection state after the connection is successful;
and calling the disconnection method module, releasing the Ethernet communication socket of the client, and setting the communication state to be a disconnection state.
According to the visual service end and the client end component based on TCP/IP Ethernet communication provided by the embodiment of the invention, the service end component and the client end component are respectively packaged into independent visual components, can be flexibly configured according to actual needs in a software development process, can be freely applied to the integration development with third-party application software according to needs, and can also be mutually cooperated to carry out application program development in the aspect of data communication, so that the visual service end and the client end component based on TCP/IP Ethernet communication have great application flexibility and convenience, the multiplexing of different communication application software is realized, and the stability of a communication system is enhanced.
Fig. 6 is a schematic structural diagram of an electronic device provided in an embodiment of the present application.
As shown in fig. 6, an electronic device 500 according to an embodiment of the present application is further provided, which includes a processor 501, a memory 502, and a program or an instruction stored in the memory 502 and executable on the processor 501, and when the program or the instruction is executed by the processor 501, the steps of the server and/or the client program are implemented, and the same technical effect can be achieved.
It should be noted that the electronic devices in the embodiments of the present application may include mobile electronic devices and non-mobile electronic devices.
The embodiment of the present application further provides a readable storage medium, where a program or an instruction is stored on the readable storage medium, and when the program or the instruction is executed by a processor, the program or the instruction implements the steps of the server and/or the client program, and can achieve the same technical effect.
The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and so on.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element. Further, it should be noted that the scope of the methods and apparatus of the embodiments of the present application is not limited to performing the functions in the order illustrated or discussed, but may include performing the functions in a substantially simultaneous manner or in a reverse order based on the functionality involved, e.g., the methods described may be performed in an order different than that described, and various steps may be applied, omitted, or combined. In addition, features described with reference to certain examples may be combined in other examples.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present application may be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal (such as a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present application.
While the present embodiments have been described with reference to the accompanying drawings, it is to be understood that the invention is not limited to the precise embodiments described above, which are meant to be illustrative and not restrictive, and that various changes may be made therein by those skilled in the art without departing from the spirit and scope of the invention as defined by the appended claims.

Claims (10)

1. A server, comprising:
the TCP/IP server visual component is configured to be a first attribute configuration module, a first event configuration module and a first background method module;
the first attribute configuration module is used for configuring communication parameters of the server visual component in front-end visual design and/or calling in a background program in TCP/IP Ethernet-based server application program development;
the first event configuration module is used for visually configuring and processing corresponding events and/or background program configuration calling events at the front end in the application program development based on the TCP/IP Ethernet server;
the first background method module is associated with the first attribute configuration module and the first event configuration module;
after the first background method module is started, automatically triggering each event of the first event configuration module, and/or calling the first background method module to perform data and service logic processing after each event of the first event configuration module is triggered.
2. The server according to claim 1,
the first attribute configuration module is a server communication parameter attribute set, and the server communication parameter attribute set comprises an IP address attribute, a port number attribute, a data packet size attribute, a maximum client connection number attribute, a monitoring state attribute and a connected client list attribute of a server;
the port number attribute, the data packet size attribute and the maximum client connection number attribute of the server are read-write attributes, and the read-write attribute values are configured and obtained according to application needs;
the monitoring state attribute and the connected client list attribute of the server are read-only attributes.
3. The server according to claim 2,
the first event configuration module is configured to configure a first client connection success event, a first client disconnection success event, a client data receiving event and a client error handling event;
the first background method module comprises a monitoring starting method module, a monitoring stopping method module, a first data sending method module, a first data receiving method module and a first error processing method module, wherein the first error processing method module is used for processing the abnormal information thrown out when the monitoring starting method module, the monitoring stopping method module, the first data sending method module and the first data receiving method module generate errors, and calling an error processing method to perform service logic processing;
initializing a service end socket by using an IP address attribute, a port number attribute, a data packet size attribute, a maximum client connection number attribute and a data packet size attribute value of a service end, calling the monitoring starting method module by a service end background to start a monitoring process, waiting for and accepting connection of the client, and setting a monitoring state attribute as a starting state;
when the first client connection success event is automatically triggered when the client connection is successful, adding the client into the connected client list attribute value in the first client connection success event;
stopping the connection of the client by using the monitoring stopping method module, setting the attribute of the monitoring state as a non-starting state, and clearing the attribute value of the connected client list;
removing the disconnected client from the connected client list attribute value in the client disconnection success event;
calling the first error processing method module to throw out client abnormal information in the event of processing the client error, and performing abnormal error service logic processing;
calling a first data receiving method module in the data event of the receiving client to receive data sent by the client;
and when the communication state of the client is judged to be the connection state, calling the first data sending method module according to the logic requirement of the application program to send data to the client.
4. A client, comprising:
the TCP/IP client visual component is configured to be a second attribute configuration module, a second event configuration module and a second background method module;
the second attribute configuration module is used for configuring the client communication parameters in the front-end visual design or/and calling the configuration of the client communication parameters in a background program in the TCP/IP Ethernet-based client application program development;
the second event configuration module is used for visually configuring and processing corresponding events at the front end and/or configuring and calling events at a background program in the development of the TCP/IP Ethernet-based client application program;
the second background method module is associated with the second attribute configuration module and the second event configuration module;
after the second background method module is started, automatically triggering each event of the second event configuration module, and/or calling the second background method module to perform data and service logic processing after each event of the second event configuration module is triggered.
5. The client of claim 4,
the second event configuration module is configured to configure a second client connection success event, receive a server data event, and disconnect a second client success event;
the second background method module is configured to be a connection method module, a disconnection method module, a second data sending method module, a second data receiving method module and a second error processing method module, and the second error processing method module is used for processing the abnormal information thrown out when the connection method module, the disconnection method module, the second data sending method module and the second data receiving method module generate errors and calling an error processing method to perform service logic processing;
calling the connection method module, and automatically triggering the second client connection success event after the connection method module starts successful connection;
calling the second data receiving method module to process the data sent by the server in the data event of the receiving server;
calling the disconnection method module, and automatically triggering the client disconnection success event after the disconnection method module starts disconnection;
and calling the second data sending method module to send data to the server according to the requirement of the application program under the condition of judging that the communication state of the client is the connection state.
6. The client of claim 5,
the second attribute configuration module is used for configuring a communication parameter attribute set for a client needing communication, wherein the client communication parameter attribute set comprises an IP address attribute, a port number attribute, a data packet size attribute and a communication state attribute of the client;
the IP address attribute, the port number attribute and the data packet size attribute of the client are read-write attributes, and attribute values are configured and obtained according to application requirements;
the communication state attribute of the client is a read-only attribute, and the setting way of the attribute value is to connect the successful event module from the second client or disconnect the successful event module from the second client.
7. The client of claim 6,
configuring the client communication parameter attribute set in front-end design or setting the client communication parameter attribute set in a background program, and initializing a client Ethernet communication socket by using the client communication parameter attribute set;
calling the connection method module, and setting a communication state as a connection state after the connection is successful;
and calling the disconnection method module, releasing the Ethernet communication socket of the client, and setting the communication state to be a disconnection state.
8. A TCP/IP ethernet communication system, comprising a server and a client, wherein the server and the client are respectively packaged as independent visual components, the server employs the server according to any one of claims 1 to 3, and the client employs the client according to any one of claims 4 to 7;
the server is applied to an application scene with a client lacking the server;
the client is applied to an application scene with a server lacking the client; and/or the server side and the client side are in interactive communication, and the method is applied to application scenes which are not provided by the client side and the server side.
9. A storage medium for storing a computer program of the server according to any one of claims 1 to 3; and/or a computer program for storing a client according to any of claims 4-7.
10. An electronic device, characterized in that it comprises a processor, a memory, a program or instructions stored on said memory and executable on said processor, which program or instructions, when executed by said processor, implement the steps of the computer program of the server of any of claims 1-3 and/or implement the steps of the computer program of the client of any of claims 4-7.
CN202210299255.7A 2022-03-25 2022-03-25 Server, client, TCP/IP Ethernet communication system, medium, and device Active CN114679484B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210299255.7A CN114679484B (en) 2022-03-25 2022-03-25 Server, client, TCP/IP Ethernet communication system, medium, and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210299255.7A CN114679484B (en) 2022-03-25 2022-03-25 Server, client, TCP/IP Ethernet communication system, medium, and device

Publications (2)

Publication Number Publication Date
CN114679484A true CN114679484A (en) 2022-06-28
CN114679484B CN114679484B (en) 2023-01-10

Family

ID=82073981

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210299255.7A Active CN114679484B (en) 2022-03-25 2022-03-25 Server, client, TCP/IP Ethernet communication system, medium, and device

Country Status (1)

Country Link
CN (1) CN114679484B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109725901A (en) * 2018-05-31 2019-05-07 中国平安人寿保险股份有限公司 Development approach, device, equipment and the computer storage medium of front-end code
CN110597586A (en) * 2019-08-19 2019-12-20 北京邮电大学 Method and device for large screen layout of componentized layout based on dragging
CN112558970A (en) * 2020-12-24 2021-03-26 贵阳货车帮科技有限公司 Rendering generation method and device for front-end page, front-end equipment and storage medium
CN112579142A (en) * 2020-11-26 2021-03-30 北京航天智造科技发展有限公司 Application program issuing method and device for industrial Internet
US20210096826A1 (en) * 2016-10-17 2021-04-01 Sachin Dev Duggal Application development involving instant protoyping
CN113835691A (en) * 2021-09-27 2021-12-24 工银科技有限公司 iOS application development method, system, device, medium and program product
CN114036425A (en) * 2021-11-24 2022-02-11 上海哔哩哔哩科技有限公司 Page access method, client, server and system
CN114153442A (en) * 2021-12-01 2022-03-08 北京国网信通埃森哲信息技术有限公司 Large-screen visualization page configuration method and system based on visualization component

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20210096826A1 (en) * 2016-10-17 2021-04-01 Sachin Dev Duggal Application development involving instant protoyping
CN109725901A (en) * 2018-05-31 2019-05-07 中国平安人寿保险股份有限公司 Development approach, device, equipment and the computer storage medium of front-end code
CN110597586A (en) * 2019-08-19 2019-12-20 北京邮电大学 Method and device for large screen layout of componentized layout based on dragging
CN112579142A (en) * 2020-11-26 2021-03-30 北京航天智造科技发展有限公司 Application program issuing method and device for industrial Internet
CN112558970A (en) * 2020-12-24 2021-03-26 贵阳货车帮科技有限公司 Rendering generation method and device for front-end page, front-end equipment and storage medium
CN113835691A (en) * 2021-09-27 2021-12-24 工银科技有限公司 iOS application development method, system, device, medium and program product
CN114036425A (en) * 2021-11-24 2022-02-11 上海哔哩哔哩科技有限公司 Page access method, client, server and system
CN114153442A (en) * 2021-12-01 2022-03-08 北京国网信通埃森哲信息技术有限公司 Large-screen visualization page configuration method and system based on visualization component

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
彭浩等: "基于JSP技术的三层结构商务网站构建", 《福建电脑》 *

Also Published As

Publication number Publication date
CN114679484B (en) 2023-01-10

Similar Documents

Publication Publication Date Title
CN108494817B (en) Data transmission method, related device and system
CN112039824B (en) Communication method, system, device and computer readable storage medium
EP2429225A1 (en) Method for provisioning parameters of terminal, system thereof, and terminal management device
CN109857572B (en) Method, device and equipment for realizing remote calling and computer readable storage medium
US6442612B1 (en) Device and method for communication over a network
JP2008502972A (en) System and method for managing changes to a cluster configuration
CN105530277A (en) Method and device for cooperative work of devices
CN110138753B (en) Distributed message service system, method, apparatus, and computer-readable storage medium
CN108810000B (en) Method and device for generating serialization and deserialization API
US20100325627A1 (en) System for Deploying Software Components on Computation Units that are Limited in Terms of Processing Capacity
CN114679484B (en) Server, client, TCP/IP Ethernet communication system, medium, and device
CN113791920A (en) Dual-system communication method, device, electronic equipment and computer readable storage medium
CN113965628A (en) Message scheduling method, server and storage medium
CN104714760B (en) A kind of method and device for reading and writing storage device
CN102123079A (en) Method and device for processing transaction message
CN102684924B (en) Network management workstation and debugging method of network management software
CN114244758A (en) Network diagnosis method, storage medium, electronic device and system of android platform
CN110557453B (en) Data distribution method, device, equipment and storage medium
CN112165529A (en) Method, device, equipment and medium for low-cost cross-network data exchange
CN105577433A (en) ACS cluster management method, apparatus and system
CN110943895A (en) Network shutdown and Linux system-based network data processing method and device
CN102946395B (en) The method and apparatus of analogue network element
CN114490202B (en) Password equipment testing method and device, electronic equipment and storage medium
US6459786B1 (en) Call and connection control
CN112835728B (en) Message processing method, device, computer equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant