Dual-system communication method and system, vehicle and storage medium
By realizing data encoding, decoding and verification in the dual-system of the vehicle and machine, and combining the adaptation processing of the data distribution module, the problem of traditional communication systems being unable to develop separately and signal synchronization is solved, the development efficiency and system scalability are improved, and the Signal synchronization between Android and Linux systems.
Patent Information
- Application Number
- CN202411137180.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-19
- Publication Date
- 2024-12-20
AI Technical Summary
The traditional dual-system communication system of the vehicle computer cannot realize the separate development of upper-level applications and underlying architectures, and there are signal synchronization problems, resulting in long development cycles, poor scalability, high portability costs, and difficult to achieve signal synchronization between Android and Linux systems. .
By implementing data encoding and decoding between operating systems, using data verification to filter unqualified data, and adapting and processing through the data distribution module, signal synchronization between different operating systems and external devices is achieved, reducing developers' ability to use underlying hardware Dependency to improve system scalability and reusability.
It realizes separate development of upper-level applications and underlying architectures, reduces development cycles, improves the scalability and reusability of communication systems, ensures signal synchronization between Android and Linux systems, and reduces the probability of system signal reception being out of sync. .
Smart Images

Figure CN119166383A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communication control technology, and in particular to a dual-system communication method, system, vehicle and storage medium. Background Art
[0002] With the deepening of automobile intelligence and networking, the car system has gradually evolved from a single on-board central control system to a dual-system architecture based on Android and Linux. However, traditional communication systems are often specific communication systems with relatively simple functions designed for specific purposes, and the development of traditional communication systems has high requirements for developers. Software developers need to be familiar with the underlying hardware and cannot separate upper-level development from underlying development, which will greatly increase the development cycle, resulting in poor scalability of traditional communication systems, high portability costs, and long development cycles.
[0003] At the same time, there are some new requirements for the communication between the two systems of the car. There is a signal synchronization requirement between the Android and Linux systems. That is, the signal of one system needs to be sent to the other operating system in time for synchronous display of the signal or synchronous change of the UI.
[0004] Therefore, how to achieve separate development of upper-layer applications and underlying architecture and meet the signal synchronization requirements of dual-system communications has become a key issue that needs to be solved urgently. Summary of the invention
[0005] In view of this, the present invention provides a dual-system communication method, system, vehicle and storage medium to solve the problem that the traditional communication architecture cannot meet the upper-layer development and bottom-layer separation and signal synchronization.
[0006] In a first aspect, the present invention provides a dual-system communication method, which is applied to a first operating system, and the method includes:
[0007] Receiving first communication data sent by a first application on an upper layer of a first operating system;
[0008] Encoding the first communication data to obtain a first data packet;
[0009] When it is determined that the target receiving object of the first communication data is the second operating system, the first data packet is sent to the second operating system so that the second operating system decodes the first data packet to obtain the first communication data. After detecting that the first communication data passes the data verification, the first communication data is stored and sent to the second application on the upper layer of the second operating system.
[0010] Beneficial effect: The first operating system is used to encode the first communication data of the first application on its upper layer to obtain a first data packet. When it is determined that the target receiving object is the second operating system, the first data packet is sent to the second operating system, so that the second operating system can perform data verification on the first communication data in the first data packet to filter out unqualified data. After the data verification is passed, the first communication data is sent to the upper-layer second application for signal synchronization, and only the data sending and receiving methods between the upper-layer application and the underlying architecture need to be considered. Developers do not need to master the underlying hardware structure, which is conducive to reducing the development cycle.
[0011] In an optional implementation, a data distribution module is provided between the first operating system and the external device; after encoding the first communication data to obtain the first data packet, the method further includes:
[0012] When it is determined that the target receiving object of the first communication data is an external device, the first data packet is sent to the data distribution module, so that the data distribution module decodes the first data packet to obtain the first communication data, adapts the first communication data, and sends the adapted first communication data to the corresponding external device.
[0013] Beneficial effects: Signal transmission between the first operating system and external devices is achieved through the data distribution module, and the communication data is adapted and processed by the data distribution module, so that the upper-layer software is unaware of changes to the underlying hardware and software. The application layer software ecosystem can be transplanted and reused on different vehicle platforms, improving the scalability and reusability of the communication system.
[0014] In an optional embodiment, the method further includes:
[0015] Receive a second data packet sent by the data distribution module;
[0016] Decoding the second data packet to obtain second communication data;
[0017] After detecting that the second communication data passes the data verification, storing the second communication data, and sending the second communication data to the first application in the upper layer of the first operating system;
[0018] After detecting that the second communication data fails the data verification, the second communication data is rejected.
[0019] Beneficial effects: By receiving the communication sent by the data distribution module, storing and synchronizing it, data synchronization between different operating systems and between the operating system and external devices is achieved, and duplicate data is filtered through data verification, which is conducive to improving communication efficiency.
[0020] In an optional implementation, sending the first data packet to the second operating system includes:
[0021] A socket connection is established with the second operating system, and the first data packet is sent to the second operating system using the socket connection.
[0022] Beneficial effect: Using the socket connection method to realize communication and data transmission between the first operating system and the second operating system is conducive to achieving data synchronization.
[0023] In an optional implementation, after establishing the socket connection with the second operating system, the method further includes:
[0024] Sending a socket heartbeat packet to the second operating system and timing the heartbeat packet sending duration;
[0025] When it is detected that the heartbeat packet sending duration exceeds the preset duration and no heartbeat response is received from the second operating system based on the socket heartbeat packet, the socket connection with the second operating system is disconnected, the socket connection with the second operating system is re-established, and the heartbeat packet sending duration is reset.
[0026] Beneficial effect: By sending socket heartbeat packets and timing the heartbeat packet sending duration, the connection status of the operating system is monitored, and reconnection is performed in time after disconnection, reducing the probability of asynchronous signal reception in the system.
[0027] In a second aspect, the present invention provides a dual-system communication method, which is applied to a second operating system, and the method includes:
[0028] Receiving a first data packet sent by a first operating system; the first data packet is obtained by the first operating system encoding first communication data sent by an upper layer first application;
[0029] Decoding the first data packet to obtain first communication data;
[0030] After detecting that the first communication data passes the data verification, the first communication data is stored, and the first communication data is sent to the second application on the upper layer of the second operating system.
[0031] Beneficial effect: The first operating system is used to encode the first communication data of the first application on its upper layer to obtain a first data packet. When it is determined that the target receiving object is the second operating system, the first data packet is sent to the second operating system, so that the second operating system can perform data verification on the first communication data in the first data packet to filter out unqualified data. After the data verification is passed, the first communication data is sent to the upper-layer second application for signal synchronization, and only the data sending and receiving methods between the upper-layer application and the underlying architecture need to be considered. Developers do not need to master the underlying hardware structure, which is conducive to reducing the development cycle.
[0032] In an optional implementation, a data distribution module is provided between the second operating system and the external device; the method further includes:
[0033] Receive a second data packet sent by the data distribution module;
[0034] Decoding the second data packet to obtain second communication data;
[0035] After detecting that the second communication data passes the data verification, storing the second communication data, and sending the second communication data to a second application in an upper layer of the second operating system;
[0036] After detecting that the second communication data fails the data verification, the second communication data is rejected.
[0037] Beneficial effects: By receiving the communication sent by the data distribution module, storing and synchronizing it, data synchronization between different operating systems and between the operating system and external devices is achieved, and duplicate data is filtered through data verification, which is conducive to improving communication efficiency.
[0038] In a third aspect, the present invention provides a communication system, the system comprising a first operating system and a second operating system;
[0039] The first operating system is used to receive first communication data sent by a first application on an upper layer of the first operating system; encode the first communication data to obtain a first data packet; and send the first data packet to the second operating system when it is determined that the target receiving object of the first communication data is the second operating system;
[0040] The second operating system is used to receive a first data packet sent by the first operating system; decode the first data packet to obtain first communication data; after detecting that the first communication data passes data verification, store the first communication data, and send the first communication data to a second application on the upper layer of the second operating system.
[0041] Beneficial effect: The first operating system is used to encode the first communication data of the first application on its upper layer to obtain a first data packet. When it is determined that the target receiving object is the second operating system, the first data packet is sent to the second operating system, so that the second operating system can send the first communication data in the first data packet to the second application on its upper layer for signal synchronization, and only the data sending and receiving methods between the upper layer application and the underlying architecture need to be considered, without the need for developers to master the underlying hardware structure, which is conducive to reducing the development cycle.
[0042] In a fourth aspect, the present invention provides a vehicle comprising a first operating system and a second operating system, wherein the first operating system is used to execute the dual-system communication method of the first aspect or any corresponding embodiment thereof, and the second operating system is used to execute the dual-system communication method of the second aspect or any corresponding embodiment thereof.
[0043] In an optional implementation, the first operating system is an Android system, and the second operating system is a Linux system; or, the first operating system is a Linux system, and the second operating system is an Android system.
[0044] In a fifth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the dual-system communication method of the first aspect or any corresponding embodiment thereof, or to execute the dual-system communication method of the second aspect or any corresponding embodiment thereof.
[0045] The beneficial effects of the present invention are:
[0046] The first operating system is used to encode the first communication data of the first application on its upper layer to obtain a first data packet. When it is determined that the target receiving object is the second operating system, the first data packet is sent to the second operating system, so that the second operating system can perform data verification on the first communication data in the first data packet to filter out unqualified data. After the data verification is passed, the first communication data is sent to the upper-layer second application for signal synchronization, and only the data sending and receiving methods between the upper-layer application and the underlying architecture need to be considered. Developers do not need to master the underlying hardware structure, which is conducive to reducing the development cycle. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] 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.
[0048] Figure 1 is a structural block diagram of a communication system according to an embodiment of the present invention;
[0049] Figure 2 is a structural block diagram of another communication system according to an embodiment of the present invention;
[0050] Figure 3 is a schematic diagram of an interaction process of a communication system according to an embodiment of the present invention;
[0051] Figure 4 is a schematic diagram of an interaction process of another communication system according to an embodiment of the present invention;
[0052] Figure 5 is a schematic diagram of an interaction process of another communication system according to an embodiment of the present invention;
[0053] Figure 6 is a schematic diagram of the structure of an Android and Linux dual system according to an embodiment of the present invention;
[0054] Figure 7 is a schematic diagram of a communication process of an Android system according to an embodiment of the present invention;
[0055] Figure 8 is a communication flow diagram of a data distribution module according to an embodiment of the present invention;
[0056] Fig. 9 is a schematic diagram of a dual-system heartbeat monitoring process according to an embodiment of the present invention;
[0057] Fig.10 is a structural block diagram of a vehicle according to an embodiment of the present invention. DETAILED DESCRIPTION
[0058] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0059] With the deepening of automobile intelligence and networking, the car system has gradually evolved from a single on-board central control system to a dual-system architecture based on Android and Linux. However, traditional communication systems are often specific communication systems with relatively simple functions designed for specific purposes, and the development of traditional communication systems has high requirements for developers. Software developers need to be familiar with the underlying hardware and cannot separate the upper-layer development from the underlying development. This will greatly increase the development cycle, resulting in poor scalability, high portability costs, and long development cycles for traditional communication systems.
[0060] At the same time, there are some new requirements for the communication between the two systems of the car. First, there is the problem of status monitoring between the two systems of the car. Android and Linux systems often do not know the operating status of the other operating system. Secondly, there is a signal synchronization problem between the Android and Linux systems. The signal of one system needs to be sent to the other operating system in time for signal display or UI changes, and the external input signals of the Android and Linux systems may be out of sync and delayed.
[0061] Therefore, a new vehicle-machine dual system software communication architecture and method are needed to address the shortcomings of the traditional communication system and meet the new communication requirements of the vehicle-machine dual system.
[0062] According to an embodiment of the present invention, a communication system is provided, such as Figure 1 As shown, the communication system includes a first operating system 101 and a second operating system 102, wherein the first operating system 101 and the second operating system 102 are interchangeable, that is, the first operating system 101 and the second operating system 102 are functionally symmetrical, and most of the functions that can be executed by the first operating system 101 can also be executed by the second operating system 102, and vice versa.
[0063] Specifically, the first operating system 101 is used to receive the first communication data sent by the first application on the upper layer of the first operating system 101; encode the first communication data to obtain a first data packet; when it is determined that the target receiving object of the first communication data is the second operating system 102, send the first data packet to the second operating system 102.
[0064] The second operating system 102 is used to receive the first data packet sent by the first operating system 101; decode the first data packet to obtain first communication data; after detecting that the first communication data passes the data verification, store the first communication data, and send the first communication data to the second application on the upper layer of the second operating system 102.
[0065] Specifically, the first operating system 101 and the second operating system 102 include a signal storage module that can store the current signal state value when the signal is uplinked, so that the application layer can obtain the current state of the signal when the relevant signal is needed. The first operating system 101 and the second operating system 102 also include a signal callback module that can notify the application layer through a callback function when the signal value changes. At the same time, the first operating system 101 and the second operating system 102 both include a signal filtering mechanism, which can filter the uplink and callback of repeated signal values through data repeatability verification, effectively avoid congestion of communication channels, and improve communication efficiency.
[0066] The communication system of the embodiment of the present invention utilizes the first operating system 101 to encode the first communication data of the first application on its upper layer to obtain a first data packet, and when determining that the target receiving object is the second operating system 102, the first data packet is sent to the second operating system 102, so that the second operating system 102 can send the first communication data in the first data packet to the second application on its upper layer for signal synchronization, and only needs to consider the data sending and receiving method between the upper layer application and the underlying architecture, without the need for developers to master the underlying hardware structure, which is conducive to reducing the development cycle.
[0067] The specific working principles and working processes of the first operating system 101 and the second operating system 102 are described in the following method embodiments and will not be elaborated here.
[0068] like Figure 2 As shown, a data distribution module 103 is provided between the first operating system 101 and the external device. After encoding the first communication data to obtain the first data packet, the first operating system 101 is also used for: when it is determined that the target receiving object of the first communication data is the external device, sending the first data packet to the data distribution module 103, so that the data distribution module 103 can decode the first data packet to obtain the first communication data, adapt the first communication data, and send the adapted first communication data to the corresponding external device.
[0069] Specifically, the data distribution module 103 can perform adaptation processing such as data conversion on external input data, so that signals from different platforms can provide a unified signal value definition to the upper-level applications, making the upper-level application software unaware of modifications to the underlying software and hardware. The application layer software ecosystem can be transplanted and reused on different vehicle platforms, thereby improving the system scalability and reusability.
[0070] See again Figure 2 The data distribution module 103 is also arranged between the second operating system 102 and the external device. The first / second operating system is also used to: receive the second data packet sent by the data distribution module 103; decode the second data packet to obtain second communication data; after detecting that the second communication data passes the data verification, store the second communication data, and send the second communication data to the first / second application on the upper layer of the first / second operating system; after detecting that the second communication data fails the data verification, refuse to receive the second communication data.
[0071] Specifically, the external vehicle machine status signal is first input to the data distribution module 103 through SPI or driver, and the data distribution module 103 sends it to the first operating system 101 or the second operating system 102 through the signal routing mechanism. The first operating system 101 and the second operating system 102 use HIDL (Hal Interface Definition Language) or AIDL (Android Interface Definition Language) to communicate with the upper-layer application, and can provide a set of overall protocols for all signals, and provide the same set of attribute ID values for the application layer and the external device layer. The application layer calls different interfaces through the attribute ID to send signals and communication data, and the application receives the monitoring callback of the signal through the attribute ID.
[0072] In some optional implementations, the first operating system 101 establishes a socket connection with the second operating system 102 and uses the socket connection to send the first data packet to the second operating system 102 .
[0073] Furthermore, the first operating system 101 sends a socket heartbeat packet to the second operating system 102 and times the duration of sending the heartbeat packet. When it is detected that the duration of sending the heartbeat packet exceeds a preset duration and no heartbeat response based on the socket heartbeat packet is received from the second operating system, the socket connection with the second operating system 102 is disconnected, the socket connection with the second operating system 102 is re-established, and the duration of sending the heartbeat packet is reset.
[0074] Specifically, the first operating system 101, the second operating system 102 and the data distribution module 103 use Socket connection to send and receive signals, and the first operating system 101 or the second operating system 102 can monitor the running status of the other operating system through heartbeat monitoring, thereby greatly reducing the probability of asynchronous reception of the first operating system 101 and the second operating system 102. Exemplarily, the present invention can control the signal reception error within 50ms.
[0075] Exemplarily, the first operating system 101 may be an Android system, and the second operating system 102 may be a Linux system; or, the first operating system 101 may be a Linux system, and the second operating system 102 may be an Android system.
[0076] The following takes the first operating system 101 being an Android system and the second operating system 102 being a Linux system as an example to describe the dual-system communication method of the present invention in detail.
[0077] According to an embodiment of the present invention, an embodiment of a dual-system communication method 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.
[0078] In this embodiment, a dual-system communication method is provided. The dual-system communication method can be used as follows: Figure 1 The first operating system 101 shown is an Android system and the second operating system 102 is a Linux system. Figure 3 1 is a schematic diagram of the interaction process of the communication system according to an embodiment of the present invention, wherein the first operating system 101 is used to execute steps S101 to S103, and the second operating system 102 is used to execute steps S201 to S203. The specific interaction process between the first operating system 101 and the second operating system 102 is as follows:
[0079] Step S101: receiving first communication data sent by a first application on a first operating system upper layer.
[0080] Specifically, the Android system and the Linux system use HIDL or AIDL to communicate with the upper layer, which can provide a set of overall protocols for all signals, and provide the same set of attribute ID values to the Android application layer and external devices. The application layer calls different interfaces through the attribute ID to send signals, and the application layer receives signal monitoring callbacks through the attribute ID.
[0081] Specifically, the Android system provides interfaces such as signal sending, signal acquisition, signal subscription and unsubscription to the upper layer, and the Android system can directly obtain the first communication data sent by the first application in the upper layer of the Android system through the corresponding signal acquisition interface. Similarly, the Linux system provides interfaces such as signal sending, signal acquisition, signal subscription and unsubscription to the upper layer.
[0082] Exemplarily, the signals communicated between the Android system and the Linux system are mainly signals that require dual-system synchronization, including time, screen brightness, software and hardware versions, vehicle speed, mileage, as well as vehicle speed, air conditioning, lights, doors, windows, sunroof, seats, power status, etc., but the present invention is not limited to this.
[0083] Step S102: encode the first communication data to obtain a first data packet.
[0084] Specifically, the communication data can be encoded or decoded according to the signal transmission protocol between the Android system, the Linux system and the external device, and the entire dual-system communication uses the internally formulated protocol to package and parse the data. For example, for the door signal, the first two bytes of data can indicate that the first communication data is the door information data; the third byte can indicate which door it is, such as 0x01 for the main driving door, 0x02 for the passenger driving door, etc.; the fourth byte indicates the state of the door, for example, 0x00 is the default invalid value, 0x01 indicates the door is closed, 0x02 indicates the door is open, 0x03 indicates the door state error, etc.
[0085] In addition, the first communication data may also include a window signal. Similarly, the first two bytes may be used to indicate that the data is window information; the third byte indicates which window it is; and the fourth byte may indicate the percentage of window opening, 0x00 indicates that the window is fully closed, 0x64 indicates that the window is fully open, and the middle value indicates different opening states.
[0086] Step S103: When it is determined that the target receiving object of the first communication data is the second operating system, the first data packet is sent to the second operating system.
[0087] Specifically, the Android system can communicate with the Linux system and the data distribution module, can determine the target recipient of the data according to the data requester, etc., and send it to the target recipient according to the routing document specified by the signal routing.
[0088] Step S201: receiving a first data packet sent by a first operating system.
[0089] Exemplarily, the Linux system and the Android system transmit signals via Socket, and the signal contents mainly involve related signals such as the Linux system version, and the Linux system receives the first data packet sent by the Android system via the Socket channel.
[0090] Step S202: decode the first data packet to obtain first communication data.
[0091] Specifically, the Linux system decodes the first data packet according to the signal transmission protocol between the Android system, the Linux system and the external device. For details, please refer to the description of step S102, which will not be repeated here.
[0092] Step S203: After detecting that the first communication data passes the data verification, the first communication data is stored, and the first communication data is sent to the second application on the upper layer of the second operating system.
[0093] Specifically, after obtaining the first communication data, the Linux system will perform a repeatability check on the first communication data to filter out repeatability data and alleviate communication congestion. After the first communication data passes the data check, it is stored and synchronized by the Linux system application layer through signal callback and the like.
[0094] In this embodiment, the Android system includes submodules such as data storage, data analysis, signal callback, signal filtering, signal embedding, sleep wake-up and signal routing. Among them, the data storage submodule temporarily stores the signal data transmitted by the data distribution module and the Linux system, and the Android system application layer and other services can directly obtain the relevant signal data through the signal acquisition interface; the data analysis submodule mainly analyzes the data packets transmitted by the Linux system and the data distribution module through the Socket; the signal callback submodule monitors and calls back the registered and subscribed signals so that the status of the relevant signals can be immediately synchronized to the Android application layer; the signal filtering submodule is used to filter the callback of duplicate data during the signal callback process to reduce the phenomenon of communication congestion; the signal embedding submodule is mainly used for online troubleshooting and processing of test scenarios and some special situations; the sleep wake-up submodule is used to close the data channel when the car computer is in sleep mode to reduce the power consumption of the entire system, and open the data channel when the car computer wakes up to ensure normal communication; the signal routing submodule sends the signal issued by the application to the Linux system or the data distribution module according to the routing document.
[0095] Similarly, the Linux system also includes sub-modules such as data storage, data analysis, signal callback, signal filtering, signal tracking, sleep and wake-up. The functions of the corresponding sub-modules are the same as those of the Android system sub-modules.
[0096] Exemplarily, an Android system application or other service sends communication data by calling a signal sending interface. The Android system encodes the data through a data parsing module, and then passes the data to the Socket channel of the Linux software communication module through a signal routing module to send the data.
[0097] Furthermore, after the Linux system receives the corresponding signal data packet, it decodes the data through the data analysis module, and then the data filtering module determines whether the data is duplicate data. If it is duplicate data, the data is intercepted and the signal reporting process ends. If it is non-duplicate data, the signal is not intercepted, and the synchronized data is stored in the data storage module, and the signal callback module is used to notify the Linux upper-level application or service that the signal status has changed.
[0098] The dual-system communication method provided in this embodiment uses the first operating system to encode the first communication data of the first application on its upper layer to obtain a first data packet. When it is determined that the target receiving object is the second operating system, the first data packet is sent to the second operating system, so that the second operating system can perform data verification on the first communication data in the first data packet to filter out unqualified data. After the data verification passes, the first communication data is sent to the second application on the upper layer for signal synchronization. In addition, only the data sending and receiving method between the upper layer application and the underlying architecture needs to be considered, and there is no need for developers to master the underlying hardware structure, which is conducive to reducing the development cycle.
[0099] In this embodiment, a dual-system communication method is provided. The dual-system communication method can be used as follows: Figure 2 The first operating system 101 shown is an Android system and the second operating system 102 is a Linux system. Figure 4 1 is a schematic diagram of the interaction process of the communication system according to an embodiment of the present invention, wherein the first operating system 101 is used to execute steps S301 to S308, the second operating system 102 is used to execute steps S401 to S407, and the data distribution module 103 is used to execute steps S501 to S502. The specific interaction process of the first operating system 101, the second operating system 102 and the data distribution module 103 is as follows:
[0100] Step S301: Receive first communication data sent by a first application on a first operating system. Figure 3 Step S101 of the illustrated embodiment will not be described in detail here.
[0101] Step S302: Encode the first communication data to obtain a first data packet. Figure 3 Step S102 of the illustrated embodiment will not be described in detail here.
[0102] Step S303: When it is determined that the target receiving object of the first communication data is the second operating system, the first data packet is sent to the second operating system. Figure 3 Step S103 of the illustrated embodiment will not be described in detail here.
[0103] Step S401: Receive a first data packet sent by a first operating system. Figure 3 Step S201 of the illustrated embodiment will not be described in detail here.
[0104] Step S402: Decode the first data packet to obtain the first communication data. Figure 3 Step S202 of the illustrated embodiment will not be described in detail here.
[0105] Step S403: After detecting that the first communication data passes the data verification, the first communication data is stored and sent to the second application on the upper layer of the second operating system. Figure 3 Step S203 of the illustrated embodiment will not be described in detail here.
[0106] Step S304: When it is determined that the target receiving object of the first communication data is an external device, the first data packet is sent to the data distribution module.
[0107] Specifically, the Android application layer and other services can also set and obtain the status of the vehicle's external control components through the data distribution module, such as vehicle speed, air conditioning, lights, doors, windows, sunroof, seats, power status, etc. The Android system and the data distribution module transmit signals through Socket.
[0108] Step S501: decode a first data packet to obtain first communication data.
[0109] Specifically, the data distribution module decodes the first data packet according to the signal transmission protocol between the Android system, the Linux system and the external device. For details, please refer to the description of step S102, which will not be repeated here.
[0110] Step S502: performing adaptation processing on the first communication data, and sending the adapted first communication data to a corresponding external device.
[0111] Specifically, the data distribution module includes submodules such as data analysis, signal callback, and sleep wakeup. The data distribution module sends the vehicle control signals of the Android and Linux systems to external devices. The data distribution module uses Socket connections to communicate with the Android and Linux terminals, and can use SPI connections, read and write driver nodes, etc. to communicate with external modules. The data distribution module also includes a data adaptation submodule. Data adaptation is to perform corresponding mapping conversions on the external input signal values according to the document rules.
[0112] In the embodiment of the present application, signal transmission between the first operating system and the external device is realized through a data distribution module, and the communication data is adapted and processed by the data distribution module so that the upper-layer software is unaware of the modification of the underlying software and hardware. The application-layer software ecosystem can be transplanted and reused on different vehicle-mounted platforms, thereby improving the scalability and reusability of the communication system.
[0113] Furthermore, the data distribution module feeds back the vehicle status signal transmitted from the external device to the Android and Linux systems, and the signal routing submodule of the data distribution module sends the external input signal to different external devices according to the document, or sends it to the Android system or Linux system according to the routing document, which is described in detail below in combination with steps S305 to S308 and steps S404 to S407.
[0114] Step S305: receiving a second data packet sent by the data distribution module.
[0115] Specifically, the Android system and the data distribution module transmit signals through the Socket, and receive the second data packet sent by the data distribution module.
[0116] Step S306: decode the second data packet to obtain second communication data.
[0117] Specifically, after receiving the corresponding second data packet, the Android system decodes the data through the data analysis module to obtain the second communication data.
[0118] Step S307: after detecting that the second communication data passes the data verification, the second communication data is stored, and the second communication data is sent to the first application in the upper layer of the first operating system.
[0119] Specifically, the Android system determines whether the data is duplicate data through the data filtering module. If it is non-duplicate data, the signal is not intercepted, the synchronized data is stored in the data storage module, and the signal callback module is used to notify the Android upper-layer application or service that the signal status has changed.
[0120] Step S308: after detecting that the second communication data fails the data verification, refusing to receive the second communication data.
[0121] Specifically, if the second communication data is duplicate data, the data is intercepted and the signal reporting process ends.
[0122] Step S404: receiving a second data packet sent by the data distribution module.
[0123] Specifically, the Linux system and the data distribution module perform signal transmission via Socket, and receive the second data packet sent by the data distribution module.
[0124] Step S405: decode the second data packet to obtain second communication data.
[0125] Specifically, after receiving the corresponding second data packet, the Linux system decodes the data through the data parsing module to obtain the second communication data.
[0126] Step S406: After detecting that the second communication data passes the data verification, the second communication data is stored, and the second communication data is sent to a second application on the upper layer of the second operating system.
[0127] Specifically, the Linux system determines whether the data is duplicate data through the data filtering module. If it is non-duplicate data, the signal is not intercepted, the synchronized data is stored in the data storage module, and the signal callback module is used to notify the Android upper-layer application or service that the signal status has changed.
[0128] Step S407: after detecting that the second communication data fails the data verification, refusing to receive the second communication data.
[0129] Specifically, if the second communication data is duplicate data, the data is intercepted and the signal reporting process ends.
[0130] The embodiment of the present application realizes data synchronization between different operating systems and between operating systems and external devices by receiving communications sent by the data distribution module, storing and synchronizing the communications, and filtering duplicate data through data verification, which is beneficial to improving communication efficiency.
[0131] The dual-system communication method provided in this embodiment uses the first operating system to encode the first communication data of the first application on its upper layer to obtain the first data packet. When it is determined that the target receiving object is the second operating system, the first data packet is sent to the second operating system, so that the second operating system can perform data verification on the first communication data in the first data packet to filter out unqualified data. After the data verification passes, the first communication data is sent to the upper-layer second application for signal synchronization. When it is determined that the target receiving object is the data distribution module, the first data packet is sent to the data distribution module, and the signal transmission between the first operating system and the external device is realized through the data distribution module. The communication data is adapted and processed by the data distribution module, so that the upper-layer software is unaware of the modification of the underlying software and hardware, and the application layer software ecosystem can be transplanted and reused on different vehicle platforms, which improves the scalability and reusability of the communication system.
[0132] In this embodiment, a dual-system communication method is provided. The dual-system communication method can be used as follows: Figure 1 The first operating system 101 shown is an Android system and the second operating system 102 is a Linux system. Figure 51 is a schematic diagram of the interaction process of the communication system according to an embodiment of the present invention, wherein the first operating system 101 is used to execute steps S601 to S605, and the second operating system 102 is used to execute steps S701 to S703. The specific interaction process between the first operating system 101 and the second operating system 102 is as follows:
[0133] Step S601: Receive first communication data sent by a first application on a first operating system. Figure 4 Step S301 of the illustrated embodiment will not be described in detail here.
[0134] Step S602: Encode the first communication data to obtain a first data packet. Figure 4 Step S302 of the illustrated embodiment will not be described in detail here.
[0135] Step S603: when it is determined that the target receiving object of the first communication data is the second operating system, a socket connection is established with the second operating system, and the first data packet is sent to the second operating system by using the socket connection.
[0136] Therefore, the socket connection method is used to realize communication and data transmission between the first operating system and the second operating system, which is conducive to realizing data synchronization.
[0137] Step S701: Receive a first data packet sent by a first operating system. Figure 4 Step S401 of the illustrated embodiment will not be described in detail here.
[0138] Step S702: decode the first data packet to obtain the first communication data. Figure 4 Step S402 of the illustrated embodiment will not be described in detail here.
[0139] Step S703: After detecting that the first communication data passes the data verification, the first communication data is stored and sent to the second application on the upper layer of the second operating system. Figure 4 Step S403 of the illustrated embodiment will not be described in detail here.
[0140] Step S604: Send a socket heartbeat packet to the second operating system, and time the heartbeat packet sending duration.
[0141] Specifically, after the vehicle computer is powered on, the Android and Linux systems are started, the Socket channel is connected, the Android system heartbeat module begins to enter the heartbeat timeout timing, and the timer module starts timing to send the Socket heartbeat packet.
[0142] Step S605, when it is detected that the heartbeat packet sending duration exceeds the preset duration, and the heartbeat response returned by the second operating system based on the socket heartbeat packet is not received, the socket connection with the second operating system is disconnected, the socket connection with the second operating system is re-established, and the heartbeat packet sending duration is reset.
[0143] Specifically, when the communication module receives a response frame or a signal report, it resets the heartbeat timing of the heartbeat module. If the signal feedback from another module is not received for a long time, the heartbeat timeout will be entered, the Socket connection will be closed, and then the Socket will be reconnected. If the reconnection is successful, the heartbeat timeout will be reset. If the reconnection fails, the reconnection will be repeated until it succeeds.
[0144] The embodiment of the present application monitors the connection status of the operating system by sending a socket heartbeat packet and timing the heartbeat packet sending duration, and reconnects in time after disconnection, thereby reducing the probability of asynchronous system signal reception.
[0145] The dual-system communication solution of the present invention is described in detail below with reference to a specific application example.
[0146] like Figure 6 As shown, this application example proposes a software communication architecture based on Linux and Android dual systems to solve the problems existing in the communication between Android and Linux dual systems. The software communication architecture includes: Android-side software communication module, Linux-side software communication module and data distribution module.
[0147] The Android software communication module provides interfaces such as signal sending, signal acquisition, signal subscription and unsubscription to the upper layer. The Android system application layer and other services synchronize signals with the Linux system through the interface of this communication module. The Android software communication module and the Linux system communication module transmit signals through Socket, and the main signal content involved is the request and feedback of relevant signals of the Linux system. Through the data distribution module, the Android application layer and other services can also set and obtain the status of the external control components of the vehicle through the Android software communication module. The Android software communication module and the data distribution module transmit signals through Socket. In addition, the Android software communication module can directly communicate signals with external modules.
[0148] See again Figure 6 ,The Android software communication module includes sub-modules such as data storage, data analysis, signal callback, signal filtering, signal embedding, sleep and wake-up and signal routing.
[0149] The Linux software communication module provides interfaces such as signal sending, signal acquisition, signal subscription and unsubscription to the upper layer. The Linux system application layer and other services synchronize signals with the Linux system through this communication module, and transmit signals with the Android system communication module through Socket. The main signal content involved is related signals such as the Linux system version. The Linux software communication module can also report signals to the Linux application layer by obtaining the status of external control components, and Linux displays and processes the relevant signals.
[0150] See again Figure 6 ,The Linux software communication module also includes sub-modules such as data storage, data analysis, signal callback, signal filtering, signal embedding, sleep and wake-up.
[0151] The data distribution module sends the vehicle control signals of the Android and Linux systems to the external module, and feeds back the vehicle status signals transmitted by the external module to the Android and Linux systems. This module uses Socket connection with the communication modules on the Android and Linux sides, and can communicate with the external module through SPI connection, read and write driver nodes, etc.
[0152] The data distribution module includes submodules such as data analysis, signal callback, and sleep wakeup. The signal routing submodule of the data distribution module sends the external input signal to the Android system or Linux system according to the document, or sends the signals transmitted by the Android and Linux systems to different external modules according to the document. The data distribution module also includes a data adaptation submodule, which is to map and convert the external input signal value according to the document rules.
[0153] like Figure 7 As shown, the Android system application layer signal synchronization and setting process is described in detail.
[0154] The Android system application or other service calls the signal sending interface, the Android software communication module encodes the data through the data parsing module, and then passes the data to the Socket channel of the Linux software communication module through the signal routing module to send the data.
[0155] After the Linux-side software communication module receives the corresponding signal data, it decodes the data through the data analysis module, and then the data filtering module determines whether the data is duplicate data. If it is duplicate data, the data is intercepted and the signal reporting process ends. If it is non-duplicate data, the signal is not intercepted, and the synchronized data is stored in the data storage module. The signal callback module is used to notify the Linux upper-layer application or service that the signal status has changed.
[0156] Android system applications or other services call the signal sending interface, and the Android software communication module encodes the data through the data analysis module, then determines the data sending channel through the signal routing module, and uses the Socket to send the data to the data distribution module. After receiving the data, the data distribution module maps or converts the data through the data adapter submodule, determines which external module the signal is sent to through the routing submodule, and then sends the signal to the external module through SPI or read-write driver nodes.
[0157] like Figure 8 As shown, the external module signal status feedback uplink process is described in detail.
[0158] The external module sends the signal and data to the data distribution module through the SPI channel or the read-write driver node. The data distribution module converts the externally sent data into the data form transmitted within the dual system through data adaptation and conversion. Then the data distribution module sends the data to the Android software communication module or the Linux software communication module through data routing. After the software communication module receives the signal, it decodes the data through the data parsing module, and then the data filtering module determines whether the data is duplicate data. If it is duplicate data, the data is intercepted and the signal reporting process ends. If it is non-duplicate data, the signal is not intercepted, and the synchronized data is stored in the data storage module, and the upper-level application or service is notified of the change of the signal status through the signal callback module.
[0159] like Fig. 9 As shown, the dual-system heartbeat monitoring process is described in detail.
[0160] Specifically, after the vehicle is powered on, the Android and Linux systems are started, the Socket channel is connected, the heartbeat module starts to enter the heartbeat timeout timing, and the timer module starts to time and send the Socket heartbeat packet. When the communication module receives the response frame of the signal or the signal report, the heartbeat timing of the heartbeat module will be reset. If the signal feedback from another module is not received for a long time, the heartbeat timeout will be entered, the Socket connection will be closed, and then the Socket will be reconnected. If the reconnection is successful, the heartbeat timeout will be reset. If the reconnection fails, the connection will be repeatedly reconnected until it succeeds, which greatly reduces the probability of asynchronous signal reception between the Android and Linux systems.
[0161] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.
[0162] The embodiment of the present invention further provides a vehicle, such as Fig.10 As shown, with the above Figure 1 The first operating system 101 and the second operating system 102 are shown. Exemplarily, the first operating system 101 is an Android system, and the second operating system 102 is a Linux system; or, the first operating system 101 is a Linux system, and the second operating system 102 is an Android system.
[0163] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.
[0164] A part of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the existence of the computer program instruction in a computer-readable medium includes, but is not limited to, a source file, an executable file, an installation package file, etc., and accordingly, the way in which the computer program instruction is executed by the computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium accessible to the computer.
[0165] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A dual system communication method, characterized in that: Applied to a first operating system, the method comprises: Receiving first communication data sent by a first application on an upper layer of a first operating system; Encoding the first communication data to obtain a first data packet; When it is determined that the target receiving object of the first communication data is the second operating system, the first data packet is sent to the second operating system so that the second operating system decodes the first data packet to obtain the first communication data. After detecting that the first communication data passes the data verification, the first communication data is stored and sent to the second application on the upper layer of the second operating system.
2. The method according to claim 1, characterized in that A data distribution module is provided between the first operating system and the external device; after encoding the first communication data to obtain a first data packet, the method further includes: When it is determined that the target recipient of the first communication data is an external device, the first data packet is sent to the data distribution module, so that the data distribution module decodes the first data packet to obtain the first communication data, adapts the first communication data, and sends the adapted first communication data to the corresponding external device.
3. The method according to claim 2, characterized in that The method further comprises: Receive a second data packet sent by the data distribution module; Decoding the second data packet to obtain second communication data; After detecting that the second communication data passes the data verification, storing the second communication data, and sending the second communication data to the first application in the upper layer of the first operating system; After detecting that the second communication data fails the data verification, receiving the second communication data is rejected.
4. The method according to any one of claims 1 to 3, characterized in that The sending the first data packet to the second operating system includes: A socket connection is established with the second operating system, and the first data packet is sent to the second operating system using the socket connection.
5. The method according to claim 4, characterized in that After establishing the socket connection with the second operating system, the method further includes: Sending a socket heartbeat packet to the second operating system and timing the heartbeat packet sending duration; When it is detected that the heartbeat packet sending duration exceeds the preset duration and no heartbeat response is received from the second operating system based on the socket heartbeat packet, the socket connection with the second operating system is disconnected, the socket connection with the second operating system is re-established, and the heartbeat packet sending duration is reset.
6. A dual system communication method, characterized in that: Applied to the second operating system, the method includes: Receiving a first data packet sent by a first operating system; the first data packet is obtained by the first operating system encoding first communication data sent by a first application at an upper layer; Decoding the first data packet to obtain first communication data; After detecting that the first communication data passes the data verification, the first communication data is stored, and the first communication data is sent to a second application on an upper layer of a second operating system.
7. The method according to claim 6, characterized in that A data distribution module is provided between the second operating system and the external device; the method further comprises: Receive a second data packet sent by the data distribution module; Decoding the second data packet to obtain second communication data; After detecting that the second communication data passes the data verification, storing the second communication data, and sending the second communication data to a second application in an upper layer of a second operating system; After detecting that the second communication data fails the data verification, receiving the second communication data is rejected.
8. A communication system, characterized in that: The system includes a first operating system and a second operating system; The first operating system is used to receive first communication data sent by a first application on an upper layer of the first operating system; Encoding the first communication data to obtain a first data packet; When it is determined that the target receiving object of the first communication data is the second operating system, sending the first data packet to the second operating system; The second operating system is used to receive a first data packet sent by the first operating system; Decoding the first data packet to obtain first communication data; After detecting that the first communication data passes the data verification, the first communication data is stored, and the first communication data is sent to a second application on an upper layer of a second operating system.
9. A vehicle, characterized in that: The system comprises a first operating system and a second operating system, wherein the first operating system is used to execute the dual-system communication method according to any one of claims 1 to 5, and the second operating system is used to execute the dual-system communication method according to any one of claims 6 to 7.
10. The vehicle according to claim 9, characterized in that The first operating system is an Android system, and the second operating system is a Linux system; or, the first operating system is a Linux system, and the second operating system is an Android system.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the dual-system communication method according to any one of claims 1 to 5, or to execute the dual-system communication method according to any one of claims 6 to 7.
