[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

CN118677964A - Long connection method for vehicle end - Google Patents

Long connection method for vehicle end Download PDF

Info

Publication number
CN118677964A
CN118677964A CN202410811723.3A CN202410811723A CN118677964A CN 118677964 A CN118677964 A CN 118677964A CN 202410811723 A CN202410811723 A CN 202410811723A CN 118677964 A CN118677964 A CN 118677964A
Authority
CN
China
Prior art keywords
frame
server
vehicle
equipment
login
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
Application number
CN202410811723.3A
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.)
Tongcheng Network Technology Co Ltd
Original Assignee
Tongcheng Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tongcheng Network Technology Co Ltd filed Critical Tongcheng Network Technology Co Ltd
Priority to CN202410811723.3A priority Critical patent/CN118677964A/en
Publication of CN118677964A publication Critical patent/CN118677964A/en
Pending legal-status Critical Current

Links

Landscapes

  • Mobile Radio Communication Systems (AREA)

Abstract

The invention provides a long connection method for a vehicle end, which is used for establishing TCP connection between a device end and a service end, wherein the service end judges whether the device end is successfully logged in based on a login frame sent by the device end and sends a heartbeat Pong frame to the device end when the device end is successfully logged in, the device end uploads a positioning frame to the service end when receiving the heartbeat Pong frame, the service end recalls vehicle positioning information contained in the positioning frame to a service system for processing, and the service system notifies the service end to push a reminding message to the device end when a vehicle corresponding to the device end approaches a station. The invention can solve the problems of large flow consumption and high replacement cost of the WebSocket protocol in the existing vehicle-end equipment WebSocket long connection mode.

Description

