Data transmission method and device, computer device and storage medium
Patent Information
- Application Number
- CN202311155604.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-07
- Publication Date
- 2026-09-22
- Estimated Expiration
- 2043-09-07
AI Technical Summary
[0004]有鉴于此,本发明提供了数据传输方法、装置、计算机设备及存储介质,以解决相关技术中导航软件的惯导数据传输方式容易导致导航软件出现导航偏移,影响导航服务稳定性的问题
[0038]通过利用上一次惯导数据传输过程的数据传输耗时确定当前惯导数据传输的最大等待时间,以避免相邻两次惯导数据传输间隔过大,并利用上一次数据传输的开始时刻和当前惯导数据的接收时刻确定当前惯导数据开始传输时刻,通过对相邻两次关断数据传输间隔进行调节,从而保障惯导数据传输间隔在一定的时间范围内,保障数据传输的连续性和稳定性,从而避免导航软件出现导航漂移的情况,提高导航软件导航服务的稳定性,提升用户使用体验。
Smart Images

Figure CN117201423B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of automotive data processing technology, specifically to data transmission methods, devices, computer equipment, and storage media. Background Technology
[0002] Navigation is an indispensable tool in modern driving. With the development of smart cockpits, navigation software has been ported from mobile phones to the cockpit, offering larger screens and better sound integration for a superior driving experience. Navigation software uses inertial navigation data collected by gyroscopes and accelerometers from inertial navigation systems for navigation.
[0003] In related technologies, inertial navigation data is transmitted to navigation software according to the actual reception time. However, in real-world applications, the acquisition and upload speeds of inertial navigation data can fluctuate, and frame drops may occur, causing navigation drift in the navigation software. This leads to unstable navigation services and negatively impacts user experience. Therefore, avoiding navigation drift to ensure the stability of navigation software services has become an urgent problem to be solved. Summary of the Invention
[0004] In view of this, the present invention provides a data transmission method, apparatus, computer equipment, and storage medium to solve the problem that the inertial navigation data transmission method of navigation software in related technologies easily leads to navigation software deviation and affects the stability of navigation services.
[0005] In a first aspect, the present invention provides a data transmission method, the method comprising:
[0006] Obtain the first moment when the previous inertial navigation data transmission began and the corresponding data transmission time;
[0007] Calculate the time difference between the preset maximum transmission time interval and the data transmission time to determine the current maximum waiting time;
[0008] Based on the relationship between the first moment, the current maximum waiting time, and the current inertial navigation data reception time, a second moment is determined when the current inertial navigation data begins to be transmitted, so as to transmit the current inertial navigation data to the navigation software.
[0009] This method utilizes the data transmission time of the previous inertial navigation data transmission process to determine the maximum waiting time for the current inertial navigation data transmission, thus avoiding excessively large intervals between two adjacent inertial navigation data transmissions. Furthermore, it uses the start time of the previous data transmission and the current inertial navigation data reception time to determine the start time of the current inertial navigation data transmission. By adjusting the interval between two adjacent data transmission shutdowns, the inertial navigation data transmission interval is ensured to remain within a certain time range, guaranteeing the continuity and stability of data transmission. This prevents navigation software from drifting, improves the stability of navigation services, and enhances the user experience.
[0010] In one optional implementation, determining the second time at which the current inertial navigation data begins transmission based on the relationship between the first time, the current maximum waiting time, and the current inertial navigation data reception time, in order to transmit the current inertial navigation data to the navigation software, includes:
[0011] If no current inertial navigation data is received within the current maximum waiting time, the time corresponding to the current maximum waiting time is determined as the second time, and the previous inertial navigation data is transmitted to the navigation software as the current inertial navigation data.
[0012] Therefore, when frame loss occurs, the current maximum waiting time is used to control the transmission interval of inertial navigation data to avoid navigation drift. By using the previous inertial navigation data for compensation transmission, the continuity of inertial navigation data transmission is ensured, thus guaranteeing the performance of the navigation software.
[0013] In one optional implementation, determining the second time at which the current inertial navigation data begins transmission based on the relationship between the first time, the current maximum waiting time, and the current inertial navigation data reception time, in order to transmit the current inertial navigation data to the navigation software, includes:
[0014] If current inertial navigation data is received within the current maximum waiting time, determine whether the reception time of the current inertial navigation data is later than the first time.
[0015] If the current inertial navigation data reception time is later than the first time, calculate the time difference between the current inertial navigation data reception time and the first time to determine the current waiting time;
[0016] The second moment is determined based on the current waiting time, so that the current inertial navigation data can be transmitted to the navigation software.
[0017] Thus, during the normal reception of inertial navigation data, by comparing the relationship between the reception time of the inertial navigation data and the transmission time of the previous inertial navigation data, when the reception time is later than the transmission time of the previous inertial navigation data, the transmission time of the current inertial navigation data is determined based on the time difference between the two, thereby realizing flexible adjustment of the transmission time of inertial navigation data and further ensuring the continuity of data transmission.
[0018] In one optional implementation, determining the second moment based on the current waiting time to transmit the current inertial navigation data to the navigation software includes:
[0019] Determine whether the current waiting time is less than the preset minimum transmission time interval;
[0020] If the current waiting time is not less than the preset minimum transmission time interval, the receiving time of the current inertial navigation data is determined as the second time, so as to transmit the current inertial navigation data to the navigation software.
[0021] By comparing the time difference between the start time of the previous inertial navigation data transmission and the start time of the current inertial navigation data reception with the minimum transmission interval specified by the navigation software, if the difference is greater than the minimum transmission interval, the current inertial navigation data will be transmitted immediately upon receipt, thus ensuring the stability of the inertial navigation data received by the navigation software.
[0022] In an optional implementation, the method further includes:
[0023] If the current waiting time is less than the preset minimum transmission time interval, or if the current inertial navigation data reception time is not later than the first time, the time corresponding to the preset minimum transmission time interval after the first time is determined as the second time, so as to transmit the current inertial navigation data to the navigation software.
[0024] By comparing the time difference between the start time of the previous inertial navigation data transmission and the current inertial navigation data reception time with the minimum transmission interval specified by the navigation software, if the difference is not greater than the minimum transmission interval, or if the current inertial navigation data reception time is not later than the previous inertial navigation data transmission time, the current inertial navigation data is transmitted according to the preset minimum transmission interval. When the data reception frequency is high, the data transmission is throttled to further ensure the continuity and stability of data transmission.
[0025] In an alternative implementation, after transmitting the current inertial navigation data to the navigation software, the method further includes:
[0026] Record the second moment when the current inertial navigation data begins to be transmitted and the corresponding data transmission time.
[0027] By recording the start time and data transmission time during the inertial navigation data transmission process, a reference can be provided for the next inertial navigation data transmission time, thus ensuring the continuity and stability of data transmission.
[0028] In an optional implementation, the method further includes:
[0029] If no current inertial navigation data is received within a set time, an abnormal alarm will be triggered, where the set time is greater than the preset maximum transmission time interval.
[0030] If no new inertial navigation data is received for an extended period, it indicates an anomaly in the inertial navigation data acquisition or reporting process, preventing the navigation software from receiving accurate data. An anomaly alarm will alert the user to perform maintenance or indicate that the current navigation software is unable to provide navigation services, thereby improving the user's actual experience.
[0031] In a second aspect, the present invention provides a data transmission device, the device comprising:
[0032] The acquisition module is used to acquire the first moment when the previous inertial navigation data transmission started and the corresponding data transmission time.
[0033] The first processing module is used to calculate the time difference between the preset maximum transmission time interval and the data transmission time, and to determine the current maximum waiting time.
[0034] The second processing module is used to determine the second time when the current inertial navigation data starts to be transmitted based on the relationship between the first time, the current maximum waiting time and the current inertial navigation data reception time, so as to transmit the current inertial navigation data to the navigation software.
[0035] Thirdly, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the computer instructions to perform the method described in the first aspect or any corresponding embodiment thereof.
[0036] Fourthly, the present invention provides a computer-readable storage medium storing computer instructions for causing a computer to perform the method described in the first aspect or any corresponding embodiment thereof.
[0037] The beneficial effects of this invention are:
[0038] By utilizing the data transmission time of the previous inertial navigation data transmission process, the maximum waiting time for the current inertial navigation data transmission is determined to avoid excessively large intervals between two adjacent inertial navigation data transmissions. Furthermore, the start time of the current inertial navigation data transmission is determined by using the start time of the previous data transmission and the reception time of the current inertial navigation data. By adjusting the interval between two adjacent data transmission shutdowns, the inertial navigation data transmission interval is ensured to remain within a certain time range, guaranteeing the continuity and stability of data transmission. This prevents navigation software from drifting, improves the stability of navigation services, and enhances the user experience. Attached Figure Description
[0039] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0040] Figure 1 This is a flowchart illustrating a data transmission method according to an embodiment of the present invention;
[0041] Figure 2 This is a flowchart illustrating another data transmission method according to an embodiment of the present invention;
[0042] Figure 3 This is a flowchart illustrating another data transmission method according to an embodiment of the present invention;
[0043] Figure 4 This is a schematic diagram of the inertial navigation data transmission path based on the Android system.
[0044] Figure 5 This is a schematic diagram illustrating the specific working process of the data transmission method according to an embodiment of the present invention;
[0045] Figure 6 This is a structural block diagram of a data transmission device according to an embodiment of the present invention;
[0046] Figure 7 This is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. Detailed Implementation
[0047] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0048] Navigation is an indispensable tool in modern driving. With the development of smart cockpits, navigation software has been ported from mobile phones to the cockpit, offering larger screens and better sound integration for a superior driving experience. Navigation software uses inertial navigation data collected by gyroscopes and accelerometers from inertial navigation systems for navigation.
[0049] In related technologies, inertial navigation data is transmitted to navigation software according to the actual reception time. However, in real-world applications, the acquisition and upload speeds of inertial navigation data can fluctuate, and frame drops may occur, causing navigation drift in the navigation software. This leads to unstable navigation services and negatively impacts user experience. Therefore, avoiding navigation drift to ensure the stability of navigation software services has become an urgent problem to be solved.
[0050] Navigation drift occurs across various vehicle models, with varying causes. Frame drops are a common cause, typically appearing when system load increases or thread scheduling issues arise, resulting in brief drifts in the navigation interface. Therefore, the root cause of this problem can be understood as signal loss, requiring an algorithm to correct this loss and ensure data continuity. In today's intelligent cockpit systems, with the increasing functionality of the cockpit, navigation drift occurs during actual navigation use, necessitating a mechanism to correct frame drops.
[0051] An inertial navigation system (INS) is a navigation parameter calculation system that uses gyroscopes and accelerometers as sensing devices. The system establishes a navigation coordinate system based on the gyroscope's output and calculates the vehicle's velocity and position within that coordinate system based on the accelerometer's output. When GPS signals are weak or the vehicle is traveling through overpasses or tunnels, the INS can be used to extrapolate the vehicle's trajectory, thus providing more accurate position information.
[0052] Taking the Android system as an example, the inertial navigation module mainly performs the functions of parsing NMEA messages and transmitting inertial navigation data to map software. By receiving NMEA messages, parsing inertial navigation signals, obtaining the current vehicle speed through CarService, combining inertial navigation data and vehicle speed data according to the inertial navigation protocol, and then transmitting the inertial navigation data to the map software, i.e., navigation software, in real time through Android's Binder communication (a client-server communication structure).
[0053] To maintain data stability and meet map algorithm specifications, this invention optimizes the algorithm at the data link level. The optimal solution is to dynamically adjust the forwarding procedure at the HAL layer. Because the received inertial navigation data may vary in speed, dynamic adjustment and compensation can reliably send the required data to the upper-layer application. This ensures that the map page does not drift due to data inconsistency.
[0054] According to an embodiment of the present invention, a data transmission method embodiment is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0055] This embodiment provides a data transmission method that can be used in the aforementioned computer equipment, such as the Global Navigation Satellite System (GNSS) module of an in-vehicle infotainment system deployed in a vehicle. Figure 1 This is a flowchart of a data transmission method according to an embodiment of the present invention, such as... Figure 1 As shown, the process includes the following steps:
[0056] Step S101: Obtain the first moment when the previous inertial navigation data started transmission and the corresponding data transmission time.
[0057] Inertial navigation data is sent by calling the data callback function NameCallback through the data sending thread. The first moment mentioned above is the moment when the previous inertial navigation data is sent by calling NameCallback. The data transmission time is the time taken to call NameCallback, which is the time difference between the time before the function call and the time after the function call is completed.
[0058] Step S102: Calculate the time difference between the preset maximum transmission time interval and the data transmission time to determine the current maximum waiting time.
[0059] The preset maximum transmission time interval is the maximum time interval between each frame of inertial navigation data required by the navigation software. Its specific value can be flexibly set according to the data processing requirements of the navigation software. For example, assuming that map software A requires the time interval between each frame of map data to be controlled at 10 Hz, that is, to ensure that the data interval is 100 ms, then the preset maximum transmission time interval is 100 ms. This is just an example, and the present invention is not limited thereto.
[0060] Step S103: Based on the relationship between the first moment, the current maximum waiting time, and the current inertial navigation data reception time, determine the second moment when the current inertial navigation data begins to be transmitted, so as to transmit the current inertial navigation data to the navigation software.
[0061] Specifically, inertial navigation data is received from the underlying layer through a data receiving thread. For example, inertial navigation data can be received through a sem_post queue. sem_post is a semaphore function used to strictly monitor the data being enqueued. Whenever data is enqueued, the semaphore lock is incremented by 1. The time point when sem_post is executed is the time when the inertial navigation data is received. Since the inertial navigation data transmission time fluctuates and even frame loss occurs, the transmission time of the current inertial navigation data is flexibly adjusted by utilizing the relationship between the actual reception time, the transmission time of the previous frame of inertial navigation data, and the current maximum waiting time, so as to ensure the continuity and stability of the navigation software in receiving inertial navigation data.
[0062] This method utilizes the data transmission time of the previous inertial navigation data transmission process to determine the maximum waiting time for the current inertial navigation data transmission, thus avoiding excessively large intervals between two adjacent inertial navigation data transmissions. Furthermore, it uses the start time of the previous data transmission and the current inertial navigation data reception time to determine the start time of the current inertial navigation data transmission. By adjusting the interval between two adjacent data transmission shutdowns, the inertial navigation data transmission interval is ensured to remain within a certain time range, guaranteeing the continuity and stability of data transmission. This prevents navigation software from drifting, improves the stability of navigation services, and enhances the user experience.
[0063] This embodiment provides another data transmission method, which can be used in the aforementioned computer devices, such as the GNSS module of an in-vehicle infotainment system deployed on a vehicle. Figure 2 This is a flowchart of a data transmission method according to an embodiment of the present invention, such as... Figure 2 As shown, the process includes the following steps:
[0064] Step S201: Obtain the first moment when the previous inertial navigation data transmission began and the corresponding data transmission time. See details below. Figure 1 The specific description of step S101 shown will not be repeated here.
[0065] Step S202: Calculate the time difference between the preset maximum transmission time interval and the data transmission time to determine the current maximum waiting time. See details below. Figure 1 The specific description of step S102 shown will not be repeated here.
[0066] Step S203: Based on the relationship between the first moment, the current maximum waiting time, and the current inertial navigation data reception time, determine the second moment when the current inertial navigation data begins to be transmitted, so as to transmit the current inertial navigation data to the navigation software.
[0067] Specifically, step S203 includes:
[0068] Step S2031: If the current inertial navigation data is not received within the current maximum waiting time, the time corresponding to the current maximum waiting time is determined as the second time, and the previous inertial navigation data is transmitted to the navigation software as the current inertial navigation data.
[0069] Specifically, the timing of the semaphore timer Sem_wait can be set using the current maximum waiting time to achieve flow control. When new inertial navigation data is received, the semaphore lock held by sem_post is incremented by 1, and the timer Sem_wait is triggered to finish execution synchronously. This moment is the moment when the inertial navigation data is received. If no new inertial navigation data is received within the current maximum waiting time, the timer Sem_wait will finish execution after the current maximum waiting time has elapsed.
[0070] Therefore, when frame loss occurs, the current maximum waiting time is used to control the transmission interval of inertial navigation data to avoid navigation drift. By using the previous inertial navigation data for compensation transmission, the continuity of inertial navigation data transmission is ensured, thus guaranteeing the performance of the navigation software.
[0071] Step S2032: If the current inertial navigation data is received within the current maximum waiting time, determine whether the reception time of the current inertial navigation data is later than the first moment.
[0072] Specifically, if the timer Sem_wait is triggered to end by the receipt of new inertial navigation data, and if the time when the timer Sem_wait ends is later than the time when NmeaCallback was last called to send inertial navigation data, it means that the current inertial navigation data reception time is after the previous inertial navigation data transmission. If the time when the timer Sem_wait ends is not later than the time when NmeaCallback was last called to send inertial navigation data, it means that the current inertial navigation data reception time is before the previous inertial navigation data transmission or the two are at the same time.
[0073] Step S2033: If the current inertial navigation data reception time is later than the first time, calculate the time difference between the current inertial navigation data reception time and the first time, and determine the current waiting time.
[0074] Specifically, the current waiting time can be obtained by calculating the time difference between the end of the Sem_wait timer and the last time NmeaCallback was called to send inertial navigation data.
[0075] Step S2034: Determine the second moment based on the current waiting time, so as to transmit the current inertial navigation data to the navigation software.
[0076] Thus, during the normal reception of inertial navigation data, by comparing the relationship between the reception time of the inertial navigation data and the transmission time of the previous inertial navigation data, when the reception time is later than the transmission time of the previous inertial navigation data, the transmission time of the current inertial navigation data is determined based on the time difference between the two, thereby realizing flexible adjustment of the transmission time of inertial navigation data and further ensuring the continuity of data transmission.
[0077] In some optional implementations, step S2034 above includes:
[0078] Step a1: Determine whether the current waiting time is less than the preset minimum transmission time interval.
[0079] The preset minimum transmission time interval can be set according to the processing requirements of the map algorithm in the navigation software for inertial navigation data. For example, assuming that map application A requires a minimum time interval of 50ms between each frame of inertial navigation data transmission, the preset minimum transmission time interval can be set to 50ms, etc. This is just an example and is not limited to this.
[0080] Step a2: If the current waiting time is not less than the preset minimum transmission time interval, the receiving time of the current inertial navigation data is determined as the second moment, so as to transmit the current inertial navigation data to the navigation software.
[0081] Specifically, if the current waiting time is not less than the preset minimum transmission time interval, it means that the time between the current reception of inertial navigation data and the transmission time of the previous inertial navigation data is greater than or equal to 50ms. At this time, there is no need to restrict data transmission. Data can be transmitted directly to the navigation software at the time of reception of inertial navigation data to ensure the real-time performance of the data as much as possible.
[0082] By comparing the time difference between the start time of the previous inertial navigation data transmission and the start time of the current inertial navigation data reception with the minimum transmission interval specified by the navigation software, if the difference is greater than the minimum transmission interval, the current inertial navigation data will be transmitted immediately upon receipt, thus ensuring the stability of the inertial navigation data received by the navigation software.
[0083] Step a3: If the current waiting time is less than the preset minimum transmission time interval, and if the current inertial navigation data reception time is not later than the first moment, the moment corresponding to the preset minimum transmission time interval after the first moment is determined as the second moment, so as to transmit the current inertial navigation data to the navigation software.
[0084] Specifically, if the current waiting time is less than the preset minimum transmission interval, it means that the time between the current reception of inertial navigation data and the transmission time of the previous inertial navigation data is less than 50ms. At this time, data transmission can be limited by throttling to avoid the navigation software being unable to process the inertial navigation data in time, which would affect map performance. By waiting for a certain period of time, the inertial navigation data will be sent after the preset minimum transmission interval is reached, so as to maintain the stability of the navigation software map performance.
[0085] Step S2035: If the current inertial navigation data reception time is not later than the first time, the time corresponding to the preset minimum transmission time interval after the first time is determined as the second time, so as to transmit the current inertial navigation data to the navigation software.
[0086] Specifically, if the current inertial navigation data reception time is not later than the first moment, it means that new inertial navigation data has been received before the previous inertial navigation data was sent. At this time, data transmission can be restricted by throttling to avoid the navigation software being unable to process the inertial navigation data in time, which would affect map performance. By waiting for a certain period of time, the inertial navigation data is sent after the above-mentioned preset minimum transmission time interval is reached, so as to maintain the stability of the navigation software map performance.
[0087] By comparing the time difference between the start time of the previous inertial navigation data transmission and the current inertial navigation data reception time with the minimum transmission interval specified by the navigation software, if the difference is not greater than the minimum transmission interval, or if the current inertial navigation data reception time is not later than the previous inertial navigation data transmission time, the current inertial navigation data is transmitted according to the preset minimum transmission interval. When the data reception frequency is high, the data transmission is throttled to further ensure the continuity and stability of data transmission.
[0088] This embodiment provides a data transmission method that can be used in the aforementioned computer equipment, such as the GNSS module of an in-vehicle infotainment system deployed on a vehicle. Figure 3 This is a flowchart of a data transmission method according to an embodiment of the present invention, such as... Figure 3 As shown, the process includes the following steps:
[0089] Step S301: Obtain the first moment when the previous inertial navigation data transmission began and the corresponding data transmission time. See details below. Figure 2 The specific description of step S201 shown will not be repeated here.
[0090] Step S302: Calculate the time difference between the preset maximum transmission time interval and the data transmission time to determine the current maximum waiting time. See details below. Figure 2 The specific description of step S202 shown will not be repeated here.
[0091] Step S303: Based on the relationship between the first moment, the current maximum waiting time, and the current inertial navigation data reception time, determine the second moment when the current inertial navigation data transmission begins, so as to transmit the current inertial navigation data to the navigation software. See details below. Figure 2 The specific description of step S203 shown will not be repeated here.
[0092] In some optional implementations, the data transmission method provided in this embodiment of the invention further includes:
[0093] Step S304: If no current inertial navigation data is received within the set time, an abnormal alarm is triggered.
[0094] The set time is greater than the preset maximum transmission interval. Specifically, this set time can be flexibly set according to the performance requirements of the navigation software's map algorithm. For example, if the driving navigation software does not receive real-time navigation data within 1 second, the navigation accuracy will not meet the user's needs. In this case, the set time can be set to 1 second or 0.5 seconds, etc., to ensure that the user can promptly detect the transmission sequence of inertial navigation data and take corresponding measures, such as turning off navigation or using other navigation software.
[0095] For example, the abnormal alarm can be sent to the navigation software to indicate an abnormal data upload, so as to prompt the user through the user interface of the navigation software to indicate that the current navigation signal is poor, or it can be sent to the user through the vehicle's system to issue corresponding prompt sounds or prompt lights, etc. The present invention is not limited thereto.
[0096] If no new inertial navigation data is received for an extended period, it indicates an anomaly in the inertial navigation data acquisition or reporting process, preventing the navigation software from receiving accurate data. An anomaly alarm will alert the user to perform maintenance or indicate that the current navigation software is unable to provide navigation services, thereby improving the user's actual experience.
[0097] In some optional implementations, after transmitting the current inertial navigation data to the navigation software, the data transmission method provided in this embodiment of the invention further includes:
[0098] Step S305: Record the second moment when the current inertial navigation data transmission begins and the corresponding data transmission time.
[0099] The second moment is the moment when NameCallback is called to start sending the current inertial navigation data, and the data transmission time is the time taken to call NameCallback.
[0100] By recording the start time and data transmission time during the inertial navigation data transmission process, a reference can be provided for the next inertial navigation data transmission time, thus ensuring the continuity and stability of data transmission.
[0101] The following will provide a detailed explanation of the specific implementation process of the data transmission method provided in the embodiments of the present invention, using specific application examples.
[0102] Taking the Android system as an example, the transmission paths for inertial navigation data and GPS signal data are as follows: Figure 4 As shown, inertial navigation data and GPS positioning signals need to traverse a long link from the module to the map algorithm. In some older designs, a 4G module is also involved. The inertial navigation signal is output from the module to the kernel, and the kernel passes it to the Hardware Abstraction Layer (HAL) through an interface. The HAL then passes the inertial navigation data to the GNSS module of the application framework through the native interface. The GNSS module assembles the incoming data and then transmits it to the map application. Data transmission experiments show that there is significant data loss between the HAL and the Framework layer. By embedding the data transmission method provided in this embodiment of the invention into the HAL program, an algorithm capable of dynamically balancing data transmission is designed to ensure that the inertial navigation data transmitted to the application framework layer meets the performance requirements of the map algorithm.
[0103] like Figure 5 As shown, the algorithm has two threads: Nmea_recv (data receiving thread) and GYOACC_send (data sending thread). The Nmea_recv thread receives inertial navigation data from the underlying layer. The GYOACC_send thread forwards the data received by the Nmea_recv thread and uses semaphores for atomic operations to ensure atomicity. This is further guaranteed by using a queue (Sem_post) and a timer (Sem_wait).
[0104] The GYOACC_send thread plays a crucial role in the entire algorithm, as all data scheduling is completed within this thread. It mainly consists of the sem_post queue, the sem_wait timer, the sleep module, and the data callback module.
[0105] Sem_post is a semaphore function used to strictly monitor enqueued data. Whenever data is enqueued, the semaphore lock is incremented by 1. When used in conjunction with the following Sem_wait function, Sem_wait can guarantee the accuracy of the waiting time.
[0106] In the entire normal compensation algorithm, there are several time control variables, namely:
[0107] Time T1: Fixed value of 100ms, used to ensure that the fixed time interval is 100ms.
[0108] Time T0: The time taken to call NmeaCallback, i.e. the time difference between the call and the completion of the function call.
[0109] Time T2: Fixed value of 50ms, used to ensure that the data distribution interval is between 50ms and 100ms.
[0110] Time CT: The time point after Sem_wait is executed (when new data is enqueued, Sem_wait execution ends, or when the Sem_wait timer duration reaches T1-T0).
[0111] Time LT: The time point when NmeaCallback was last called to send data.
[0112] The map application requires that the time interval between each frame of incoming map data be controlled at 10 Hz, which means ensuring a data interval of 100 ms. Therefore, a timer is needed to control the transmission interval to achieve flow control. After the GYOACC (inertial navigation) data is received in Nmea_recv, the global semaphore is incremented using Sem_post, and the waiting time is controlled by Sem_wait(T1-T0) to clear the sem semaphore, and then the next packet of inertial navigation data transmission process begins.
[0113] After Sem_wait finishes, the next step begins, and the CT time is updated. It checks if a timeout has occurred, i.e., whether Sem_wait has executed for the duration T1-T0. If Sem_wait timed out (meaning it executed for T1-T0), then the next frame of data needs to be sent immediately. NameCallback is called directly to send data (not shown in the diagram), and the next waiting period begins, ensuring that the data transmission interval between two adjacent frames does not exceed 100ms. If no timeout has occurred, the time calculation begins, determining the required sleep time, which must not exceed 50ms.
[0114] Specifically, the time since `Sem_wait` is obtained through `CT`, and the time of the last `NmeaCallback` is obtained through `LT`. Subtracting `LT` from `CT` checks if it's greater than 50ms. If it is, it means the next frame's data transmission needs to begin immediately, and `NameCallback` is called directly to send data. If `CT` minus `LT` is not greater than 50ms, a sleep period of (T2 - (CT - LT)) is required. The current time is kept within 50ms. When the sleep period reaches the set difference, the `NameCallback` callback is invoked, data is sent to the Framework, and the time `LT` consumed by the current call is recorded.
[0115] The above scheme effectively ensures data continuity, guaranteeing that the data received by the map follows a normal distribution. If the time it takes for the front-end data to be sent to the native system is longer than 100ms, the algorithm can compensate by using data from the previous frame, ensuring a data interval of 100ms. If the time it takes for the front-end data to be sent is shorter than 100ms, the algorithm can internally throttle the data, ensuring that the current frame is sent 100ms after the previous frame has been successfully sent. Furthermore, the algorithm fully considers the time consumption of function execution, guaranteeing that each transmission takes 100ms, thus fully meeting the performance requirements of the map.
[0116] This embodiment also provides a data transmission device for implementing the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can refer to a combination of software and / or hardware that performs a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0117] This embodiment provides a data transmission device, such as... Figure 6 As shown, it includes:
[0118] The acquisition module 601 is used to acquire the first moment when the previous inertial navigation data started transmission and the corresponding data transmission time.
[0119] The first processing module 602 is used to calculate the time difference between the preset maximum transmission time interval and the data transmission time, and to determine the current maximum waiting time.
[0120] The second processing module 603 is used to determine the second moment when the current inertial navigation data begins to be transmitted based on the relationship between the first moment, the current maximum waiting time and the current inertial navigation data reception time, so as to transmit the current inertial navigation data to the navigation software.
[0121] In some optional implementations, the second processing module 603 includes:
[0122] The first processing unit is used to determine the time corresponding to the current maximum waiting time as the second time if no current inertial navigation data is received within the current maximum waiting time, and to transmit the previous inertial navigation data as the current inertial navigation data to the navigation software.
[0123] In some optional implementations, the second processing module 603 includes:
[0124] The second processing unit is used to determine whether the reception time of the current inertial navigation data is later than the first moment if the current inertial navigation data is received within the current maximum waiting time.
[0125] The third processing unit is used to calculate the time difference between the current inertial navigation data reception time and the first time if the current inertial navigation data reception time is later than the first time, and to determine the current waiting time.
[0126] The fourth processing unit is used to determine the second moment based on the current waiting time, so as to transmit the current inertial navigation data to the navigation software.
[0127] In some optional implementations, the fourth processing unit includes:
[0128] The judgment subunit is used to determine whether the current waiting time is less than the preset minimum transmission time interval;
[0129] The first processing submodule is used to determine the receiving time of the current inertial navigation data as the second moment if the current waiting time is not less than the preset minimum transmission time interval, so as to transmit the current inertial navigation data to the navigation software.
[0130] In some optional embodiments, the second processing module 603 includes: [further details needed for complete translation]
[0131] The fifth processing unit is used to determine the time corresponding to the preset minimum transmission time interval after the first time as the second time if the current waiting time is less than the preset minimum transmission time interval, or if the current inertial navigation data reception time is not later than the first time, so as to transmit the current inertial navigation data to the navigation software.
[0132] In some optional embodiments, the data transmission device further includes:
[0133] The third processing module is used to record the second moment when the current inertial navigation data begins to be transmitted and the corresponding data transmission time.
[0134] In some optional embodiments, the data transmission device further includes:
[0135] The fourth processing module is used to issue an abnormal alarm if no current inertial navigation data is received within a set time period, where the set time period is greater than the preset maximum transmission interval.
[0136] In this embodiment, the data transmission device is presented in the form of a functional unit. Here, a unit refers to an ASIC circuit, a processor and memory that execute one or more software or fixed programs, and / or other devices that can provide the above-mentioned functions.
[0137] The further functional descriptions of the above modules and units are the same as those in the corresponding method embodiments described above, and will not be repeated here.
[0138] This invention also provides a computer device having the above-described features. Figure 6 The data transmission device shown.
[0139] Please see Figure 7 , Figure 7 This is a schematic diagram of the structure of a computer device provided in an optional embodiment of the present invention, such as... Figure 7 As shown, the computer device includes one or more processors 10, memory 20, and interfaces for connecting the components, including high-speed interfaces and low-speed interfaces. The components communicate with each other via different buses and can be mounted on a common motherboard or otherwise installed as needed. The processors can process instructions executed within the computer device, including instructions stored in or on memory to display graphical information of a GUI on external input / output devices (such as display devices coupled to the interfaces). In some alternative implementations, multiple processors and / or multiple buses can be used with multiple memories and multiple memory modules, if desired. Similarly, multiple computer devices can be connected, each providing some of the necessary operations (e.g., as a server array, a group of blade servers, or a multiprocessor system). Figure 7 Take a processor 10 as an example.
[0140] Processor 10 may be a central processing unit, a network processor, or a combination thereof. Processor 10 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The programmable logic device may be a complex programmable logic device (CAMP), a field-programmable gate array (FPGA), a general-purpose array logic (GDA), or any combination thereof.
[0141] The memory 20 stores instructions executable by at least one processor 10 to cause at least one processor 10 to perform the method shown in the above embodiments.
[0142] The memory 20 may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created based on the use of the computer device as shown by a landing page for an app. Furthermore, the memory 20 may include high-speed random access memory and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some alternative embodiments, the memory 20 may optionally include memory remotely located relative to the processor 10, which can be connected to the computer device via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0143] The memory 20 may include volatile memory, such as random access memory; the memory may also include non-volatile memory, such as flash memory, hard disk or solid-state drive; the memory 20 may also include a combination of the above types of memory.
[0144] The computer device also includes a communication interface 30 for communicating with other devices or communication networks.
[0145] This invention also provides a computer-readable storage medium. The methods described above according to embodiments of the invention can be implemented in hardware or firmware, or implemented as computer code that can be recorded on a storage medium, or implemented as computer code downloaded via a network and originally stored on a remote storage medium or a non-transitory machine-readable storage medium and then stored on a local storage medium. Thus, the methods described herein can be processed by software stored on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. The storage medium can be a magnetic disk, optical disk, read-only memory, random access memory, flash memory, hard disk, or solid-state drive, etc.; further, the storage medium can also include combinations of the above types of memory. It is understood that computers, processors, microprocessor controllers, or programmable hardware include storage components capable of storing or receiving software or computer code, which, when accessed and executed by the computer, processor, or hardware, implements the methods shown in the above embodiments.
[0146] Although embodiments of the invention have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the invention, and such modifications and variations all fall within the scope defined by the appended claims.
Claims
1. A data transmission method, characterized in that, The method includes: Obtain the first moment when the previous inertial navigation data transmission began and the corresponding data transmission time; Calculate the time difference between the preset maximum transmission time interval and the data transmission time to determine the current maximum waiting time; Based on the relationship between the first moment, the current maximum waiting time, and the current inertial navigation data reception time, a second moment is determined when the current inertial navigation data transmission begins, in order to transmit the current inertial navigation data to the navigation software, including: If no current inertial navigation data is received within the current maximum waiting time, the time corresponding to the current maximum waiting time is determined as the second time, and the previous inertial navigation data is transmitted to the navigation software as the current inertial navigation data; If current inertial navigation data is received within the current maximum waiting time, determine whether the reception time of the current inertial navigation data is later than the first time. If the current inertial navigation data reception time is later than the first time, calculate the time difference between the current inertial navigation data reception time and the first time to determine the current waiting time; Determining the second moment based on the current waiting time, and transmitting the current inertial navigation data to the navigation software, includes: Determine whether the current waiting time is less than the preset minimum transmission time interval; If the current waiting time is not less than the preset minimum transmission time interval, the receiving time of the current inertial navigation data is determined as the second time, so as to transmit the current inertial navigation data to the navigation software.
2. The method according to claim 1, characterized in that, Also includes: If the current waiting time is less than the preset minimum transmission time interval, or if the current inertial navigation data reception time is not later than the first time, the time corresponding to the preset minimum transmission time interval after the first time is determined as the second time, so as to transmit the current inertial navigation data to the navigation software.
3. The method according to any one of claims 1-2, characterized in that, After transmitting the current inertial navigation data to the navigation software, the method further includes: Record the second moment when the current inertial navigation data begins to be transmitted and the corresponding data transmission time.
4. The method according to any one of claims 1-2, characterized in that, Also includes: If no current inertial navigation data is received within a set time, an abnormal alarm will be triggered, where the set time is greater than the preset maximum transmission time interval.
5. A data transmission device, characterized in that, The device includes: The acquisition module is used to acquire the first moment when the previous inertial navigation data transmission started and the corresponding data transmission time. The first processing module is used to calculate the time difference between the preset maximum transmission time interval and the data transmission time, and to determine the current maximum waiting time. The second processing module is used to determine the second time when the current inertial navigation data starts to be transmitted based on the relationship between the first time, the current maximum waiting time and the current inertial navigation data reception time, so as to transmit the current inertial navigation data to the navigation software; The second processing module includes: The first processing unit is used to determine the time corresponding to the current maximum waiting time as the second time if the current inertial navigation data is not received within the current maximum waiting time, and transmit the previous inertial navigation data as the current inertial navigation data to the navigation software. The second processing unit is used to determine whether the reception time of the current inertial navigation data is later than the first moment if the current inertial navigation data is received within the current maximum waiting time. The third processing unit is used to calculate the time difference between the current inertial navigation data reception time and the first time if the current inertial navigation data reception time is later than the first time, and to determine the current waiting time. The fourth processing unit is used to determine the second moment based on the current waiting time, so as to transmit the current inertial navigation data to the navigation software; The fourth processing unit includes: The judgment subunit is used to determine whether the current waiting time is less than the preset minimum transmission time interval; The first processing submodule is used to determine the receiving time of the current inertial navigation data as the second moment if the current waiting time is not less than the preset minimum transmission time interval, so as to transmit the current inertial navigation data to the navigation software.
6. A computer device, characterized in that, include: A memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, the processor executing the computer instructions to perform the method of any one of claims 1 to 4.
7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing a computer to perform the method of any one of claims 1 to 4.
Citation Information
Patent Citations
Scheduling method, device and system
CN115643609A
System and method for synchronized vehicle sensor data acquisition processing using vehicular communication
US20190069051A1