Vehicle camera data transmission method and transmission device
By introducing hardware abstraction layer modules and shared memory in vehicle camera data transmission, the problems of bandwidth limitation and resource consumption of traditional IPC mechanisms are solved, efficient and secure camera data transmission is achieved, and real-time and stability of transmission is improved.
Patent Information
- Application Number
- CN202411931362.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-26
- Publication Date
- 2025-04-18
AI Technical Summary
Traditional IPC mechanisms are prone to bandwidth limitations when transmitting a large amount of continuous video data, resulting in an increase in transmission delay and reducing the transmission efficiency of camera data. Frequent data copying operations increase the use of system CPU and memory, high resource consumption, increasing the complexity of data transmission, and thus reducing the stability of data transmission.
The application sends the requested instruction information to the vehicle's customized hardware abstraction layer module to obtain the camera data, and performs key encryption and verification code processing on the camera data, so that the application can obtain the stored camera data through the shared memory set by the on-board system, and achieves efficient and secure data transmission from the underlying hardware to the upper-level application.
It improves the real-time and efficiency of camera data transmission, reduces the complexity of data transmission, and thus improves the stability of data transmission.
Smart Images

Figure CN119847787A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of vehicle-mounted information technology, and in particular to a method and device for transmitting vehicle camera data. Background Art
[0002] At present, when applications installed in a vehicle's on-board system obtain data collected by the vehicle's camera, they generally transmit data through the standard V4L2 interface set by the vehicle and combine it with traditional IPC mechanisms (for example, Binder) or dedicated hardware acceleration technology, and adapt to the camera series interface provided in the on-board system.
[0003] Among them, the traditional IPC mechanism may encounter bandwidth limitations when transmitting large amounts of continuous video data, especially when the data volume is large and the video frame rate is high, which will lead to increased transmission delays and reduce the transmission efficiency of camera data. Frequent data copying operations increase the use of system CPU and memory, resulting in high resource consumption, increasing the complexity of data transmission, and thus reducing the stability of data transmission. Summary of the invention
[0004] In view of this, the purpose of the present application is to provide a vehicle camera data transmission method and transmission device, through which the application sends the request instruction information of the camera data collected by the target vehicle camera to the vehicle's customized hardware abstraction layer module, so as to obtain the camera data through the hardware abstraction layer module, and perform key encryption and checksum processing on the camera data, so that the application obtains the stored camera data through the shared memory set by the vehicle system, and realizes an efficient and secure transmission scheme of the camera data from the underlying hardware to the upper-level application in the vehicle system, thereby improving the real-time and efficiency of the camera data transmission, reducing the complexity of data transmission, and thereby improving the stability of data transmission.
[0005] The present application provides a method for transmitting vehicle camera data, the method comprising:
[0006] In response to the vehicle's in-vehicle system completing initialization configuration, based on a demand event triggered by a target application installed in the in-vehicle system and expecting to obtain camera data collected by a target vehicle camera, generating request instruction information corresponding to the demand event, and sending the request instruction information to a hardware abstraction layer module set in the vehicle;
[0007] In response to the hardware abstraction layer module verifying the access rights of the target application based on the request instruction information, encrypting the request instruction information, and sending the encrypted request instruction information to a video device interface connected to the target vehicle camera to obtain camera data collected by the target vehicle camera;
[0008] Encrypting the camera data by using a symmetric key encryption method to obtain encrypted camera data corresponding to the camera data, and calculating a verification code corresponding to the encrypted camera data, so as to send the encrypted camera data and the verification code to a shared memory set in the vehicle-mounted system;
[0009] The target application obtains the encrypted video data and the verification code in the shared memory, and decrypts the encrypted video data so that the target application can use the video data.
[0010] Further, the vehicle's onboard system is initialized and configured through the following steps:
[0011] In response to the vehicle's onboard system being started, controlling the hardware abstraction layer module to execute an initialization logic instruction, generating a query instruction for querying configuration information of the target vehicle camera, and sending the query instruction to the target vehicle camera through the video device interface and the camera driver configured by the target vehicle camera;
[0012] The hardware abstraction layer module obtains the configuration information fed back by the camera of the target vehicle through the video device interface and the camera driver;
[0013] Based on the configuration information, the memory space corresponding to the shared memory set in the vehicle-mounted system is adjusted to complete the initialization configuration of the vehicle-mounted system.
[0014] Further, adjusting the memory space corresponding to the shared memory set in the vehicle system based on the configuration information includes:
[0015] Determine whether the video device parameters corresponding to the target vehicle camera in the video device interface can be queried in the configuration information;
[0016] If the video device parameters can be queried, adjusting the memory space corresponding to the shared memory set in the vehicle-mounted system based on the video device parameters;
[0017] If the video device parameters cannot be queried, the memory space is adjusted to a preset capacity.
[0018] Further, the access rights of the target application are verified based on the request instruction information through the following steps:
[0019] Determining a permission tag corresponding to the target application based on the request instruction information;
[0020] Determining whether the permission tag matches a camera access permission tag preset by the vehicle system;
[0021] If the permission tag matches the camera access permission tag, it is determined that the access permission of the target application is verified;
[0022] If the permission tag does not match the camera access permission tag, it is determined that the access permission of the target application has failed to be verified.
[0023] Furthermore, the request instruction information is encrypted through the following steps:
[0024] Sending a key acquisition request to a password library preset in the vehicle-mounted system to obtain an encryption key used to encrypt the request instruction information;
[0025] The request instruction information is encrypted using the encryption key to obtain the encrypted request instruction information.
[0026] Further, the target application program obtains the encrypted video data and the verification code in the shared memory, and decrypts the encrypted video data so that the target application program uses the video data, including:
[0027] The target application program obtains the encrypted video data and the verification code in the shared memory, and compares the verification code with the verification code provided by the hardware abstraction layer module, so as to verify the integrity of the encrypted video data based on the comparison result;
[0028] If it is determined that the encrypted camera data is complete, the encrypted camera data is decrypted using an encryption package preset by the vehicle-mounted system so that the target application can use the camera data.
[0029] Furthermore, the target application program acquires the encrypted video data and the verification code in the shared memory, and decrypts the encrypted video data so that the target application program uses the video data, further comprising:
[0030] If it is determined that the encrypted video data has been tampered with, error information corresponding to the encrypted video data is determined, and the error information is sent to the hardware abstraction layer module.
[0031] The embodiment of the present application further provides a device for transmitting vehicle camera data, the device comprising:
[0032] A data request module, configured to generate request instruction information corresponding to a demand event for obtaining camera data collected by a target vehicle camera in response to the vehicle-mounted system completing initialization configuration, based on a demand event triggered by a target application installed in the vehicle-mounted system and expected to obtain camera data collected by a target vehicle camera, and send the request instruction information to a hardware abstraction layer module provided in the vehicle;
[0033] an encryption verification module, configured to encrypt the request instruction information in response to the hardware abstraction layer module verifying the access rights of the target application based on the request instruction information, and send the encrypted request instruction information to a video device interface connected to the target vehicle camera to obtain the camera data collected by the target vehicle camera;
[0034] A data encryption module, used to encrypt the camera data by using a symmetric key encryption method to obtain encrypted camera data corresponding to the camera data, and calculate a check code corresponding to the encrypted camera data, so as to send the encrypted camera data and the check code to a shared memory set in the vehicle-mounted system;
[0035] The data decryption module is used for the target application to obtain the encrypted camera data and the verification code in the shared memory, and to decrypt the encrypted camera data so that the target application can use the camera data.
[0036] Furthermore, when the data request module is used to initialize the configuration of the vehicle's onboard system, the data request module is used to:
[0037] In response to the vehicle's onboard system being started, controlling the hardware abstraction layer module to execute an initialization logic instruction, generating a query instruction for querying configuration information of the target vehicle camera, and sending the query instruction to the target vehicle camera through the video device interface and the camera driver configured by the target vehicle camera;
[0038] The hardware abstraction layer module obtains the configuration information fed back by the camera of the target vehicle through the video device interface and the camera driver;
[0039] Based on the configuration information, the memory space corresponding to the shared memory set in the vehicle-mounted system is adjusted to complete the initialization configuration of the vehicle-mounted system.
[0040] Further, when the data request module is used to adjust the memory space corresponding to the shared memory set in the vehicle system based on the configuration information, the data request module is used to:
[0041] Determine whether the video device parameters corresponding to the target vehicle camera in the video device interface can be queried in the configuration information;
[0042] If the video device parameters can be queried, adjusting the memory space corresponding to the shared memory set in the vehicle system based on the video device parameters;
[0043] If the video device parameters cannot be queried, the memory space is adjusted to a preset capacity.
[0044] Further, when the encryption verification module is used to verify the access rights of the target application based on the request instruction information, the encryption verification module is used to:
[0045] Determining a permission tag corresponding to the target application based on the request instruction information;
[0046] Determining whether the permission tag matches a camera access permission tag preset by the vehicle system;
[0047] If the permission tag matches the camera access permission tag, it is determined that the access permission of the target application is verified;
[0048] If the permission tag does not match the camera access permission tag, it is determined that the access permission of the target application has failed to be verified.
[0049] Furthermore, when the encryption verification module is used to encrypt the request instruction information, the encryption verification module is used to:
[0050] Sending a key acquisition request to a password library preset in the vehicle-mounted system to obtain an encryption key used to encrypt the request instruction information;
[0051] The request instruction information is encrypted using the encryption key to obtain the encrypted request instruction information.
[0052] Furthermore, when the data decryption module is used by the target application to obtain the encrypted camera data and the verification code in the shared memory and decrypt the encrypted camera data so that the target application can use the camera data, the data decryption module is used to:
[0053] The target application program obtains the encrypted video data and the verification code in the shared memory, and compares the verification code with the verification code provided by the hardware abstraction layer module, so as to verify the integrity of the encrypted video data based on the comparison result;
[0054] If it is determined that the encrypted camera data is complete, the encrypted camera data is decrypted using an encryption package preset by the vehicle-mounted system so that the target application can use the camera data.
[0055] Furthermore, when the data decryption module is used by the target application to obtain the encrypted camera data and the verification code in the shared memory and decrypt the encrypted camera data so that the target application can use the camera data, the data decryption module is also used to:
[0056] If it is determined that the encrypted video data has been tampered with, error information corresponding to the encrypted video data is determined, and the error information is sent to the hardware abstraction layer module.
[0057] An embodiment of the present application also provides an electronic device, including: a processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the memory communicate through the bus, and when the machine-readable instructions are executed by the processor, the steps of the vehicle camera data transmission method as described above are performed.
[0058] An embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the vehicle camera data transmission method as described above are executed.
[0059] The vehicle camera data transmission method and transmission device provided by the embodiment of the present application include: in response to the vehicle's on-board system completing initialization configuration, based on the target application installed in the on-board system triggering the desired acquisition of camera data collected by the target vehicle camera, generating request instruction information corresponding to the demand event, and sending the request instruction information to the hardware abstraction layer module set in the vehicle; in response to the hardware abstraction layer module verifying the access rights of the target application based on the request instruction information, encrypting the request instruction information, and sending the encrypted request instruction information to the video device interface connected to the target vehicle camera to obtain the camera data collected by the target vehicle camera; encrypting the camera data by symmetric key encryption to obtain encrypted camera data corresponding to the camera data, and calculating the verification code corresponding to the encrypted camera data, so as to send the encrypted camera data and the verification code to the shared memory set in the on-board system; the target application obtains the encrypted camera data and the verification code in the shared memory, and decrypts the encrypted camera data so that the target application uses the camera data.
[0060] Compared with the method in the prior art of transmitting data through the standard V4L2 interface set by the vehicle and combining with the traditional IPC mechanism (for example, Binder) or combining with dedicated hardware acceleration technology, and adapting the camera series interface provided in the vehicle system, the application sends the request instruction information of the camera data collected by the target vehicle camera to the vehicle's customized hardware abstraction layer module, so as to obtain the camera data through the hardware abstraction layer module, and perform key encryption and checksum processing on the camera data, so that the application obtains the stored camera data through the shared memory set by the vehicle system, and realizes an efficient and secure transmission scheme of camera data from the underlying hardware to the upper-level application in the vehicle system, thereby improving the real-time and efficiency of camera data transmission, reducing the complexity of data transmission, and thereby improving the stability of data transmission.
[0061] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0062] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0063] Figure 1 A flow chart of a method for transmitting vehicle camera data provided in an embodiment of the present application;
[0064] Figure 2 A module architecture diagram of a vehicle-mounted system provided in an embodiment of the present application;
[0065] Figure 3 A schematic diagram of transmission of camera data provided in an embodiment of the present application;
[0066] Figure 4 A schematic diagram of the structure of a vehicle camera data transmission device provided in an embodiment of the present application;
[0067] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0068] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. The components of the embodiments of the present application usually described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, each other embodiment obtained by those skilled in the art without making creative work belongs to the scope of protection of the present application.
[0069] Research has found that currently, when applications installed in the vehicle's on-board system obtain data collected by the vehicle's camera, they generally transmit data through the standard V4L2 interface set by the vehicle and combine it with traditional IPC mechanisms (for example, Binder) or dedicated hardware acceleration technology, and adapt to the camera series interface provided in the on-board system.
[0070] In the method of transmitting camera data through the standard V4L2 interface set by the vehicle and combining it with the traditional IPC mechanism (for example, Binder), the traditional IPC mechanism may encounter bandwidth limitations when transmitting large amounts of continuous video data, especially when the data volume is large and the video frame rate is high, which will lead to increased transmission delays and reduce the transmission efficiency and real-time performance of the camera data; and frequent data copy operations (from the hardware driver to the kernel space, then to the user space, and then to the target process through IPC) increase the use of the system CPU and memory, especially in a multi-threaded or multi-process environment, the resource overhead is particularly obvious; the combination of the standard interface and the general IPC mechanism requires complex synchronization logic and error handling mechanisms, which increases the difficulty of maintaining the vehicle system and the complexity of data transmission.
[0071] In addition, in the method of transmitting data through the standard V4L2 interface set up by the vehicle and combining it with dedicated hardware acceleration technology, the on-board system relies on specific hardware accelerators (such as GPU, DSP, etc.). If the vehicle is not equipped with corresponding hardware or the hardware is incompatible, the data transmission method is difficult to implement. Targeted drivers and interface adaptation layers need to be developed for the on-board system, and may involve complex hardware programming and debugging. With the development of hardware technology, dedicated hardware acceleration technology may iterate rapidly, making it difficult for the on-board system to follow up and upgrade.
[0072] The camera series interfaces provided in the vehicle system are adapted. For example, the Camera2 series interfaces provided by the Android system are adapted. The product target of the Camera2 series interfaces is the mobile phone field. Most of the interfaces are useless for the vehicle field (for example, continuous shooting). Therefore, it is necessary to adapt the interfaces required by the vehicle during adaptation. The strong correlation between the interfaces is prone to call errors, which increases the adaptation time.
[0073] Based on this, an embodiment of the present application provides a method for transmitting vehicle camera data, wherein an application sends a request instruction information for obtaining camera data collected by a target vehicle camera to a vehicle-customized hardware abstraction layer module, so as to obtain the camera data through the hardware abstraction layer module, and perform key encryption and checksum processing on the camera data, so that the application obtains the stored camera data through the shared memory set by the vehicle-mounted system, and implements an efficient and secure transmission scheme for camera data from the underlying hardware to the upper-level application in the vehicle-mounted system, thereby improving the real-time and efficiency of camera data transmission, reducing the complexity of data transmission, and thereby improving the stability of data transmission.
[0074] See also Figure 1 , Figure 1 This is a flow chart of a method for transmitting vehicle camera data provided by an embodiment of the present application. Figure 1 As shown in , the vehicle camera data transmission method provided by the embodiment of the present application includes:
[0075] S101. In response to the vehicle's onboard system completing the initialization configuration, based on a demand event triggered by a target application installed in the onboard system to obtain camera data collected by a target vehicle camera, generate request instruction information corresponding to the demand event, and send the request instruction information to a hardware abstraction layer module set in the vehicle.
[0076] In an embodiment of the present application, the vehicle-mounted system may include an Android system applied to a vehicle, the target application may include at least one application among a plurality of applications installed in the vehicle-mounted system; the target vehicle camera may include any one of at least one camera installed on the vehicle.
[0077] See also Figure 2 , Figure 2 This is a module architecture diagram of a vehicle-mounted system provided in an embodiment of the present application. Figure 2 As shown in , the in-vehicle system may include but is not limited to the application layer where the application program is located, the interface layer, the library file layer and the hardware abstraction layer.
[0078] Among them, Figure 2As shown in, the application layer may include at least one application and a camera service module. For example, the application may include an advanced video monitoring program, a driving monitoring program, a digital video program, and a video call program, etc.; the interface layer may include an API interface call module and a camera hardware abstract interface module; the library file layer may include a plurality of preset library files; the hardware abstract layer may include a video device interface, a camera driver, and a shared memory interface, etc.
[0079] In this step, during the specific implementation, first, the vehicle-mounted system is initialized and configured; then, in response to the vehicle-mounted system completing the initialization configuration, a demand event triggered by the target application to obtain the camera data collected by the target vehicle camera is determined, so as to generate request instruction information corresponding to the demand event based on the demand event; finally, the request instruction information is sent to the hardware abstraction layer module set in the vehicle.
[0080] The demand event includes specific function information of the target application and demand information corresponding to obtaining the camera data; the request instruction information may include specific information of the target application and information such as the purpose of obtaining the camera data.
[0081] In the embodiment of the present application, the hardware abstraction layer module (HAL) is a customized HAL interface for the specific needs of the vehicle environment, which optimizes the interaction protocol between the vehicle system and the camera hardware, improves the pertinence and flexibility of the interface, and ensures good compatibility with various types of vehicle camera devices. The hardware abstraction layer module can identify special requirements such as AVM / DMS, which facilitates the integration and application of applications such as AVM / DMS.
[0082] Among them, the hardware abstraction layer module sets a video device (V4L2) interface in the optimization of the interaction protocol between the system and the hardware. The video device interface uses the V4L2 framework, which improves the compatibility of the interface and has a larger adjustable range for camera-related parameters.
[0083] In this way, the hardware abstraction layer module is not only compatible with the video device interface, but also fully considers the special needs and hardware differences of the vehicle environment, so that the camera hardware can be better integrated with the vehicle system, adapt to the needs of different vehicle models or camera characteristics, enhance the system's scalability and differentiated competitiveness, and facilitate flexible configuration.
[0084] In one embodiment of the present application, in a specific implementation, the step of initializing the configuration of the vehicle's onboard system in step S101 may include:
[0085] S1011. In response to the vehicle's onboard system starting up, control the hardware abstraction layer module to execute initialization logic instructions, generate a query instruction for querying the configuration information of the target vehicle camera, and send the query instruction to the target vehicle camera through the video device interface and the camera driver configured by the target vehicle camera.
[0086] In an embodiment of the present application, the query instruction is first sent to the video device interface; then sent to the camera driver through the video device interface; finally, the query instruction is sent to the target vehicle camera through the camera driver.
[0087] The initialization logic instruction is used to start the data transmission logic and information collection function of the hardware abstraction layer module.
[0088] S1012: The hardware abstraction layer module obtains configuration information fed back by the target vehicle camera through the video device interface and the camera driver.
[0089] In an embodiment of the present application, the configuration information may include but is not limited to device parameters (eg, pixel range, etc.) and driver configuration information corresponding to the target vehicle camera, as well as information such as the data type and parameters of the camera data.
[0090] S1013: Based on the configuration information, adjust the memory space corresponding to the shared memory set in the vehicle-mounted system to complete the initialization configuration of the vehicle-mounted system.
[0091] In one implementation of the present application, during specific implementation, step S1013 may include:
[0092] S10131. Determine whether the video device parameters corresponding to the target vehicle camera in the video device interface can be queried in the configuration information.
[0093] In this step, it is determined whether the video data is compatible in the memory space of the shared memory by judging whether the video device parameters corresponding to the video device interface of the target vehicle camera can be queried in the configuration information.
[0094] S10132: If the video device parameters can be found, adjust the memory space corresponding to the shared memory set in the vehicle-mounted system based on the video device parameters.
[0095] In this step, based on the space occupied by the camera data and the data type included in the video device parameters, the memory space corresponding to the shared memory set in the vehicle system is adaptively adjusted.
[0096] S10133. If the video device parameters cannot be queried, the memory space is adjusted to a preset capacity.
[0097] In this step, if the camera data is compatible in the memory space of the shared memory, the size of the memory space of the shared memory is adjusted to a preset capacity value.
[0098] In this way, the shared memory size is dynamically allocated and adjusted according to the video device parameters of the vehicle camera, which reduces unnecessary memory usage, effectively copes with resource limitations in the vehicle environment, and improves the overall performance of the vehicle system.
[0099] S102, in response to the hardware abstraction layer module verifying the access rights of the target application based on the request instruction information, encrypting the request instruction information, and sending the encrypted request instruction information to the video device interface connected to the target vehicle camera to obtain the camera data collected by the target vehicle camera.
[0100] It should be noted that a fine-grained access permission control strategy is implemented between the vehicle system and the application in the embodiment of the present application to ensure that only authorized applications can access the data collected by the vehicle camera, thereby preventing illegal access and data leakage.
[0101] Here, the fine-grained access permission control strategy is to refine the requirements and functions of the vehicle camera, and then split the refined permissions, and use the refined permissions to constrain the access and requests of the target application to achieve the permission control strategy.
[0102] Specifically, a new permission tag is created in the native permission tag of the vehicle system. By creating the new permission tag, the specific needs of the vehicle camera are divided and the functions are refined, such as obtaining data, closing data, or obtaining streaming data.
[0103] For example, "com.exaple.car.permission.CAMERA_HAL_Open" can be used as the permission tag corresponding to the vehicle camera. When the application calls the hardware abstraction layer module to obtain access rights to the vehicle camera, the permission tag needs to be declared in the bottom layer of the application.
[0104] In one embodiment of the present application, in a specific implementation, the step of verifying the access rights of the target application based on the request instruction information in step S102 may include:
[0105] S1021. Determine a permission tag corresponding to the target application based on the request instruction information.
[0106] In this step, based on the permission information of the target application included in the request instruction information, a permission tag corresponding to the target application is determined in the permission information.
[0107] S1022: Determine whether the permission tag matches the camera access permission tag preset by the vehicle-mounted system.
[0108] S1023: If the permission tag matches the camera access permission tag, it is determined that the access permission of the target application is verified.
[0109] S1024: If the permission tag does not match the camera access permission tag, it is determined that the access permission verification of the target application has failed.
[0110] In an embodiment of the present application, when the target application registers the service corresponding interface of the hardware abstraction layer module, the hardware abstraction layer module will call the native permission management service to verify the permission label of the target application. If the underlying layer of the application does not declare the corresponding permission label, the access action of the target application is invalid.
[0111] In one implementation of the present application, during specific implementation, the step of encrypting the request instruction information in step S102 may include:
[0112] S1025: Send a key acquisition request to a cryptographic library preset in the vehicle-mounted system to obtain an encryption key used to encrypt the request instruction information.
[0113] S1026. Encrypt the request instruction information using the encryption key to obtain the encrypted request instruction information.
[0114] In an embodiment of the present application, the preset password library may include a Keystore library in the Android system, which is used to store and manage keys to ensure the security of the keys.
[0115] S103, encrypting the video data by using a symmetric key encryption method to obtain encrypted video data corresponding to the video data, and calculating a verification code corresponding to the encrypted video data, so as to send the encrypted video data and the verification code to a shared memory set in the vehicle-mounted system.
[0116] In an embodiment of the present application, the symmetric key encryption method may include an AES (Advanced Encryption Standard) encryption algorithm. In the AES encryption algorithm, the same key is used for encryption and decryption, that is, the sender and the receiver must securely share the same key. AES is a block cipher that divides plaintext into fixed-size data blocks for encryption. If the data length is not an integer multiple of the block size, the last block needs to be padded.
[0117] Among them, the check code corresponding to the encrypted camera data may include a CRC check code. The CRC check (Cyclic Redundancy Check) is an error detection technology used to verify the integrity of data transmission or storage. A check value is calculated at the sending end and attached to the data, and the check value is recalculated at the receiving end and compared with the received check value to determine whether the data has changed during the transmission process.
[0118] In this way, the camera data in the shared memory is protected by means of checksums and encryption algorithms to prevent the data from being tampered with during transmission, thereby enhancing the security of the vehicle-mounted system.
[0119] In an embodiment of the present application, the encrypted camera data and the verification code are sent to a shared memory set in the vehicle-mounted system, and the shared memory may include an anonymous shared memory (Ashmem, Anonymous Shared Memory) configured by the Android system.
[0120] In this way, the shared memory is used as a data exchange medium to avoid the overhead problems such as context switching and data replication brought about by the traditional inter-process communication (IPC) method, and zero-copy data transmission between the hardware and framework layers can be directly realized in the kernel space, which greatly improves the transmission speed and real-time performance of the vehicle camera's camera data.
[0121] In summary, by using shared memory for data transmission, shared memory serves as the data exchange medium between the underlying hardware and the upper-level framework, effectively breaking through the bandwidth limitation of the traditional IPC mechanism when transmitting large amounts of video data, and significantly reducing data transmission delays. This direct memory sharing method greatly improves the data transmission rate, ensures real-time, lossless transmission of high-definition, high-frame-rate video streams, and strongly supports the high-performance requirements of video surveillance, driving records, ADAS and other functions in the vehicle environment.
[0122] In addition, compared with traditional solutions that rely on data replication, the use of shared memory avoids unnecessary memory copy operations, significantly reduces the consumption of CPU and memory resources, makes the flow of data between different levels more efficient, and reduces the system burden, especially in multi-tasking concurrent vehicle environments, which helps maintain the stable operation and high performance of the vehicle system.
[0123] S104: The target application program obtains the encrypted video data and the verification code in the shared memory, and decrypts the encrypted video data, so that the target application program can use the video data.
[0124] In an embodiment of the present application, a data synchronization mechanism is implemented for encrypted camera data in shared memory to ensure that real-time updates of encrypted camera data in shared memory can be promptly perceived by upper-level applications. Pre-reading of camera data and intelligent buffering of shared memory can reduce data access delays, improve the smoothness of video streaming, and enhance the stability of the vehicle system and user experience.
[0125] Among them, the intelligent buffering of shared memory further improves the smoothness of video streaming, effectively avoiding screen freezes or interruptions caused by network fluctuations or transient hardware failures, thereby improving user satisfaction with in-vehicle video services.
[0126] In one implementation of the present application, during specific implementation, step S104 may include:
[0127] S1041: The target application obtains the encrypted video data and the verification code in the shared memory, and compares the verification code with the verification code provided by the hardware abstraction layer module to verify the integrity of the encrypted video data based on the comparison result.
[0128] In this step, during the specific implementation, first, the target application obtains the encrypted camera data and the verification code in the shared memory; then, the verification code calculated by the hardware abstraction layer module based on the camera data is obtained; finally, the verification code and the verification code are compared. If the verification code and the verification code are consistent, it is determined that the encrypted camera data is complete; if the verification code and the verification code are inconsistent, it is determined that the encrypted camera data has been tampered with.
[0129] S1042: If it is determined that the encrypted video data is complete, decrypt the encrypted video data using an encryption package preset by the vehicle-mounted system, so that the target application can use the video data.
[0130] Exemplarily, the preset encryption package may include a javax.crypto package provided by the Android system.
[0131] S1043: If it is determined that the encrypted video data has been tampered with, error information corresponding to the encrypted video data is determined, and the error information is sent to the hardware abstraction layer module.
[0132] In this step, the error information corresponding to the encrypted video data includes the specific content and location of the tampered encrypted video data.
[0133] See also Figure 3 , Figure 3 A schematic diagram of the transmission of camera data provided in an embodiment of the present application. Figure 3 As shown in , the target application sends request instruction information to the hardware abstraction layer module through the JAVA service; then, the hardware abstraction layer module verifies the authority of the target application based on the request instruction information, and encrypts the request instruction information to send it to the target vehicle camera through the video device interface and the camera driver; then, the camera data collected by the target vehicle camera is sent to the hardware abstraction layer module through the video device interface and the camera driver, and the hardware abstraction layer module symmetrically encrypts the camera data and calculates the verification code, and sends it to the shared memory; finally, the target application obtains the encrypted camera data and the verification code, and uses the camera data after verifying the data integrity and decrypting the data.
[0134] The vehicle camera data transmission method provided in the embodiment of the present application sends the request instruction information of the camera data collected by the target vehicle camera to the vehicle's customized hardware abstraction layer module through the application, so as to obtain the camera data through the hardware abstraction layer module, and perform key encryption and checksum processing on the camera data, so that the application can obtain the stored camera data through the shared memory set by the vehicle system, and realize the efficient and secure transmission scheme of the camera data from the bottom hardware to the upper application in the vehicle system, thereby improving the real-time and efficiency of the camera data transmission, reducing the complexity of data transmission, and thus improving the stability of data transmission.
[0135] See also Figure 4 , Figure 4 This is a schematic diagram of the structure of a vehicle camera data transmission device provided in an embodiment of the present application. Figure 4 As shown in , the transmission device 400 includes:
[0136] The data request module 410 is used to generate request instruction information corresponding to the demand event in response to the vehicle's in-vehicle system completing initialization configuration, based on a demand event triggered by a target application installed in the in-vehicle system and expecting to obtain camera data collected by a target vehicle camera, and send the request instruction information to a hardware abstraction layer module set in the vehicle;
[0137] The encryption verification module 420 is used for encrypting the request instruction information in response to the hardware abstraction layer module verifying the access rights of the target application based on the request instruction information, and sending the encrypted request instruction information to the video device interface connected to the target vehicle camera to obtain the camera data collected by the target vehicle camera;
[0138] The data encryption module 430 is used to encrypt the camera data by using a symmetric key encryption method to obtain encrypted camera data corresponding to the camera data, and calculate a verification code corresponding to the encrypted camera data, so as to send the encrypted camera data and the verification code to a shared memory set in the vehicle-mounted system;
[0139] The data decryption module 440 is used for the target application to obtain the encrypted video data and the verification code in the shared memory, and to decrypt the encrypted video data so that the target application can use the video data.
[0140] Furthermore, when the data request module 410 is used to initialize the configuration of the vehicle's onboard system, the data request module 410 is used to:
[0141] In response to the vehicle's onboard system being started, controlling the hardware abstraction layer module to execute an initialization logic instruction, generating a query instruction for querying configuration information of the target vehicle camera, and sending the query instruction to the target vehicle camera through the video device interface and the camera driver configured by the target vehicle camera;
[0142] The hardware abstraction layer module obtains the configuration information fed back by the camera of the target vehicle through the video device interface and the camera driver;
[0143] Based on the configuration information, the memory space corresponding to the shared memory set in the vehicle-mounted system is adjusted to complete the initialization configuration of the vehicle-mounted system.
[0144] Further, when the data request module 410 is used to adjust the memory space corresponding to the shared memory set in the vehicle system based on the configuration information, the data request module 410 is used to:
[0145] Determine whether the video device parameters corresponding to the target vehicle camera in the video device interface can be queried in the configuration information;
[0146] If the video device parameters can be queried, adjusting the memory space corresponding to the shared memory set in the vehicle-mounted system based on the video device parameters;
[0147] If the video device parameters cannot be queried, the memory space is adjusted to a preset capacity.
[0148] Further, when the encryption verification module 420 is used to verify the access rights of the target application based on the request instruction information, the encryption verification module 420 is used to:
[0149] Determining a permission tag corresponding to the target application based on the request instruction information;
[0150] Determining whether the permission tag matches a camera access permission tag preset by the vehicle system;
[0151] If the permission tag matches the camera access permission tag, it is determined that the access permission of the target application is verified;
[0152] If the permission tag does not match the camera access permission tag, it is determined that the access permission of the target application has failed to be verified.
[0153] Furthermore, when the encryption verification module 420 is used to encrypt the request instruction information, the encryption verification module 420 is used to:
[0154] Sending a key acquisition request to a password library preset in the vehicle-mounted system to obtain an encryption key used to encrypt the request instruction information;
[0155] The request instruction information is encrypted using the encryption key to obtain the encrypted request instruction information.
[0156] Further, when the data decryption module 440 is used by the target application to obtain the encrypted camera data and the verification code in the shared memory and decrypt the encrypted camera data so that the target application can use the camera data, the data decryption module 440 is used to:
[0157] The target application program obtains the encrypted video data and the verification code in the shared memory, and compares the verification code with the verification code provided by the hardware abstraction layer module, so as to verify the integrity of the encrypted video data based on the comparison result;
[0158] If it is determined that the encrypted camera data is complete, the encrypted camera data is decrypted using an encryption package preset by the vehicle-mounted system so that the target application can use the camera data.
[0159] Furthermore, when the data decryption module 440 is used by the target application to obtain the encrypted camera data and the verification code in the shared memory and decrypt the encrypted camera data so that the target application can use the camera data, the data decryption module 440 is also used to:
[0160] If it is determined that the encrypted video data has been tampered with, error information corresponding to the encrypted video data is determined, and the error information is sent to the hardware abstraction layer module.
[0161] The vehicle camera data transmission device provided in the embodiment of the present application sends the request instruction information of the camera data collected by the target vehicle camera to the vehicle's customized hardware abstraction layer module through the application, so as to obtain the camera data through the hardware abstraction layer module, and perform key encryption and checksum processing on the camera data, so that the application can obtain the stored camera data through the shared memory set by the vehicle system, and realize the efficient and secure transmission scheme of the camera data from the bottom hardware to the upper application in the vehicle system, thereby improving the real-time and efficiency of the camera data transmission, reducing the complexity of data transmission, and thus improving the stability of data transmission.
[0162] See also Figure 5 , Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 5 As shown in , the electronic device 500 includes a processor 510 , a memory 520 and a bus 530 .
[0163] The memory 520 stores machine-readable instructions executable by the processor 510. When the electronic device 500 is running, the processor 510 communicates with the memory 520 via the bus 530. When the machine-readable instructions are executed by the processor 510, the above-mentioned Figure 1 The specific implementation of the steps of the vehicle camera data transmission method in the method embodiment shown can be found in the method embodiment, which will not be repeated here.
[0164] The present application also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the computer program can execute the above-mentioned Figure 1 The specific implementation of the steps of the vehicle camera data transmission method in the method embodiment shown can be found in the method embodiment, which will not be repeated here.
[0165] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0166] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.
[0167] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0168] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0169] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present application can essentially or in other words, the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0170] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present application, which are used to illustrate the technical solutions of the present application, rather than to limit them. The protection scope of the present application is not limited thereto. Although the present application is described in detail with reference to the above-mentioned embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-mentioned embodiments within the technical scope disclosed in the present application, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.
Claims
1. A method for transmitting vehicle camera data, characterized in that: The transmission method comprises: In response to the vehicle's in-vehicle system completing initialization configuration, based on a demand event triggered by a target application installed in the in-vehicle system and expecting to obtain camera data collected by a target vehicle camera, generating request instruction information corresponding to the demand event, and sending the request instruction information to a hardware abstraction layer module set in the vehicle; In response to the hardware abstraction layer module verifying the access rights of the target application based on the request instruction information, encrypting the request instruction information, and sending the encrypted request instruction information to a video device interface connected to the target vehicle camera to obtain camera data collected by the target vehicle camera; Encrypting the camera data by using a symmetric key encryption method to obtain encrypted camera data corresponding to the camera data, and calculating a verification code corresponding to the encrypted camera data, so as to send the encrypted camera data and the verification code to a shared memory set in the vehicle-mounted system; The target application obtains the encrypted video data and the verification code in the shared memory, and decrypts the encrypted video data so that the target application can use the video data.
2. The method according to claim 1, characterized in that: Perform the following steps to initialize the vehicle's onboard system configuration: In response to the vehicle's onboard system being started, controlling the hardware abstraction layer module to execute an initialization logic instruction, generating a query instruction for querying configuration information of the target vehicle camera, and sending the query instruction to the target vehicle camera through the video device interface and the camera driver configured by the target vehicle camera; The hardware abstraction layer module obtains the configuration information fed back by the camera of the target vehicle through the video device interface and the camera driver; Based on the configuration information, the memory space corresponding to the shared memory set in the vehicle-mounted system is adjusted to complete the initialization configuration of the vehicle-mounted system.
3. The method according to claim 2, characterized in that The adjusting, based on the configuration information, a memory space corresponding to a shared memory set in the vehicle-mounted system includes: Determine whether the video device parameters corresponding to the target vehicle camera in the video device interface can be queried in the configuration information; If the video device parameters can be queried, adjusting the memory space corresponding to the shared memory set in the vehicle-mounted system based on the video device parameters; If the video device parameters cannot be queried, the memory space is adjusted to a preset capacity.
4. The method according to claim 1, characterized in that Verify the access rights of the target application based on the request instruction information by the following steps: Determining a permission tag corresponding to the target application based on the request instruction information; Determining whether the permission tag matches a camera access permission tag preset by the vehicle system; If the permission tag matches the camera access permission tag, it is determined that the access permission of the target application is verified; If the permission tag does not match the camera access permission tag, it is determined that the access permission of the target application has failed to be verified.
5. The method according to claim 1, characterized in that The request instruction information is encrypted by the following steps: Sending a key acquisition request to a password library preset in the vehicle-mounted system to obtain an encryption key used to encrypt the request instruction information; The request instruction information is encrypted using the encryption key to obtain the encrypted request instruction information.
6. The method according to claim 1, characterized in that The step of obtaining the encrypted video data and the verification code from the shared memory by the target application and decrypting the encrypted video data so that the target application can use the video data includes: The target application program obtains the encrypted video data and the verification code in the shared memory, and compares the verification code with the verification code provided by the hardware abstraction layer module, so as to verify the integrity of the encrypted video data based on the comparison result; If it is determined that the encrypted camera data is complete, the encrypted camera data is decrypted using an encryption package preset by the vehicle-mounted system so that the target application can use the camera data.
7. The method according to claim 6, characterized in that The target application program acquires the encrypted video data and the verification code in the shared memory, and decrypts the encrypted video data so that the target application program uses the video data, further comprising: If it is determined that the encrypted video data has been tampered with, error information corresponding to the encrypted video data is determined, and the error information is sent to the hardware abstraction layer module.
8. A vehicle camera data transmission device, characterized in that: The transmission device comprises: A data request module, configured to generate request instruction information corresponding to a demand event for obtaining camera data collected by a target vehicle camera in response to the vehicle-mounted system completing initialization configuration, based on a demand event triggered by a target application installed in the vehicle-mounted system and expected to obtain camera data collected by a target vehicle camera, and send the request instruction information to a hardware abstraction layer module provided in the vehicle; an encryption verification module, configured to encrypt the request instruction information in response to the hardware abstraction layer module verifying the access rights of the target application based on the request instruction information, and send the encrypted request instruction information to a video device interface connected to the target vehicle camera to obtain the camera data collected by the target vehicle camera; A data encryption module, used to encrypt the camera data by using a symmetric key encryption method to obtain encrypted camera data corresponding to the camera data, and calculate a check code corresponding to the encrypted camera data, so as to send the encrypted camera data and the check code to a shared memory set in the vehicle-mounted system; The data decryption module is used for the target application to obtain the encrypted camera data and the verification code in the shared memory, and to decrypt the encrypted camera data so that the target application can use the camera data.
9. An electronic device, characterized in that: include: A processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the memory communicate through the bus, and the machine-readable instructions are executed by the processor to execute the steps of the vehicle camera data transmission method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the vehicle camera data transmission method according to any one of claims 1 to 7 are executed.
Citation Information
Cited By
Camera configuration system and method, vehicle, storage medium and program product
CN120786173A