Long connection method for vehicle end
Technical Field
The invention relates to the technical field of communication, in particular to a long connection method for a vehicle end.
Background
In order to increase the transmission speed and save the traffic, the internet product uses a long connection technology to realize message pushing and real-time uploading of data at the equipment end. There are generally two ways of connecting a common long connection: one is that the equipment end polls the service end in an http long connection initiated from the back end (i.e. the service end), the mode needs the equipment end to poll the service end, the real-time message pushing of the service end is not supported, the flow consumption is high, and the requirement on the network stability is low; the other is a long connection using WebSocket protocol, which supports real-time message pushing at the server, and the traffic consumption is smaller than the former.
With the development of the internet, a lot of vehicles are provided with vehicle-end devices to assist passengers to pay, assist drivers to check lines and the like, and some devices can also provide functions of confirming seat ticket purchasing conditions, checking the positions of the vehicles and other vehicle positions of the affiliated vehicle teams, reminding getting on/off and the like for the drivers, so that the message pushing and data uploading of the vehicle-end devices become high-frequency, and the long connection of the vehicle-end devices WebSocket is generally established to realize the message pushing and data uploading of the vehicle-end devices, so that the following two problems occur in the conventional long connection mode of the vehicle-end devices WebSocket:
(1) In the scene of mass message pushing and data uploading, the flow consumption of WebSocket is large. Although WebSocket long connections consume less traffic than short connections, the tiny extra traffic in the context of large message pushing and data uploading can be amplified resulting in a larger total traffic consumption.
(2) The WebSocket protocol is costly to replace with other low-traffic protocols. For low flow purposes, there are two main common ways: one is that the self-defined TCP-based protocol reduces the flow by only transmitting the concerned data, the mode is good in effect, but poor in universality, so that the mode is difficult to popularize and use, the replacement cost of the mode is high, the mature implementation mode in the existing WebSocket protocol is also abandoned when the WebSocket protocol is completely abandoned, and the implementation risk of using a set of immature brand new protocol for vehicle-end equipment and a service end is also high; and the WebSocket protocol is replaced by an MQTT (Message Queuing Telemetry Transport message queue telemetry) transmission protocol based on a message publishing/subscribing mode, the implementation of the mode is relatively mature, but the mode is greatly different from the WebSocket in code implementation, the MQTT transmission protocol is newly added with message middleware, the message interaction is changed into the publishing/subscribing mode, the whole interaction flow is greatly changed, and the replacement cost is high.
Disclosure of Invention
Accordingly, it is an object of the present invention to provide a long connection method for a vehicle end, which alleviates the above-mentioned problems of the related art.
In a first aspect, an embodiment of the present invention provides a long connection method for a vehicle end, where the method is applied to an equipment end, and the method includes: establishing TCP connection with a server, and sending a login frame containing login information to the server; the login information has a first preset format and comprises a login instruction, wherein a mask bit of a login frame is 0, and a mask key of the login frame is null; the server is used for establishing TCP connection with the equipment and receiving a login frame; if a heartbeat Pong frame sent by the server side is received, acquiring vehicle positioning information of a vehicle corresponding to the equipment side, and uploading a positioning frame containing the vehicle positioning information to the server side; the vehicle positioning information has a second preset format and comprises a positioning instruction, wherein a mask bit of the positioning frame is 0, and a mask key of the positioning frame is null; the server side is further used for judging whether the equipment side is successfully logged in or not based on the login frame, and sending a heartbeat Pong frame to the equipment side when the equipment side is successfully logged in; receiving a reminding message which is pushed by the server and characterizes a vehicle adjacent station corresponding to the equipment; the server side is also used for recalling the vehicle positioning information contained in the positioning frame to the service system when the positioning frame is received, and pushing a reminding message to the equipment side when a first notification sent by the service system is received; the service system is used for storing vehicle positioning information, judging whether the vehicle corresponding to the equipment end approaches a station or not based on the vehicle positioning information and the pre-stored station positioning information, and sending a first notification to the service end when the vehicle corresponding to the equipment end approaches the station.
In a second aspect, an embodiment of the present invention further provides a long connection method for a vehicle end, where the method is applied to a service end, and the method includes: establishing TCP connection with a device end, and receiving a login frame which is sent by the device end and contains login information; the login information has a first preset format and comprises a login instruction, wherein a mask bit of a login frame is 0, and a mask key of the login frame is null; the equipment end is used for establishing TCP connection with the server end and sending a login frame to the server end; judging whether the equipment end is successfully logged in or not based on the login frame, and if the equipment end is successfully logged in, sending a heartbeat Pong frame to the equipment end; if the positioning frame uploaded by the equipment end is received, the vehicle positioning information contained in the positioning frame is recalled to a service system; the positioning frame comprises vehicle positioning information of a vehicle corresponding to the equipment end, the vehicle positioning information has a second preset format and comprises a positioning instruction, a mask bit of the positioning frame is 0, and a mask key of the positioning frame is null; the equipment end is also used for acquiring vehicle positioning information of a vehicle corresponding to the equipment end when receiving the heartbeat Pong frame, and uploading the positioning frame to the server end; the service system is used for storing vehicle positioning information and judging whether a vehicle corresponding to the equipment end approaches a station or not based on the vehicle positioning information and the pre-stored station positioning information; if a first notification sent by the service system is received, pushing a reminding message to the equipment end; the service system is further used for sending a first notification to the service end when the vehicle corresponding to the equipment end approaches a station.
The method for long connection of the vehicle end includes the steps that TCP connection between a device end and a service end is established, the device end sends a login frame containing login information to the service end, the service end judges whether the device end is successful in login or not based on the login frame and sends a heartbeat Pong frame to the device end when the device end is successful in login, the device end obtains vehicle positioning information of a vehicle corresponding to the device end when the heartbeat Pong frame is received and uploads the positioning frame containing the vehicle positioning information to the service end, the service end recalls the vehicle positioning information contained in the positioning frame to a service system, the service system stores the vehicle positioning information and judges whether a vehicle corresponding to the device end is close to a station or not and sends a first notification to the service end when the vehicle corresponding to the device end is close to the station based on the vehicle positioning information and the pre-stored station positioning information, and the service end pushes a reminding message representing the vehicle station corresponding to the device end when the first notification is received. By adopting the technology, when the equipment end and the service end are established to be connected, the equipment end can carry out login verification only by sending a login frame to the service end so as to realize one-stage login, compared with the traditional WebSocket long connection technology which also needs to carry out http handshake, the flow rate when long connection is established can be reduced, and the grammar multiplexing of the heartbeat Pong frame enables the connection mode between the equipment end and the service end to be compatible with the implementation mode in the traditional WebSocket protocol, so that the transformation cost of the WebSocket protocol is reduced; the equipment end uploads the vehicle positioning information to the service end through long connection so that the service end directly calls back the vehicle positioning information to the service system to judge whether the vehicle approaches a station or not, the service system can be convenient for informing the service end when the vehicle approaches the station and triggering the service end to push reminding information to the equipment end, and therefore the flow of the equipment at the vehicle end during message pushing and data uploading is reduced on the basis of realizing the function of reminding the vehicle to get on or off; the format of the information contained in the data frame sent by the equipment side to the service side can be preset, so that the flexibility of information interaction of the vehicle side equipment can be improved by presetting the information format, and the information interaction requirements of different scenes can be met.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
In order to make the above objects, features and advantages of the present invention more comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings that are needed in the description of the embodiments or the prior art will be briefly described, and it is obvious that the drawings in the description below are some embodiments of the present invention, and other drawings can be obtained according to the drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic flow chart of a method for long connection of a vehicle end according to an embodiment of the invention;
FIG. 2 is a flow chart of another method for long connection of a vehicle end according to an embodiment of the present invention;
FIG. 3 is a schematic flow chart of a method for long connection of a vehicle end according to an embodiment of the present invention;
FIG. 4 is a partial flow chart illustrating a long connection method for a vehicle end according to an embodiment of the present invention;
FIG. 5 is a partial flow chart illustrating another embodiment of a method for long connection of a vehicle end;
FIG. 6 is a schematic diagram of an interaction scenario in an embodiment of the present invention;
Fig. 7 is a schematic structural diagram of a long connection management system according to an embodiment of the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of the present invention will be clearly and completely described in conjunction with the embodiments, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
At present, the following two problems mainly exist in the existing vehicle-end equipment WebSocket long connection mode: (1) In a scene of pushing a large amount of messages and uploading data, the flow consumption of WebSocket is large; (2) The WebSocket protocol is costly to replace with other low-traffic protocols.
Based on the above, the long connection method for the vehicle end provided by the embodiment of the invention can alleviate the problems existing in the related art.
In order to facilitate a better understanding of the present invention, technical terms related to the present invention will be briefly described below.
Long Connection (Long Connection): it means that a plurality of data packets can be continuously transmitted over one connection, and both sides are required to transmit a link detection packet if no data packet is transmitted during connection hold.
WebSocket: a protocol for full duplex communication over a single TCP connection allows a server to actively push data to a device.
Frame (Frame): the invention relates to a Frame of a WebSocket, which is a data transmission unit of the WebSocket and is divided into a text Frame, a binary Frame, a Close Frame, a Ping Frame, a Pong Frame and the like. The present invention uses the same frame structure.
Retention position (RSV): the invention refers to a field in a WebSocket frame, which is divided into RSV1, RSV2 and RSV3, and each field occupies 1 bit. In the present invention, RSV1 is used to identify whether data compression is performed, RSV3 is used to identify whether device-side to server acknowledgement message reception is required, and RSV2 is used to identify whether data encryption is performed.
MASK bits (MASK): the invention refers to a field in a WebSocket frame, which takes up 1 bit and is used for identifying whether a mask key is generated or not.
Mask key (masking-key): the invention refers in particular to a field in a WebSocket frame, which takes up 32 bits and exists in a frame sent from a device side to a server side, and is used for resisting cache poisoning attacks commonly found in an http protocol.
The embodiment of the invention provides a long connection method for a vehicle end, which can be applied to a device end, and is shown in fig. 1, and the method can comprise the following steps:
Step S102, a TCP connection with the server is established, and a login frame containing login information is sent to the server.
The login information has a first preset format and comprises a login instruction, a mask bit of a login frame is 0, and a mask key of the login frame is null. The server may be configured to establish a TCP connection with the device and receive a login frame.
Step S104, if the heartbeat Pong frame sent by the server is received, vehicle positioning information of the vehicle corresponding to the equipment is obtained, and the positioning frame containing the vehicle positioning information is uploaded to the server.
The vehicle positioning information has a second preset format and comprises a positioning instruction, the mask bit of the positioning frame is 0, and the mask key of the positioning frame is null. The server may be further configured to determine whether the device is successfully logged in based on the login frame, and send a heartbeat Pong frame to the device when the device is successfully logged in.
Taking the long connection between the equipment end and the service end as an example in the running process of the vehicle, a driver starts the equipment at the vehicle end, and the equipment end enters a connection establishment link. Because the high-speed movement of the vehicle causes the continuous switching of the base station for providing the network service, and the aggregation of people causes the aggregation of equipment such as mobile phones carried by people and the like to contend for network resources, the condition of unstable network often occurs, long connection is often interrupted under the condition of unstable network, the equipment end often needs to reestablish the connection, and the flow consumption for establishing the connection is not negligible.
The existing WebSocket long connection mode adopts two-stage login, wherein the first stage is http handshake, the second stage is TCP transmission, whether the handshake is successful or not is confirmed through http request and response in the first stage, and the second stage is to carry out service login verification through service response data in a frame so as to confirm whether the login is successful or not. In order to reduce the flow consumption when the vehicle-end equipment establishes connection, TCP connection between the equipment end and the service end can be directly established, the equipment end sends a binary frame containing login information to the service end, and the service end returns a Pong frame representing successful login of the equipment end to the equipment end after the login information is checked successfully. The operation mode that the equipment end is directly connected with the server TCP and sends the binary frame containing login information to the server is adopted, compared with the existing WebSocket long connection mode, the flow consumption of http handshake in the first stage is eliminated; the operation mode that the service end returns the Pong frame after the login information is checked successfully is adopted, and the Pong frame conforming to the WebSocket grammar is used for expressing general login result semantics, so that compared with the existing WebSocket long connection mode, the flow consumption of service response data in the frame is removed, the multiplexing of the Pong frame can be compatible with some existing implementation modes of the WebSocket protocol, the login verification can be realized by only adjusting the frame identification mode of the login result, and the cost of replacing the WebSocket protocol is reduced.
In the existing WebSocket long connection mode, frames uploaded by a device side to a server side generally adopt json format (namely, field names and field values which appear in pairs need to be contained), and the frames uploaded by the device side to the server side generally need to contain a 32-bit mask key to resist cache poisoning attacks commonly found in http protocols. The operation mode that the equipment end is directly connected with the server TCP and sends the binary frame containing login information to the server is adopted, and no mask key is needed in safety because http handshake is not needed, compared with the existing WebSocket long connection mode, the flow consumption of the mask key is removed, and the multiplexing of the frame grammar can be directly compatible with some existing implementation modes of the WebSocket protocol, so that the cost of replacing the WebSocket protocol is reduced.
Step S106, a reminding message which is pushed by the server and characterizes the adjacent stations of the vehicles corresponding to the equipment is received.
The server side can also be used for callback vehicle positioning information contained in the positioning frame to the service system when the positioning frame is received, and pushing a reminding message to the equipment side when a first notification sent by the service system is received. The service system can be used for storing the vehicle positioning information and judging whether the vehicle corresponding to the equipment end approaches to the station or not based on the vehicle positioning information and the pre-stored station positioning information. The service system may be further configured to send a first notification to the server when the vehicle corresponding to the device is approaching the station.
Continuing the former example, in the vehicle driving process, the equipment end continuously uploads the vehicle GPS data of the vehicle where the equipment end is located to the service end in a positioning frame mode, the service end transmits the uploaded vehicle GPS data to the service system, the service system stores the vehicle GPS data and compares the vehicle GPS data with the site GPS data stored in advance to judge whether the vehicle approaches the site, when the vehicle approaches the site, the service system informs the service end, the service end pushes the get-on/off reminding message to the equipment end after receiving the notification, and the equipment end carries out voice broadcasting after receiving the get-on/off reminding message to remind passengers to get on/off the vehicle.
According to the long connection method for the vehicle end, when the connection between the equipment end and the service end is established, the equipment end can perform login verification only by sending a login frame to the service end so as to realize one-stage login, compared with the conventional WebSocket long connection technology, the method of performing http handshake is also required, the flow rate when the long connection is established can be reduced, and the grammar multiplexing of the heartbeat Pong frame enables the connection mode between the equipment end and the service end to be compatible with the implementation mode in the conventional WebSocket protocol, so that the transformation cost of the WebSocket protocol is reduced; the equipment end uploads the vehicle positioning information to the service end through long connection so that the service end directly calls back the vehicle positioning information to the service system to judge whether the vehicle approaches a station or not, the service system can be convenient for informing the service end when the vehicle approaches the station and triggering the service end to push reminding information to the equipment end, and therefore the flow of the equipment at the vehicle end during message pushing and data uploading is reduced on the basis of realizing the function of reminding the vehicle to get on or off; the format of the information contained in the data frame sent by the equipment side to the service side can be preset, so that the flexibility of information interaction of the vehicle side equipment can be improved by presetting the information format, and the information interaction requirements of different scenes can be met.
As a possible implementation manner, the long connection method for the vehicle end may further include: and if the time interval between the current time and the last time of data interaction with the server exceeds a preset time interval threshold, sending a heartbeat Ping frame to the server so as to maintain TCP connection with the server.
The server may be further configured to send a heartbeat Pong frame to the device when a time interval between the current time and a time of a last data interaction with the device exceeds a preset time interval threshold, so as to maintain a TCP connection with the device.
Continuing the previous example, if the server side checks the login information successfully, the server side sends a Pong frame to the equipment side to represent that the equipment side is successfully logged in, and starts a timing heartbeat mechanism; the timing heartbeat mechanism specifically comprises: and presetting a first duration at each interval, calculating the time interval between the current time and the time of transmitting data to the equipment end at the last time by the server end, judging whether the time interval exceeds a preset time interval threshold, and if so (namely, the time interval exceeds the preset time interval threshold), transmitting a Pong frame to the equipment end so as to maintain TCP connection with the equipment end. If the device side receives the Pong frame representing successful login, the device side starts a timing heartbeat mechanism, and the timing heartbeat mechanism specifically comprises: and presetting a second duration at each interval, calculating the time interval between the current time and the time of transmitting data to the server last time by the equipment end, judging whether the time interval exceeds a preset time interval threshold, and if so (namely, the time interval exceeds the preset time interval threshold), transmitting a Ping frame to the server end so as to maintain TCP connection with the server end.
As a possible implementation manner, after the TCP connection with the service end is established in the step S102, the long connection method for the vehicle end may further include: and receiving passenger payment information pushed by the server.
The service end can also be used for pushing the passenger payment information to the equipment end when receiving the second notification sent by the service system. The business system may be configured to send a second notification to the server when the passenger payment is successful.
Continuing the former example, the vehicle is internally provided with a two-dimensional code for passenger code scanning payment, and the passenger can scan the two-dimensional code by using a mobile phone to carry out code scanning payment of riding fees; after the passenger scans the code and pays successfully, the service system informs the service end that pays successfully, and the service end pushes the payment information containing the seat number to the equipment end after receiving the notification, so that the driver can confirm whether the actual seat pays or not at the equipment end according to the payment information pushed by the service end.
As a possible implementation manner, the long connection method for the vehicle end may further include: and receiving the vehicle positioning information pushed by the server.
The service end can also be used for calling the vehicle positioning information stored by the service system and pushing the vehicle positioning information to the equipment end when receiving a third notification sent by the service system; the service system may be configured to send a third notification to the server according to a preset time step.
Continuing the former example, in the scene that a vehicle team is formed by a plurality of vehicles, presetting a third time length at each interval, informing a service end of vehicle GPS data pushing by a service system, and after receiving the notification, the service end retrieving the vehicle GPS data of all vehicles in the vehicle team from the service system and pushing the vehicle GPS data to a device end connected with the service end, so that a driver can change shifts in time and flexibly adjust a vehicle route at the device end according to the positions of all the vehicles in the vehicle team.
As a possible implementation manner, the long connection method for the vehicle end may further include: and if the Close frame sent by the server is received, the TCP connection with the server is disconnected.
The server may be configured to send a Close frame to the device when the login of the device fails, and disconnect the TCP connection with the device.
Continuing the previous example, if the server side fails to check the login information, the server side sends a Close frame to the equipment side to represent the equipment side login failure and disconnect the TCP connection with the equipment side; after receiving the Close frame representing the login failure, the device disconnects the TCP connection with the server.
The embodiment of the invention also provides another long connection method for the vehicle end, which can be applied to the service end, and is shown in fig. 2, and the method can comprise the following steps:
Step S202, a TCP connection with the equipment end is established, and a login frame containing login information sent by the equipment end is received.
The login information has a first preset format and comprises a login instruction, a mask bit of a login frame is 0, and a mask key of the login frame is null. The device side may be configured to establish a TCP connection with the server side and send a login frame to the server side.
Step S204, judging whether the equipment end is successfully logged in or not based on the login frame, and if the equipment end is successfully logged in, sending a heartbeat Pong frame to the equipment end.
Step S206, if the positioning frame uploaded by the equipment end is received, the vehicle positioning information contained in the positioning frame is recalled to the service system.
The positioning frame comprises vehicle positioning information of a vehicle corresponding to the equipment end, the vehicle positioning information has a second preset format and comprises a positioning instruction, a mask bit of the positioning frame is 0, and a mask key of the positioning frame is null. The device side can also be used for acquiring vehicle positioning information of a vehicle corresponding to the device side and uploading the positioning frame to the server side when receiving the heartbeat Pong frame. The service system can be used for storing the vehicle positioning information and judging whether the vehicle corresponding to the equipment end approaches to the station or not based on the vehicle positioning information and the pre-stored station positioning information.
Step S208, if a first notification sent by the service system is received, a reminding message is pushed to the equipment end.
The service system may be further configured to send a first notification to the server when the vehicle corresponding to the device is approaching the station.
As a possible implementation manner, the long connection method for the vehicle end may further include: if the time interval between the current time and the last time of data interaction with the equipment end exceeds a preset time interval threshold, sending a heartbeat Pong frame to the equipment end so as to maintain TCP connection with the equipment end; the device side is further configured to send a heartbeat Ping frame to the server side when a time interval between the current time and a time of last data interaction with the server side exceeds a preset time interval threshold, so as to maintain TCP connection with the server side.
As a possible implementation manner, after the TCP connection with the device end is established in the step S202, the long connection method for the vehicle end may further include: and if the second notification sent by the service system is received, pushing the passenger payment information to the equipment end.
The device side can also be used for receiving passenger payment information pushed by the device side. The business system may be configured to send a second notification to the server when the passenger payment is successful.
As a possible implementation manner, the long connection method for the vehicle end may further include: and if the third notification sent by the service system is received, calling the vehicle positioning information stored by the service system and pushing the vehicle positioning information to the equipment end.
The equipment end can also be used for receiving the vehicle positioning information pushed by the service end. The service system may be configured to send a third notification to the server according to a preset time step.
As a possible implementation manner, the long connection method for the vehicle end may further include: if the login of the equipment end fails, a Close frame is sent to the equipment end, and the TCP connection with the equipment end is disconnected.
The device side may also be configured to disconnect the TCP connection with the server side when receiving the Close frame sent by the server side.
The implementation principle and the generated technical effects of the long connection method for the vehicle end applied to the service end provided by the embodiment of the invention are the same as those of the long connection method for the vehicle end applied to the equipment end, and for the sake of brief description, the corresponding contents in the method embodiment applied to the equipment end can be referred to where the method embodiment applied to the service end is not mentioned.
For ease of understanding, the above-described long connection method for the vehicle end is exemplarily described herein below taking practical application as an example.
Referring to fig. 3, the main flow of the long connection method for the vehicle end may include:
step S301, starting the vehicle-end equipment and establishing connection.
The driver turns on the vehicle-end equipment, and the equipment end can establish connection with the service end.
When the equipment end establishes connection with the service end, one-stage login is adopted, namely: the device side firstly sends a binary frame containing login information to the server side, and the server side returns a Pong frame representing success or a Close frame representing failure after checking the login information.
In the whole driving process, the equipment end and the service end are connected in a bidirectional manner, and a dynamic heartbeat mechanism is adopted. The operation modes of the dynamic heartbeat mechanism specifically can include: the equipment end sends the Ping frame to the server according to the interval time of the current moment from the last time of data transmission (namely uploading data or sending the Ping frame) to the server, if the data is continuously uploaded (namely, the interval time of the current moment from the last time of data transmission to the server does not exceed a preset threshold value), the Ping frame does not need to be sent to the server, and if the data is not uploaded for a long time (namely, the interval time of the previous moment from the last time of data transmission to the server exceeds the preset threshold value), the Ping frame needs to be sent to the server; the server side transmits the Pong frame to the device side according to the interval time of the current moment from the last data transmission (i.e. push message or sending the Pong frame) to the device side, if the data is continuously transmitted (i.e. the interval time of the current moment from the last data transmission to the device side does not exceed the preset threshold), the Pong frame does not need to be transmitted to the device side, and if the data is not transmitted for a long time (i.e. the interval time of the current moment from the last data transmission to the device side exceeds the preset threshold), the Pong frame needs to be transmitted to the device side.
In a scene of high frequency data uploading (such as uploading GPS data by a device side, etc.), the dynamic heartbeat mechanism is adopted to save the flow consumption of Ping frames; in a scene of message pushing high frequency, a dynamic heartbeat mechanism is adopted to save the flow consumption of the Pong frame; when the existing WebSocket protocol is replaced or modified into other protocols, only the judgment of whether to send heartbeat is increased, and the heartbeat frame is not modified due to grammar multiplexing, so that the cost of replacing or modifying the WebSocket protocol is very low.
And step S302, after the passenger sweeps the code to pay, pushing seat payment information to the equipment end, and confirming whether the actual seat is paid or not by a driver.
After the passenger scans the code and pays, the business system notifies the server that the payment is successful, the server pushes the payment information containing the seat number selected by the passenger to the equipment, and the driver confirms whether the actual seat is paid.
When the server pushes information to the equipment, a custom instruction of data compression and comma separation is adopted, and a reserved bit of a data frame is used for informing whether the equipment is required to confirm that the information is received and whether the information is required to be encrypted. Specifically, the server firstly converts the pushed information content into a service instruction of the server separated by English commas, the format of application identification and service content is adopted, and the specific service content and the service instruction of the server are agreed in advance by the service; then the server sets a reserved bit RSV3 so as to inform the equipment whether the equipment needs the equipment confirmation information to be received, wherein RSV3 is 0 and represents that the equipment does not need the equipment confirmation information to be received, and RSV3 is 1 and represents that the equipment needs the equipment to reply the equipment confirmation information to be received; the server sets a reserved bit RSV2 so as to inform the equipment whether the data is AES encrypted, wherein RSV2 represents that the data is AES encrypted when 1, and RSV2 represents that the data is not AES encrypted when 0; finally, the server sets a reserved bit RSV1 so as to inform the equipment whether the data are compressed, wherein RSV1 represents compression, and RSV1 represents non-compression; and finally, the server transmits information to the equipment end.
Because the format of the service end service instruction, the application identifier and the service content removes the field name and uses the agreed service instruction, compared with the json format adopted by the prior WebSocket protocol, the flow consumption of the field name is saved; when the existing WebSocket protocol is replaced or modified into other protocols, only instructions can be appointed for common messages, and the non-common messages are kept unchanged, so that the compatibility cost is low because the frame grammar is unchanged.
In addition, the reserved bit RSV3 is set so as to inform the equipment end whether the operation mode of the equipment end for confirming the information reception is needed, so that the flow consumption of needAck fields in service data is saved; the reserved bit RSV2 is set so as to inform the equipment whether the data is encrypted by AES or not, so that the service can be dynamically encrypted according to the information security level, the transmission efficiency is improved, the traffic consumption caused by encryption is saved, and the data security is ensured; the reserved bit RSV1 is set to inform the device whether the data is compressed or not, so that the data traffic can be reduced. Therefore, by adopting the operation mode of setting the reserved bits, when the existing WebSocket protocol is replaced or modified into other protocols, the corresponding processing is only needed to be changed into the reserved bits for judgment, and the related code can be directly compatible with the related implementation mode of the existing WebSocket protocol without modification due to multiplexing of frame grammar.
Step S303, after the vehicle starts, the equipment end continuously uploads the GPS.
After the vehicle starts, the equipment end starts the uploading of the GPS data of the vehicle, and uploads the GPS data of the vehicle to the service end through long connection every few seconds; and after receiving the GPS data, the server side transmits the GPS data to the service system.
When the equipment side uploads data to the service side, a custom instruction of data compression and comma separation is adopted, and a reserved bit of a data frame is used for informing whether data encryption is needed or not. Specifically, the device side firstly converts the pushed information content into a device side service instruction separated by English commas, the format of application identification and service content is adopted, and the specific service content and the device side service instruction are agreed by the service in advance; then the equipment end sets a reserved bit RSV2 so as to inform the service end whether the data is subjected to AES encryption, wherein RSV2 is1 for representing the data and is subjected to AES encryption, and RSV2 is 0 for representing the data and is not subjected to AES encryption; then the equipment end sets a reserved bit RSV1 so as to inform the service end whether data are compressed, wherein RSV1 represents compression, and RSV1 represents non-compression; finally, the device sets a MASK bit MASK to 0 (representing no MASK), sets a MASK key MASK-key to null correspondingly, and then transmits data to the server.
Step S304, the server pushes the GPS data of the vehicle and the get-on/off reminding message.
The service system informs the service end of pushing the GPS data of the vehicles at regular intervals, the service end pushes the GPS data of all the vehicles in the vehicle team to the equipment end, and a driver can know the positions of all the vehicles in the vehicle team through the equipment end and timely change shifts and flexibly adjust the vehicle route according to the positions. When a website is close, the service system can inform the service end, the service end pushes the get-on/off reminding message to the corresponding equipment end after receiving the notification, and the equipment end plays the voice after receiving the get-on/off reminding message so as to realize get-on/off reminding.
The long connection method for the vehicle end has the following beneficial effects: firstly, a driver starts a vehicle end device, the device end enters a connection establishment link, and when the device end establishes connection with a server end, one-stage login is adopted, so that compared with the two-stage login adopted by the existing WebSocket long connection mode, the flow consumption when the connection is established can be reduced. After the passenger sweeps the code and pays, the service system notifies the server, the server pushes the message to the device, the driver confirms whether the actual seat pays, the server pushes the message to the device by adopting a message compression and comma separated custom instruction and using the reserved bit to inform the device whether the device confirms that the message is received and whether the data is encrypted or not, compared with json format and service data content adopted by the existing WebSocket protocol, the traffic consumption is saved. After the vehicle starts, the equipment end continuously uploads the GPS data of the vehicle through long connection, and the service end pushes the GPS data of all vehicles of the fleet to the equipment end after receiving the notification of the service system, so that a driver can conveniently change shifts and adjust the vehicle route; the service system also informs the service end when finding that the vehicle approaches a station based on the GPS data uploaded by the equipment end to the service end, so that the service end pushes a get-on and get-off reminding message to the equipment end; when the equipment side uploads data to the server side, a custom instruction of data compression and comma separation is adopted, a reserved bit is used for informing the server side whether the data is encrypted or not, and a mask key is also removed. In the whole driving process, the equipment end and the service end are connected in a bidirectional mode, and a dynamic heartbeat mechanism is adopted, so that extra flow generated by reconnection can be saved under the condition that a network is unstable.
Therefore, by adopting the long connection method for the vehicle end, when the message is pushed and data is uploaded, the flow is reduced, the data safety is ensured, the transmission efficiency is improved, the cost of replacing or modifying the existing WebSocket protocol can be saved, and the low flow requirement of the vehicle end during large-scale data pushing and uploading is met.
Referring to fig. 4, in the above method for long connection between a vehicle end and a server, the process of establishing connection between the device end and the server and uploading data to the server may include:
in step S401, the device initiates a TCP connection to the server, and after establishing a connection, the device sends a login frame.
After a driver starts the vehicle-end equipment, the equipment end initiates TCP connection to the service end, after the connection is successful, the equipment end enters a login stage, and the equipment end sends a login frame containing login information to the service end.
The login information includes a login instruction, for example, the login instruction may be uniformly appointed as C001, and the login information format may be "C001, login name, device side information"; then the equipment end sets the reserved bit RSV1 of the login frame as 1 (representing that the login information needs to be subjected to data compression), and performs data compression on the login information; setting the mask bit of the login frame to 0 at the equipment end, and setting the mask key of the login frame to be null; and finally, the equipment end sends the login frame containing the compressed login information to the server end.
In step S402, the server checks whether the login is successful.
Continuing the previous example, after receiving the login frame containing the login information, the server firstly decompresses to obtain the login information, then carries out login verification according to the instruction C001 contained in the login information, and finally verifies the login name. If the server side does not receive the login frame or the connection time between the distance establishment of the login frame time and the equipment side exceeds the preset time threshold, the server side judges that the login of the equipment side is not passed.
In step S403, the server sends a Close frame.
And if the login of the equipment end is checked to be failed by the service end, sending a Close frame to the equipment end, and closing the connection with the equipment end.
Step S404, the server sends a Pong frame and starts the heartbeat.
And the server side verifies that the equipment side passes the login, sends a Pong frame (representing the equipment side passes the login) to the equipment side, and starts a timing heartbeat. In the process of timing heartbeat, if the interval time between the current moment and the moment when the last time the server transmits data to the equipment exceeds a preset threshold, sending a Pong frame to the equipment so as to maintain connection with the equipment.
Step S405, the device receives the Pong frame, starts the heartbeat, and starts the GPS data uploading.
The equipment end receives the Pong frame (representing login passing), starts timing heartbeat, and then starts a task of uploading vehicle GPS data to the service end at fixed time. In the process of timing heartbeat, if the interval time between the current moment and the moment when the last equipment transmits data to the server exceeds a preset threshold, sending a Ping frame to the server so as to maintain connection with the server.
In step S406, the device sets a reserved bit, encrypts and compresses GPS data, sets a mask key to null, and then uploads a GPS data frame.
For example, it may be agreed that the GPS data upload instruction contained in the GPS data is C002, and the GPS data format may be "C002, GPS longitude and latitude"; then the equipment end sets a reserved bit RSV2 of the GPS data frame to be 1 (representing that AES data encryption is needed to be carried out on the GPS data) according to the message security level, and carries out AES data encryption on the GPS data, and sets a reserved bit RSV1 of the GPS data frame to be 1 (representing that data compression is needed to be carried out on the GPS data) and carries out data compression on the GPS data; setting the mask bit of the GPS data frame to 0 at the equipment end, and setting the mask key of the GPS data frame to be null; and finally, the equipment side uploads the GPS data frame containing the GPS data to the server side.
Step S407, the server receives the GPS data frame, analyzes the reserved bit, decompresses, decrypts and calls back the service system.
Continuing the previous example, the server receives the GPS data frame uploaded by the equipment, firstly analyzes the reserved bit, decompresses according to RSV1, decrypts according to RSV2, then judges that service callback is required according to the instruction C002, and calls the callback address of the service system to transmit GPS data with the equipment.
Referring to fig. 5, in the foregoing method for long connection between a vehicle end and a device end, a procedure of pushing a message by a server end may include:
In step S501, the server receives a push request of the service system, sets a reserved bit, encrypts, compresses data, and pushes information.
The information pushed by the server side to the device side may include payment information, get-on/off reminding information, vehicle GPS data and the like, which is not limited.
Taking the pushing of the payment information as an example, after the service end receives the pushing request of the payment information of the service system, the service end can agree that the instruction contained in the payment information is S001, and represents the payment information of the seat selected by the passenger, and the format of the payment information can be S001 and the message content; then the server sets a reserved bit RSV2 of the payment information to be 1 (representing that AES data encryption is needed to be carried out on the payment information) according to the security level of the payment information and carries out AES data encryption on the payment information, sets a reserved bit RSV1 of the payment information to be 1 (representing that data compression is needed to be carried out on the payment information) and carries out data compression on the payment information; then the server sets a reserved bit RSV3 of the payment information to be 1 according to the importance degree of the payment information (the representation requires the equipment end to confirm the receipt of the payment information); and finally, the service end pushes the payment information to the equipment end.
Step S502, the equipment receives the information, analyzes the reserved bit, decompresses and decrypts.
Taking the pushing of the payment information as an example, after receiving the payment information, the device end firstly analyzes to obtain reserved bits RSV1, RSV2 and RSV3, then decompresses the payment information according to RSV1, and decrypts the payment information according to RSV 2.
In step S503, the device sets a reserved bit, encrypts and compresses data, sets a mask key to be null, and uploads an information confirmation message.
Taking the pushing of the payment information as an example, the device side determines whether to upload a confirmation message representing that the payment information has been received to the server side according to the reserved bit RSV3 of the payment information. The confirmation instruction contained in the confirmation message may be appointed as C003, and the data format of the confirmation message may be "C003", and the device side receives the timestamp of the payment information "; then the equipment end sets the reserved bit RSV2 of the confirmation message as 1 (representing that AES data encryption is needed to be carried out on the confirmation message) according to the security level of the confirmation message and carries out AES data encryption on the confirmation message, sets the reserved bit RSV1 of the confirmation message as 1 (representing that data compression is needed to be carried out on the confirmation message) and carries out data compression on the confirmation message; then the equipment end sets the mask bit of the confirmation message to 0 and sets the mask key of the confirmation message to be null; and finally, the equipment end uploads the confirmation message to the server end and carries out service processing on the payment information, and the equipment end can play voice prompt information representing that the seat selected by the passenger has paid when receiving the payment information.
Similar to the payment information pushing, in the get-on/off reminding message pushing scene, the equipment end can play voice to remind passengers to get on/off when receiving the get-on/off reminding message.
Step S504, the server receives the information confirmation message, analyzes the reserved bit, decompresses, decrypts and processes the information confirmation message.
In the following previous example, the server receives the acknowledgement message, parses the reserved bits RSV1 and RSV2 of the acknowledgement message, decompresses the acknowledgement message according to RSV1, AES decrypts the acknowledgement message according to RSV2, and then performs corresponding processing according to command C003 to update the push information in the database to the acknowledged state.
For ease of understanding, the above-described long connection method for a vehicle end is exemplarily described herein below taking a specific interaction scenario as an example.
Referring to fig. 6, an application manager newly builds an application in the long connection management system, and after the device side installs a corresponding application, the application automatically registers the device at the vehicle side to the long connection management system. When entering the vehicle operation time, a driver starts the vehicle end equipment, the equipment end initiates connection to the long connection service of the service end, login information is sent, and the long connection service performs login verification by calling the long connection management system, so that login is completed. Then, the vehicle starts to move, the equipment starts to upload GPS data to the long connection service at regular time, the long connection service analyzes and forwards the GPS data to the long connection management system, the long connection management system completes business processing according to instructions in the GPS data, namely, the long connection management system returns the GPS data to the business system for processing, and the business system can store the vehicle position information. The service system checks whether the vehicle approaches a station or not by using GPS data, and calls the long connection management system to initiate the pushing of the get-on and get-off reminding message when the vehicle approaches the station, the long connection management system analyzes and forwards the get-on and get-off reminding message to the long connection service, the long connection service pushes the get-on and get-off reminding message (such as S002, namely XX station is about to reach, XX of next station) packaged with the instruction to the equipment at the vehicle end, and the equipment end plays the get-on and get-off reminding after receiving the get-on and get-off reminding message. The long connection management system may also store application information, device information, and get-on/off reminding messages to a long connection management DB (i.e., a long connection management database).
The long connection method for the vehicle end in the interaction scene shown in fig. 6 has the following advantages: firstly, business logic and long connection logic are mutually isolated, iterative release of a business system can not influence a long connection management system and long connection service, and corresponding development cost is saved. Secondly, different applications are allowed to be installed on the same equipment end, the applications are isolated from each other and do not affect message pushing and data uploading, the equipment numbers registered by the applications on the same equipment end are the same, and the long connection logic can be further analyzed and optimized according to the different applications associated with the equipment numbers. And thirdly, the long connection service and the long connection management system are mutually isolated, and because the long connection service is relatively stable, the long connection management system can be additionally provided with a service instruction, and the service logic is closed in the long connection management system, the condition that the long connection is interrupted due to iterative release of the management system is reduced. Finally, the long connection management system manages all applications uniformly, and is convenient for the online and offline of the long connection of the applications.
For the long connection method for the vehicle end provided in the foregoing embodiment, the embodiment of the present invention further provides a long connection management system, as shown in fig. 7, where the system may include the following parts:
the application management module 701 is configured to manage an application provided to the device side for installation, and configure a callback address of the uploading data. When the server receives the data uploaded by the equipment, the callback address is called to transmit the data to the service system.
The device management module 702 is configured to manage a vehicle-end device on which an application is installed, and push a message to a device end.
The message management module 703 is configured to push the view of the message, whether the device side receives the view of the message, and re-push the message to the device side.
The long connection management system provided by the embodiment of the invention can configure different business system callback addresses according to different applications, so that the logic of uploading data and business logic are mutually isolated and are not mutually influenced, the application configuration takes effect immediately, the effectiveness is improved, the development cost is saved, and the business requirement is met.
After the vehicle starts, the equipment end continuously uploads the GPS data of the vehicle through long connection, and the service end pushes the GPS data of the vehicle to other vehicle end equipment of the vehicle team, so that the vehicle team can change shifts and adjust routes conveniently; based on the uploaded GPS data, when the service system discovers that the vehicle approaches a station, the service system also informs a long connection service end, and the service end pushes a get-on and get-off reminding message to the equipment end; when the equipment side uploads data to the service side, a custom instruction of data compression and comma separation is adopted, and reserved bits are used for informing whether the data is encrypted or not and removing a mask key. In the whole driving process, the equipment end and the service end are in bidirectional connection, and dynamically send heartbeat.
The relative steps, numerical expressions and numerical values of the components and steps set forth in these embodiments do not limit the scope of the present invention unless it is specifically stated otherwise.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a non-volatile computer readable storage medium executable by a processor. Based on this understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a usb disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
In the description of the present invention, it should be noted that the directions or positional relationships indicated by the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc. are based on the directions or positional relationships shown in the drawings, are merely for convenience of describing the present invention and simplifying the description, and do not indicate or imply that the devices or elements referred to must have a specific orientation, be configured and operated in a specific orientation, and thus should not be construed as limiting the present invention. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance.
Finally, it should be noted that: the above examples are only specific embodiments of the present invention, and are not intended to limit the scope of the present invention, but it should be understood by those skilled in the art that the present invention is not limited thereto, and that the present invention is described in detail with reference to the foregoing examples: any person skilled in the art may modify or easily conceive of the technical solution described in the foregoing embodiments, or perform equivalent substitution of some of the technical features, while remaining within the technical scope of the present disclosure; such modifications, changes or substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention, and are intended to be 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. A long connection method for a vehicle end, wherein the method is applied to a device end, and the method comprises:
Establishing TCP connection with a server, and sending a login frame containing login information to the server; the login information has a first preset format and comprises a login instruction, wherein a mask bit of a login frame is 0, and a mask key of the login frame is null; the server is used for establishing TCP connection with the equipment and receiving a login frame;
If a heartbeat Pong frame sent by the server side is received, acquiring vehicle positioning information of a vehicle corresponding to the equipment side, and uploading a positioning frame containing the vehicle positioning information to the server side; the vehicle positioning information has a second preset format and comprises a positioning instruction, wherein a mask bit of the positioning frame is 0, and a mask key of the positioning frame is null; the server side is further used for judging whether the equipment side is successfully logged in or not based on the login frame, and sending a heartbeat Pong frame to the equipment side when the equipment side is successfully logged in;
Receiving a reminding message which is pushed by the server and characterizes a vehicle adjacent station corresponding to the equipment; the server side is also used for recalling the vehicle positioning information contained in the positioning frame to the service system when the positioning frame is received, and pushing a reminding message to the equipment side when a first notification sent by the service system is received; the service system is used for storing vehicle positioning information and judging whether a vehicle corresponding to the equipment end approaches a station or not based on the vehicle positioning information and the pre-stored station positioning information; the service system is further used for sending a first notification to the service end when the vehicle corresponding to the equipment end approaches a station.
2. The method according to claim 1, wherein the method further comprises:
If the time interval between the current time and the last time of data interaction with the server exceeds a preset time interval threshold, sending a heartbeat Ping frame to the server so as to maintain TCP connection with the server; the server side is further configured to send a heartbeat Pong frame to the device side when a time interval between a current time and a time of a last data interaction with the device side exceeds a preset time interval threshold, so as to maintain TCP connection with the device side.
3. The method of claim 1, wherein after establishing the TCP connection with the server, the method further comprises:
receiving passenger payment information pushed by the server side; the service end is also used for pushing passenger payment information to the equipment end when receiving a second notification sent by the service system; and the service system is used for sending a second notification to the service terminal when the passenger pays successfully.
4. The method according to claim 1, wherein the method further comprises:
receiving vehicle positioning information pushed by the server; the service end is also used for calling the vehicle positioning information stored by the service system and pushing the vehicle positioning information to the equipment end when receiving a third notification sent by the service system; the service system is used for sending a third notification to the server according to a preset time step.
5. The method according to claim 1, wherein the method further comprises:
If a Close frame sent by the server is received, the TCP connection with the server is disconnected; and the server side is used for sending a Close frame to the equipment side when the login of the equipment side fails and disconnecting the TCP connection with the equipment side.
6. A long connection method for a vehicle end, wherein the method is applied to a service end, and the method comprises:
establishing TCP connection with a device end, and receiving a login frame which is sent by the device end and contains login information; the login information has a first preset format and comprises a login instruction, wherein a mask bit of a login frame is 0, and a mask key of the login frame is null; the equipment end is used for establishing TCP connection with the server end and sending a login frame to the server end;
Judging whether the equipment end is successfully logged in or not based on the login frame, and if the equipment end is successfully logged in, sending a heartbeat Pong frame to the equipment end;
If the positioning frame uploaded by the equipment end is received, the vehicle positioning information contained in the positioning frame is recalled to a service system; the positioning frame comprises vehicle positioning information of a vehicle corresponding to the equipment end, the vehicle positioning information has a second preset format and comprises a positioning instruction, a mask bit of the positioning frame is 0, and a mask key of the positioning frame is null; the equipment end is also used for acquiring vehicle positioning information of a vehicle corresponding to the equipment end when receiving the heartbeat Pong frame, and uploading the positioning frame to the server end; the service system is used for storing vehicle positioning information and judging whether a vehicle corresponding to the equipment end approaches a station or not based on the vehicle positioning information and the pre-stored station positioning information;
if a first notification sent by the service system is received, pushing a reminding message to the equipment end; the service system is further used for sending a first notification to the service end when the vehicle corresponding to the equipment end approaches a station.
7. The method of claim 6, wherein the method further comprises:
If the time interval between the current time and the last time of data interaction with the equipment end exceeds a preset time interval threshold, sending a heartbeat Pong frame to the equipment end so as to maintain TCP connection with the equipment end; the device side is further configured to send a heartbeat Ping frame to the server side when a time interval between a current time and a time of last data interaction with the server side exceeds a preset time interval threshold, so as to maintain TCP connection with the server side.
8. The method of claim 6, wherein after establishing the TCP connection with the device, the method further comprises:
If a second notification sent by the service system is received, pushing passenger payment information to the equipment end; the equipment end is also used for receiving passenger payment information pushed by the equipment end; and the service system is used for sending a second notification to the service terminal when the passenger pays successfully.
9. The method of claim 6, wherein the method further comprises:
If a third notification sent by the service system is received, calling the vehicle positioning information stored by the service system and pushing the vehicle positioning information to the equipment end; the equipment end is also used for receiving the vehicle positioning information pushed by the server end; the service system is used for sending a third notification to the server according to a preset time step.
10. The method of claim 6, wherein the method further comprises:
If the login of the equipment end fails, sending a Close frame to the equipment end, and disconnecting the TCP connection with the equipment end; the equipment end is also used for disconnecting the TCP connection with the server end when receiving the Close frame sent by the server end.
CN202410811723.3A 2024-06-21 2024-06-21 Long connection method for vehicle end Pending CN118677964A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410811723.3A CN118677964A (en) 2024-06-21 2024-06-21 Long connection method for vehicle end

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410811723.3A CN118677964A (en) 2024-06-21 2024-06-21 Long connection method for vehicle end

