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

CN110708283A - Method and device for processing abnormal connection between vehicle and terminal, vehicle and storage medium - Google Patents

Method and device for processing abnormal connection between vehicle and terminal, vehicle and storage medium Download PDF

Info

Publication number
CN110708283A
CN110708283A CN201910810234.5A CN201910810234A CN110708283A CN 110708283 A CN110708283 A CN 110708283A CN 201910810234 A CN201910810234 A CN 201910810234A CN 110708283 A CN110708283 A CN 110708283A
Authority
CN
China
Prior art keywords
terminal
vehicle
connection
duration
sending
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
CN201910810234.5A
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.)
FAW Group Corp
Original Assignee
FAW Group Corp
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 FAW Group Corp filed Critical FAW Group Corp
Priority to CN201910810234.5A priority Critical patent/CN110708283A/en
Publication of CN110708283A publication Critical patent/CN110708283A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/143Termination or inactivation of sessions, e.g. event-controlled end of session
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/12Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/54Presence management, e.g. monitoring or registration for receipt of user log-on information, or the connection status of the users
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
    • H04L69/161Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields
    • H04L69/162Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields involving adaptations of sockets based mechanisms

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Health & Medical Sciences (AREA)
  • Computing Systems (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The invention discloses a method and a device for processing abnormal connection between a vehicle and a terminal, the vehicle and a storage medium, wherein the method comprises the following steps: and when the first detection response fed back by the terminal is received and/or the overtime length is determined to exceed the second preset time length, the connection between the vehicle and the terminal is terminated. According to the detection response fed back by the terminal and the dual determination mode of judging whether the overtime duration without data transmission exceeds the threshold value, when the connection between the vehicle and the terminal is abnormal, the vehicle end automatically executes the termination of the connection between the vehicle and the terminal so as to reestablish the connection between the terminal and the vehicle, the vehicle end does not need to be restarted by user intervention, the user operation is saved, and therefore the user experience is improved.

Description

Method and device for processing abnormal connection between vehicle and terminal, vehicle and storage medium
Technical Field
The embodiment of the invention relates to the technical field of communication, in particular to a method and a device for processing abnormal connection between a vehicle and a terminal, the vehicle and a storage medium.
Background
With the development of technology, the configuration of vehicles is higher and higher. At present, a vehicle can support a terminal to control related functions of the vehicle in a mode of connecting with a Wi-Fi hot spot of a vehicle machine, such as control of lifting of a vehicle window, temperature adjustment and automatic driving. The method comprises the steps that socket communication based on a Transmission Control Protocol (TCP) is established between a terminal and a vehicle end of a vehicle, and communication between the terminal and the vehicle end is achieved. In order to realize convenience, a blocking type receiving and sending function is adopted in TCP-based socket communication at the vehicle end. Because the real-time requirement of the communication between the terminal and the vehicle end is high, a long connection is established between the terminal and the vehicle end. In the communication process between the vehicle terminal and the terminal, the terminal is disconnected abnormally, for example, a Wi-Fi hotspot is closed abnormally, and a terminal program is crashed. In this case, the receiving and transmitting function of the vehicle end is always blocked and cannot return due to the fact that data cannot be received and transmitted, so that the communication program of the vehicle end is blocked, and the terminal cannot be connected with the vehicle end any more.
At present, the vehicle end can be restarted to establish connection between the terminal and the vehicle end again.
However, the above method is cumbersome to operate and the user experience is poor.
Disclosure of Invention
The invention provides a method and a device for processing abnormal connection between a vehicle and a terminal, the vehicle and a storage medium, and aims to solve the technical problems that the conventional method for processing the abnormal connection between the vehicle and the terminal is complex in operation and poor in user experience.
In a first aspect, an embodiment of the present invention provides a method for processing an abnormal connection between a vehicle and a terminal, including:
when determining that the communication with the terminal is not carried out within a first preset time, sending a detection message to the terminal;
determining whether the overtime duration of the transceiving function which does not carry out data transmission exceeds a second preset duration or not;
and when a first detection response fed back by the terminal is received and/or the overtime length is determined to exceed the second preset time length, terminating the connection between the vehicle and the terminal.
In the above method, after the sending the probe packet to the terminal, the method further includes:
when a second detection response fed back by the terminal is received, resetting the keep-alive timer to enable the keep-alive timer to count again; and the maximum timing time length of the keep-alive timer is the first preset time length.
In the above method, after the sending the probe packet to the terminal, the method further includes:
when the detection response fed back by the terminal is not received within a preset third time, retransmitting the detection message to the terminal, and repeating the step until the detection response fed back by the terminal is received or the total number of times of sending the detection message is equal to the preset number of times, stopping sending;
when a first detection response fed back by the terminal is received, the vehicle is terminated to be connected with the terminal;
resetting the keep-alive timer when receiving a second detection response fed back by the terminal;
and when the total times of sending the detection messages are equal to the preset times, terminating the connection between the vehicle and the terminal.
In the method as shown above, the terminating the connection of the vehicle with the terminal includes:
and after the transceiving function returns, terminating the connection between the vehicle and the terminal.
In the method as described above, the second preset duration includes a sending timeout duration and a receiving timeout duration;
the determining whether the timeout duration for which the transceiving function does not perform data transmission exceeds a second preset duration includes:
determining whether the timeout duration of the sending function exceeds the sending timeout duration;
determining whether the timeout duration of the receive function exceeds the receive timeout duration;
correspondingly, the determining that the timeout duration exceeds the second preset duration includes:
and when the overtime duration of the sending function is determined to exceed the sending overtime duration and/or the overtime duration of the receiving function is determined to exceed the receiving overtime duration, determining that the overtime duration exceeds the second preset duration.
In the method shown above, the connection is a long connection of TCP.
In a second aspect, an embodiment of the present invention provides a device for processing an abnormal connection between a vehicle and a terminal, including:
the sending module is used for sending a detection message to the terminal when the fact that the terminal is not communicated within a first preset time length is determined;
the determining module is used for determining whether the overtime duration of the transceiving function which does not carry out data transmission exceeds a second preset duration;
and the connection termination module is used for terminating the connection between the vehicle and the terminal when receiving the first detection response fed back by the terminal and/or determining that the timeout duration exceeds the second preset duration.
In the apparatus as described above, the apparatus further comprises:
the resetting module is used for resetting the keep-alive timer when receiving a second detection response fed back by the terminal so as to enable the keep-alive timer to count again; and the maximum timing time length of the keep-alive timer is the first preset time length.
In the apparatus as described above, the apparatus further comprises:
the retransmission module is used for retransmitting the detection message to the terminal when the detection response fed back by the terminal is not received within a preset third time length, and repeating the step until the detection response fed back by the terminal is received or the total number of times of sending the detection message is equal to the preset number of times, and stopping sending;
the connection termination module is further used for terminating the connection between the vehicle and the terminal when receiving a first detection response fed back by the terminal;
the reset module is further configured to reset the keep-alive timer when receiving a second detection response fed back by the terminal;
and the connection termination module is further used for terminating the connection between the vehicle and the terminal when the total times of sending the detection messages is equal to the preset times.
In the above-described apparatus, the connection termination module is specifically configured to:
and after the transceiving function returns, terminating the connection between the vehicle and the terminal.
In the apparatus as described above, the second preset duration includes a sending timeout duration and a receiving timeout duration;
the determining module is specifically configured to:
determining whether the timeout duration of the sending function exceeds the sending timeout duration;
determining whether the timeout duration of the receive function exceeds the receive timeout duration;
correspondingly, the connection termination module is configured to determine that the timeout duration exceeds the second preset duration, and the connection termination module is specifically configured to:
and when the overtime duration of the sending function is determined to exceed the sending overtime duration and/or the overtime duration of the receiving function is determined to exceed the receiving overtime duration, determining that the overtime duration exceeds the second preset duration.
In the arrangement shown above, the connection is a long connection of TCP.
In a third aspect, an embodiment of the present invention further provides a vehicle, including:
one or more processors;
a memory for storing one or more programs;
when the one or more programs are executed by the one or more processors, the one or more processors implement the method for handling the vehicle-to-terminal connection abnormality as provided in the first aspect.
In a fourth aspect, the embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, which when executed by a processor, implements the method for handling the vehicle-to-terminal connection abnormality as provided in the first aspect.
The embodiment provides a method and a device for processing abnormal connection between a vehicle and a terminal, the vehicle and a storage medium, wherein the method comprises the following steps: and when the first detection response fed back by the terminal is received and/or the overtime length is determined to exceed the second preset time length, the connection between the vehicle and the terminal is terminated. According to the detection response fed back by the terminal and the dual determination mode of judging whether the overtime duration without data transmission exceeds the threshold value, when the connection between the vehicle and the terminal is abnormal, the vehicle end automatically executes the termination of the connection between the vehicle and the terminal so as to reestablish the connection between the terminal and the vehicle, the vehicle end does not need to be restarted by user intervention, the user operation is saved, and therefore the user experience is improved.
Drawings
FIG. 1 is a schematic diagram of a vehicle and terminal communication process;
FIG. 2 is a schematic flowchart of a first embodiment of a method for processing abnormal connection between a vehicle and a terminal according to the present invention;
FIG. 3 is a schematic flowchart of a second embodiment of a method for processing abnormal connection between a vehicle and a terminal according to the present invention;
FIG. 4 is a schematic structural diagram of a first embodiment of a device for processing abnormal connection between a vehicle and a terminal according to the present invention;
FIG. 5 is a schematic structural diagram of a second embodiment of a processing apparatus for processing abnormal connection between a vehicle and a terminal according to the present invention;
fig. 6 is a schematic structural diagram of a vehicle according to the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
At present, a vehicle can support a terminal to control related functions of the vehicle in a way of connecting with a Wi-Fi hotspot of a vehicle machine. The terminal may be a handheld device, a mobile terminal, a wearable device, a computing device, and various forms of User Equipment (UE). Illustratively, the terminal in this embodiment is a mobile phone. The vehicle end in this embodiment may be integrated into a central control host of the vehicle. The terminal and the vehicle end can communicate through a socket based on TCP, and communication between the terminal and the vehicle end is achieved. Since the terminal in this embodiment has a high real-time requirement for controlling the vehicle through the TCP connection, the connection established between the vehicle end and the terminal in this embodiment is a long connection of the TCP, because if a short connection of the TCP is used, frequent connection establishment and closing affects the processing speed and wastes resources.
Fig. 1 is a schematic diagram of a communication process between a vehicle and a terminal. As shown in fig. 1, in the present embodiment, the vehicle side corresponds to a server side, and the terminal corresponds to a client side. The method comprises the steps that a socket () function is called by a vehicle end to achieve socket creation, then a bind () function is called to achieve binding of a fixed network address and a fixed port number, then a listen () function is called to achieve monitoring, and when a connection request initiated by a terminal is monitored, an accept () function is called to achieve receiving connection. The terminal calls the socket () function to create the socket, and then calls the connect () function to request connection. After the terminal calls the connect () function, the terminal and the vehicle end are established through three-way handshake connection. Then, when the terminal needs to send data to the vehicle end, the sending function send () function is called to send the data, the vehicle end receives the data by calling the receiving function recv () function, when the vehicle end needs to send the data to the terminal, the sending function send () function is called to send the data, the terminal receives the data by calling the receiving function recv () function, and through the receiving and sending processes, data transmission between the terminal and the vehicle end is achieved. In order to achieve convenience, the receiving and sending functions at the vehicle end are all blocking functions, namely, the receiving function recv () function is always blocked until data is received, and the sending function send () function is always blocked until data is sent. In this process, if the terminal is abnormal, for example, the terminal program crashes, so that the terminal cannot send data to the vehicle end, the receiving function recv () function of the vehicle end is always blocked, that is, the terminal waits for the data and cannot return. Under the condition, the program at the vehicle end is always blocked at the node waiting for receiving the data, when the terminal returns to normal, the socket () function and the connect () function are called again to request connection, and because the program at the vehicle end cannot return to execute the call of the socket () function, the bind () function, the list () function and the accept (), the terminal cannot establish connection with the vehicle end any more. In order to establish connection between the terminal and the vehicle end again, the vehicle end can be restarted to forcibly disconnect the connection between the terminal and the vehicle end, so that the vehicle end starts to execute by calling the socket () function again from the beginning. However, the process of restarting the vehicle end is cumbersome to operate, and the user experience is poor.
The embodiment provides a method for processing abnormal connection between a vehicle and a terminal, which is implemented by sending a detection message to the terminal, and according to a detection response fed back by the terminal and a dual determination mode of judging whether the timeout duration without data transmission exceeds a threshold value, when the connection between the vehicle and the terminal is abnormal, terminating the connection between the vehicle and the terminal so as to reestablish the connection between the terminal and the vehicle.
Fig. 2 is a schematic flowchart of a first embodiment of a method for processing connection abnormality between a vehicle and a terminal according to the present invention. The embodiment is suitable for a scene that a user connects the vehicle through the terminal to operate the vehicle in the process of using the vehicle. The embodiment may be implemented by a processing device of the abnormal connection between the vehicle and the terminal, which may be implemented by software and/or hardware, and the processing device of the abnormal connection between the vehicle and the terminal may be integrated in a central control host of the vehicle. As shown in fig. 2, the method for processing abnormal connection between a vehicle and a terminal according to this embodiment includes the following steps:
step 201: and when determining that the communication with the terminal is not carried out within the first preset time, sending a detection message to the terminal.
Specifically, the vehicle in this embodiment may be a motor vehicle such as a car or a truck, or may be a non-motor vehicle such as an electric bicycle. The method for processing the abnormal connection between the vehicle and the terminal provided by the embodiment can be executed by the vehicle which can establish the connection with the terminal.
The embodiment can utilize a keep alive (KeepAlive) mechanism of the TCP to process the connection exception. The KeepAlive mechanism is as follows: if one connection has no action within a certain time, the server side can send a detection message to the client side.
When the detection message is sent at the vehicle end, the terminal has the following three different states:
first terminal state: the terminal crashes and has restarted. In this scenario, after receiving the probe message, the terminal feeds back a first probe response to the vehicle end. The first probe response is used for indicating the vehicle terminal to terminate the connection with the terminal.
Second terminal state: and the terminal normally operates. In this scenario, after receiving the probe message, the terminal feeds back a second probe response to the vehicle end. The second probe response is used to indicate that the keep-alive timer is reset. And after the vehicle end sends the detection message once, the keep-alive timer is reset after receiving a second detection response, and the detection message is sent again when the keep-alive timer reaches the maximum timing duration and the vehicle end still does not communicate with the terminal.
The third terminal state: the terminal is crashed and shut down, is restarted or normally operates, but cannot receive the detection message due to the network and the like. In such a scenario, the terminal cannot receive the detection message, and cannot feed back a detection response to the vehicle end. The vehicle end can retransmit the detection message to the terminal at the set transmission interval until the number of times of transmitting the detection message reaches the preset number of times, or after the terminal is restarted, the vehicle end receives a first detection response fed back by the terminal, or after the network is recovered, the terminal receives the detection message and feeds back a second detection response to the vehicle end, and the vehicle end receives the second detection response fed back by the terminal. And after the vehicle end receives the detection response, corresponding operation is carried out according to whether the detection response is the first detection response or the second detection response. And when the sending times of the detection message reach the preset times, terminating the connection between the vehicle and the terminal.
Before step 201, the SO _ KEEPALIVE socket option needs to be set to validate the KEEPALIVE mechanism.
1) By the following code:
setsockopt(sockfd_,SOL_SOCKET,SO_KEEPALIVE,(void*)&KeepAlive,sizeof(KeepAlive));
the KeepAlive mechanism is turned on. In order to validate the KeepAlive mechanism, the KeepAlive field in the code is set to a valid value, for example, to 1.
2) By the following code:
setsockopt(sockfd_,SOL_TCP,TCP_KEEPIDLE,(void*)&keepIdle,sizeof(keepIdle));
setting a first preset time length. The keepid field in the code may be set to a specific value of the first preset duration.
3) By the following code:
setsockopt(sockfd_,SOL_TCP,TCP_KEEPINTVL,(void*)&keepInterval,sizeof(keepInterval));
and setting the sending interval of the detection message. The keepcalval field in the code may be set to a specific value of the transmission interval. The transmission interval herein refers to a time interval for retransmitting the probe packet in the third terminal state.
4) By the following code:
setsockopt(sockfd_,SOL_TCP,TCP_KEEPCNT,(void*)&keepCount,sizeof(keepCount));
and setting the sending times of the detection message. The keepCount field in the code may be set as a specific value of the number of times of transmission.
After a KeepAlive mechanism is started, when a vehicle end, namely a processing device or a central control host with abnormal connection between a vehicle and a terminal, determines that communication with the terminal is not performed within a first preset time, a detection message is sent to the terminal.
Step 202: and determining whether the timeout duration of the transceiving function for not carrying out data transmission exceeds a second preset duration.
Specifically, the transceiving functions in the present embodiment refer to a receiving function and a transmitting function.
In a first implementation manner, the second preset duration includes a sending timeout duration and a receiving timeout duration. Step 202 specifically includes: determining whether the timeout duration of the send function exceeds the send timeout duration, and determining whether the timeout duration of the receive function exceeds the receive timeout duration.
In a second implementation manner, step 202 specifically includes: and determining whether the overtime duration of the sending function which does not carry out data transmission exceeds a second preset duration, and determining whether the overtime duration of the receiving function which does not carry out data transmission exceeds the second preset duration.
Before step 202, a socket option needs to be set to implement the transceive function timeout setting.
1) By the following code:
setsockopt(socket,SOL_SOCKET,SO_SNDTIMEO,(char*)&timeout,sizeof(struct timeval));
setting a transmission timeout duration. Wherein, the timeout field in the code may be set as the transmission timeout duration.
2) By the following code:
setsockopt(socket,SOL_SOCKET,SO_RCVTIMEO,(char*)&timeout,sizeof(struct timeval));
setting a reception timeout duration. Wherein, the timeout field in the code may be set as the reception timeout duration.
And if the sending timeout duration is the same as the receiving timeout duration, namely the sending timeout duration is the second preset duration, setting the timeout fields to specific values of the second preset duration.
It should be noted that there is no order relationship between step 201 and step 202, and these two steps may be executed concurrently or in any order.
Step 203: and when a first detection response fed back by the terminal is received and/or the timeout duration is determined to exceed a second preset duration, the connection between the vehicle and the terminal is terminated.
Specifically, the present embodiment may terminate the connection of the vehicle with the terminal based on the execution results of step 201 and step 202.
In one implementation manner, as long as the first detection response fed back by the terminal is received, and the timeout duration during which the transceiving function does not perform data transmission exceeds the second preset duration, when any one of the conditions is met, the vehicle end terminates the connection between the vehicle and the terminal.
In another implementation manner, when the first detection response fed back by the terminal is received and the timeout duration of the transceiving function without data transmission exceeds the second preset duration, and both conditions are met, the vehicle end terminates the connection between the vehicle and the terminal.
Based on the first implementation manner in step 202, the determining that the timeout period exceeds the second preset period in step 203 may specifically include: and when the overtime duration of the sending function is determined to exceed the sending overtime duration and/or the overtime duration of the receiving function is determined to exceed the receiving overtime duration, determining that the overtime duration exceeds a second preset duration. That is, in one implementation manner, as long as any one of the timeout duration of the sending function exceeds the sending timeout duration and the timeout duration of the receiving function exceeds the receiving timeout duration, the timeout duration is considered to exceed the second preset duration. In another implementation manner, when the timeout duration of the sending function exceeds the sending timeout duration and the timeout duration of the receiving function exceeds the receiving timeout duration, and both of them are satisfied, the timeout duration is considered to exceed the second preset duration.
The specific mode of terminating the connection between the vehicle and the terminal at the vehicle end is to terminate the connection between the vehicle and the terminal after the receiving and sending function returns.
In this embodiment, the connection between the vehicle and the terminal is a long connection of TCP.
The above process is illustrated below with a specific example:
after the terminal is connected with a Wi-Fi hotspot of the car machine, the automatic parking function can be controlled. The terminal and the vehicle terminal establish socket communication based on TCP and adopt long connection. After the connection is established, the terminal and the vehicle terminal can send data to the other side. And when the terminal controls the automatic parking, the vehicle can be flamed out after the parking according to the user experience requirement of the parking function. After the vehicle is shut down, the Wi-Fi hot spot is closed, so that the connection between the vehicle end and the terminal is disconnected. And the vehicle end executes the steps 201 to 202, and when a first detection response fed back by the terminal is received or the timeout duration is determined to exceed a second preset duration, the vehicle end terminates the connection between the vehicle and the terminal. In the process, the vehicle end is restarted without user intervention, so that user operation is saved, and user experience is improved.
The method for processing the abnormal connection between the vehicle and the terminal provided by the embodiment comprises the following steps: and when the first detection response fed back by the terminal is received and/or the overtime length is determined to exceed the second preset time length, the connection between the vehicle and the terminal is terminated. According to the detection response fed back by the terminal and the dual determination mode of judging whether the overtime duration without data transmission exceeds the threshold value, when the connection between the vehicle and the terminal is abnormal, the vehicle end automatically executes the termination of the connection between the vehicle and the terminal so as to reestablish the connection between the terminal and the vehicle, the vehicle end does not need to be restarted by user intervention, the user operation is saved, and therefore the user experience is improved.
Fig. 3 is a schematic flow chart of a second method for processing abnormal connection between a vehicle and a terminal according to an embodiment of the present invention. The embodiment describes a detailed implementation manner of feeding back the second probe response or not feeding back the probe response by the terminal on the basis of various alternatives given in the first embodiment of the method for processing the abnormal connection between the vehicle and the terminal. As shown in fig. 3, the method for processing abnormal connection between a vehicle and a terminal according to this embodiment includes the following steps:
step 301: and when determining that the communication with the terminal is not carried out within the first preset time, sending a detection message to the terminal.
Step 302: and determining whether the timeout duration of the transceiving function for not carrying out data transmission exceeds a second preset duration.
Step 303: and when a first detection response fed back by the terminal is received and/or the timeout duration is determined to exceed a second preset duration, the connection between the vehicle and the terminal is terminated.
The implementation processes and technical principles of step 301 and step 201, step 302 and step 202, and step 303 are similar, and are not described herein again.
Step 304: and when a second detection response fed back by the terminal is received, resetting the keep-alive timer so as to count the keep-alive timer again.
The maximum timing duration of the keep-alive timer is a first preset duration.
Specifically, in this embodiment, a keep-alive timer may be used to control the sending interval of the probe packet. And the terminal feeds back a second detection response, which indicates that the terminal operates normally and needs to count the keep-alive timer again.
Step 305: and when the detection response fed back by the terminal is not received within the preset third time, retransmitting the detection message to the terminal, and repeating the step until the detection response fed back by the terminal is received or the total times of sending the detection message is equal to the preset times, and stopping sending.
Step 306: and when the first detection response fed back by the terminal is received, the connection of the vehicle and the terminal is terminated.
Step 307: and resetting the keep-alive timer when receiving a second detection response fed back by the terminal.
Step 308: and when the total times of sending the detection messages are equal to the preset times, terminating the connection between the vehicle and the terminal.
In steps 305 to 308, when the terminal does not feed back the probe response, the vehicle end may retransmit the probe message to the terminal at a time interval of a third duration, and stop transmitting until the probe response is received or the total number of times of transmitting the probe message is equal to the preset number of times. And then, the vehicle end performs corresponding operation according to the type of the feedback detection response. Alternatively, the connection of the vehicle with the terminal is terminated.
It should be noted that the third preset time period may be shorter than the first preset time period, which is not limited in this embodiment. The third preset time duration in this embodiment is the sending interval of the detection packet in the embodiment shown in fig. 2.
According to the processing method for the abnormal connection between the vehicle and the terminal, different operations are performed when different detection responses fed back by the terminal are received, so that when the abnormal connection between the vehicle and the terminal is realized, the vehicle end automatically performs subsequent operations, the connection between the terminal and the vehicle is reestablished, and therefore the user experience is further improved.
Fig. 4 is a schematic structural diagram of a first embodiment of a device for processing connection abnormality between a vehicle and a terminal according to the present invention. As shown in fig. 4, the apparatus for processing an abnormal connection between a vehicle and a terminal according to the present embodiment includes: a sending module 41, a determining module 42 and a connection terminating module 43.
The sending module 41 is configured to send a probe packet to the terminal when it is determined that no communication is performed with the terminal within the first preset time duration.
And a determining module 42, configured to determine whether a timeout duration during which the transceiving function does not perform data transmission exceeds a second preset duration.
And a connection termination module 43, configured to terminate the connection between the vehicle and the terminal when the first probe response fed back by the terminal is received and/or the timeout duration is determined to exceed the second preset duration.
Optionally, the connection termination module 43 is specifically configured to: and after the transceiving function returns, terminating the connection between the vehicle and the terminal.
Optionally, the second preset duration includes a sending timeout duration and a receiving timeout duration. The determining module 42 is specifically configured to: determining whether the timeout duration of the sending function exceeds the sending timeout duration; it is determined whether the timeout period of the receive function exceeds the receive timeout period. Correspondingly, the connection terminating module 43 is configured to determine that the timeout duration exceeds the second preset duration, and the connection terminating module 43 is specifically configured to: and when the overtime duration of the sending function is determined to exceed the sending overtime duration and/or the overtime duration of the receiving function is determined to exceed the receiving overtime duration, determining that the overtime duration exceeds a second preset duration.
Optionally, the connection in this embodiment is a long connection of TCP.
The processing device for the abnormal connection between the vehicle and the terminal, provided by the embodiment of the invention, can execute the processing method for the abnormal connection between the vehicle and the terminal, provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.
Fig. 5 is a schematic structural diagram of a second embodiment of a processing device for processing connection abnormality between a vehicle and a terminal according to the present invention. The embodiment provides various alternatives on the basis of the embodiment of the processing device for the abnormal connection between the vehicle and the terminal, and further modules included in the processing device for the abnormal connection between the vehicle and the terminal are described in detail. As shown in fig. 5, the processing device for processing the abnormal connection between the vehicle and the terminal in the present embodiment further includes: a reset module 51 and a retransmission module 52.
And a resetting module 51, configured to reset the keep-alive timer when receiving the second detection response fed back by the terminal, so that the keep-alive timer is started again.
The maximum timing duration of the keep-alive timer is a first preset duration.
And a retransmission module 52, configured to retransmit the probe packet to the terminal when the probe response fed back by the terminal is not received within the preset third duration, and repeat this step until the probe response fed back by the terminal is received or the total number of times of sending the probe packet is equal to the preset number of times, and stop sending the probe packet.
In this embodiment, the connection termination module 43 is further configured to terminate the connection between the vehicle and the terminal when the first probe response fed back by the terminal is received.
The resetting module 51 is further configured to reset the keep-alive timer when receiving the second detection response fed back by the terminal.
And the connection termination module 43 is further configured to terminate the connection between the vehicle and the terminal when the total number of times of sending the detection message is equal to the preset number of times.
The processing device for the abnormal connection between the vehicle and the terminal, provided by the embodiment of the invention, can execute the second processing method for the abnormal connection between the vehicle and the terminal, and has the corresponding functional modules and beneficial effects of the execution method.
Fig. 6 is a schematic structural diagram of a vehicle according to the present invention. As shown in fig. 6, the vehicle includes a processor 70 and a memory 71. The number of processors 70 in the vehicle may be one or more, and one processor 70 is taken as an example in fig. 6; the processor 70 and memory 71 of the vehicle may be connected by a bus or other means, as exemplified by the bus connection in fig. 6.
The memory 71 is a computer-readable storage medium, and can be used for storing software programs, computer-executable programs, and modules, such as program instructions and modules corresponding to the processing method of the vehicle-to-terminal connection abnormality in the embodiment of the present invention (for example, the sending module 41, the determining module 42, and the connection terminating module 43 in the processing device of the vehicle-to-terminal connection abnormality). The processor 70 executes various functional applications and data processing of the vehicle by running software programs, instructions and modules stored in the memory 71, that is, implements the above-described processing method for the abnormal connection between the vehicle and the terminal.
The memory 71 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to the use of the vehicle, and the like. Further, the memory 71 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some embodiments, the memory 71 may further include memory located remotely from the processor 70, which may be connected to the vehicle over a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The present invention also provides a storage medium containing computer-executable instructions which, when executed by a computer processor, perform a method of handling vehicle-to-terminal connection anomalies, the method comprising:
when determining that the communication with the terminal is not carried out within a first preset time, sending a detection message to the terminal;
determining whether the overtime duration of the transceiving function which does not carry out data transmission exceeds a second preset duration or not;
and when a first detection response fed back by the terminal is received and/or the overtime length is determined to exceed the second preset time length, terminating the connection between the vehicle and the terminal.
Of course, the storage medium containing the computer-executable instructions provided by the embodiments of the present invention is not limited to the method operations described above, and may also perform related operations in the method for processing the vehicle-terminal connection abnormality provided by any embodiment of the present invention.
From the above description of the embodiments, it is obvious for those skilled in the art that the present invention can be implemented by software and necessary general hardware, and certainly, can also be implemented by hardware, but the former is a better embodiment in many cases. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which may be stored in a computer-readable storage medium, such as a floppy disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a FLASH Memory (FLASH), a hard disk or an optical disk of a computer, and includes several instructions for enabling a computer device (which may be a personal computer, a server, or a network device) to execute the methods according to the embodiments of the present invention.
It should be noted that, in the embodiment of the processing device for abnormal connection between the vehicle and the terminal, the included units and modules are only divided according to the functional logic, but are not limited to the above division, as long as the corresponding functions can be realized; in addition, specific names of the functional units are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present invention.
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (10)

