Method and system for persistent interconnection of vehicle machine and mobile phone based on long connection
By adopting long connection and Nacos heartbeat detection mechanisms in the car computer system, the convenience of on-board application control and multi-person interaction problems are solved, real-time synchronization and automatic reconnection between mobile phones and car computers are realized, and user experience and system stability are improved sex.
Patent Information
- Application Number
- CN202411176395.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-26
- Publication Date
- 2024-11-01
AI Technical Summary
In the existing car-machine system, the control of on-board applications mainly relies on the touchpad or remote control. The rear user is inconvenient to operate, the connection is frequently disconnected, and the simultaneous interaction of multiple people is not possible, which increases costs and usage restrictions.
Adopt the persistent interconnection method of car-computer mobile phones based on long connections, establish and monitor long connections through cloud servers, realize real-time data synchronization between mobile phones and car-computer and command forwarding, optimize network communication using TCP/IP and WebSocket protocols, and combine Nacos heartbeat detection. Mechanism ensures connection stability and automatic reconnection.
It realizes the mobile phone direct operation of the car computer APP, millisecond response, supports multiple people's simultaneous connection and automatic reconnection function, ensures command accuracy and information synchronization, and improves user operation convenience and interactive experience.
Smart Images

Figure CN118890413A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of intelligent vehicle machine technology, and in particular to a method and system for persistent interconnection between a vehicle machine and a mobile phone based on a long connection. Background Art
[0002] With the rise of electric vehicles, large-screen displays have become standard for car use. As the "third space", car computers also carry many social and entertainment functions, especially when people are singing karaoke in the car and are unable to move around in large movements.
[0003] Currently, the main way to control the car is by installing a touchpad or remote control on the car. However, not all cars have touchpads. When using it, it is inconvenient for users in the back seat to operate. Even if they use a mobile phone to operate, the connection will be frequently disconnected and they need to reconnect each time. Or they can control it by remote control, which increases the storage cost. At the same time, in most cases, only one person can control it at a time, and multiple people cannot interact.
[0004] Therefore, there is an urgent need for an intelligent interconnection system that allows users to control in-vehicle applications through their mobile phones. Whether the user is sitting in the front seat, in the back seat, or outside the car, they can control the car APP through the mobile phone app. Summary of the invention
[0005] The purpose of the present invention is to solve the shortcomings existing in the above-mentioned prior art, and to provide a method and system for persistent interconnection between a car computer and a mobile phone based on a long connection, which is applied to the linkage between the car-mounted APP and the mobile phone. When the APP is turned on, it can be connected to the cloud and exchange data. At the same time, the mini program can be connected to the cloud and exchange data. Through the cloud mediation, the mobile phone can directly operate the car computer APP, which can be executed very quickly, with a response of milliseconds. The user will not feel any delay, and multiple people (mobile phones) can be connected to the car computer at the same time to realize multi-person interaction.
[0006] On the one hand, the method for persistent interconnection between a vehicle and a mobile phone based on a long connection includes the following steps:
[0007] S1: The mobile terminal initiates a request, and the cloud server establishes a persistent connection. At the same time, the cloud server establishes a heartbeat detection task to monitor the real-time connection status of the persistent connection;
[0008] S2: The cloud server synchronizes the data of the vehicle terminal and the mobile terminal in real time through the long connection, and forwards commands of the mobile terminal and the vehicle terminal to synchronize the two terminals;
[0009] S3: The cloud server parses the command sent by the mobile terminal and transmits it to the vehicle terminal, and finally transmits the feedback information to the mobile terminal through the cloud server for display.
[0010] Furthermore, in step S1, the request content initiated includes vehicle-side APP device information, vehicle-side APP session information, mobile-side connection set, identifier, forwarding information and instruction, and instruction type;
[0011] The long connection includes a business layer and a protocol layer. The business layer completes tasks including sending and receiving commands, multi-terminal access, network diagnosis and connection maintenance. The protocol layer optimizes network communication by combining the TCP / IP protocol and TLS1.3. At the same time, the WebSocket protocol for full-duplex communication on a single TCP connection is used to exchange data between the cloud server and the mobile terminal and the vehicle terminal.
[0012] Furthermore, the tasks completed by the business layer specifically include the following steps:
[0013] S11: the mobile terminal initiates a long connection request, the cloud server establishes long connections with the mobile terminal and the vehicle terminal respectively, and the long connection is kept alive within a relatively long life cycle;
[0014] S12: After the connection is successful, the cloud server establishes the heartbeat detection task to monitor the connection status of the mobile terminal. At the same time, the mobile terminal and the vehicle terminal display the content fed back to each other through the long connection;
[0015] S13: If the cloud server detects that the mobile terminal is disconnected through the heartbeat detection task, the cloud server notifies the vehicle terminal and displays disconnection information, then the cloud server retains the heartbeat detection task, automatically reconnects with the mobile terminal, waits until the heartbeat detection task detects that the connection with the mobile terminal is reestablished, notifies the vehicle terminal to display reconnection success information, and continues to receive instructions;
[0016] If it is detected that both the mobile terminal and the vehicle terminal are disconnected, the heartbeat detection task is terminated and the long connection is cleared.
[0017] Furthermore, before step S13, the cloud server determines whether the connection is available or active through a heartbeat detection task before forwarding a command each time, wherein:
[0018] The heartbeat detection task adopts the Nacos heartbeat mechanism. The mobile terminal and the vehicle terminal periodically send heartbeat signals to Nacos to indicate their survival status. If Nacos does not receive the heartbeat signal from the mobile terminal or the vehicle terminal within the heartbeat interval, Nacos marks the terminal as unavailable.
[0019] The heartbeat signal is configured through the REST API of Nacos, and the timeout and interval of the heartbeat are adjusted by configuring parameters to meet the needs of different scenarios.
[0020] Preferably, the Nacos heartbeat mechanism specifically includes the following steps:
[0021] S21: Start the Nacos client and register the instance service. If the instance is valid for a short period of time, add a delayed heartbeat scheduled task BeatTask;
[0022] S22: Encapsulate the heartbeat information into a thread, put it into the BeatTask task thread pool, and send a heartbeat request to the Nacos server after a specified delay time;
[0023] S23: The Nacos server parses the heartbeat request parameters of the client, constructs a client heartbeat information object according to the request parameters, obtains the information of the service instance from the registry, and if the service instance information does not exist, constructs a service instance according to the heartbeat request parameters and registers the service instance in the registry of the Nacos client;
[0024] S24: The Nacos server constructs a client heartbeat processor object to encapsulate the heartbeat information of the Nacos client service instance, puts the client heartbeat processor into a thread pool for heartbeat processing, and updates the last heartbeat time of the service instance to the current system time;
[0025] S25: The Nacos server sends a request to the service instance in an active detection manner at a specified period, and determines the inventory status of the service instance according to the response information.
[0026] More preferably, one of the long connections corresponds to one of the vehicle terminals and one or more of the mobile devices. If there are multiple long connections, the long connections are managed according to the identifier in the request content to ensure that the commands and information are accurate.
[0027] Furthermore, step S3 specifically includes:
[0028] S31: After the mobile terminal and the vehicle terminal are synchronized, the cloud server binds the mobile terminal and the vehicle terminal;
[0029] S32: the cloud server sends the vehicle-side APP data to the mobile terminal, and the mobile terminal displays the vehicle-side APP information;
[0030] S33: the mobile terminal sends a command to the cloud server, and the cloud server parses the command and sends it to the vehicle terminal for execution;
[0031] S34: The cloud server updates the vehicle-side APP information according to the information fed back by the vehicle-side, and sends it to the mobile terminal for display.
[0032] Furthermore, the cloud server acts as a relay to directly operate the vehicle terminal through the mobile terminal, thereby achieving long-distance operation and millisecond-level response.
[0033] On the other hand, a car-mobile phone persistent interconnection system based on long connection is provided, including:
[0034] A connection initiation module is used for initiating a request from a mobile terminal, and for the cloud server to establish a long connection. At the same time, the cloud server establishes a heartbeat detection task to monitor the real-time connection status of the long connection;
[0035] A state management module, used for the cloud server to synchronize the data of the vehicle terminal and the mobile terminal in real time through the long connection, and forward the commands of the mobile terminal and the vehicle terminal to synchronize the two terminals;
[0036] The business module is used for the cloud server to parse the command sent by the mobile terminal and pass it to the vehicle terminal, and finally transmit the feedback information to the mobile terminal through the cloud server for display.
[0037] Furthermore, the system further comprises:
[0038] A long connection management module, the long connection management module includes a business layer and a protocol layer. The business layer completes tasks including sending and receiving commands, multi-terminal access, network diagnosis and connection maintenance. The protocol layer optimizes network communication by combining the TCP / IP protocol and TLS1.3, and exchanges data between the cloud server and the mobile terminal and the vehicle terminal by using the WebSocket protocol for full-duplex communication on a single TCP connection;
[0039] The heartbeat detection module adopts the Nacos heartbeat mechanism. The mobile terminal and the vehicle terminal periodically send heartbeat signals to Nacos to indicate their survival status. If Nacos does not receive the heartbeat signal from the mobile terminal or the vehicle terminal within the heartbeat interval, Nacos marks the terminal as unavailable.
[0040] Compared with the prior art, the present invention has the following beneficial effects:
[0041] (1) The present invention allows the mobile phone to directly operate the vehicle computer APP through the cloud mediation. The mobile phone and the vehicle computer are respectively connected to the cloud and exchange data, with millisecond-level response, and the user will not feel the delay. At the same time, remote operation is possible;
[0042] (2) The present invention can connect to multiple mobile terminals and the vehicle computer at the same time to achieve multi-person interaction;
[0043] (3) The present invention establishes a persistent connection. If one end is disconnected and then the program is entered, the program will automatically reconnect as long as the persistent connection exists. At the same time, the program will be managed according to the identifier to ensure that commands and information will not go wrong.
[0044] (4) The present invention designs a heartbeat detection task, which is used to determine whether the connection is available or active before forwarding each command, and prompts the user. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] The accompanying drawings are used to provide further understanding of the present invention and constitute a part of the specification. They are used to explain the present invention together with the embodiments of the present invention and do not constitute a limitation of the present invention.
[0046] In the attached picture:
[0047] Figure 1 This is a flow chart of a method for persistently interconnecting a vehicle machine and a mobile phone based on a long connection according to the present invention;
[0048] Figure 2 A mobile terminal initiated request content instance table of the present invention;
[0049] Figure 3 This is a structural block diagram of a long connection client of the present invention;
[0050] Figure 4 This is a heartbeat detection task flow chart of the present invention;
[0051] Figure 5 A Nacos detection source code logic flow chart of the present invention;
[0052] Figure 6 The present invention provides a block diagram of a vehicle-mobile phone persistent interconnection system based on a long connection. DETAILED DESCRIPTION
[0053] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0054] Those skilled in the art will appreciate that, unless otherwise stated, the singular forms "a", "an", "said" and "the" used herein may also include plural forms. It should be further understood that the term "comprising" used in the specification of the present invention refers to the presence of the features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof.
[0055] The specific implementation of the present invention is described below with reference to the accompanying drawings and embodiments.
[0056] Example 1
[0057] like Figure 1 As shown, this embodiment first provides a method for persistent interconnection between a vehicle and a mobile phone based on a long connection, including the following steps:
[0058] S1: The mobile terminal initiates a request, and the cloud server establishes a persistent connection. At the same time, the cloud server establishes a heartbeat detection task to monitor the real-time connection status of the persistent connection;
[0059] S2: The cloud server synchronizes the data of the vehicle terminal and the mobile terminal in real time through the long connection, and forwards commands of the mobile terminal and the vehicle terminal to synchronize the two terminals;
[0060] S3: The cloud server parses the command sent by the mobile terminal and transmits it to the vehicle terminal, and finally transmits the feedback information to the mobile terminal through the cloud server for display.
[0061] Among them, Figure 2 As shown in the table, in step S1, the request content initiated includes the vehicle-side APP device information, the vehicle-side APP session information, the mobile terminal connection set, identifier, forwarding information and instructions, and instruction type. The field name and type of each content in the system are as follows Figure 2 shown.
[0062] In this embodiment, the identifier is a long connection identity flag, and the instruction type is used to distinguish between upstream and downstream instructions.
[0063] Preferably, Figure 3 As shown, the long connection includes a business layer and a protocol layer. The business layer completes tasks including sending and receiving commands, multi-terminal access, network diagnosis and connection maintenance. The protocol layer optimizes network communication by combining the TCP / IP protocol and TLS1.3, and at the same time uses the WebSocket protocol for full-duplex communication on a single TCP connection to exchange data between the cloud server and the mobile terminal and the vehicle terminal.
[0064] This embodiment implements the automatic reconnection function through a persistent connection. If the mobile terminal program is killed or exited, it can be automatically reconnected by reopening it.
[0065] Among them, the tasks completed by the business layer are as follows: Figure 4 As shown, the specific steps include:
[0066] S11: the mobile terminal initiates a long connection request, the cloud server establishes long connections with the mobile terminal and the vehicle terminal respectively, and the long connection is kept alive within a relatively long life cycle;
[0067] S12: After the connection is successful, the cloud server establishes the heartbeat detection task to monitor the connection status of the mobile terminal. At the same time, the mobile terminal and the vehicle terminal display the content fed back to each other through the long connection;
[0068] S13: If the cloud server detects that the mobile terminal is disconnected through the heartbeat detection task, the cloud server notifies the vehicle terminal and displays disconnection information, then the cloud server retains the heartbeat detection task, automatically reconnects with the mobile terminal, waits until the heartbeat detection task detects that the connection with the mobile terminal is reestablished, notifies the vehicle terminal to display reconnection success information, and continues to receive instructions;
[0069] If it is detected that both the mobile terminal and the vehicle terminal are disconnected, the heartbeat detection task is terminated and the long connection is cleared.
[0070] Among them, in this embodiment, one long connection corresponds to one vehicle terminal and one or more mobile devices. If there are multiple long connections, the long connection is managed according to the identifier in the request content to ensure the accuracy of commands and information.
[0071] Before step S13, the cloud server determines whether the connection is available or active through a heartbeat detection task before forwarding each command, wherein:
[0072] The heartbeat detection task adopts the Nacos heartbeat mechanism. The mobile terminal and the vehicle terminal periodically send heartbeat signals to Nacos to indicate their survival status. If Nacos does not receive the heartbeat signal from the mobile terminal or the vehicle terminal within the heartbeat interval, Nacos marks the terminal as unavailable.
[0073] The heartbeat signal is configured through the REST API of Nacos, and the timeout and interval of the heartbeat are adjusted by configuring parameters to meet the needs of different scenarios.
[0074] Among them, the Nacos heartbeat mechanism is as follows Figure 5 As shown, the specific steps include:
[0075] S21: Start the Nacos client and register the instance service through namingService.registration. If the instance is valid for a short period of time, add a delayed heartbeat scheduled task BeatTask;
[0076] S22: Encapsulate the heartbeat information into a thread through beatReactor.addBeat I nfo, put it into the BeatTask task thread pool, and send a heartbeat request to the Nacos server after a specified delay (5 seconds by default);
[0077] S23: The Nacos server parses the heartbeat request parameters of the client through instanceController.beat, builds a client heartbeat information object according to the request parameters, obtains the service instance information from the registry through serviceManager.requestInstance, and if the service instance information does not exist, builds a service instance according to the heartbeat request parameters and registers the service instance in the registry of the Nacos client;
[0078] S24: The Nacos server encapsulates the heartbeat information of the Nacos client service instance by constructing a client heartbeat processor object through Service.processClientBeat, puts the client heartbeat processor into a thread pool for heartbeat processing, and updates the last heartbeat time of the service instance to the current system time through Instance.setLastBeat(System.currentTimeM i llis());
[0079] S25: The Nacos server sends a request to the service instance in an active detection manner at a specified period, and determines the inventory status of the service instance according to the response information.
[0080] Furthermore, if Figure 1 As shown, step S3 specifically includes:
[0081] S31: After the mobile terminal and the vehicle terminal are synchronized, the cloud server binds the mobile terminal and the vehicle terminal;
[0082] S32: the cloud server sends the vehicle-side APP data to the mobile terminal, and the mobile terminal displays the vehicle-side APP information;
[0083] S33: the mobile terminal sends a command to the cloud server, and the cloud server parses the command and sends it to the vehicle terminal for execution;
[0084] S34: The cloud server updates the vehicle-side APP information according to the information fed back by the vehicle-side, and sends it to the mobile terminal for display.
[0085] Specifically, the cloud server acts as a relay to directly operate the vehicle terminal through the mobile terminal, thereby achieving long-distance operation and millisecond-level response.
[0086] Specifically, in this embodiment, Nacos is an open source dynamic service discovery, configuration and service management platform, which provides functions such as service registration, service discovery, configuration management, service management, etc. In Nacos, the heartbeat mechanism is used to detect the health status of service instances.
[0087] In this embodiment, when the APP is turned on, it can be connected to the cloud and exchange data, and the mobile terminal can be connected to the cloud and exchange data. Through the cloud mediation, the mobile phone can directly operate the vehicle APP.
[0088] In summary, it can be executed very quickly, with millisecond-level response, and users will not feel any delay. At the same time, multiple people (mobile phones) can be connected to the car computer at the same time to achieve multi-person interaction, and can be operated remotely, even when it is inconvenient to touch the car computer screen. It improves the convenience of users operating APP in and out of the car, allowing users to interact well while entertaining in the car.
[0089] Example 2
[0090] like Figure 6 As shown, this embodiment provides a car-mobile phone persistent interconnection system based on a long connection, including:
[0091] A connection initiation module is used for initiating a request from a mobile terminal, and for the cloud server to establish a long connection. At the same time, the cloud server establishes a heartbeat detection task to monitor the real-time connection status of the long connection;
[0092] A state management module, used for the cloud server to synchronize the data of the vehicle terminal and the mobile terminal in real time through the long connection, and forward the commands of the mobile terminal and the vehicle terminal to synchronize the two terminals;
[0093] The business module is used for the cloud server to parse the command sent by the mobile terminal and pass it to the vehicle terminal, and finally transmit the feedback information to the mobile terminal through the cloud server for display.
[0094] Furthermore, the system further comprises:
[0095] A long connection management module, the long connection management module includes a business layer and a protocol layer. The business layer completes tasks including sending and receiving commands, multi-terminal access, network diagnosis and connection maintenance. The protocol layer optimizes network communication by combining the TCP / IP protocol and TLS1.3, and exchanges data between the cloud server and the mobile terminal and the vehicle terminal by using the WebSocket protocol for full-duplex communication on a single TCP connection;
[0096] The heartbeat detection module adopts the Nacos heartbeat mechanism. The mobile terminal and the vehicle terminal periodically send heartbeat signals to Nacos to indicate their survival status. If Nacos does not receive the heartbeat signal from the mobile terminal or the vehicle terminal within the heartbeat interval, Nacos marks the terminal as unavailable.
[0097] Finally, it should be noted that the above is only a preferred embodiment of the present invention, and the protection scope of the present invention is not limited to the above embodiments. All technical solutions under the concept of the present invention belong to the protection scope of the present invention. It should be pointed out that for ordinary technicians in this technical field, some improvements and modifications without departing from the principle of the present invention should also be regarded as the protection scope of the present invention.
[0098] The technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above-described embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
Claims
1. A method for persistent interconnection between car and mobile phone based on long connection. It is characterized in that The steps include: S1: The mobile terminal initiates a request, and the cloud server establishes a persistent connection. At the same time, the cloud server establishes a heartbeat detection task to monitor the real-time connection status of the persistent connection; S2: The cloud server synchronizes the data of the vehicle terminal and the mobile terminal in real time through the long connection, and forwards commands of the mobile terminal and the vehicle terminal to synchronize the two terminals; S3: The cloud server parses the command sent by the mobile terminal and transmits it to the vehicle terminal, and finally transmits the feedback information to the mobile terminal through the cloud server for display.
2. According to the method for persistent interconnection between a vehicle and a mobile phone based on a long connection according to claim 1, It is characterized in that In step S1, the request content initiated includes vehicle-side APP device information, vehicle-side APP session information, mobile-side connection set, identifier, forwarding information and instructions, and instruction type; The long connection includes a business layer and a protocol layer. The business layer completes tasks including sending and receiving commands, multi-terminal access, network diagnosis and connection maintenance. The protocol layer optimizes network communication by combining the TCP / IP protocol and TLS1.
3. At the same time, the WebSocket protocol for full-duplex communication on a single TCP connection is used to exchange data between the cloud server and the mobile terminal and the vehicle terminal.
3. According to the method for persistent interconnection between a vehicle and a mobile phone based on a long connection according to claim 2, It is characterized in that The tasks completed by the business layer specifically include the following steps: S11: the mobile terminal initiates a long connection request, the cloud server establishes long connections with the mobile terminal and the vehicle terminal respectively, and the long connection is kept alive within a relatively long life cycle; S12: After the connection is successful, the cloud server establishes the heartbeat detection task to monitor the connection status of the mobile terminal. At the same time, the mobile terminal and the vehicle terminal display the content fed back to each other through the long connection; S13: If the cloud server detects that the mobile terminal is disconnected through the heartbeat detection task, the cloud server notifies the vehicle terminal and displays disconnection information, then the cloud server retains the heartbeat detection task, automatically reconnects with the mobile terminal, waits until the heartbeat detection task detects that the connection with the mobile terminal is reestablished, notifies the vehicle terminal to display reconnection success information, and continues to receive instructions; If it is detected that both the mobile terminal and the vehicle terminal are disconnected, the heartbeat detection task is terminated and the long connection is cleared.
4. According to the method for persistent interconnection between a vehicle and a mobile phone based on a long connection according to claim 3, It is characterized in that Before step S13, the cloud server determines whether the connection is available or active through a heartbeat detection task before forwarding each command, wherein: The heartbeat detection task adopts the Nacos heartbeat mechanism. The mobile terminal and the vehicle terminal periodically send heartbeat signals to Nacos to indicate their survival status. If Nacos does not receive the heartbeat signal from the mobile terminal or the vehicle terminal within the heartbeat interval, Nacos marks the terminal as unavailable. The heartbeat signal is configured through the REST API of Nacos, and the timeout and interval of the heartbeat are adjusted by configuring parameters to meet the needs of different scenarios.
5. According to the method for persistent interconnection between vehicle and mobile phone based on long connection in claim 4, It is characterized in that The Nacos heartbeat mechanism specifically includes the following steps: S21: Start the Nacos client and register the instance service. If the instance is valid for a short period of time, add a delayed heartbeat scheduled task BeatTask; S22: Encapsulate the heartbeat information into a thread, put it into the BeatTask task thread pool, and send a heartbeat request to the Nacos server after a specified delay time; S23: The Nacos server parses the heartbeat request parameters of the client, constructs a client heartbeat information object according to the request parameters, obtains the information of the service instance from the registry, and if the service instance information does not exist, constructs a service instance according to the heartbeat request parameters and registers the service instance in the registry of the Nacos client; S24: The Nacos server constructs a client heartbeat processor object to encapsulate the heartbeat information of the Nacos client service instance, puts the client heartbeat processor into a thread pool for heartbeat processing, and updates the last heartbeat time of the service instance to the current system time; S25: The Nacos server sends a request to the service instance in an active detection manner at a specified period, and determines the inventory status of the service instance according to the response information.
6. According to the method for persistent interconnection between a vehicle and a mobile phone based on a long connection as claimed in claim 3, It is characterized in that One of the long connections corresponds to one of the vehicle terminals and one or more of the mobile devices. If there are multiple long connections, the long connections are managed according to the identifier in the request content to ensure that the commands and information are accurate.
7. According to the method for persistent interconnection between a vehicle and a mobile phone based on a long connection in claim 1, It is characterized in that Step S3 specifically includes: S31: After the mobile terminal and the vehicle terminal are synchronized, the cloud server binds the mobile terminal and the vehicle terminal; S32: the cloud server sends the vehicle-side APP data to the mobile terminal, and the mobile terminal displays the vehicle-side APP information; S33: the mobile terminal sends a command to the cloud server, and the cloud server parses the command and sends it to the vehicle terminal for execution; S34: The cloud server updates the vehicle-side APP information according to the information fed back by the vehicle-side, and sends it to the mobile terminal for display.
8. According to the method for persistent interconnection between vehicle and mobile phone based on long connection in claim 1, It is characterized in that The cloud server acts as a relay to directly operate the vehicle terminal through the mobile terminal, thereby achieving long-distance operation and millisecond-level response.
9. A car-mobile phone persistent interconnection system based on long connection, It is characterized in that include: A connection initiation module is used for initiating a request from a mobile terminal, and for the cloud server to establish a long connection. At the same time, the cloud server establishes a heartbeat detection task to monitor the real-time connection status of the long connection; A state management module, used for the cloud server to synchronize the data of the vehicle terminal and the mobile terminal in real time through the long connection, and forward the commands of the mobile terminal and the vehicle terminal to synchronize the two terminals; The business module is used for the cloud server to parse the command sent by the mobile terminal and pass it to the vehicle terminal, and finally transmit the feedback information to the mobile terminal through the cloud server for display.
10. The vehicle-machine and mobile phone persistent interconnection system based on long connection according to claim 9, It is characterized in that The system further comprises: A long connection management module, the long connection management module includes a business layer and a protocol layer. The business layer completes tasks including sending and receiving commands, multi-terminal access, network diagnosis and connection maintenance. The protocol layer optimizes network communication by combining the TCP / IP protocol and TLS1.3, and exchanges data between the cloud server and the mobile terminal and the vehicle terminal by using the WebSocket protocol for full-duplex communication on a single TCP connection; The heartbeat detection module adopts the Nacos heartbeat mechanism. The mobile terminal and the vehicle terminal periodically send heartbeat signals to Nacos to indicate their survival status. If Nacos does not receive the heartbeat signal from the mobile terminal or the vehicle terminal within the heartbeat interval, Nacos marks the terminal as unavailable.
