Communication method and device of vehicle-mounted equipment, electronic equipment and computer storage medium

By dynamically adjusting the communication mode of on-board equipment, using network status prediction and sensor data evaluation, the problems of poor communication stability, high cost and insufficient emergency communication capabilities of on-board equipment are solved, and stable communication and emergency information in various network environments are achieved. transfer.

CN119136171APending Publication Date: 2024-12-13NEUSOFT REACH AUTOMOBILE TECH (SHENYANG) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411310097.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-19
Publication Date
2024-12-13

AI Technical Summary

Technical Problem

The communication methods of existing vehicle-mounted equipment have poor communication stability when the network coverage is insufficient or the signal is unstable, and the cost is high and the emergency communication capabilities are insufficient, which affects the user experience and system reliability.

Method used

By obtaining current network parameters and using network status prediction models to predict future network conditions, dynamically adjusting communication mode, selecting MQTT protocol or SMS platform for communication, and adjusting communication mode based on sensor data to evaluate the severity of emergency events to ensure that in various networks Stable communication in the environment and have emergency communication capabilities.

Benefits of technology

It realizes stable communication of vehicle-mounted equipment in various network environments, reduces communication costs, and ensures timely transmission of emergency information in emergency situations, alleviates the problems of poor communication stability, high costs and insufficient emergency communication capabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119136171A_ABST
    Figure CN119136171A_ABST
Patent Text Reader

Abstract

The invention provides a communication method and device of vehicle-mounted equipment, electronic equipment and a computer storage medium, in the method, the vehicle-mounted equipment can dynamically select and seamlessly switch two communication modes of MQTT and short messages according to network parameters and sensor data, so that the vehicle-mounted equipment can stably communicate in various network environments, and the communication efficiency of the vehicle-mounted equipment is improved. The MQTT mode has the characteristics of low bandwidth consumption and strong real-time performance, greatly reduces the communication cost, has the emergency communication capability, and can ensure the timely transmission of emergency information when an emergency event occurs.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of vehicle networking, and in particular to a communication method, device, electronic equipment and computer storage medium for vehicle-mounted equipment. Background Art

[0002] In existing Internet of Vehicles technologies, TCP / IP protocol is usually used to use mobile data networks (such as 4G and 5G) to achieve communication between vehicle-mounted devices and servers. However, this method has problems such as insufficient network coverage and high communication costs in some cases. Especially in remote areas and high-speed mobile states, the signal stability and coverage of mobile data networks are limited, affecting the real-time communication and control of vehicle-mounted devices.

[0003] Although the existing Internet of Vehicles technology has solved the problem of information interaction between vehicles and the outside world to a certain extent, it still has the following technical defects and shortcomings:

[0004] Insufficient communication stability: In areas with insufficient network coverage or unstable signals, the existing communication methods based on mobile data networks cannot ensure real-time communication between vehicle-mounted devices and users, affecting user experience and system reliability.

[0005] High communication cost: The existing Internet of Vehicles communication methods mainly rely on mobile data networks, which have high communication costs, especially in the case of long-term and large-volume data transmission, which increases the cost of use for car owners;

[0006] Lack of emergency communication capabilities: In certain emergency situations (e.g., vehicle breakdown or accident), existing communication methods may not be able to send and receive important information in a timely manner, affecting the efficiency of emergency response.

[0007] In summary, the communication methods of traditional vehicle-mounted equipment have technical problems such as poor communication stability, high communication costs, and lack of emergency communication capabilities. Summary of the invention

[0008] In view of this, the purpose of the present invention is to provide a communication method, device, electronic device and computer storage medium for vehicle-mounted equipment to alleviate the technical problems of poor communication stability, high communication cost and lack of emergency communication capability of existing communication methods for vehicle-mounted equipment.

[0009] In a first aspect, an embodiment of the present invention provides a communication method of an in-vehicle device, which is applied to the in-vehicle device, and the method includes:

[0010] Acquire current network parameters, and use a network status prediction model to predict the network status of the current network parameters, to obtain the network status that the vehicle-mounted device will encounter at a preset time in the future and the target communication mode corresponding to the network status, wherein the target communication mode includes any one of the following: a communication mode of the MQTT protocol, a communication mode of the SMS platform;

[0011] When the future preset time is reached, communicating according to the target communication mode;

[0012] The target communication mode is dynamically adjusted based on continuously monitored current network parameters and sensor data.

[0013] Further, dynamically adjusting the target communication mode according to the continuously monitored current network parameters and sensor data includes:

[0014] Continuously monitoring the current network parameters, and comprehensively evaluating the current network parameters through a weighted scoring system to obtain a comprehensive score;

[0015] Acquiring the sensor data, and determining the type and severity of the emergency event based on the sensor data;

[0016] The target communication mode is dynamically adjusted according to the comprehensive score, the type of the emergency event and the severity.

[0017] Furthermore, before obtaining the current network parameters, the method further includes:

[0018] After the vehicle-mounted device is started, a connection is established with the MQTT server and the SMS platform;

[0019] The communication is performed according to the communication mode of the MQTT protocol.

[0020] Furthermore, dynamically adjusting the target communication mode according to the comprehensive score, the type of the emergency event and the severity includes:

[0021] Determining a first target communication mode according to the type and severity of the emergency event;

[0022] If the comprehensive score is greater than a preset score threshold, determining that the second target communication mode is the communication mode of the MQTT protocol;

[0023] If the comprehensive score is not greater than the preset score threshold, determining that the second target communication mode is the communication mode of the SMS platform;

[0024] If the first target communication mode is the same as the second target communication mode, taking the first target communication mode or the second target communication mode as the target communication mode;