1. A method for processing abnormal connection between a vehicle and a terminal is characterized by comprising the following steps:
when determining that the communication with the terminal is not carried out within a first preset time, sending a detection message to the terminal;
determining whether the overtime duration of the transceiving function which does not carry out data transmission exceeds a second preset duration or not;
and when a first detection response fed back by the terminal is received and/or the overtime length is determined to exceed the second preset time length, terminating the connection between the vehicle and the terminal.
2. The method of claim 1, wherein after sending the probe packet to the terminal, the method further comprises:
when a second detection response fed back by the terminal is received, resetting the keep-alive timer to enable the keep-alive timer to count again; and the maximum timing time length of the keep-alive timer is the first preset time length.
3. The method of claim 2, wherein after sending the probe packet to the terminal, the method further comprises:
when the detection response fed back by the terminal is not received within a preset third time, retransmitting the detection message to the terminal, and repeating the step until the detection response fed back by the terminal is received or the total number of times of sending the detection message is equal to the preset number of times, stopping sending;
when a first detection response fed back by the terminal is received, the vehicle is terminated to be connected with the terminal;
resetting the keep-alive timer when receiving a second detection response fed back by the terminal;
and when the total times of sending the detection messages are equal to the preset times, terminating the connection between the vehicle and the terminal.
4. The method of any of claims 1-3, wherein the terminating the vehicle connection with the terminal comprises:
and after the transceiving function returns, terminating the connection between the vehicle and the terminal.
5. The method according to any one of claims 1-3, wherein the second preset duration comprises a transmission timeout duration and a reception timeout duration;
the determining whether the timeout duration for which the transceiving function does not perform data transmission exceeds a second preset duration includes:
determining whether the timeout duration of the sending function exceeds the sending timeout duration;
determining whether the timeout duration of the receive function exceeds the receive timeout duration;
correspondingly, the determining that the timeout duration exceeds the second preset duration includes:
and when the overtime duration of the sending function is determined to exceed the sending overtime duration and/or the overtime duration of the receiving function is determined to exceed the receiving overtime duration, determining that the overtime duration exceeds the second preset duration.
6. A method according to any of claims 1-3, characterized in that said connection is a long connection of the transmission control protocol TCP.
7. A processing device for abnormal connection between a vehicle and a terminal is characterized by comprising:
the sending module is used for sending a detection message to the terminal when the fact that the terminal is not communicated within a first preset time length is determined;
the determining module is used for determining whether the overtime duration of the transceiving function which does not carry out data transmission exceeds a second preset duration;
and the connection termination module is used for terminating the connection between the vehicle and the terminal when receiving the first detection response fed back by the terminal and/or determining that the timeout duration exceeds the second preset duration.
8. The apparatus of claim 7, further comprising:
the resetting module is used for resetting the keep-alive timer when receiving a second detection response fed back by the terminal so as to enable the keep-alive timer to count again; and the maximum timing time length of the keep-alive timer is the first preset time length.
9. A vehicle, characterized in that the vehicle comprises:
one or more processors;
a memory for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement the method of handling vehicle-to-terminal connection anomalies of any one of claims 1-6.
10. A computer-readable storage medium on which a computer program is stored, characterized in that the program, when executed by a processor, implements a method of handling vehicle-to-terminal connection abnormality according to any one of claims 1 to 6.
CN201910810234.5A 2019-08-29 2019-08-29 Method and device for processing abnormal connection between vehicle and terminal, vehicle and storage medium Pending CN110708283A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910810234.5A CN110708283A (en) 2019-08-29 2019-08-29 Method and device for processing abnormal connection between vehicle and terminal, vehicle and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910810234.5A CN110708283A (en) 2019-08-29 2019-08-29 Method and device for processing abnormal connection between vehicle and terminal, vehicle and storage medium

