CN114615324A - Websocket-based internet of vehicles alarm push system - Google Patents
Websocket-based internet of vehicles alarm push system Download PDFInfo
- Publication number
- CN114615324A CN114615324A CN202210225508.6A CN202210225508A CN114615324A CN 114615324 A CN114615324 A CN 114615324A CN 202210225508 A CN202210225508 A CN 202210225508A CN 114615324 A CN114615324 A CN 114615324A
- Authority
- CN
- China
- Prior art keywords
- websocket
- vehicle
- alarm
- database
- pushing
- 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.)
- Pending
Links
- 230000006855 networking Effects 0.000 claims abstract description 15
- 238000010295 mobile communication Methods 0.000 claims description 6
- 239000000284 extract Substances 0.000 claims description 3
- 238000004891 communication Methods 0.000 description 8
- 238000005516 engineering process Methods 0.000 description 5
- 230000002457 bidirectional effect Effects 0.000 description 3
- 238000000034 method Methods 0.000 description 3
- 230000008569 process Effects 0.000 description 3
- 238000012545 processing Methods 0.000 description 3
- 230000005856 abnormality Effects 0.000 description 2
- 230000005540 biological transmission Effects 0.000 description 2
- 230000008878 coupling Effects 0.000 description 2
- 238000010168 coupling process Methods 0.000 description 2
- 238000005859 coupling reaction Methods 0.000 description 2
- 238000011161 development Methods 0.000 description 2
- 230000007246 mechanism Effects 0.000 description 2
- 238000012544 monitoring process Methods 0.000 description 2
- 230000002085 persistent effect Effects 0.000 description 2
- 206010000117 Abnormal behaviour Diseases 0.000 description 1
- 230000002159 abnormal effect Effects 0.000 description 1
- 230000006399 behavior Effects 0.000 description 1
- 230000000903 blocking effect Effects 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 238000009434 installation Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/02—Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W4/00—Services specially adapted for wireless communication networks; Facilities therefor
- H04W4/30—Services specially adapted for particular environments, situations or purposes
- H04W4/40—Services specially adapted for particular environments, situations or purposes for vehicles, e.g. vehicle-to-pedestrians [V2P]
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Traffic Control Systems (AREA)
Abstract
The invention discloses a vehicle networking alarm pushing system based on Websocket, which comprises a vehicle-mounted terminal, a gateway module, a database module, a Websocket server and a Web front end, wherein the vehicle-mounted terminal is connected with the gateway module; the vehicle-mounted terminal reports vehicle data to the gateway through a network according to a protocol; the gateway is connected with the vehicle-mounted terminal through a network and used for receiving vehicle data reported by the vehicle-mounted terminal, analyzing the vehicle data, writing the vehicle data into the database module and pushing alarm information to the Websocket server; the database module consists of a relational MySQL database and a non-relational Redis database and is used for storing data and sending alarm information to the Websocket server; the Websocket server carries out authority judgment, Websocket pushing and pushing statistics according to the alarm information pushed by the database module; the Web front end is used for receiving and displaying the alarm information pushed by the Websocket server. The system improves the pushing efficiency of the whole system to the mass alarm data.
Description
Technical Field
The invention relates to the technical field of vehicle networking, in particular to a Websocket-based vehicle networking alarm pushing system.
Background
In recent years, with the rapid development of electronic information technology, mobile communication technology and internet of things technology, the internet of vehicles technology has also advanced significantly. In the car networking system, alarm notification and processing are very important functional modules. According to the relevant laws and regulations of the traffic department and the requirements of traffic management departments of various provinces, when dangerous driving behaviors such as overspeed, fatigue driving and the like occur to the vehicle, the vehicle networking operator of the networking joint control platform of the traffic department needs to receive the notification in time and correspondingly process the abnormal behavior of the vehicle.
When the vehicle gives an abnormal alarm, the terminal reports to the Internet of vehicles server in real time, and the server needs to inform the user of the alarm information in real time. In a traditional BS-structured vehicle networking system, alarm information is generally pulled in an AJAX polling mode, which is simple to implement, but has the following disadvantages: (1) the polling time interval causes the alarm to delay, and the too short polling interval generates a large number of invalid requests and increases the pressure of the server; (2) when the number of users increases, polling generates a large amount of network flow, unnecessary bandwidth loss is increased, and a server generates great concurrent pressure; (3) when the terminal data reporting frequency is higher than the AJAX polling frequency, the Web client has not yet made an AJAX request, and new alarm data already cover the old alarm data, so that the alarm data is lost. Therefore, a new technical means is needed to solve the problem of pushing massive alarm data in the internet of vehicles system.
Disclosure of Invention
In order to solve the problems, the invention provides a Websocket-based vehicle networking alarm pushing system, so as to solve the problem of pushing mass alarm data in the vehicle networking system.
The invention adopts the following technical scheme:
the vehicle networking alarm pushing system based on the Websocket comprises a vehicle-mounted terminal, a gateway module, a database module, a Websocket server and a Web front end;
the vehicle-mounted terminal reports vehicle data to the gateway through a network according to a protocol;
the gateway is connected with the vehicle-mounted terminal through a network and used for receiving vehicle data reported by the vehicle-mounted terminal, analyzing the vehicle data, writing the vehicle data into the database module and pushing alarm information to the Websocket server;
the database module consists of a relational MySQL database and a non-relational Redis database and is used for storing data and sending alarm information to the Websocket server;
the Websocket server carries out authority judgment, Websocket pushing and pushing statistics according to the alarm information pushed by the database module;
the Web front end is used for receiving and displaying the alarm information pushed by the Websocket server.
Further, the gateway adopts a Netty library.
Further, the protocol employs JT/T808 protocol.
Further, the network adopts a wireless mobile communication network or a WLAN network.
Further, the wireless mobile communication network adopts a 2G, 3G, 4G or 5G network.
Further, the gateway writes the vehicle data into the MySQL database or the Redis database respectively according to the type of the vehicle data.
Further, the gateway writes the vehicle data to the Redis database in two ways: one is by issue mode writing and one is by set/hset mode writing.
Further, the authority judgment, Websocket push and push statistics of the Websocket server are specifically as follows:
when alarm information is pushed to the Websocket server from the Redis database, the Websocket server extracts the alarm information, vehicle information and vehicle-mounted terminal information corresponding to the alarm information, then queries the corresponding relation between a user and a vehicle from the MySQL database, judges whether the alarm information needs to be pushed to the user according to user setting, and counts the number of the alarm information pushed to each user.
Furthermore, the user setting comprises vehicle information checking authority and user preference setting, only a user with the vehicle checking authority can receive the alarm push, and meanwhile, the Websocket server filters the alarm push of a specific type according to the user preference setting and only pushes the alarm type concerned by the user.
Further, the Web front end employs a js library of socket.
After adopting the technical scheme, compared with the background technology, the invention has the following advantages:
1. websocket is introduced into a server of the system, so that a browser at the front end of a Web and the Websocket server can directly establish persistent connection and perform bidirectional data transmission only by completing handshake once, and the occupied network bandwidth is small;
2. redis is introduced to reduce coupling between the gateway and subsequent Websocket push services, so that the stability of the gateway is guaranteed, even if backlog or blockage of the Websocket push services is caused by network abnormality, normal communication between the gateway and a terminal is not influenced, and data writing into a relational database is not influenced; when a plurality of programs subscribe Redis messages, data can be distributed among different modules in the system in real time, and data synchronization is realized; in addition, the Redis also plays a role of caching and can be directly inquired in the Redis, so that the pushing efficiency of the whole system on massive alarm data is improved.
Drawings
FIG. 1 is a schematic diagram of the system of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
Examples
As shown in fig. 1, the Websocket-based car networking alarm push system includes a vehicle-mounted terminal, a gateway module, a database module, a Websocket server, and a Web front end;
in the car networking system of this embodiment, the vehicle-mounted terminal reports the car data to the gateway according to JT/T808 protocol through a network (including a wireless mobile communication network or WLAN network of a 2G, 3G, 4G, or 5G network); the JT/T808 protocol is the technical specification of the road transport vehicle satellite positioning system Beidou compatible vehicle-mounted terminal communication protocol.
The vehicle data includes positioning data, alarm data, and other additional data.
The gateway is connected with the vehicle-mounted terminal through a network, is in charge of maintaining socket long connection of a plurality of terminals, receives vehicle data reported by the vehicle-mounted terminal, analyzes the vehicle data, writes the vehicle data into the database module, and pushes alarm information to the Websocket server;
the database module consists of a relational MySQL database and a non-relational Redis database and is used for storing data and sending alarm information to the Websocket server;
the gateway writes a part of the vehicle data into a relational database MySQL according to the type of the vehicle data so as to be durable for a long time, and the historical data are used for vehicle track query, travel analysis, alarm statistics and the like; and writing the other part of data needing real-time query and push into the non-relational data Redis for caching. The gateway writes the vehicle data into the Redis database in two ways: one is writing by issuing a pattern to notify the other modules in real time, and one is writing by set/hset to query the other modules for real-time data.
The gateway of the system adopts a Netty library to process socket connection and data receiving and sending, Netty is a high-performance asynchronous time-driven NIO framework, all IO operations are asynchronous and non-blocking, and the high-performance Netty can process connection and data receiving and sending of tens of thousands of terminals.
In the present system, Redis acts both as a cache database and as a message queue. Redis is deployed in a mode of 6 Redis node clusters, and comprises 3 main nodes and 3 slave nodes, so that data can be automatically distributed to different nodes, the performance is improved, service can be continuously provided under the condition that part of nodes fail, and the high availability of the system is improved.
Redis was introduced for the purpose of: (1) the coupling between the gateway and the subsequent Websocket pushing service is reduced, so that the stability of the gateway is guaranteed, even if the Websocket pushing service is backlogged or blocked due to network abnormality, the normal communication between the gateway and the terminal is not influenced, and the data writing into a relational database is not influenced; (2) when a plurality of programs subscribe Redis messages, data can be distributed among different modules in the system in real time, so that data synchronization is realized; (3) redis itself also plays a role of cache and can be directly queried in Redis.
The Websocket server carries out authority judgment, Websocket pushing and pushing statistics according to the alarm information pushed by the database module;
when alarm information is pushed to the Websocket server from the Redis database, the Websocket server extracts the alarm information, vehicle information and vehicle-mounted terminal information corresponding to the alarm information, then queries the corresponding relation between a user and a vehicle from the MySQL database, judges whether the alarm information needs to be pushed to the user according to user setting, and counts the number of the alarm information pushed to each user; the user setting comprises vehicle information checking authority and user preference setting, only a user with the vehicle checking authority can receive the alarm push, and meanwhile, the Websocket server filters the alarm push of a specific type according to the user preference setting and only pushes the alarm type concerned by the user.
Websocket is a communication mechanism in a new HTML5 standard, can realize stable full-duplex real-time communication, and has the characteristics of simplicity and high efficiency. In Websocket API, the browser and the server only need to complete one handshake, persistent connection can be directly established between the browser and the server, bidirectional data transmission is carried out, and occupied network bandwidth is small. It does not require the installation of browser plug-ins, so cross-browser compatibility is better.
The Websocket pushing service of the system adopts an open source Netty-socket scheme, and a Connect Lister of the Netty-socket pushing service monitors Websocket connection events. When a user logs in the system through a browser, a service end receives a unique identifier (UUID). The Clients collection holds the identities of all logged-in users. After the vehicle-mounted terminal reports one piece of alarm data, the program inquires the vehicle corresponding to the alarm from the database, and then finds one or more users needing to be notified by the alarm according to the relationship between the vehicle and the users. And if receiving alarm pushing is configured in the personal setting of the user, searching the Websocket connection corresponding to the user from the clients set, and pushing the alarm to the web front end through the connection.
The Web front end is used for receiving and displaying the alarm information pushed by the Websocket server. The Web front end adopts a js library of socket. Io is a js library which is cross-browser and supports Websocket real-time communication, supports real-time, bidirectional and event-based data communication, and can work on different platforms, browsers and equipment. Io can automatically select an optimal mode to realize network real-time application according to the supporting condition of the browser to the communication mechanism, so that the front-end Websocket development becomes simpler.
Here, the front end introduces a socket.io.js to monitor Websocket events, such as events of establishing connection, disconnecting connection, receiving data, and the like. When an alarm is received, js analyzes the alarm content and displays the result on a web interface. The whole front-end page comprises a set of complete vehicle networking platform, and comprises functions of vehicle monitoring, track playback, alarm processing, instruction issuing, report query and the like. The alarm push is only one module, when the front end receives the alarm push, the user is obviously prompted in a mode of playing frames, sounds and the like, and the functions of vehicle monitoring, alarm processing, report query and the like can synchronously refresh alarm data.
The above description is only for the preferred embodiment of the present invention, but the scope of the present invention is not limited thereto, and any changes or substitutions that can be easily conceived by those skilled in the art within the technical scope of the present invention are included in the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Claims (10)
1. Car networking warning push system based on Websocket, its characterized in that: the system comprises a vehicle-mounted terminal, a gateway module, a database module, a Websocket server and a Web front end;
the vehicle-mounted terminal reports vehicle data to the gateway through a network according to a protocol;
the gateway is connected with the vehicle-mounted terminal through a network and used for receiving vehicle data reported by the vehicle-mounted terminal, analyzing the vehicle data, writing the vehicle data into the database module and pushing alarm information to the Websocket server;
the database module consists of a relational MySQL database and a non-relational Redis database and is used for storing data and sending alarm information to the Websocket server;
the Websocket server carries out authority judgment, Websocket pushing and pushing statistics according to the alarm information pushed by the database module;
the Web front end is used for receiving and displaying the alarm information pushed by the Websocket server.
2. The Websocket-based Internet of vehicles alarm push system of claim 1, wherein: the gateway adopts a Netty library.
3. The Websocket-based Internet of vehicles alarm push system of claim 2, wherein: the protocol employs the JT/T808 protocol.
4. The Websocket-based Internet of vehicles alarm push system of claim 3, wherein: the network adopts a wireless mobile communication network or a WLAN network.
5. The Websocket-based Internet of vehicles alarm push system of claim 4, wherein: the wireless mobile communication network adopts a 2G, 3G, 4G or 5G network.
6. The Websocket-based Internet of vehicles alarm push system of claim 5, wherein: and the gateway writes the vehicle data into the MySQL database or the Redis database respectively according to the type of the vehicle data.
7. The Websocket-based Internet of vehicles alarm push system of claim 6, wherein: the gateway writes the vehicle data to the Redis database in two ways: one is by issue mode writing and one is by set/hset mode writing.
8. The Websocket-based Internet of vehicles alarm push system of claim 7, wherein: the authority judgment, Websocket pushing and pushing statistics of the Websocket server are as follows:
when alarm information is pushed to the Websocket server from the Redis database, the Websocket server extracts the alarm information, vehicle information and vehicle-mounted terminal information corresponding to the alarm information, then queries the corresponding relation between a user and a vehicle from the MySQL database, judges whether the alarm information needs to be pushed to the user according to user setting, and counts the number of the alarm information pushed to each user.
9. The Websocket-based Internet of vehicles alarm push system of claim 8, wherein: the user setting comprises vehicle information checking authority and user preference setting, only a user with the vehicle checking authority can receive the alarm push, and meanwhile, the Websocket server filters the alarm push of a specific type according to the user preference setting and only pushes the alarm type concerned by the user.
10. The Websocket-based vehicle networking alarm push system of claim 9, wherein: the Web front end adopts a js library of socket.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210225508.6A CN114615324A (en) | 2022-03-09 | 2022-03-09 | Websocket-based internet of vehicles alarm push system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210225508.6A CN114615324A (en) | 2022-03-09 | 2022-03-09 | Websocket-based internet of vehicles alarm push system |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114615324A true CN114615324A (en) | 2022-06-10 |
Family
ID=81861103
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210225508.6A Pending CN114615324A (en) | 2022-03-09 | 2022-03-09 | Websocket-based internet of vehicles alarm push system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114615324A (en) |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20190251759A1 (en) * | 2016-06-30 | 2019-08-15 | The Car Force Inc. | Vehicle data aggregation and analysis platform providing dealership service provider dashboard |
CN112565214A (en) * | 2020-11-26 | 2021-03-26 | 中国船舶工业系统工程研究院 | Data transmission method, system and medium based on WebSocket |
CN112769921A (en) * | 2020-12-31 | 2021-05-07 | 中建三局智能技术有限公司 | Highway emergency alarm system and method |
-
2022
- 2022-03-09 CN CN202210225508.6A patent/CN114615324A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20190251759A1 (en) * | 2016-06-30 | 2019-08-15 | The Car Force Inc. | Vehicle data aggregation and analysis platform providing dealership service provider dashboard |
CN112565214A (en) * | 2020-11-26 | 2021-03-26 | 中国船舶工业系统工程研究院 | Data transmission method, system and medium based on WebSocket |
CN112769921A (en) * | 2020-12-31 | 2021-05-07 | 中建三局智能技术有限公司 | Highway emergency alarm system and method |
Non-Patent Citations (1)
Title |
---|
李先懿等: "基于Websocket 的车联网报警推送系统", 《计算机系统应用》, vol. 29, no. 3, pages 2 * |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7526322B2 (en) | Real-time analyst program for processing log files from network elements | |
US7664848B2 (en) | System and method for monitoring networked devices employing RSS functionality | |
CN106100914B (en) | Cloud AC alarm information pushing method and system | |
CN108235353B (en) | Monitoring system of urban rail system based on LTE-M communication | |
US20070033446A1 (en) | Monitoring apparatus | |
CN102136924A (en) | Alarming information filtering and delivery processing method and server | |
CN108228625B (en) | Push message processing method and device | |
CN111884861B (en) | Real-time alarm method for Internet of things equipment based on Netty | |
CN113890903A (en) | Alarm information management system and method | |
CN112141832A (en) | Visual operation platform of elevator thing networking | |
CN111953525A (en) | Special equipment operation and maintenance monitoring system | |
CN102148692B (en) | Secondary filtering monitoring method and system for alarm information | |
CN112671922B (en) | Industrial internet data processing system and method | |
CN114615324A (en) | Websocket-based internet of vehicles alarm push system | |
CN108259576B (en) | Software and hardware real-time information transmission system and method | |
Huang | Architecture of audio broadcasting coverage monitoring system based on internet of things | |
CN116668988A (en) | C-V2X unified access gateway and access method based on multi-source sensing equipment | |
CN114201659A (en) | Message track transmission query method, device and system | |
CN216387853U (en) | Real-time vehicle fault pushing system of electric vehicle remote service and management system | |
CN114124646B (en) | Websocket mode integrated network management system and method | |
CN108989467B (en) | Centralized addressing method | |
CN110225070B (en) | Real-time data processing method and gateway based on new energy vehicle | |
CN105763380A (en) | Network management data obtaining method and device | |
CN112636964A (en) | Remote configuration method and system for monitoring equipment | |
CN213547535U (en) | Operation and maintenance monitoring system based on Zabbix |
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 |