[0025] If the first target communication mode is different from the second target communication mode, the communication mode of the SMS platform is used as the target communication mode.

[0026] Further, when the target communication mode is the communication mode of the MQTT protocol, the vehicle-mounted device communicates with the user device by sending an MQTT message, wherein the MQTT message includes: a message ID, a subject, and a message body;

[0027] When the target communication mode is the communication mode of the SMS platform, the vehicle-mounted device communicates with the user device by sending SMS, wherein the SMS is obtained by compressing and encrypting the JSON content obtained by encapsulating the MQTT message.

[0028] Furthermore, the method further comprises:

[0029] After sending the MQTT message, the vehicle-mounted device waits for a confirmation message from the MQTT server;

[0030] If the confirmation message is not received within the first preset time, resending the MQTT message, or communicating through the communication mode of the SMS platform;

[0031] After the vehicle-mounted device sends the text message, it waits for the confirmation text message replied by the user device;

[0032] If the confirmation message is not received within the second preset time, the message is resent.

[0033] Furthermore, the SMS encapsulation process includes:

[0034] Encapsulate the MQTT message to obtain the JSON content;

[0035] The instruction content in the JSON content is Huffman encoded, and other content in the JSON content except the instruction content is adaptively compressed to obtain the short message.

[0036] In a second aspect, an embodiment of the present invention further provides a communication device for an in-vehicle device, which is applied to the in-vehicle device, and the device includes:

[0037] A network status prediction unit, used to obtain current network parameters, and use a network status prediction model to predict the network status of the current network parameters, to obtain the network status that the vehicle-mounted device will encounter at a preset time in the future and a target communication mode corresponding to the network status, wherein the target communication mode includes any one of the following: a communication mode of the MQTT protocol, a communication mode of the SMS platform;

[0038] A communication unit, configured to communicate according to the target communication mode when the future preset time is reached;

[0039] A dynamic adjustment unit is used to dynamically adjust the target communication mode according to the current network parameters and sensor data that are continuously monitored.

[0040] In a third aspect, an embodiment of the present invention further provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of any one of the methods described in the first aspect when executing the computer program.

[0041] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores machine-executable instructions. When the machine-executable instructions are called and executed by a processor, the machine-executable instructions prompt the processor to execute any method described in the first aspect above.

[0042] In an embodiment of the present invention, a communication method for a vehicle-mounted device is provided, which is applied to the vehicle-mounted device, and the method includes: obtaining current network parameters, and using a network status prediction model to predict the network status of the current network parameters, and obtaining the network status that the vehicle-mounted device will encounter at a preset time in the future and the target communication mode corresponding to the network status, wherein the target communication mode includes any one of the following: a communication mode of the MQTT protocol, a communication mode of the SMS platform; when the preset time in the future is reached, communication is performed in accordance with the target communication mode; and the target communication mode is dynamically adjusted according to the current network parameters and sensor data that are continuously monitored. It can be seen from the above description that in the communication method for the vehicle-mounted device of the present invention, the vehicle-mounted device can dynamically select and seamlessly switch between the two communication modes of MQTT and SMS according to the network parameters and sensor data, ensuring that the vehicle-mounted device can communicate stably in various network environments. The MQTT mode has the characteristics of low bandwidth consumption and strong real-time performance, which greatly reduces the communication cost, and also has emergency communication capabilities. When an emergency event occurs, it can ensure that emergency information is delivered in a timely manner, alleviating the technical problems of poor communication stability, high communication cost, and lack of emergency communication capabilities in the communication method of traditional vehicle-mounted devices. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0044] Figure 1A flow chart of a communication method for a vehicle-mounted device provided by an embodiment of the present invention;

[0045] Figure 2 A schematic diagram of an MQTT message provided in an embodiment of the present invention;

[0046] Figure 3 A schematic diagram of a compressed short message provided by an embodiment of the present invention;

[0047] Figure 4 A schematic diagram of a communication device for an on-vehicle device provided by an embodiment of the present invention;

[0048] Figure 5 A schematic diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0049] The technical solution of the present invention will be clearly and completely described below in conjunction with the embodiments. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0050] The communication methods of traditional vehicle-mounted equipment have poor communication stability, high communication costs, and lack of emergency communication capabilities.

[0051] Based on this, in the communication method of the vehicle-mounted equipment of the present invention, the vehicle-mounted equipment can dynamically select and seamlessly switch between the two communication modes of MQTT and SMS according to network parameters and sensor data, ensuring that the vehicle-mounted equipment can communicate stably in various network environments. The MQTT mode has the characteristics of low bandwidth consumption and strong real-time performance, which greatly reduces the communication cost. In addition, it also has emergency communication capabilities, which can ensure the timely transmission of emergency information when an emergency occurs.

[0052] To facilitate understanding of this embodiment, a communication method for a vehicle-mounted device disclosed in an embodiment of the present invention is first introduced in detail.

[0053] Embodiment 1:

[0054] According to an embodiment of the present invention, an embodiment of a communication method for a vehicle-mounted device is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0055] Figure 1 is a flow chart of a communication method of a vehicle-mounted device according to an embodiment of the present invention. Figure 1As shown, the method comprises the following steps:

[0056] Step S102, obtaining current network parameters, and using a network status prediction model to predict the network status of the current network parameters, to obtain the network status that the vehicle-mounted device will encounter at a preset time in the future and the target communication mode corresponding to the network status, wherein the target communication mode includes any one of the following: a communication mode of the MQTT protocol, a communication mode of the SMS platform;

