CN110704467A - System and method for realizing real-time data updating processing based on B/S architecture - Google Patents

System and method for realizing real-time data updating processing based on B/S architecture Download PDF

Info

Publication number
CN110704467A
CN110704467A CN201910966555.4A CN201910966555A CN110704467A CN 110704467 A CN110704467 A CN 110704467A CN 201910966555 A CN201910966555 A CN 201910966555A CN 110704467 A CN110704467 A CN 110704467A
Authority
CN
China
Prior art keywords
serial port
data
browser
communication protocol
real
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.)
Withdrawn
Application number
CN201910966555.4A
Other languages
Chinese (zh)
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.)
Shanghai Intelligence Fuse Breath Science And Technology Ltd
Original Assignee
Shanghai Intelligence Fuse Breath Science And Technology 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 Shanghai Intelligence Fuse Breath Science And Technology Ltd filed Critical Shanghai Intelligence Fuse Breath Science And Technology Ltd
Priority to CN201910966555.4A priority Critical patent/CN110704467A/en
Publication of CN110704467A publication Critical patent/CN110704467A/en
Withdrawn legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • G06F16/2379Updates performed during online database operations; commit processing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • 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

Abstract

The invention relates to a system for realizing real-time data updating processing based on a B/S framework, which comprises an external device, a data processing device and a data processing device, wherein the external device is used for providing serial port data displayed in real time; the client is connected with the external equipment through a serial port communication protocol and is used for connecting a serial port and providing communication protocol service; the network server is used for providing service for all HTTP requests; and the browser is connected with the client and the network server and used for sending an HTTP request to the network server and displaying the data information of the external equipment in real time in the browser. The invention also relates to a method for realizing the real-time updating processing of the data based on the B/S architecture. The system and the method for realizing the real-time data updating processing based on the B/S architecture solve the problem of serial port communication between software and hardware based on the B/S architecture and achieve the purposes of being compatible with different browsers and not reducing the performance of a server.

Description

