WO2019028673A1 - B/s architecture-based data communication system and method, web server, and monitoring system - Google Patents
B/s architecture-based data communication system and method, web server, and monitoring system Download PDFInfo
- Publication number
- WO2019028673A1 WO2019028673A1 PCT/CN2017/096413 CN2017096413W WO2019028673A1 WO 2019028673 A1 WO2019028673 A1 WO 2019028673A1 CN 2017096413 W CN2017096413 W CN 2017096413W WO 2019028673 A1 WO2019028673 A1 WO 2019028673A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- communication
- data
- socket
- server
- browser
- Prior art date
Links
- 230000006854 communication Effects 0.000 title claims abstract description 314
- 238000004891 communication Methods 0.000 title claims abstract description 313
- 238000000034 method Methods 0.000 title claims abstract description 47
- 238000012544 monitoring process Methods 0.000 title claims abstract description 16
- 230000008569 process Effects 0.000 claims abstract description 26
- 230000005540 biological transmission Effects 0.000 claims description 18
- 238000012545 processing Methods 0.000 claims description 12
- 230000004044 response Effects 0.000 claims description 7
- 230000005856 abnormality Effects 0.000 claims description 6
- 238000001514 detection method Methods 0.000 claims description 5
- 230000001960 triggered effect Effects 0.000 claims description 3
- 230000002159 abnormal effect Effects 0.000 claims description 2
- 230000000903 blocking effect Effects 0.000 claims description 2
- 238000012423 maintenance Methods 0.000 abstract description 6
- 230000006870 function Effects 0.000 description 26
- 238000010586 diagram Methods 0.000 description 6
- 238000005516 engineering process Methods 0.000 description 4
- 230000007246 mechanism Effects 0.000 description 4
- 238000012546 transfer Methods 0.000 description 3
- 238000011161 development Methods 0.000 description 2
- 230000000977 initiatory effect Effects 0.000 description 2
- 230000008859 change Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 239000004984 smart glass Substances 0.000 description 1
- 230000009466 transformation Effects 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L65/00—Network arrangements, protocols or services for supporting real-time applications in data packet communication
- H04L65/40—Support for services or applications
Definitions
- the present application relates to the field of communications technologies, and in particular, to a data communication system, method, web server, and monitoring system based on a B/S architecture.
- wearable devices are becoming more and more popular, so remote control of wearable devices is particularly important.
- the communication between the wearable device and the server or the communication between the remote monitoring platform and the server is based on the TCP (Transmission Control Protocol)-based C/
- the S architecture (Client/Server structure, client and server structure) is implemented.
- C/S architecture For the communication between the remote monitoring platform and the server, if it is implemented by C/S architecture, it is mostly applicable to the local area network. This method requires special technology for remote access, and the system is specially designed to handle distributed data. Relative to the rapid development of the Internet, there is a lack of certain scalability.
- the C/S architecture can be seen as a "fat" client architecture, because the client needs to implement most of the business logic and interface presentation. In this architecture, the client needs to bear a lot of pressure, the user is When using, you need to install monitoring platform software to achieve communication between the two. There are also restrictions on the operating system of the client. In addition, every time the system is upgraded, all client programs need to be changed and upgraded.
- a data communication system based on a B/S architecture comprising a client, a communication server, and a web server for connecting the client and the communication server, the web server having an intermediate communication component:
- the browser of the client initiates an HTTP request to the intermediate communication component of the web server;
- the intermediate communication component processes the HTTP request and establishes a Socket communication with the communication server;
- the intermediate communication component transmits a Socket request corresponding to the HTTP request to the communication server by using a TCP/IP protocol;
- the communication server processes the Socket request and returns corresponding result data to display the result data through a browser of the client.
- a data communication method based on a B/S architecture comprising:
- the intermediate communication component of the web server obtains an HTTP request initiated by the client's browser
- the intermediate communication component processes the HTTP request and establishes a Socket communication with the communication server;
- the intermediate communication component transmits a Socket request corresponding to the HTTP request to the communication server through a TCP/IP protocol.
- a web server for a data communication system based on a B/S architecture includes a client, a communication server, the web server is configured to connect the client and a communication server, and the web server is provided Intermediate communication component:
- the intermediate communication component acquires an HTTP request initiated by a browser of the client
- the intermediate communication component processes the HTTP request and establishes a Socket communication with the communication server letter;
- the intermediate communication component transmits a Socket request corresponding to the HTTP request to the communication server through a TCP/IP protocol.
- a wearable device-based monitoring system comprising a wearable device, and the above-described B/S architecture-based data communication system, the wearable device establishing a network data connection with the communication server, the client The end is used for remote monitoring of the wearable device:
- the browser of the client initiates an HTTP request to the intermediate communication component of the web server when acquiring the operation of the user;
- the intermediate communication component processes the HTTP request and establishes a Socket communication with the communication server;
- the intermediate communication component transmits a Socket request corresponding to the HTTP request to the communication server by using a TCP/IP protocol;
- the communication server processes the Socket request, acquires result data corresponding to the wearable device according to the Socket request, and returns the result data to be displayed by a browser of the client.
- the data communication system, method, web server and monitoring system based on the B/S architecture the browser of the client initiates an HTTP request to the intermediate communication component of the web server, and the intermediate communication component processes the HTTP request And establishing a socket communication with the communication server, the intermediate communication component transmitting a Socket request corresponding to the HTTP request to the communication server by using a TCP/IP protocol, the communication server processing the Socket request, and returning Corresponding result data, the result data is finally displayed by the browser of the client.
- the client of the present application does not need to download the application and related operations, nor does it need to update frequently, which brings convenience to the user, reduces maintenance costs, and the like, and the user only needs to operate through the browser. Remote monitoring and operation of wearable devices.
- FIG. 1 is a block diagram of a data communication system based on a B/S architecture in an embodiment
- FIG. 2 is a flowchart of a data communication method based on a B/S architecture in an embodiment
- FIG. 3 is a block diagram of a Web server of a data communication system based on a B/S architecture in an embodiment
- FIG. 4 is a block diagram of an implementation example of a specific application example of a data communication system based on a B/S architecture
- FIG. 5 is a flowchart showing an implementation of a communication server in the data communication system of FIG. 4;
- FIG. 6 is a flowchart of an event processing of a new client initiating a TCP connection request in the data communication system of FIG. 4;
- FIG. 7 is a flow chart of event processing of the intermediate communication component in the data communication system of FIG. 4;
- FIG. 8 is a flow chart showing the processing mechanism of the communication between the client browser and the intermediate communication component in the data communication system of FIG. 4.
- FIG. 1 is a block diagram of a data communication system based on a B/S architecture in an embodiment.
- the data communication system based on the B/S architecture in this embodiment includes but is not limited to a client. 11.
- the B/S architecture refers to a browser/server architecture
- the web server refers to a web server
- HTTP refers to a hypertext transfer protocol (HyperText Transfer Protocol).
- the TCP/IP protocol refers to the Transmission Control Protocol/Internet Protocol
- the Socket refers to the socket.
- the browser of the client 11 initiates an HTTP request to the intermediate communication component 121 of the web server 12, and the intermediate communication component 121 processes the HTTP request and establishes with the communication server 13. Socket communication, the intermediate communication component 121 passes a Socket request corresponding to the HTTP request to the communication server 13 via a TCP/IP protocol, the communication server 13 processes the Socket request, and returns corresponding result data, To pass the guest The browser of the client 11 presents the result data.
- the client 11 is a mobile terminal conveniently used by a user, and may specifically be a handheld mobile phone, a tablet computer or the like with a browser installed thereon.
- the intermediate communication component 121 when receiving the HTTP request initiated by the browser, creates a socket and establishes a TCP/IP connection with the communication server 13, and if the connection fails, the connection fails. The information is returned to the front end page of the browser, and if the connection is successful, the Socket request corresponding to the HTTP request is sent to the communication server 13.
- the intermediate communication component 121 in this embodiment can create a socket by using a socket creation function, for example, an existing socket creation function can be utilized:
- the intermediate communication component 121 of this embodiment may send the Socket request to the communication server 13 through a socket write function, for example, socket_write ($socket, $message) may be utilized.
- the intermediate communication component 121 sets a timeout period for the socket to wait for the first time, and receives the result data returned by the communication server 13 according to the Socket request, if the second time does not reach the first time If the result data returned by the communication server 13 is not received, the information of the failed data transmission is returned to the front page of the browser, and if the result data returned by the communication server 13 is received at the first time, the data is closed. Socket communication, whether the format of the detection result data is valid. If the format is incorrect, the information in response to the data exception is returned to the front page of the browser. If the format is correct, the returned result data is parsed and packaged into a predetermined one. The format data is sent to the front page of the browser.
- the first time may be 10 seconds
- the second time may be 5 seconds
- the combination of the first time is 8 seconds and the second time is 4 seconds, which is not limited herein.
- the predetermined format data may be json data (JavaScript Object Notation).
- the data transmission format between the intermediate communication component 121 and the communication server 13 Need to be consistent, first, the client 11 needs to send a packet of the format "HEL; xxxxxxxxx; @" to the communication server 13 to mean that the client 11 goes online, and then sends a packet of the format "DATA; xxxxxxxxxxx; @" to the communication server 13 Used to transfer the data requested by the client 11.
- both the wearer's wearable device and the web application of the front-end user act as a client for the communication server 13.
- the client 11 and the wearable device are first required to go online. After the online connection is successful, the data is transmitted to the communication server 13 according to a predetermined data transmission format, and even after the transmission of the data is completed, the Socket communication is closed.
- the intermediate communication component 121 can be implemented by the php language (Universal Open Source Scripting Language), which can run on an Apache (Web Server Software) server.
- the communication server 13 in this embodiment may be based on the Epoll communication model and run on a Linux system.
- the Epoll of this embodiment is an improved poll for the Linux kernel to process large batch file descriptors. In this way, the embodiment can significantly improve the system CPU utilization when the program has only a small amount of active in a large number of concurrent connections.
- the communication server 13 initializes the Socket communication parameter, establishes the listening Socket descriptor, initializes the Epoll communication model, creates a linked list containing only the head node, initializes and starts the system timing of controlling the heartbeat packet, before processing the Socket request. , invokes the Epoll_wait function, and waits for the triggering of the client communication event in a blocking manner.
- the Socket descriptor of the communication server 13 may use socket_fd, and the Epoll_wait function may use the Epoll_wait function.
- the main program of the communication server 13 will exit the Epoll_waiting function, trigger the response to the client, and then, for example, can dynamically calculate the number of online clients.
- the change in the number of online clients is mainly due to the occurrence and processing of communication events of the following clients, including but not limited to:
- TCP Transmission Control Protocol
- the Epoll_wait function of the communication server 13 finds that the communication event to be processed is equal to listening to the Socket descriptor, and is accepted according to the Socket descriptor.
- the function returns a new Socket Descriptor, and the intercepted Socket Descriptor is added to the Epoll handle via the Epoll_Event Registration Function to communicate bi-directionally with the new client that has established a connection using the Socket Descriptor.
- the acceptance function is an accept function
- the event registration function is an Epoll_ctl function.
- the webpage of the browser of the client 11 in this embodiment may adopt a JQuery (JavaScript code library, or JavaScript framework) framework, and communicate with the intermediate communication component 121 via AJAX (Asynchronous Javascript And XML).
- the asynchronous JavaScript and XML) engine implements a communication connection to enable the web page to be asynchronously updated.
- the AJAX engine can be used to create a fast dynamic webpage, and the webpage can be asynchronously updated by performing a small amount of data exchange with the server in the background.
- the entire webpage can be reloaded without reloading the entire webpage.
- the update of a certain part of the webpage does not cause the webpage to be stuck. This application can further improve the user experience in this way.
- a communication event with the intermediate communication component 121 is triggered.
- the browser of the client 11 implements and sets parameters of the request address, the request data, the request mode, and the timeout period by using the $.ajax() method, and when an HTTP request is initiated when the user's operation is obtained, if If the front-end webpage of the browser does not receive the return data within the timeout period, the current network abnormality is prompted. If the returned data is received within the timeout period, it is determined whether the data is a connection failure (connect_error), and if so, the server connection failure is prompted.
- connect_error connection failure
- the returned data is a data exception (data_error), and if so, it prompts a return data exception. If not, it determines whether the returned data is timeout (overtime), and if so, prompts to wait for the return data to time out, if not, then The obtained result data is parsed and displayed on the browser web page.
- data_error data exception
- timeout overtime
- the client 11 of the present application does not need to download the application program and related operations, and does not need to update frequently, which brings convenience to the user and reduces maintenance cost.
- the user only needs to operate through the browser to realize remote monitoring and operation. .
- the client 11 for mobile phones, tablets, There is no need to download the application, and it is very space-saving, and it is not necessary to repeatedly update and download the latest client due to the update of the server, which brings great convenience to the client 11.
- FIG. 2 is a flowchart of a data communication method based on the B/S architecture in an embodiment.
- the data communication method based on the B/S architecture in this embodiment includes but is not limited to the following steps.
- the intermediate communication component of the web server obtains an HTTP request initiated by the client's browser.
- the intermediate communication component of the embodiment when receiving the HTTP request initiated by the browser, creates a socket and establishes a TCP/IP connection with the communication server, and if the connection fails, the connection fails.
- the information is returned to the front end page of the browser, and if the connection is successful, the Socket request corresponding to the HTTP request is sent to the communication server.
- the intermediate communication component of this embodiment may send the Socket request to the communication server through a socket write function, for example, socket_write ($socket, $message) may be utilized.
- the intermediate communication component processes the HTTP request and establishes a Socket communication with the communication server.
- the intermediate communication component delivers a Socket request corresponding to the HTTP request to the communication server by using a TCP/IP protocol.
- the intermediate communication component of the embodiment sets the timeout period for waiting for the Socket communication to be the first time, and receives the result data returned by the communication server according to the Socket request, if the first time is not reached. If the result data returned by the communication server is not received in the second time, the information of the failed data transmission is returned to the front page of the browser, and if the result returned by the communication server is received at the first time Data, close Socket communication, check whether the format of the result data is valid. If the format is incorrect, return the information in response to the data exception to the front page of the browser. If the format is correct, parse the returned result data, and The packaged into predetermined format data is sent to the front page of the browser.
- the first time may be 10 seconds
- the second time may be 5 seconds
- the first time is 8 seconds
- the second time is 4 seconds. set.
- the predetermined format data may be json data.
- FIG. 3 is a block diagram of a Web server of a data communication system based on a B/S architecture in an embodiment.
- the Web server 12 of this embodiment is provided with an intermediate communication component 121, and the data communication system includes the above.
- the client 11, the communication server 13, and the web server 12 are used to connect the client 11 and the communication server 13.
- the intermediate communication component 121 acquires an HTTP request initiated by the browser of the client 11.
- the intermediate communication component 121 processes the HTTP request and establishes a Socket communication with the communication server 13.
- the intermediate communication component 121 delivers a Socket request corresponding to the HTTP request to the communication server 13 via a TCP/IP protocol.
- the intermediate communication component 121 when receiving the HTTP request initiated by the browser, creates a socket and establishes a TCP/IP connection with the communication server 13, and if the connection fails, the connection fails. The information is returned to the front end page of the browser, and if the connection is successful, the Socket request corresponding to the HTTP request is sent to the communication server 13.
- the intermediate communication component 121 of this embodiment may send the Socket request to the communication server 13 through a socket write function, for example, socket_write ($socket, $message) may be utilized.
- the intermediate communication component 121 sets the timeout period for the socket to wait for the first time, and receives the result data returned by the communication server 13 according to the Socket request, if the second time does not reach the first time If the result data returned by the communication server 13 is not received, the information of the failed data transmission is returned to the front page of the browser, and if the result data returned by the communication server 13 is received at the first time, the data is closed. Socket communication, whether the format of the detection result data is valid, and if the format is incorrect, the information in response to the data abnormality is returned to the front page of the browser. If the format is correct, the returned result data is parsed and packaged into a predetermined format data and sent to the front page of the browser.
- the first time may be 10 seconds
- the second time may be 5 seconds
- the combination of the first time is 8 seconds and the second time is 4 seconds, which is not limited herein.
- the predetermined format data may be json data.
- the overall communication process of the data communication system based on the B/S architecture of the present application may specifically send an HTTP request to the intermediate communication component 121 for the client 11 of the browser, and the intermediate communication component 121 sends a Socket request to the communication server 13
- the communication server 13 then sends a Socket request to the wearable device, wherein the communication server 13 and the wearable device transmit through the socket.
- the wearable device returns data to the communication server 13, to the intermediate communication component 121, and finally to the client 11 of the browser.
- the intermediate communication component 121 of the present application forwards the data transmission to the Tcp protocol of the HTTP protocol, and the data transmission based on the Tcp protocol between the communication server 13 and the wearable device.
- the intermediate communication component 121 is a server, ie, a B/S architectural mode, for the client 11 of the browser to receive the request of the client 11 of the browser.
- the intermediate communication component 121, for the communication server 13, is a client, that is, a C/S architecture mode, and sends a request to the server (communication server 13).
- the present application further provides a wearable device-based monitoring system, which includes a wearable device, and a data communication system based on the B/S architecture mentioned in any of the above embodiments, preferably, the embodiment Using the data communication system shown in FIG. 1, the wearable device establishes a network data connection with the communication server 13, and the client 11 is configured to remotely monitor the wearable device.
- the browser of the client 11 initiates an HTTP request to the intermediate communication component 121 of the web server 12 when acquiring the user's operation.
- the intermediate communication component 121 processes the HTTP request and establishes a Socket communication with the communication server 13.
- the intermediate communication component 121 sets a Socket corresponding to the HTTP request through a TCP/IP protocol The request is passed to the communication server 13.
- the communication server 13 processes the Socket request, acquires result data corresponding to the wearable device according to the Socket request, and returns the result data for display by the browser of the client 11.
- the client 11 uses the client 11 to remotely monitor the wearable device, and the client 11 itself can be a mobile terminal conveniently used by the user, and the specific mobile phone and tablet can be handheld.
- Computer of course, with the development of technology, it can also be a wearable device capable of intelligent display and operation, such as a smart watch, a smart helmet, smart glasses, etc.
- this embodiment can use a mobile phone, a tablet computer or Wearable devices remotely monitor wearable devices.
- FIG. 4 is a block diagram of an implementation example of a specific application example of a data communication system based on a B/S architecture
- FIG. 5 is a flowchart of implementing a communication server in the data communication system of FIG.
- FIG. 7 is a flow chart of event processing for initiating a TCP connection request in a data communication system of FIG. 4,
- FIG. 7 is a flow chart of event processing of the intermediate communication component in the data communication system of FIG. 4,
- FIG. 8 is a client in the data communication system of FIG.
- the communication mechanism of the browser and the intermediate communication component processes the flow chart.
- the implementation process of the communication server in the data communication system of the specific application example includes but is not limited to the following steps:
- the server socket communication parameter is initialized, and the socket socket socket descriptor socket_fd is established;
- the event processing procedure for a new client to initiate a TCP connection request in the data communication system of the specific application example includes but is not limited to the following steps:
- the Epoll_wait function finds that the event to be processed is triggered to be equal to the listening socket descriptor socket_fd;
- socket_fd Calling the accept function according to socket_fd returns a new socket socket descriptor socket_fd;
- the event processing procedure of the intermediate communication component in the data communication system of the specific application example includes but is not limited to the following steps:
- the processing mechanism of the communication mechanism between the client browser and the intermediate communication component in the data communication system of the specific application example includes but is not limited to the following steps:
- the user is prompted to wait for the return data to time out and end, and if not, the returned data is presented to the browser page and ends.
- the application client does not need to download the application and related operations, and does not need to update frequently, which brings convenience to the user, reduces maintenance costs, etc., and the user only needs to operate through the browser to implement the wearable device. Remote monitoring and operation.
- the technical solution of the present application or the part that contributes to the prior art or all or part of the technical solution may be embodied in the form of a software product stored in a storage medium, including several instructions. All or part of the steps of the method of the various embodiments of the present application are performed by a computer device (which may be a personal computer, server, or network device, etc.) or a processor.
- the foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and the like. .
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer And Data Communications (AREA)
Abstract
Description
Claims (14)
- 一种基于B/S架构的数据通信系统,其特征在于,所述数据通信系统包括客户端、通信服务器以及用于连接所述客户端和通信服务器的Web服务器,所述Web服务器设有中间通信组件:A data communication system based on a B/S architecture, characterized in that the data communication system comprises a client, a communication server, and a web server for connecting the client and the communication server, the web server is provided with an intermediate communication Component:所述客户端的浏览器发起HTTP请求到所述Web服务器的所述中间通信组件;The browser of the client initiates an HTTP request to the intermediate communication component of the web server;所述中间通信组件处理所述HTTP请求,并与所述通信服务器建立Socket通信;The intermediate communication component processes the HTTP request and establishes a Socket communication with the communication server;所述中间通信组件通过TCP/IP协议将与所述HTTP请求对应的Socket请求传递到所述通信服务器;The intermediate communication component transmits a Socket request corresponding to the HTTP request to the communication server by using a TCP/IP protocol;所述通信服务器处理所述Socket请求,并返回对应的结果数据,以通过所述客户端的浏览器展示所述结果数据。The communication server processes the Socket request and returns corresponding result data to display the result data through a browser of the client.
- 根据权利要求1所述的数据通信系统,其特征在于,所述中间通信组件在收到所述浏览器发起的所述HTTP请求时,创建一个socket,并与所述通信服务器建立TCP/IP连接,如果连接失败则将连接失败的信息返回到所述浏览器的前端页面,如果连接成功,则将所述HTTP请求对应的所述Socket请求发送到所述通信服务器。The data communication system according to claim 1, wherein said intermediate communication component creates a socket upon establishment of said HTTP request initiated by said browser, and establishes a TCP/IP connection with said communication server If the connection fails, the information of the connection failure is returned to the front page of the browser, and if the connection is successful, the Socket request corresponding to the HTTP request is sent to the communication server.
- 根据权利要求2所述的数据通信系统,其特征在于,所述中间通信组件设置Socket通信等待的超时时间为第一时间,并接收所述通信服务器根据所述Socket请求返回的结果数据,若在未到达所述第一时间的第二时间内未收到所述通信服务器返回的结果数据,则将发送数据失败的信息返回到所述浏览器的前端网页,若在所述第一时间收到所述通信服务器返回的结果数据,关闭Socket通信,检测结果数据的格式是否有效,若格式不正确,则将响应数据异常的信息返回到所述浏览器的前端网页,若格式正确,则对返回的结果数据进行解析,并打包成预定格式数据发送到所述浏览器的前端网页。The data communication system according to claim 2, wherein the intermediate communication component sets a timeout period for waiting for the Socket communication to be the first time, and receives result data returned by the communication server according to the Socket request, if If the result data returned by the communication server is not received within the second time period when the first time is not reached, the information that the data transmission failure is returned to the front page of the browser, if received at the first time The result data returned by the communication server is closed, and the format of the detection result data is valid. If the format is incorrect, the information of the response data abnormality is returned to the front page of the browser. If the format is correct, the format is returned. The resulting data is parsed and packaged into predetermined format data for transmission to the front end web page of the browser.
- 根据权利要求1-3任一项所述的数据通信系统,其特征在于,所述通 信服务器为基于Epoll通信模型、并运行于Linux系统,所述通信服务器在处理所述Socket请求之前,初始化Socket通信参数、建立监听Socket描述符、对Epoll通信模型初始化、创建只包含头结点的链表、初始化并启动控制心跳包的系统定时器、调用Epoll_等待函数,以及采用阻塞的方式等待所述客户端通信事件的触发。A data communication system according to any one of claims 1 to 3, wherein said communication The letter server is based on the Epoll communication model and runs on the Linux system. The communication server initializes the Socket communication parameters, establishes the listening Socket descriptor, initializes the Epoll communication model, and creates only the head node before processing the Socket request. Linking the list, initializing and starting the system timer that controls the heartbeat packet, calling the Epoll_waiting function, and waiting for the triggering of the client communication event in a blocking manner.
- 根据权利要求4所述的数据通信系统,其特征在于,新的客户端发起TCP连接请求时,所述通信服务器的所述Epoll_等待函数发现触发待处理的通信事件等于监听所述Socket描述符,根据所述Socket描述符调用接受函数返回新的Socket描述符,将侦听到的Socket描述符通过Epoll_事件注册函数添加到Epoll句柄中,以利用所述Socket描述符与已经建立连接的所述新的客户端进行双向通信。The data communication system according to claim 4, wherein when the new client initiates the TCP connection request, the Epoll_wait function of the communication server finds that the communication event to be processed is triggered to be equal to listening to the Socket descriptor. Retrieving a new Socket descriptor according to the Socket descriptor call accept function, and adding the intercepted Socket descriptor to the Epoll handle through the Epoll_ event registration function, to utilize the Socket descriptor and the established connection The new client performs two-way communication.
- 根据权利要求1-3任一项所述的数据通信系统,其特征在于,所述客户端的浏览器的网页采用JQuery框架,并与所述中间通信组件之间通过AJAX引擎实现通信连接,以使所述网页实现异步更新。The data communication system according to any one of claims 1 to 3, wherein the webpage of the browser of the client adopts a JQuery framework, and communicates with the intermediate communication component through an AJAX engine, so that The web page implements an asynchronous update.
- 根据权利要求6所述的数据通信系统,其特征在于,所述客户端的浏览器使用$.ajax()方法实现并设置请求地址、请求数据、请求方式和超时时间的参数,在获取到用户的操作而发起HTTP请求时,若在超时时间内所述浏览器的前端网页未收到返回数据,则提示当前网络异常,若在超时时间内接收到返回数据,则判断数据是否为连接失败,若是,则提示服务器连接失败,若不是,接着判断返回数据是否为数据异常,若是,则提示返回数据异常,若不是,判断返回数据是否为超时,若是,则提示等待返回数据超时,若不是,则将获取到的结果数据经过解析展示到浏览器网页页面上。The data communication system according to claim 6, wherein the browser of the client uses the $.ajax() method to implement and set parameters of the request address, the request data, the request mode, and the timeout period, and obtains the user's When an HTTP request is initiated, if the browser's front-end webpage does not receive the return data within the timeout period, the current network abnormality is prompted. If the returned data is received within the timeout period, it is determined whether the data is a connection failure, and if , the server connection failure is prompted, if not, then it is determined whether the returned data is a data exception, and if so, the data return is abnormal. If not, it is determined whether the returned data is a timeout, and if so, the data is timed out waiting for the return data, if not, then The obtained result data is parsed and displayed on the browser web page.
- 一种基于B/S架构的数据通信方法,其特征在于,所述数据通信方法包括:A data communication method based on a B/S architecture, characterized in that the data communication method comprises:Web服务器的中间通信组件获取客户端的浏览器发起的HTTP请求;The intermediate communication component of the web server obtains an HTTP request initiated by the client's browser;所述中间通信组件处理所述HTTP请求,并与通信服务器建立Socket通信; The intermediate communication component processes the HTTP request and establishes a Socket communication with the communication server;所述中间通信组件通过TCP/IP协议将与所述HTTP请求对应的Socket请求传递到所述通信服务器。The intermediate communication component transmits a Socket request corresponding to the HTTP request to the communication server through a TCP/IP protocol.
- 根据权利要求8所述的数据通信方法,其特征在于,所述中间通信组件在收到所述浏览器发起的所述HTTP请求时,创建一个socket,并与所述通信服务器建立TCP/IP连接,如果连接失败则将连接失败的信息返回到所述浏览器的前端页面,如果连接成功,则将所述HTTP请求对应的所述Socket请求发送到所述通信服务器。The data communication method according to claim 8, wherein said intermediate communication component creates a socket upon establishment of said HTTP request initiated by said browser, and establishes a TCP/IP connection with said communication server If the connection fails, the information of the connection failure is returned to the front page of the browser, and if the connection is successful, the Socket request corresponding to the HTTP request is sent to the communication server.
- 根据权利要求9所述的数据通信方法,其特征在于,所述中间通信组件设置Socket通信等待的超时时间为第一时间,并接收所述通信服务器根据所述Socket请求返回的结果数据,若在未到达所述第一时间的第二时间内未收到所述通信服务器返回的结果数据,则将发送数据失败的信息返回到所述浏览器的前端网页,若在所述第一时间收到所述通信服务器返回的结果数据,关闭Socket通信,检测结果数据的格式是否有效,若格式不正确,则将响应数据异常的信息返回到所述浏览器的前端网页,若格式正确,则对返回的结果数据进行解析,并打包成预定格式数据发送到所述浏览器的前端网页。The data communication method according to claim 9, wherein the intermediate communication component sets a timeout period for waiting for the Socket communication to be the first time, and receives result data returned by the communication server according to the Socket request, if If the result data returned by the communication server is not received within the second time period when the first time is not reached, the information that the data transmission failure is returned to the front page of the browser, if received at the first time The result data returned by the communication server is closed, and the format of the detection result data is valid. If the format is incorrect, the information of the response data abnormality is returned to the front page of the browser. If the format is correct, the format is returned. The resulting data is parsed and packaged into predetermined format data for transmission to the front end web page of the browser.
- 一种用于基于B/S架构的数据通信系统的Web服务器,其特征在于,所述数据通信系统包括客户端、通信服务器,所述Web服务器用于连接所述客户端和通信服务器,所述Web服务器设有中间通信组件:A web server for a data communication system based on a B/S architecture, characterized in that the data communication system includes a client, a communication server, and the web server is configured to connect the client and the communication server, The web server has an intermediate communication component:所述中间通信组件获取所述客户端的浏览器发起的HTTP请求;The intermediate communication component acquires an HTTP request initiated by a browser of the client;所述中间通信组件处理所述HTTP请求,并与通信服务器建立Socket通信;The intermediate communication component processes the HTTP request and establishes a Socket communication with the communication server;所述中间通信组件通过TCP/IP协议将与所述HTTP请求对应的Socket请求传递到所述通信服务器。The intermediate communication component transmits a Socket request corresponding to the HTTP request to the communication server through a TCP/IP protocol.
- 根据权利要求11所述的Web服务器,其特征在于,所述中间通信组件在收到所述浏览器发起的所述HTTP请求时,创建一个socket,并与所述通信服务器建立TCP/IP连接,如果连接失败则将连接失败的信息返回到所述浏览器的前端页面,如果连接成功,则将所述HTTP请求对应的所述Socket请 求发送到所述通信服务器。The web server according to claim 11, wherein the intermediate communication component creates a socket and establishes a TCP/IP connection with the communication server upon receiving the HTTP request initiated by the browser. If the connection fails, the information of the connection failure is returned to the front page of the browser. If the connection is successful, the Socket corresponding to the HTTP request is requested. Request to send to the communication server.
- 根据权利要求12所述的Web服务器,其特征在于,所述中间通信组件设置Socket通信等待的超时时间为第一时间,并接收所述通信服务器根据所述Socket请求返回的结果数据,若在未到达所述第一时间的第二时间内未收到所述通信服务器返回的结果数据,则将发送数据失败的信息返回到所述浏览器的前端网页,若在所述第一时间收到所述通信服务器返回的结果数据,关闭Socket通信,检测结果数据的格式是否有效,若格式不正确,则将响应数据异常的信息返回到所述浏览器的前端网页,若格式正确,则对返回的结果数据进行解析,并打包成预定格式数据发送到所述浏览器的前端网页。The web server according to claim 12, wherein the intermediate communication component sets a timeout period for waiting for the Socket communication to be the first time, and receives result data returned by the communication server according to the Socket request, if not If the result data returned by the communication server is not received within the second time period of the first time, the information that the data failure is returned is returned to the front page of the browser, and if the first time is received, The result data returned by the communication server is closed, the Socket communication is closed, and the format of the detection result data is valid. If the format is incorrect, the information in response to the data abnormality is returned to the front page of the browser. If the format is correct, the returned data is returned. The resulting data is parsed and packaged into predetermined format data for transmission to the front end web page of the browser.
- 一种基于穿戴式设备的监控系统,其特征在于,所述监控系统包括穿戴式设备,以及根据权利要求1-7任一项所述的基于B/S架构的数据通信系统,所述穿戴式设备与所述通信服务器建立网络数据连接,所述客户端用于对所述穿戴式设备进行远程监控:A wearable device-based monitoring system, comprising: a wearable device, and a data communication system based on a B/S architecture according to any one of claims 1-7, the wearable The device establishes a network data connection with the communication server, and the client is configured to remotely monitor the wearable device:所述客户端的浏览器在获取到用户的操作时,发起HTTP请求到所述Web服务器的所述中间通信组件;The browser of the client initiates an HTTP request to the intermediate communication component of the web server when acquiring the operation of the user;所述中间通信组件处理所述HTTP请求,并与所述通信服务器建立Socket通信;The intermediate communication component processes the HTTP request and establishes a Socket communication with the communication server;所述中间通信组件通过TCP/IP协议将与所述HTTP请求对应的Socket请求传递到所述通信服务器;The intermediate communication component transmits a Socket request corresponding to the HTTP request to the communication server by using a TCP/IP protocol;所述通信服务器处理所述Socket请求,根据所述Socket请求获取所述穿戴式设备对应的结果数据,并将所述结果数据返回以通过所述客户端的浏览器展示。 The communication server processes the Socket request, acquires result data corresponding to the wearable device according to the Socket request, and returns the result data to be displayed by a browser of the client.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/CN2017/096413 WO2019028673A1 (en) | 2017-08-08 | 2017-08-08 | B/s architecture-based data communication system and method, web server, and monitoring system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/CN2017/096413 WO2019028673A1 (en) | 2017-08-08 | 2017-08-08 | B/s architecture-based data communication system and method, web server, and monitoring system |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2019028673A1 true WO2019028673A1 (en) | 2019-02-14 |
Family
ID=65272753
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2017/096413 WO2019028673A1 (en) | 2017-08-08 | 2017-08-08 | B/s architecture-based data communication system and method, web server, and monitoring system |
Country Status (1)
Country | Link |
---|---|
WO (1) | WO2019028673A1 (en) |
Cited By (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110445642A (en) * | 2019-07-17 | 2019-11-12 | 陕西千山航空电子有限责任公司 | A kind of means of communication of across bus maintenance FDR system |
CN110557380A (en) * | 2019-08-07 | 2019-12-10 | 北京首贝科技发展有限公司 | secure data transmission method based on TCP/IP protocol |
CN112422681A (en) * | 2020-11-18 | 2021-02-26 | 中盈优创资讯科技有限公司 | Cross-platform distributed communication calling method and device |
CN113064158A (en) * | 2021-03-17 | 2021-07-02 | 中国有色金属长沙勘察设计研究院有限公司 | Engineering disaster intelligent monitoring radar communication system based on double middleware |
CN113542408A (en) * | 2021-07-14 | 2021-10-22 | 首约科技(北京)有限公司 | Method for interaction of message between driver and passenger |
CN113626208A (en) * | 2020-05-08 | 2021-11-09 | 许继集团有限公司 | Server communication method based on NIO asynchronous thread model |
CN114827114A (en) * | 2022-04-22 | 2022-07-29 | 雷沃工程机械集团有限公司 | Method and system for realizing data twinning of engineering machinery Internet of vehicles platform |
CN115118704A (en) * | 2022-05-18 | 2022-09-27 | 青岛国实科技集团有限公司 | Method for realizing function linkage of same platform heterogeneous system in marine application |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101043522A (en) * | 2006-03-22 | 2007-09-26 | 腾讯科技(深圳)有限公司 | Web server based communication method and system |
CN102835093A (en) * | 2010-04-15 | 2012-12-19 | 微软公司 | Method and system for reliable protocol tunneling over http |
US20130212227A1 (en) * | 2012-02-09 | 2013-08-15 | Cogent Real-Time Systems Inc. | System and method for streaming data via http |
CN103297384A (en) * | 2012-02-22 | 2013-09-11 | 航天信息股份有限公司 | Method and system for communication of protocol conversion |
-
2017
- 2017-08-08 WO PCT/CN2017/096413 patent/WO2019028673A1/en active Application Filing
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101043522A (en) * | 2006-03-22 | 2007-09-26 | 腾讯科技(深圳)有限公司 | Web server based communication method and system |
CN102835093A (en) * | 2010-04-15 | 2012-12-19 | 微软公司 | Method and system for reliable protocol tunneling over http |
US20130212227A1 (en) * | 2012-02-09 | 2013-08-15 | Cogent Real-Time Systems Inc. | System and method for streaming data via http |
CN103297384A (en) * | 2012-02-22 | 2013-09-11 | 航天信息股份有限公司 | Method and system for communication of protocol conversion |
Cited By (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110445642A (en) * | 2019-07-17 | 2019-11-12 | 陕西千山航空电子有限责任公司 | A kind of means of communication of across bus maintenance FDR system |
CN110557380A (en) * | 2019-08-07 | 2019-12-10 | 北京首贝科技发展有限公司 | secure data transmission method based on TCP/IP protocol |
CN113626208A (en) * | 2020-05-08 | 2021-11-09 | 许继集团有限公司 | Server communication method based on NIO asynchronous thread model |
CN113626208B (en) * | 2020-05-08 | 2024-05-14 | 许继集团有限公司 | Server communication method based on NIO asynchronous thread model |
CN112422681A (en) * | 2020-11-18 | 2021-02-26 | 中盈优创资讯科技有限公司 | Cross-platform distributed communication calling method and device |
CN112422681B (en) * | 2020-11-18 | 2023-01-13 | 中盈优创资讯科技有限公司 | Cross-platform distributed communication calling method and device |
CN113064158A (en) * | 2021-03-17 | 2021-07-02 | 中国有色金属长沙勘察设计研究院有限公司 | Engineering disaster intelligent monitoring radar communication system based on double middleware |
CN113542408A (en) * | 2021-07-14 | 2021-10-22 | 首约科技(北京)有限公司 | Method for interaction of message between driver and passenger |
CN113542408B (en) * | 2021-07-14 | 2024-04-19 | 首约科技(北京)有限公司 | Method for interaction message between driver and passenger |
CN114827114A (en) * | 2022-04-22 | 2022-07-29 | 雷沃工程机械集团有限公司 | Method and system for realizing data twinning of engineering machinery Internet of vehicles platform |
CN115118704A (en) * | 2022-05-18 | 2022-09-27 | 青岛国实科技集团有限公司 | Method for realizing function linkage of same platform heterogeneous system in marine application |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2019028673A1 (en) | B/s architecture-based data communication system and method, web server, and monitoring system | |
US10686775B2 (en) | Method and apparatus of providing messaging service and callback feature to mobile stations | |
CN107426233A (en) | Data communication system, method, Web server and monitoring system based on B/S frameworks | |
US9223746B2 (en) | Data card and method for internet access of data card | |
US9491682B2 (en) | Wireless routing device, mobile terminal, and management system and method | |
US11025724B2 (en) | Transport of control data in proxy-based network communications | |
US9124494B2 (en) | Method and apparatus of performing remote management of a managed machine | |
US10594768B2 (en) | Method and apparatus of performing remote command dispatching | |
WO2016058133A1 (en) | Software upgrading method and device | |
US10574518B2 (en) | Method and apparatus of performing remote management of a managed machine | |
WO2017045190A1 (en) | Method, apparatus and device for instructing operations on terminal device | |
EP3435629A1 (en) | Transport of control data in proxy-based network communications | |
CN115866069A (en) | Method and system for processing remote call request and electronic equipment | |
CN115904081A (en) | Human-computer interaction method and device based on Internet of things and related medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 17920941 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 17920941 Country of ref document: EP Kind code of ref document: A1 |
|
32PN | Ep: public notification in the ep bulletin as address of the adressee cannot be established |
Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 01.04.2020) |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 17920941 Country of ref document: EP Kind code of ref document: A1 |