[0057] In the embodiment of the present invention, the communication method of the vehicle-mounted device can be applied to the vehicle-mounted device.

[0058] The above current network parameters may specifically include: signal strength, delay, and packet loss rate. The above network status prediction model may specifically be a decision tree model, which is pre-trained. The training and application process of the network status prediction model is introduced below:

[0059] Core idea: By introducing a decision tree model to analyze historical data on network conditions (i.e., training the model with historical data to improve the intelligence and predictability of transmission mode switching), future network conditions can be predicted, and the communication mode can be adjusted in advance to ensure the continuity and stability of communication.

[0060] Implementation:

[0061] 1. Data collection and preprocessing

[0062] step:

[0063] Data Collection:

[0064] Periodically (for example, every 5 seconds) collect network parameters such as network signal strength, delay, and packet loss rate.

[0065] Save this data as historical data for training and testing decision tree models.

[0066] Data preprocessing:

[0067] Clean data: handle missing values ​​and outliers to ensure data quality.

[0068] Data normalization: Normalize the network parameters to ensure that data of different scales have the same importance in the model.

[0069] Example:

[0070] Timestamp Signal strength (dBm) Delay (ms) Packet loss rate (%) 2024-01-01 00:00:05 -70 50 0.1 2024-01-01 00:00:10 -65 40 0.2 2024-01-01 00:00:15 -80 60 0.5

[0071] 2. Feature selection and label definition

[0072] step:

[0073] Feature Selection:

[0074] Network signal strength, latency, and packet loss rate are selected as input features of the model.

[0075] For example, feature vector: [signal strength, delay, packet loss rate]

[0076] Tag definition:

[0077] Define the communication mode (MQTT or SMS platform) as the output tag of the model.

[0078] The network parameters at each time point are labeled according to the threshold of the network score in the historical data (e.g., 75 points).

[0079] Tag example: If the score is higher than 75 points, the tag is "MQTT"; if the score is lower than 75 points, the tag is "SMS Platform".

[0080] Example:

[0081] Example of feature vector and label:

[0082] Timestamp Eigenvector Label 2024-01-01 00:00:05 [-70,50,0.1] MQTT 2024-01-01 00:00:10 [-65,40,0.2] MQTT 2024-01-01 00:00:15 [-80,60,0.5] SMS platform

[0083] 3. Decision tree model training

[0084] step:

[0085] Training dataset:

[0086] The training data set is constructed using the preprocessed historical network parameter data and the corresponding communication mode labels.

[0087] Model training:

[0088] The model is trained using a decision tree algorithm to learn the relationship between network parameters and communication patterns.

[0089] The decision tree splits the feature vector to find the decision path that can best distinguish different communication mode labels.

[0090] Algorithm flow:

[0091] Starting from the root node, select a feature to split and calculate the information gain of each split point.

[0092] Select the split point with the largest information gain to divide the dataset into sub-nodes.

[0093] Repeat the above process for each child node until the stopping condition is met (e.g., the leaf node purity is high, the maximum depth is reached, the data set is less than the minimum number of split samples, etc.).

[0094] 4. Real-time prediction and mode switching

[0095] step:

[0096] Real-time prediction:

[0097] The on-board equipment regularly collects the current network parameters to form a feature vector.

[0098] The feature vector is input into the decision tree model to predict the future network status and applicable target communication mode.

[0099] Mode switch:

[0100] According to the prediction results of the decision tree model, switch the target communication mode in advance to ensure the continuity and stability of communication.

[0101] If the prediction result is MQTT, continue to use the MQTT protocol for communication; if the prediction result is the SMS platform, switch to the SMS platform for communication.

[0102] Example:

[0103] Current network parameters: [Signal strength = -78, delay = 60, packet loss rate = 0.3]

[0104] Decision tree prediction results: SMS platform

[0105] The system switches to the SMS platform in advance to ensure the stability of data transmission.

[0106] The MQTT (Message Queuing Telemetry Transport) protocol is a lightweight message transmission protocol based on the publish / subscribe model, designed for device communication in low-bandwidth, unstable network environments. The MQTT protocol has the characteristics of high efficiency, low bandwidth consumption, and strong real-time performance, which is very suitable for communication needs in the Internet of Vehicles environment. At the same time, the SMS platform, as a traditional communication method, has the advantages of wide coverage and no reliance on the Internet. By combining the MQTT protocol with the SMS platform, intelligent communication between vehicle-mounted devices and user mobile phones can be achieved, providing users with a low-cost, high-reliability remote control method for vehicle-mounted devices.

[0107] Step S104, when the preset time in the future is reached, communication is performed according to the target communication mode;

[0108] Step S106, dynamically adjusting the target communication mode according to the continuously monitored current network parameters and sensor data.

[0109] Specifically, when continuously monitoring the current network parameters, the current network parameters are continuously monitored at a monitoring frequency, such as measuring the network signal strength, delay, and packet loss rate at fixed intervals (e.g., every 5 seconds). The process of dynamically adjusting the target communication mode is described in detail below.