System and method for realizing real-time data updating processing based on B/S architecture
Technical Field
The invention relates to the field of enterprise information systems, in particular to the field of server systems, and specifically relates to a system and a method for realizing real-time data updating processing based on a B/S architecture.
Background
Traditional software based on a C/S (client/server) architecture can realize data exchange with various external devices through a serial port communication protocol depending on the advantages of the software. However, when using software of the B/S (browser/server) architecture, serial communication becomes a big pain point. At present, the mainstream browser does not support direct communication with a device serial port, and developers can only solve the problem through other ways. To display serial port data in a browser page in real time, several schemes exist at present: 1. the IE browser MSComm control only supports the IE browser and is not maintained at present; 2. and installing a serial port communication client on equipment needing serial port communication, and sending data to the page through the HTTP request server. For the above two cases, there are the following disadvantages: mode 1 is only applicable to IE browsers, which are not supported by popular Chrome and Firefox browsers, and thus is not applicable to most cases; mode 2, if serial port data is to be displayed in real time to a browser while the performance of a server is not reduced, a polling mode is required to maintain a long HTTP connection, which inevitably consumes a large amount of resources, and polling is affected by many other factors, such as network unsmooth, which may aggravate the effect on the server. Therefore, a method for displaying serial data in real time under the condition of being compatible with different browsers and not reducing the performance of a server is needed to solve the problems, and the example is generated for solving the problems.
Disclosure of Invention
The invention aims to overcome the defects of the prior art and provides a system and a method for realizing real-time data updating processing based on a B/S (browser/server) architecture, which have the advantages of low error, simple structure and wide application range.
In order to achieve the above object, the system and method for realizing real-time data update processing based on the B/S architecture of the present invention are as follows:
the system for realizing the real-time data updating processing based on the B/S architecture is mainly characterized by comprising the following components:
the external equipment is used for providing serial port data displayed in real time;
the client is connected with the external equipment through a serial port communication protocol and is used for connecting a serial port and providing communication protocol service;
the network server is used for providing service for all HTTP requests;
and the browser is connected with the client and the network server and used for sending an HTTP request to the network server and displaying the data information of the external equipment in real time in the browser, and the browser carries out serial port communication through the client.
Preferably, the communication protocol service provided by the client is a WebSocket Server service.
The method for realizing the real-time updating processing of the data based on the B/S architecture by utilizing the system is mainly characterized by comprising the following steps:
(1) the browser sends an HTTP request to a network server;
(2) the browser is connected with the communication protocol service of the client through a communication protocol;
(3) and the client pushes the serial port data to the browser through a communication protocol for real-time display.
Preferably, the method further comprises the steps of:
and (1.1) establishing a communication protocol service and a connection serial port after the client is started.
Preferably, the communication protocol is WebSocket Server, and the communication protocol service is WebSocket Server service.
By adopting the system and the method for realizing the real-time data updating processing based on the B/S framework, the influence on the performance of the server caused by the fact that the browser does not support direct communication with a serial port and frequent HTTP requests is avoided, and the real-time data is prevented from being influenced by the outside, for example, the HTTP requests consume larger resources when the network is not smooth. The invention uses the WebSocket protocol as a full duplex communication protocol, ensures the timeliness and the continuity of data by the characteristics of one-time handshake and permanent communication, solves the problem of serial port communication of software and hardware based on a B/S framework, and achieves the purposes of being compatible with different browsers and not reducing the performance of a server.
Drawings
FIG. 1 is a schematic diagram of a system for implementing real-time data update processing based on a B/S architecture according to the present invention.
FIG. 2 is a flowchart of a method for implementing a real-time update process of data based on a B/S architecture according to the present invention.
Detailed Description
In order to more clearly describe the technical contents of the present invention, the following further description is given in conjunction with specific embodiments.
The system for realizing real-time data updating processing based on the B/S architecture comprises the following components:
the external equipment is used for providing serial port data displayed in real time;
the client is connected with the external equipment through a serial port communication protocol and is used for connecting a serial port and providing communication protocol service;
the network server is used for providing service for all HTTP requests;
and the browser is connected with the client and the network server and used for sending an HTTP request to the network server and displaying the data information of the external equipment in real time in the browser, and the browser carries out serial port communication through the client.
As a preferred embodiment of the present invention, the communication protocol service provided by the client is a WebSocketServer service.
The method for realizing the real-time data updating processing based on the B/S architecture by utilizing the system comprises the following steps:
(1) the browser sends an HTTP request to a network server;
(2) the browser is connected with the communication protocol service of the client through a communication protocol;
(3) and the client pushes the serial port data to the browser through a communication protocol for real-time display.
As a preferred embodiment of the present invention, the method further comprises the steps of:
and (1.1) establishing a communication protocol service and a connection serial port after the client is started.
As a preferred embodiment of the present invention, the communication protocol is a WebSocket Server, and the communication protocol service is a WebSocket Server service.
In the specific implementation mode of the invention, in enterprise production, a lot of informationized software is used, and meanwhile, the software and a lot of external equipment are involved to carry out data communication, for example, weighing quantity is automatically obtained through an electronic scale, data of an RFID card is read, and the like. Software of a traditional C/S architecture easily communicates with various external devices through a serial port communication protocol. However, for the currently mainstream B/S architecture software, serial communication has become a great difficulty. The problems that the browser does not support direct and serial port communication, the performance of a server is affected by frequent HTTP requests and the like need to be solved.
At present, the common method is to perform serial port communication by means of the universality of a client, then connect a remote Web server through HTTP to transmit data, and then display the data in a browser. However, this approach has several disadvantages: 1. the HTTP long connection needs to be maintained in a polling mode; 2. the server performance is seriously affected; 3. the data is displayed in time and greatly influenced by the outside, for example, the HTTP request consumes more resources due to network unsmooth.
In view of some of the pain problems of the prior art, the following solution is proposed, and a scheme framework schematic diagram is shown in fig. 1. Deploying Web application on the server to provide service for all HTTP requests; the external equipment is used as a serial port data source and provides data to be displayed in real time; the client (WebSocket Server) serves as a bridge of an external device and a browser, is connected with a serial port and provides WebSocket Server service; the browser requests the Web server and displays the information of the external equipment in a browser interface in real time.
Because the browser cannot directly communicate with the serial port, the client is used as a bridge between the serial port of the computer and the browser for communication. The client is installed on a computer connected with external equipment, is connected with a serial port of the computer by using a serial port communication protocol while being opened, and reads and stores serial port data in a memory.
And, in the course of opening the customer end, establish WebSocket Server service synchronously (WebSocket is a protocol that begins to provide a full duplex communication on a single TCP connection in HTML5, browser and Server only need finish a handshake, can establish the persistent connection directly between the two, and carry on the two-way data transmission, WebSocket agreement, can better save Server resource and bandwidth, and can communicate in more real time). Therefore, the client is a receiver of the serial data and a provider of the WebSocket Server service.
When a user opens a browser and enters a page needing serial port communication, the user can connect a WebSocket Server created on the computer through a WebSocket protocol, and after the connection is completed, the client and the browser can realize mutual data pushing. The client side pushes the serial port data to the browser through the WebSocket protocol for real-time display, and the purpose that the data can be displayed in the browser in real time without a Web server side is achieved.
At present, the mainstream browser is compatible with a WebSocket protocol, and a long connection with a Web Server is effectively avoided (the long connection generally adopts an HTTP polling mode) by adopting a mode of connecting a WebSocket Client and a local WebSocket Server, so that no pressure is generated on the Server. And the WebSocket protocol is a full-duplex communication protocol, and the timeliness and the continuity of data are ensured by the characteristics of one-time handshaking and permanent communication. Because the data is received and displayed on the same computer, the timeliness of the data display is not influenced by whether the network is smooth or not, and therefore the method in the scheme can fill the defects of the prior art.
By adopting the system and the method for realizing the real-time data updating processing based on the B/S framework, the influence on the performance of the server caused by the fact that the browser does not support direct communication with a serial port and frequent HTTP requests is avoided, and the real-time data is prevented from being influenced by the outside, for example, the HTTP requests consume larger resources when the network is not smooth. The invention uses the WebSocket protocol as a full duplex communication protocol, ensures the timeliness and the continuity of data by the characteristics of one-time handshake and permanent communication, solves the problem of serial port communication of software and hardware based on a B/S framework, and achieves the purposes of being compatible with different browsers and not reducing the performance of a server.
In this specification, the invention has been described with reference to specific embodiments thereof. It will, however, be evident that various modifications and changes may be made thereto without departing from the broader spirit and scope of the invention. The specification and drawings are, accordingly, to be regarded in an illustrative rather than a restrictive sense.