Publications (1)

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

Family

ID=69194264

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910810234.5A Pending CN110708283A (en) 2019-08-29 2019-08-29 Method and device for processing abnormal connection between vehicle and terminal, vehicle and storage medium

Country Status (1)

Country Link
CN (1) CN110708283A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111510492A (en) * 2020-04-15 2020-08-07 矩阵元技术(深圳)有限公司 Data processing method, device, equipment and system for realizing disconnection reconnection
CN111860954A (en) * 2020-06-18 2020-10-30 上海钧正网络科技有限公司 Vehicle loss of contact prediction method and device, computer equipment and storage medium
CN113411371A (en) * 2020-11-12 2021-09-17 腾讯科技(深圳)有限公司 Communication method and device applied to vehicle, electronic equipment and vehicle
CN113452568A (en) * 2020-03-25 2021-09-28 上汽通用汽车有限公司 Vehicle communication method, communication system, vehicle, and storage medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102395119A (en) * 2011-11-15 2012-03-28 华为技术有限公司 Method for supporting permanent online of application client, system and apparatus thereof
CN102724770A (en) * 2012-05-09 2012-10-10 中国联合网络通信集团有限公司 Method, device and system for switching state of user equipment
CN103312766A (en) * 2011-11-15 2013-09-18 华为技术有限公司 Method, system and device for supporting permanent online of application client
CN106533845A (en) * 2016-12-27 2017-03-22 海尔优家智能科技(北京)有限公司 Long-connection state monitoring method and device
CN107333252A (en) * 2017-06-09 2017-11-07 中国联合网络通信集团有限公司 communication abnormality processing method, device and smart card terminal
US20180206169A1 (en) * 2017-01-17 2018-07-19 Guangdong Oppo Mobile Telecommunications Corp., Ltd. Method and device for calling in network congestion state
CN108900370A (en) * 2018-06-08 2018-11-27 努比亚技术有限公司 It is long to connect multiple overtime judgment method, device and computer readable storage medium
CN109327527A (en) * 2018-10-30 2019-02-12 北京摩拜科技有限公司 Control method for vehicle, server, client, vehicle and Vehicular system

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102395119A (en) * 2011-11-15 2012-03-28 华为技术有限公司 Method for supporting permanent online of application client, system and apparatus thereof
CN103312766A (en) * 2011-11-15 2013-09-18 华为技术有限公司 Method, system and device for supporting permanent online of application client
CN102724770A (en) * 2012-05-09 2012-10-10 中国联合网络通信集团有限公司 Method, device and system for switching state of user equipment
CN106533845A (en) * 2016-12-27 2017-03-22 海尔优家智能科技(北京)有限公司 Long-connection state monitoring method and device
US20180206169A1 (en) * 2017-01-17 2018-07-19 Guangdong Oppo Mobile Telecommunications Corp., Ltd. Method and device for calling in network congestion state
CN107333252A (en) * 2017-06-09 2017-11-07 中国联合网络通信集团有限公司 communication abnormality processing method, device and smart card terminal
CN108900370A (en) * 2018-06-08 2018-11-27 努比亚技术有限公司 It is long to connect multiple overtime judgment method, device and computer readable storage medium
CN109327527A (en) * 2018-10-30 2019-02-12 北京摩拜科技有限公司 Control method for vehicle, server, client, vehicle and Vehicular system

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113452568A (en) * 2020-03-25 2021-09-28 上汽通用汽车有限公司 Vehicle communication method, communication system, vehicle, and storage medium
CN111510492A (en) * 2020-04-15 2020-08-07 矩阵元技术(深圳)有限公司 Data processing method, device, equipment and system for realizing disconnection reconnection
CN111860954A (en) * 2020-06-18 2020-10-30 上海钧正网络科技有限公司 Vehicle loss of contact prediction method and device, computer equipment and storage medium
CN113411371A (en) * 2020-11-12 2021-09-17 腾讯科技(深圳)有限公司 Communication method and device applied to vehicle, electronic equipment and vehicle
CN113411371B (en) * 2020-11-12 2024-02-06 腾讯科技(深圳)有限公司 Communication method and device applied to vehicle, electronic equipment and vehicle