[0110] In an embodiment of the present invention, a communication method for a vehicle-mounted device is provided, which is applied to the vehicle-mounted device, and the method includes: obtaining current network parameters, and using a network status prediction model to predict the network status of the current network parameters, and obtaining the network status that the vehicle-mounted device will encounter at a preset time in the future and the target communication mode corresponding to the network status, wherein the target communication mode includes any one of the following: a communication mode of the MQTT protocol, a communication mode of the SMS platform; when the preset time in the future is reached, communication is performed in accordance with the target communication mode; and the target communication mode is dynamically adjusted according to the current network parameters and sensor data that are continuously monitored. It can be seen from the above description that in the communication method for the vehicle-mounted device of the present invention, the vehicle-mounted device can dynamically select and seamlessly switch between the two communication modes of MQTT and SMS according to the network parameters and sensor data, ensuring that the vehicle-mounted device can communicate stably in various network environments. The MQTT mode has the characteristics of low bandwidth consumption and strong real-time performance, which greatly reduces the communication cost, and also has emergency communication capabilities. When an emergency event occurs, it can ensure that emergency information is delivered in a timely manner, alleviating the technical problems of poor communication stability, high communication cost, and lack of emergency communication capabilities in the communication method of traditional vehicle-mounted devices.

[0111] In an optional embodiment of the present invention, dynamically adjusting the target communication mode according to the continuously monitored current network parameters and sensor data specifically includes the following steps:

[0112] (1) Continuously monitor the current network parameters and conduct a comprehensive evaluation of the current network parameters through a weighted scoring system to obtain a comprehensive score;

[0113] Specifically, after obtaining the current network parameters, a weighted scoring system is used to comprehensively evaluate the current network parameters, for example, signal strength accounts for 50%, delay accounts for 30%, and packet loss rate accounts for 20%.

[0114] When implementing, a comprehensive scoring formula can be defined based on the given weights (signal strength accounts for 50%, delay accounts for 30%, and packet loss rate accounts for 20%), and assuming that signal strength, delay, and packet loss rate have corresponding quantitative indicators. First of all, it should be clear that signal strength is usually a higher value, the better, while delay and packet loss rate are the lower the better. Based on these prerequisites, a weighted scoring system can be constructed through the following steps:

[0115] Defining quantitative indicators

[0116] Signal Strength (SI): The value range is from 0 to 100, and the larger the value, the stronger the signal.

[0117] Latency: The unit is usually milliseconds (ms). The smaller the value, the lower the latency.

[0118] Packet Loss Rate: Usually expressed as a percentage. The smaller the value, the less packet loss.

[0119] Constructing a scoring formula

[0120] For negative indicators such as delay and packet loss rate, we need to convert them into positive indicators, that is, negate them. For example, if the maximum delay is L max , then the delayed score L′ can be expressed as:

[0121] Similarly, the packet loss rate P′ can be expressed as:

[0122] Here L max and P max They represent the maximum acceptable values ​​of delay and packet loss rate respectively, which depends on the requirements of the specific application scenario.

[0123] The comprehensive scoring formula is as follows:

[0124] Score=0.5×SI+0.3×L′+0.2×P′

[0125] Among them, SI directly adopts the value of signal strength; L′ and P′ are the values ​​converted according to the above methods respectively.

[0126] Advantages: The combination of weighted scoring system and machine learning model improves the accuracy and intelligence of network adaptation; dynamic priority adjustment predicts network status in advance to ensure the continuity and stability of communication.

[0127] (2) Obtain sensor data and determine the type and severity of the emergency event based on the sensor data;

[0128] (3) Dynamically adjust the target communication mode based on the comprehensive score, type and severity of the emergency event.

[0129] The specific steps include:

[0130] (31) Determine the primary target communication mode based on the type and severity of the emergency incident;

[0131] Specifically, the present invention designs an intelligent emergency communication priority processing algorithm to ensure timely transmission of emergency event information through multi-sensor fusion and event priority judgment.

[0132] Multi-sensor fusion:

[0133] Combine multiple sensor data (such as collision, fuel level, GPS, etc.) to comprehensively determine the type of emergency event.

[0134] Use sensor fusion algorithms (e.g., Kalman filtering) to improve event detection accuracy.

[0135] Event priority determination:

[0136] Set different priorities according to the type and severity of the emergency.

[0137] High-priority events are sent quickly through the SMS platform, while low-priority events are sent through the MQTT protocol.

[0138] advantage:

[0139] Multi-sensor fusion improves the accuracy and response speed of emergency event detection.

[0140] Event priority determination ensures that emergency information is delivered first and improves system reliability.

[0141] Example:

[0142] If a serious collision occurs, the system uses a multi-sensor fusion algorithm to determine that the severity of the collision is high and immediately sends emergency information via the SMS platform, including the vehicle's location and collision details.

[0143] The specific implementation process is:

[0144] 1. Multi-sensor fusion

[0145] 1.1 Sensor Data Collection

[0146] Crash sensor: monitors vehicle collision events.

[0147] Fuel sensor: monitors the vehicle's fuel level.

[0148] GPS module: obtain vehicle location information.

[0149] Other sensors: such as temperature sensors, smoke sensors, etc.

[0150] 1.2 Data Preprocessing

[0151] Perform preliminary cleaning and formatting of the data from each sensor.

[0152] Ensure data consistency and integrity.

[0153] 1.3 Kalman filter fusion

[0154] The Kalman filter algorithm is used to fuse the data from different sensors.

[0155] This helps reduce noise and improves the accuracy of event detection.

[0156] The specific steps include prediction, updating (measurement), correction and other links.

[0157] 2. Event priority determination

[0158] 2.1 Event Classification

[0159] Classify events into categories such as Urgent, Important, Normal, etc.

[0160] For example:

[0161] Emergency: serious traffic accident, fire, etc.

[0162] Important events: insufficient fuel, minor accidents, etc.

[0163] General events: daily maintenance reminders, etc.

[0164] 2.2 Setting priority rules

[0165] Establish prioritization rules based on incident type and severity.

[0166] For example:

[0167] Emergency: Highest priority.

[0168] Important incidents: Medium priority.

[0169] General events: lowest priority.

[0170] 2.3 Priority Processing Mechanism