Claims (5)

1. A system for realizing real-time data updating processing based on a B/S architecture is characterized by comprising:
the external equipment is used for providing serial port data displayed in real time;
the client is connected with the external equipment through a serial port communication protocol and is used for connecting a serial port and providing communication protocol service;
the network server is used for providing service for all HTTP requests;
and the browser is connected with the client and the network server and used for sending an HTTP request to the network server and displaying the data information of the external equipment in real time in the browser, and the browser carries out serial port communication through the client.
2. The system for realizing real-time data updating processing based on the B/S architecture as claimed in claim 1, wherein the communication protocol service provided by the client is a WebSocket Server service.
3. A method for implementing real-time update processing of data based on B/S architecture by using the system of claim 1, wherein the method comprises the following steps:
(1) the browser sends an HTTP request to a network server;
(2) the browser is connected with the communication protocol service of the client through a communication protocol;
(3) and the client pushes the serial port data to the browser through a communication protocol for real-time display.
4. The method for implementing real-time update processing of data based on B/S architecture as claimed in claim 3, wherein the method further comprises the following steps:
and (1.1) establishing a communication protocol service and a connection serial port after the client is started.
5. The method of claim 3, wherein the communication protocol is WebSocket Server, and the communication protocol service is WebSocket Server.
CN201910966555.4A 2019-10-12 2019-10-12 System and method for realizing real-time data updating processing based on B/S architecture Withdrawn CN110704467A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910966555.4A CN110704467A (en) 2019-10-12 2019-10-12 System and method for realizing real-time data updating processing based on B/S architecture

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910966555.4A CN110704467A (en) 2019-10-12 2019-10-12 System and method for realizing real-time data updating processing based on B/S architecture