Publications (1)

Publication Number Publication Date
CN118677964A true CN118677964A (en) 2024-09-20

Family

ID=92728544

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410811723.3A Pending CN118677964A (en) 2024-06-21 2024-06-21 Long connection method for vehicle end

Country Status (1)

Country Link
CN (1) CN118677964A (en)

Similar Documents

Publication Publication Date Title
EP1559291B1 (en) Handling location services independently from the cellular communication system
TWI555354B (en) Reporting terminal capabilities for supporting short message service
US8823767B2 (en) Delivery of short messages
EP2740250B1 (en) Method and apparatus for high performance low latency real time notification delivery
CN111065120B (en) Method, device and medium for enhancing cellular network uplink ECN mechanism
US9154911B2 (en) Selective delivery of presence messages for wireless communication devices
US20080160906A1 (en) Discrete media transfer progress status indication
US20130040669A1 (en) System and method for delivering messages while roaming
US8744500B2 (en) Method and apparatus for managing push service
US8385251B2 (en) Data communication control apparatus, data communication system, data communication method, and computer-readable storage medium recording data communication program
JP2003111136A (en) Communication system, gateway, data relaying method, program, and recording medium
US7720788B2 (en) System and method for implementing a wireless access protocol push by establishing connection-oriented signaling channel for transmitting session initiation request
CN118677964A (en) Long connection method for vehicle end
US20190082499A1 (en) Communication system, relaying apparatus, control method, and program
CN114143729B (en) Apparatus, method and computer readable storage medium for data transceiving with IoT devices
US12048031B2 (en) Unicast connection establishment method and apparatus, and storage medium
JP2015023558A (en) Method and device for accessing broadcast distribution information
WO2022001665A1 (en) Communication method for vehicle-mounted device, vehicle-mounted device, storage medium, and electronic apparatus
CN102377825B (en) System and method for uploading message
JP3730228B2 (en) Protocol conversion apparatus and protocol conversion method
EP3836657B1 (en) Method for nextgen mission critical networks to determine location of tetra network devices
EP1587281A1 (en) System and Method for Implementing a Wireless Access Protocol Push
KR20040000203A (en) Contents conversion method for terminal dependent messaging service on wireless internet
EP4362420A1 (en) Multimedia message transmission method and apparatus
WO2022041923A1 (en) Network slice connection method, terminal, and computer-readable storage medium

Legal Events

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