[0171] High priority events: sent quickly via SMS platform.

[0172] Advantages: Good immediacy, ensuring that information is conveyed quickly.

[0173] Low priority events: sent via the MQTT protocol.

[0174] Advantages: Save bandwidth and suitable for non-real-time information transmission.

[0175] (32) If the comprehensive score is greater than the preset score threshold, determining that the second target communication mode is a communication mode of the MQTT protocol;

[0176] (33) If the comprehensive score is not greater than the preset score threshold, determining the second target communication mode as the communication mode of the SMS platform;

[0177] (34) if the first target communication mode is the same as the second target communication mode, taking the first target communication mode or the second target communication mode as the target communication mode;

[0178] (35) If the first target communication mode is different from the second target communication mode, the communication mode of the SMS platform is used as the target communication mode.

[0179] In an optional embodiment of the present invention, before obtaining the current network parameters, the method further includes the following steps:

[0180] (1) After the vehicle-mounted device is started, it establishes a connection with the MQTT server and SMS platform;

[0181] (2) Communicate according to the communication mode of the MQTT protocol.

[0182] Specifically, before executing the step of obtaining the current network parameters, the system needs to be initialized: specifically, MQTT connection: after the vehicle-mounted device is started, try to establish a connection with the MQTT server through the MQTT protocol; subscribe to relevant topics and prepare to receive control instructions and data.

[0183] At the same time, the SMS platform is initialized: the SMS platform connection is initialized to ensure that it can switch to the SMS transmission mode in time when the network is unstable. After the vehicle-mounted equipment is started, it first communicates according to the communication mode of the MQTT protocol, and then switches the communication mode according to the network parameters.

[0184] In an optional embodiment of the present invention, when the target communication mode is a communication mode of the MQTT protocol, the vehicle-mounted device communicates with the user device by sending an MQTT message, wherein the MQTT message includes: a message ID, a subject, and a message body;

[0185] When the target communication mode is the communication mode of the SMS platform, the vehicle-mounted device communicates with the user device by sending SMS messages, wherein the SMS messages are obtained by compressing and encrypting the JSON content obtained by encapsulating the MQTT message.

[0186] Specifically, the JSON content is compressed and encrypted to ensure data security and transmission efficiency.

[0187] In an optional embodiment of the present invention, the method further comprises the following steps:

[0188] (1) After the vehicle device sends the MQTT message, it waits for the confirmation message from the MQTT server;

[0189] (2) If no confirmation message is received within the first preset time, resend the MQTT message, or communicate through the communication mode of the SMS platform;

[0190] (3) After the vehicle-mounted device sends a text message, it waits for the user device to reply with a confirmation text message;

[0191] (4) If the confirmation SMS is not received within the second preset time, the SMS is resent.

[0192] Specifically, in order to ensure the reliability of communication, confirmation is required.

[0193] MQTT transmission and confirmation: Use the MQTT protocol to send messages and wait for the confirmation message (PUBACK) from the MQTT server; if the confirmation message is not received within the first preset time (for example, 3 seconds), resend the message or switch to the SMS platform.

[0194] SMS transmission and confirmation: Use the SMS platform to send SMS and wait for the confirmation SMS from the user's device; if the confirmation SMS is not received within a second preset time (e.g., 10 seconds), resend the SMS.

[0195] Algorithm flow: Use the MQTT protocol to send a message and start a timer to wait for PUBACK.

[0196] If the timer times out and PUBACK is not received, the message is resent and the timer is started again; if it is still not received, the SMS platform is switched.

[0197] Use the SMS platform to send a text message and start a timer to wait for the confirmation text message; if the timer times out and no confirmation text message is received, resend the text message.

[0198] In addition, the vehicle-mounted device and the user device need to maintain two-way data synchronization to ensure that the operation results and status information are updated in real time. According to the display and processing capabilities of the user device, the vehicle-mounted device intelligently adjusts the format and content of the feedback information.

[0199] Algorithm flow: After the vehicle-mounted device executes the user's command, it synchronizes the result to the user's device through the MQTT protocol or SMS platform; the user's device receives the synchronized data and updates the display status. If a synchronization conflict is detected, the latest data is retained first to resolve the conflict.

[0200] In an optional embodiment of the present invention, the SMS encapsulation process includes:

[0201] (1) Encapsulate the MQTT message and obtain the JSON content;

[0202] (2) Huffman encoding is performed on the instruction content in the JSON content, and other contents in the JSON content except the instruction content are adaptively compressed to obtain a short message.

[0203] Specifically, in order to further reduce the length of SMS content, the present invention designs a multi-layer compression and decoding algorithm, combining Huffman coding and adaptive compression to ensure data security and transmission efficiency.

[0204] The following is a detailed description of the algorithm steps and a practical application example.

[0205] 1. Multi-layer compression algorithm

[0206] Step 1: Encapsulate the MQTT message as JSON content

[0207] Purpose:

[0208] Convert MQTT messages into standardized JSON format for subsequent compression and transmission.

[0209] Implementation:

[0210] Encapsulate the various parts of the MQTT message (such as message ID, topic, message body, etc.) as JSON content. For example, the original MQTT message is Figure 2 shown.

[0211] Step 2: Huffman coding compression

[0212] Purpose:

[0213] Compress common command content and keywords to reduce the length of text messages.

[0214] Implementation:

[0215] Constructing the Huffman tree:

[0216] Collect common instruction contents and their occurrence frequencies, and construct a Huffman tree.

[0217] Each common instruction content and keyword is taken as a leaf node, and the frequency is taken as the weight.

[0218] Generate Huffman code:

[0219] Traverse the Huffman tree and generate a unique Huffman code for each instruction content.

[0220] Compressed Data:

[0221] Replace common command content and keywords in JSON content with Huffman codes.

[0222] Example:

[0223] Assume that common commands and keywords and their frequencies are as follows:

[0224] CMD:LOCK frequency 30%

[0225] CMD:UNLOCK frequency 20%

[0226] CMD:START frequency 20%

[0227] CMD:STOP frequency 10%

[0228] TEMP:HIGH frequency 10%

[0229] TEMP:LOW frequency 10%

[0230] Construct the Huffman tree and generate the encoding:

[0231] CMD:LOCK->0

[0232] CMD:UNLOCK->10

[0233] CMD:START->110

[0234] CMD:STOP->1110

[0235] TEMP:HIGH->11110

[0236] TEMP:LOW->11111

[0237] Step 3: Adaptive compression algorithm (e.g., LZW)

[0238] Purpose:

[0239] Further compress the data according to the characteristics of the SMS content.

[0240] Implementation:

[0241] Initialize the dictionary:

[0242] Initialize the LZW dictionary to contain all possible single-character strings.

[0243] Coding process:

[0244] Scan the input data stream and replace the longest matching string with the encoding in the dictionary.

[0245] If a new string combination is found, it is added to the dictionary.

[0246] Generate compressed data:

[0247] Compress the JSON content into a series of dictionary encodings.

[0248] Assume the initial dictionary is:

[0249] "->0

[0250] :->1

[0251] {->2

[0252] }->3

[0253] [->4

[0254] ]->5

[0255] ,->6

[0256] id->7

[0257] topic->8

[0258] vehicle->9

[0259] command->10

[0260] payload->11

[0261] commands->12

[0262] status->13

[0263] Active->14

[0264] 0->15

[0265] 110->16

[0266] 11110->17

[0267] Other characters as separate dictionary entries

[0268] Compression process:

[0269] Read {-> Output 2

[0270] Read "id"->output 07

[0271] Read:-> Output 1

[0272] Read "12345" -> Output 012345

[0273] Read, "topic"->output 6 08

[0274] Read:-> Output 1

[0275] Read "vehicle" -> output 09

[0276] Read, "command"->output 6 010

[0277] Read, "payload"->output 6 011

[0278] Read:-> Output 1

[0279] Read {-> Output 2

[0280] Read "commands"->output 012

[0281] Read:-> Output 1

[0282] Read ["0" -> Output 4 015

[0283] Read, "110" -> output 6 016

[0284] Read, "11110"-> output 6 017

[0285] Read],-> output 5 6

[0286] Read "status" -> output 013

[0287] Read:-> Output 1

[0288] Read "active" -> output 014

[0289] Read}->Output 3

[0290] Read}->Output 3

[0291] The final compression result is as follows Figure 3 shown.

[0292] Through the multi-layer SMS compression algorithm, the SMS content length is effectively reduced, and the data transmission efficiency and security are improved. Combined with Huffman coding and adaptive compression technology, the data compression rate is improved, and efficient multi-layer compression is achieved to ensure data integrity and accuracy.

[0293] In an optional embodiment of the present invention, the method further comprises the following steps:

[0294] After receiving the text message, the vehicle-mounted device uses the adaptive decoding algorithm and the Huffman decoding algorithm to parse the text message and obtain the data information therein.

[0295] Specifically, the multi-layer decoding algorithm: After the vehicle-mounted device receives the text message, it first uses the adaptive decoding algorithm to restore the data. Then it uses Huffman decoding to parse the original instructions. The multi-layer decoding algorithm ensures data integrity and accuracy.

[0296] The communication method of the vehicle-mounted device of the present invention has the following advantages:

[0297] Dual communication guarantee: through intelligent selection and seamless switching mechanism, it ensures that the vehicle equipment can communicate stably in various network environments;

[0298] Enhanced emergency communication capabilities: In emergency situations, emergency information can be sent through the SMS platform to ensure timely delivery of emergency information;

[0299] Improved communication stability: Intelligent network adaptation and dynamic switching mechanisms ensure reliable communication even in the case of network fluctuations and instability;

[0300] Enhanced real-time data transmission: The efficient and low-latency transmission of the MQTT protocol, combined with the reliability of the SMS platform, ensures that data can be transmitted in real time.

[0301] The main technical points of the present invention include:

[0302] Intelligent communication mode selection: Dynamically select MQTT protocol or SMS platform for communication based on real-time evaluation of network parameters (signal strength, delay, packet loss rate). Comprehensively consider multiple network parameters, use weighted scoring system to make decisions, and can quickly respond and switch when network conditions change to ensure communication stability;

[0303] Message encapsulation and compression encryption: Encapsulate MQTT messages into SMS content in JSON format, and compress and encrypt the JSON content to ensure data security and transmission efficiency. Combining data compression and encryption technology, the security and efficiency of data transmission are optimized, making it possible to transmit MQTT messages through the SMS platform;

[0304] Information transmission of emergency events: In emergency situations, encapsulated emergency information is sent through the SMS platform, which significantly improves the transmission reliability of emergency information.

[0305] Embodiment 2:

[0306] An embodiment of the present invention further provides a communication device for a vehicle-mounted device, which is mainly used to execute the communication method for the vehicle-mounted device provided in the first embodiment of the present invention. The communication device for the vehicle-mounted device provided in the embodiment of the present invention is specifically introduced below.

[0307] Figure 4 is a schematic diagram of a communication device of a vehicle-mounted device according to an embodiment of the present invention. Figure 4 As shown, the device includes: a network status prediction unit 10, a communication unit 20 and a dynamic adjustment unit 30, wherein:

[0308] A network status prediction unit is used to obtain current network parameters and use a network status prediction model to predict the network status of the current network parameters, so as to obtain the network status that the vehicle-mounted device will encounter at a preset time in the future and the target communication mode corresponding to the network status, wherein the target communication mode includes any one of the following: a communication mode of the MQTT protocol and a communication mode of the SMS platform;

[0309] A communication unit, used for communicating according to a target communication mode when a preset time in the future is reached;

[0310] A dynamic adjustment unit is used to dynamically adjust the target communication mode according to the current network parameters and sensor data that are continuously monitored.

[0311] In an embodiment of the present invention, a communication device for a vehicle-mounted device is provided, which is applied to the vehicle-mounted device, and the device includes: obtaining current network parameters, and using a network status prediction model to predict the network status of the current network parameters, and obtaining the network status that the vehicle-mounted device will encounter at a preset time in the future and the target communication mode corresponding to the network status, wherein the target communication mode includes any of the following: a communication mode of the MQTT protocol, a communication mode of the SMS platform; when the preset time in the future is reached, communication is performed in accordance with the target communication mode; and the target communication mode is dynamically adjusted according to the current network parameters and sensor data that are continuously monitored. It can be seen from the above description that in the communication device for the vehicle-mounted device of the present invention, the vehicle-mounted device can dynamically select and seamlessly switch between the two communication modes of MQTT and SMS according to the network parameters and sensor data, ensuring that the vehicle-mounted device can communicate stably in various network environments. The MQTT mode has the characteristics of low bandwidth consumption and strong real-time performance, which greatly reduces the communication cost, and also has emergency communication capabilities. When an emergency event occurs, it can ensure that emergency information is delivered in a timely manner, alleviating the technical problems of poor communication stability, high communication cost, and lack of emergency communication capabilities in the communication method of traditional vehicle-mounted devices.

[0312] Optionally, the dynamic adjustment unit is also used to: continuously monitor current network parameters, and comprehensively evaluate the current network parameters through a weighted scoring system to obtain a comprehensive score; obtain sensor data, and determine the type and severity of the emergency event based on the sensor data; dynamically adjust the target communication mode based on the comprehensive score, the type and severity of the emergency event.

[0313] Optionally, the device is also used to: establish a connection with an MQTT server and a text messaging platform after the vehicle-mounted device is started; and communicate in accordance with the communication mode of the MQTT protocol.

[0314] Optionally, the dynamic adjustment unit is also used to: determine the first target communication mode according to the type and severity of the emergency event; if the comprehensive score is greater than a preset scoring threshold, determine the second target communication mode as the communication mode of the MQTT protocol; if the comprehensive score is not greater than the preset scoring threshold, determine the second target communication mode as the communication mode of the SMS platform; if the first target communication mode is the same as the second target communication mode, use the first target communication mode or the second target communication mode as the target communication mode; if the first target communication mode is different from the second target communication mode, use the communication mode of the SMS platform as the target communication mode.

[0315] Optionally, when the target communication mode is the communication mode of the MQTT protocol, the vehicle-mounted device communicates with the user device by sending MQTT messages, wherein the MQTT messages include: message ID, subject and message body; when the target communication mode is the communication mode of the SMS platform, the vehicle-mounted device communicates with the user device by sending SMS messages, wherein the SMS messages are obtained by compressing and encrypting the JSON content encapsulated by the MQTT message.

[0316] Optionally, the device is also used for: after the vehicle-mounted device sends an MQTT message, waiting for the confirmation message replied by the MQTT server; if the confirmation message is not received within the first preset time, resending the MQTT message, or communicating through the communication mode of the SMS platform; after the vehicle-mounted device sends a text message, waiting for the confirmation text message replied by the user device; if the confirmation text message is not received within the second preset time, resending the text message.

[0317] Optionally, the device is also used to: encapsulate the MQTT message to obtain JSON content; perform Huffman encoding on the instruction content in the JSON content, and adaptively compress other content in the JSON content except the instruction content to obtain a text message.

[0318] Optionally, the device is also used for: after the vehicle-mounted device receives the text message, using an adaptive decoding algorithm and a Huffman decoding algorithm to parse the text message to obtain the data information therein.

[0319] The device provided in the embodiment of the present invention has the same implementation principle and technical effects as those of the aforementioned method embodiment. For the sake of brief description, for matters not mentioned in the device embodiment, reference may be made to the corresponding contents in the aforementioned method embodiment.

[0320] like Figure 5 As shown, an electronic device 600 provided in an embodiment of the present application includes: a processor 601, a memory 602 and a bus, wherein the memory 602 stores machine-readable instructions executable by the processor 601. When the electronic device is running, the processor 601 communicates with the memory 602 through the bus, and the processor 601 executes the machine-readable instructions to perform the steps of the communication method of the above-mentioned vehicle-mounted equipment.

[0321] Specifically, the above-mentioned memory 602 and processor 601 can be general-purpose memories and processors, which are not specifically limited here. When the processor 601 runs the computer program stored in the memory 602, it can execute the communication method of the above-mentioned vehicle-mounted device.

[0322] The processor 601 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 601. The above processor 601 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the embodiments of the present application can be directly embodied as a hardware decoding processor for execution, or a combination of hardware and software modules in the decoding processor for execution. The software module may be located in a storage medium mature in the art, such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 602, and the processor 601 reads the information in the memory 602 and completes the steps of the above method in combination with its hardware.