Publications (1)

Publication Number Publication Date
CN110704467A true CN110704467A (en) 2020-01-17

Family

ID=69198582

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910966555.4A Withdrawn CN110704467A (en) 2019-10-12 2019-10-12 System and method for realizing real-time data updating processing based on B/S architecture

Country Status (1)

Country Link
CN (1) CN110704467A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114328353A (en) * 2021-12-28 2022-04-12 福建新大陆支付技术有限公司 WEB interactive serial port communication framework
CN115277665A (en) * 2022-08-08 2022-11-01 北京视友科技有限责任公司 Brain-computer interface system based on internet

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1487677A (en) * 2002-07-18 2004-04-07 涛 陈 Radio image monitoring method and system
CN109067884A (en) * 2018-08-13 2018-12-21 中国农业大学 Agricultural machinery backsets remote monitoring platform and agricultural machinery backsets detection method
CN109188974A (en) * 2018-09-11 2019-01-11 桂林电子科技大学 Empty nest elderly house weather monitors inquiry system and method
CN109769001A (en) * 2019-03-19 2019-05-17 中信梧桐港供应链管理有限公司 A kind of internet of things data transmission method and system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1487677A (en) * 2002-07-18 2004-04-07 涛 陈 Radio image monitoring method and system
CN109067884A (en) * 2018-08-13 2018-12-21 中国农业大学 Agricultural machinery backsets remote monitoring platform and agricultural machinery backsets detection method
CN109188974A (en) * 2018-09-11 2019-01-11 桂林电子科技大学 Empty nest elderly house weather monitors inquiry system and method
CN109769001A (en) * 2019-03-19 2019-05-17 中信梧桐港供应链管理有限公司 A kind of internet of things data transmission method and system

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114328353A (en) * 2021-12-28 2022-04-12 福建新大陆支付技术有限公司 WEB interactive serial port communication framework
CN114328353B (en) * 2021-12-28 2024-05-07 福建新大陆支付技术有限公司 WEB interactive serial port communication architecture
CN115277665A (en) * 2022-08-08 2022-11-01 北京视友科技有限责任公司 Brain-computer interface system based on internet

Similar Documents

Publication Publication Date Title
JP5676655B2 (en) Mobile broadband device and method for managing mobile broadband device
US20150294022A1 (en) Terminal device, system for providing picture and method for transmitting picture
CN102833323A (en) Method and system for remote control of controlled terminal by server
CN106161145A (en) A kind of monitoring method and system of server system operation status information
CN103685269B (en) A kind of web browser carries out the method and system of both-way communication with server
CN107104999B (en) Method and device for processing service interface call request
TW200404439A (en) Remote dynamic configuration of a web server to facilitate capacity on demand
CN102984237B (en) A kind of data transmission system and method connecting based on socket
CN110704467A (en) System and method for realizing real-time data updating processing based on B/S architecture
US20140095687A1 (en) Method, device, and system for managing mobile broadband device
CN109413140B (en) Remote automatic upgrading method for PACS server
CN103685433A (en) Virtual document transmission system and virtual document transmission method thereof
CN113779054A (en) Data updating method, device, server, storage medium and program product
CN101741896A (en) Data processing method, device and system in WEB system
KR20070011043A (en) Method and system for pushing asynchronous notifications to networked device
CN105577617A (en) Client, terminal equipment, host machine, and file transmission system and method
CN106878419A (en) A kind of efficient Method of printing of desktop cloud based on tunnel and system
CN116366928B (en) USB camera bridging method and cloud terminal
US8195818B2 (en) Enforcing communication security for selected resources
CN109831510A (en) Internet of things data processing system and method
KR20130084462A (en) Apparatas and method for managing service of providing server in a terminal
CN111600883A (en) Vehicle diagnosis method and system, electronic equipment and storage medium
US10643039B2 (en) Location based situation awareness system and method thereof
CN112203158B (en) Image display method, device, system, equipment and medium
CN112671844B (en) Equipment registration method and system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
WW01 Invention patent application withdrawn after publication
WW01 Invention patent application withdrawn after publication

Application publication date: 20200117