Similar Documents

Publication Publication Date Title
CN110708283A (en) Method and device for processing abnormal connection between vehicle and terminal, vehicle and storage medium
CN108023683B (en) Method, device, chip and terminal for sending message
EP3823411B1 (en) Control method for user equipment, and user equipment for mcg failure processing
EP1914939A1 (en) An method for the triggering failure detection of bidirectional forwarding detection
KR102229144B1 (en) Method for re-enabling data frame aggregation after bluetooth session
EP3123762B1 (en) Wlan access point which approves internet access only if quality of the radio link is sufficiently good
US10750499B2 (en) Method, device and system for controlling air interface resource
WO2013143342A1 (en) Home gateway, cloud server and method for communication therebetween
CN108234087B (en) Data transmission method and sending end
WO2015042911A1 (en) Paging method, network device and communication system
KR100889670B1 (en) Method for preventing tcp-based denial-of-service attacks on mobile devices
JP3872977B2 (en) Method, system, and packet data serving node for mobile IP registration of a mobile node
WO2016007050A1 (en) Multipath transmission control protocol
CN108124504B (en) TFO transmission method, proxy server and system
WO2012175024A1 (en) Method, system and device for realizing concurrency of wireless data transmission and short message transceiving
EP2536067B1 (en) Apparatus and method for implementing point to point protocol data service link-disconnect
CN103391636B (en) A kind of method strengthening the keep-alive of CAPWAP communication tunnel
CN110121215B (en) Data connection establishment method and device of 5G terminal and 5G terminal
CN114205405B (en) BFD message sending method and device, electronic equipment and storage medium
WO2014201771A1 (en) Method for releasing wireless link resource and user equipment
CN115397034A (en) Service request transmission method, device, equipment and medium
EP3991369B1 (en) Application control of providing application data to radio link
CN118784526A (en) Fault detection method, message transmission method, system and client
Liqing et al. TCP optimization implementation of a small embedded system
CN118120336A (en) Method and device for deleting block acknowledgement session, multi-link equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20200117