[0323] Corresponding to the communication method of the above-mentioned vehicle-mounted equipment, an embodiment of the present application also provides a computer-readable storage medium, which stores machine-executable instructions. When the computer-executable instructions are called and executed by the processor, the computer-executable instructions prompt the processor to execute the steps of the communication method of the above-mentioned vehicle-mounted equipment.

[0324] The communication device of the vehicle-mounted equipment provided in the embodiment of the present application can be specific hardware on the equipment or software or firmware installed on the equipment. The implementation principle and technical effects of the device provided in the embodiment of the present application are the same as those of the aforementioned method embodiment. For the sake of brief description, the parts not mentioned in the device embodiment can refer to the corresponding contents in the aforementioned method embodiment. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, devices and units described above can all refer to the corresponding processes in the aforementioned method embodiment, and will not be repeated here.

[0325] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.

[0326] For another example, the flowchart and block diagram in the accompanying drawings show the possible architecture, function and operation of the device, method and computer program product according to multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of the code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or the flowchart, and the combination of the boxes in the block diagram and / or the flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.

[0327] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0328] In addition, each functional unit in the embodiments provided in the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0329] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can essentially or partly contribute to the prior art or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including a number of instructions for an electronic device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the vehicle marking method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, and other media that can store program codes.

[0330] It should be noted that similar numbers and letters represent similar items in the following figures. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. In addition, the terms "first", "second", "third", etc. are only used to distinguish the description and are not to be understood as indicating or implying relative importance.

[0331] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present application, which are used to illustrate the technical solution of the present application, rather than to limit it. The protection scope of the present application is not limited thereto. Although the present application is described in detail with reference to the aforementioned embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solution recorded in the aforementioned embodiments within the technical scope disclosed in the present application, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solution deviate from the scope of the technical solution of the embodiment of the present application. They should all be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.

Claims

1. A communication method for a vehicle-mounted device, characterized in that: Applied to an in-vehicle device, the method comprises: Acquire current network parameters, and use a network status prediction model to predict the network status of the current network parameters, to obtain the network status that the vehicle-mounted device will encounter at a preset time in the future and the target communication mode corresponding to the network status, wherein the target communication mode includes any one of the following: a communication mode of the MQTT protocol, a communication mode of the SMS platform; When the future preset time is reached, communicating according to the target communication mode; The target communication mode is dynamically adjusted based on continuously monitored current network parameters and sensor data.

2. The method according to claim 1, characterized in that Dynamically adjusting the target communication mode based on continuously monitored current network parameters and sensor data, including: Continuously monitoring the current network parameters, and comprehensively evaluating the current network parameters through a weighted scoring system to obtain a comprehensive score; Acquiring the sensor data, and determining the type and severity of the emergency event based on the sensor data; The target communication mode is dynamically adjusted according to the comprehensive score, the type of the emergency event and the severity.

3. The method according to claim 1, characterized in that Before obtaining the current network parameters, the method further includes: After the vehicle-mounted device is started, a connection is established with the MQTT server and the SMS platform; The communication is performed according to the communication mode of the MQTT protocol.

4. The method according to claim 2, characterized in that: Dynamically adjusting the target communication mode according to the comprehensive score, the type of the emergency event and the severity, including: Determining a first target communication mode according to the type and severity of the emergency event; If the comprehensive score is greater than a preset score threshold, determining that the second target communication mode is the communication mode of the MQTT protocol; If the comprehensive score is not greater than the preset score threshold, determining that the second target communication mode is the communication mode of the SMS platform; If the first target communication mode is the same as the second target communication mode, taking the first target communication mode or the second target communication mode as the target communication mode; If the first target communication mode is different from the second target communication mode, the communication mode of the SMS platform is used as the target communication mode.

5. The method according to claim 1, characterized in that When the target communication mode is the communication mode of the MQTT protocol, the vehicle-mounted device communicates with the user device by sending an MQTT message, wherein the MQTT message includes: a message ID, a subject, and a message body; When the target communication mode is the communication mode of the SMS platform, the vehicle-mounted device communicates with the user device by sending SMS, wherein the SMS is obtained by compressing and encrypting the JSON content obtained by encapsulating the MQTT message.

6. The method according to claim 5, characterized in that The method further comprises: After sending the MQTT message, the vehicle-mounted device waits for a confirmation message from the MQTT server; If the confirmation message is not received within the first preset time, resending the MQTT message, or communicating through the communication mode of the SMS platform; After the vehicle-mounted device sends the text message, it waits for the confirmation text message replied by the user device; If the confirmation message is not received within the second preset time, the message is resent.

7. The method according to claim 5, characterized in that The SMS encapsulation process includes: Encapsulate the MQTT message to obtain the JSON content; The instruction content in the JSON content is Huffman encoded, and other content in the JSON content except the instruction content is adaptively compressed to obtain the short message.

8. A communication device for vehicle-mounted equipment, characterized in that: Applied to vehicle-mounted equipment, the device comprises: A network status prediction unit, used to obtain current network parameters, and use a network status prediction model to predict the network status of the current network parameters, to obtain the network status that the vehicle-mounted device will encounter at a preset time in the future and a target communication mode corresponding to the network status, wherein the target communication mode includes any one of the following: a communication mode of the MQTT protocol, a communication mode of the SMS platform; A communication unit, configured to communicate according to the target communication mode when the future preset time is reached; A dynamic adjustment unit is used to dynamically adjust the target communication mode according to the current network parameters and sensor data that are continuously monitored.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores machine-executable instructions. When the machine-executable instructions are called and executed by a processor, the machine-executable instructions prompt the processor to execute the method according to any one of claims 1 to 7.