Equipment control method, automobile intelligent cabin, automobile and medium

By configuring the virtual I2C bus in the main operating system of the car's smart cockpit and configuring the virtual I2C device in the slave operating system, the problem that VirtIO-I2C cannot be universalized in the existing technology is solved, and the development efficiency and system flexibility are improved. .

CN118584844APending Publication Date: 2024-09-03HISENSE GRP HLDG CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202310188857.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-03-01
Publication Date
2024-09-03

AI Technical Summary

Technical Problem

In the existing technology, the I2C bus and I2C devices of VirtIO-I2C need to be dynamically generated in the main operating system, causing the main operating system to be unable to be generalized and reducing development efficiency.

Method used

Configure the virtual I2C bus in the main operating system, configure the virtual I2C device connected to the car's smart cockpit in the slave operating system, and mount the virtual I2C device to the virtual I2C bus when the slave operating system kernel starts, and obtain it from the operating system The driver instructions of the target peripheral are sent to the target peripheral through the virtual I2C bus.

Benefits of technology

It reduces the coupling degree between the main operating system and the slave operating system, ensures the universality of VirtIO-I2C of the main operating system, enables the main operating system to be quickly transplanted to other projects, and improves development efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118584844A
    Figure CN118584844A
Patent Text Reader

Abstract

The invention provides an equipment control method, an automobile intelligent cabin, an automobile and a medium. According to the method, a virtual I2C bus is configured in a master operating system in an automobile intelligent cabin, virtual I2C equipment corresponding to at least one peripheral connected with the automobile intelligent cabin is configured in a slave operating system, and then the virtual I2C equipment of the slave operating system is mounted on the virtual I2C bus in the starting process of a kernel of the slave operating system; after successful mounting, acquiring a driving instruction for a target peripheral in the at least one peripheral from the operating system; and if it is determined that the configuration information of the virtual I2C device of the operating system comprises the identification information of the target peripheral acquired from the operating system, sending the driving instruction to the target peripheral through the virtual I2C bus, so that the target peripheral executes an operation corresponding to the driving instruction. Therefore, the generalization of the main operating system is ensured, so that the main operating system can be quickly transplanted to other projects, and the development efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of vehicle control technology, and in particular to a device control method, a car smart cockpit, a car and a medium. Background Art

[0002] In the in-vehicle smart cockpit system, multiple operating systems are generally run on a SOC (System on Chip), including a master operating system and at least one slave operating system. VirtIO-I2C technology is a technical solution for sharing the I2C bus and I2C devices between the master operating system and the slave operating system.

[0003] However, in the existing solution, the I2C bus and I2C device of VirtIO-I2C need to be dynamically generated for the slave operating system in the master operating system. At this time, if a peripheral is replaced, the configuration information of the master operating system and the slave operating system needs to be replaced at the same time, making the master operating system VirtIO-I2C unable to be universal, reducing development efficiency. Summary of the invention

[0004] The purpose of this application is to provide a device control method, a car smart cockpit, a car and a medium, so as to solve the problem in the prior art that the main operating system VirtIO-I2C cannot be universalized, thereby reducing the development efficiency.

[0005] In a first aspect, the present application provides a method for controlling a device, which is applied to a smart cockpit of a car, wherein the smart cockpit is connected to at least one peripheral device, and the smart cockpit includes a main operating system and a slave operating system, and the method includes:

[0006] The automobile intelligent cockpit obtains the DTB file of the slave operating system through the master operating system, adds the configuration information of the virtual I2C bus of the master operating system to the DTB file, and obtains a reference DTB file;

[0007] The automobile intelligent cockpit obtains the reference DTB file through the slave operating system, adds the configuration information of the virtual I2C device in the slave operating system in the reference DTB file to the configuration information of the virtual I2C bus in the master operating system, and obtains a target DTB file;

[0008] The automobile intelligent cockpit obtains a driving instruction for a target peripheral device in the at least one peripheral device through the operating system; the driving instruction includes identification information of the target peripheral device;

[0009] If the automobile intelligent cockpit determines through the slave operating system that the target DTB file includes the identification information of the target peripheral device, the driving instruction is sent to the target peripheral device through the virtual I2C bus, so that the target peripheral device executes the operation corresponding to the driving instruction.

[0010] In a possible implementation, the automobile intelligent cockpit obtains the DTB file of the slave operating system through the master operating system, adds the configuration information of the virtual I2C bus of the master operating system to the DTB file, and obtains a reference DTB file, including:

[0011] The automobile intelligent cockpit obtains the DTB file of the slave operating system through the master operating system, stores the DTB file of the slave operating system in the shared memory through the Virtio channel, and records the location information of the DTB file of the slave operating system in the shared memory;

[0012] The automobile intelligent cockpit adds the configuration information of the virtual I2C bus in the main operating system to the DTB file of the slave operating system based on the location information through the main operating system to obtain the reference DTB file; the reference DTB file is stored in the shared memory.

[0013] In a possible implementation manner, the automobile intelligent cockpit obtains the reference DTB file from the operating system, including:

[0014] After the automobile intelligent cockpit receives the startup command sent by the main operating system through the slave operating system, it obtains the reference DTB file from the shared memory; wherein, the startup command is sent to the slave operating system by the main operating system after storing the reference DTB file in the shared memory.

[0015] In a possible implementation, the automobile intelligent cockpit obtains the reference DTB file through the slave operating system, adds the configuration information of the virtual I2C device in the slave operating system in the reference DTB file to the configuration information of the virtual I2C bus in the master operating system, and obtains the target DTB file, including:

[0016] The automobile intelligent cockpit obtains the reference DTB file through the slave operating system. If it is determined that the reference DTB file includes the configuration information of the virtual I2C device in the slave operating system and the configuration information of the virtual I2C bus in the main operating system, the configuration information of the virtual I2C device in the slave operating system in the reference DTB file is added to the configuration information of the virtual I2C bus in the main operating system to obtain the target DTB file.

[0017] In a possible implementation manner, the configuration information of the virtual I2C device in the slave operating system and the configuration information of the virtual I2C bus in the master operating system are determined in the reference DTB file according to the following method:

[0018] The automobile intelligent cockpit scans the reference DTB file through the slave operating system, and if the reference DTB file includes preset node information corresponding to the virtual I2C device in the slave operating system, determines that the reference DTB file includes configuration information of the virtual I2C device in the slave operating system;

[0019] The automobile smart cockpit scans the reference DTB file again through the slave operating system. If the reference DTB file includes preset node information corresponding to the virtual I2C bus in the main operating system, it is determined that the reference DTB file includes configuration information of the virtual I2C bus in the main operating system.

[0020] In a possible implementation, adding the configuration information of the virtual I2C device in the slave operating system in the reference DTB file to the configuration information of the virtual I2C bus in the master operating system to obtain the target DTB file includes:

[0021] The automobile intelligent cockpit records, by the slave operating system, a first offset address of the preset node information of the virtual I2C device relative to the reference DTB file header and a second offset address of the preset node information of the virtual I2C device relative to the reference DTB file header;

[0022] Based on the first offset address and the second offset address, the configuration information of the virtual I2C device in the slave operating system in the reference DTB file is added to the configuration information of the virtual I2C bus in the master operating system to obtain a target DTB file.

[0023] In a possible implementation manner, before adding the configuration information of the virtual I2C device in the slave operating system in the reference DTB file to the configuration information of the virtual I2C bus in the master operating system to obtain the target DTB file, the method further includes:

[0024] The automobile intelligent cockpit parses the reference DTB file through the unflatten_device_tree interface of the slave operating system to obtain configuration information corresponding to the virtual I2C bus in the reference DTB file and configuration information corresponding to the virtual I2C device in the reference DTB file.

[0025] In a second aspect, the present application provides an intelligent car cockpit, the intelligent car cockpit comprising a processor and a memory, a main operating system and a slave operating system running on the processor, and the processor being connected to at least one peripheral device via a physical I2C bus;

[0026] The memory stores program codes, and when the program codes are executed by the processor, the processor performs the following process:

[0027] Obtaining the DTB file of the slave operating system through the master operating system, adding the configuration information of the virtual I2C bus of the master operating system to the DTB file, and obtaining a reference DTB file;

[0028] Acquire the reference DTB file through the slave operating system, add the configuration information of the virtual I2C device in the slave operating system in the reference DTB file to the configuration information of the virtual I2C bus in the master operating system, and obtain a target DTB file;

[0029] Obtaining a driving instruction for a target peripheral device in the at least one peripheral device from the operating system; the driving instruction includes identification information of the target peripheral device;

[0030] If the slave operating system determines that the target DTB file includes identification information of the target peripheral device, the drive instruction is sent to the target peripheral device through the virtual I2C bus, so that the target peripheral device executes the operation corresponding to the drive instruction.

[0031] In a third aspect, the present application provides a car, the car comprising a car smart cockpit and at least one peripheral device, the car smart cockpit being connected to the peripheral device via a physical I2C bus, the car smart cockpit comprising a master operating system and a slave operating system:

[0032] The automobile intelligent cockpit is used to obtain the DTB file of the slave operating system through the main operating system, add the configuration information of the virtual I2C bus of the main operating system to the DTB file, and obtain a reference DTB file; obtain the reference DTB file through the slave operating system, add the configuration information of the virtual I2C device in the slave operating system in the reference DTB file to the configuration information of the virtual I2C bus in the main operating system, and obtain a target DTB file; obtain the drive instruction for the target peripheral device in the at least one peripheral device through the slave operating system; if it is determined by the slave operating system that the target DTB file includes the identification information of the target peripheral device, the drive instruction is sent to the target peripheral device through the virtual I2C bus; wherein the drive instruction includes the identification information of the target peripheral device;

[0033] The target peripheral device in the at least one peripheral device is used to execute the operation corresponding to the driving instruction.

[0034] In a fourth aspect, the present application provides a computer-readable storage medium comprising a program code. When the program code is run on a smart cockpit of a car, the program code is used to enable the smart cockpit of the car to execute the method for controlling the device as described in the first aspect above.

[0035] In a fifth aspect, the present application provides a computer program product, including a computer program:

[0036] When the computer program is executed by a processor, the method for controlling the device as described in the first aspect above is implemented.

[0037] The technical solution provided by the embodiments of the present application brings at least the following beneficial effects:

[0038] Since the embodiment of the present application targets the main operating system and the slave operating system in the smart cockpit of the car, a virtual I2C bus is configured in the main operating system, and a virtual I2C device corresponding to at least one peripheral connected to the smart cockpit of the car is configured in the slave operating system, and then the virtual I2C device of the slave operating system is mounted to the virtual I2C bus during the process of starting from the operating system kernel; after the mounting is successful, a driving instruction for a target peripheral in at least one peripheral is obtained from the operating system; the driving instruction includes identification information of the target peripheral; if it is determined that the configuration information of the virtual I2C device of the slave operating system includes the identification information of the target peripheral obtained from the operating system, the driving instruction is sent to the target peripheral through the virtual I2C bus, so that the target peripheral executes the operation corresponding to the driving instruction.

[0039] Therefore, in the present application, the main operating system only creates a virtual I2C bus for the slave operating system, and creates a virtual I2C device from the operating system itself, thereby avoiding the separation of the device and driver of the virtual I2C device in different operating systems, and at the same time reducing the coupling degree between the main operating system and the slave operating system, ensuring the universality of the main operating system VirtIO-I2C, making it convenient to replace peripherals without affecting the use of the main operating system, so that the main operating system can be quickly transplanted to other projects, thereby improving development efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments of the present application will be briefly introduced below. Obviously, the drawings introduced below are only some embodiments of the present application.

[0041] Figure 1 A schematic diagram of an application scenario of a control method for a device according to an embodiment of the present application;

[0042] Figure 2 This is a schematic diagram of an automobile intelligent cockpit in a vehicle according to an embodiment of the present application;

[0043] Figure 3 A schematic diagram of a control method for a device according to an embodiment of the present application;

[0044] Figure 4 A flowchart of a method for determining a reference DTB file according to an embodiment of the present application;

[0045] Figure 5 A schematic diagram of a process of creating a virtual I2C bus in a main operating system according to an embodiment of the present application;

[0046] Figure 6 A schematic diagram of a virtual I2C bus in a main operating system according to an embodiment of the present application;

[0047] Figure 7 A flowchart of a method for determining configuration information in a reference DTB file according to an embodiment of the present application;

[0048] Figure 8 A schematic diagram of scanning a reference DTB file from an operating system according to an embodiment of the present application;

[0049] Fig. 9 A flowchart of a method for determining a target DTB file according to an embodiment of the present application;

[0050] Fig.10 This is a schematic diagram of a process of mounting a virtual I2C device according to an embodiment of the present application;

[0051] Fig.11 This is a schematic diagram of mounting a virtual I2C device according to an embodiment of the present application;

[0052] Fig.12 A schematic diagram of a process of mounting a virtual I2C device to a virtual I2C bus according to an embodiment of the present application;

[0053] Fig.13 A schematic diagram of mounting a virtual I2C device on a virtual I2C bus according to an embodiment of the present application;

[0054] Fig.14 A schematic diagram of mounting a virtual I2C device on a virtual I2C bus according to an embodiment of the present application;

[0055] Fig.15 A schematic diagram of a peripheral device corresponding to a slave operating system according to an embodiment of the present application;

[0056] Fig.16 A schematic diagram of a peripheral device corresponding to a slave operating system according to an embodiment of the present application;

[0057] Fig.17 A schematic diagram of a peripheral device corresponding to a slave operating system according to an embodiment of the present application;

[0058] Fig.18 This is an overall flow chart of a control method for a device according to an embodiment of the present application;

[0059] Fig.19 This is a structural schematic diagram of an automobile intelligent cockpit according to an embodiment of the present application;

[0060] Fig. 20 This is a schematic diagram of the structure of a control device of an equipment in an embodiment of the present application. DETAILED DESCRIPTION

[0061] In order 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. Among them, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0062] Furthermore, in the description of the embodiments of the present application, unless otherwise specified, “ / ” means or. For example, A / B can mean A or B. The “and / or” in the text is merely a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, “multiple” refers to two or more than two.

[0063] In the following, the terms "first" and "second" are used for descriptive purposes only and should not be understood as suggesting or implying relative importance or implicitly indicating the number of technical features indicated. Thus, features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the embodiments of the present application, unless otherwise specified, "multiple" means two or more.

[0064] In order to facilitate understanding of a control method of a device, a car smart cockpit, a car and a medium provided in an embodiment of the present application, some terms in the embodiments of the present application are explained below to facilitate understanding by those skilled in the art.

[0065] (1) SoC, from a narrow perspective, is the chip integration at the core of the information system, which integrates the key components of the system on a single chip; from a broad perspective, SoC is a miniature system. If the central processing unit (CPU) is the brain, then SoC is a system that includes the brain, heart, eyes, and hands.

[0066] (2) The I2C bus (Inter-Integrated Circuit) is a simple, bidirectional, two-wire synchronous serial bus. It only requires two wires to transmit information between devices connected to the bus. The master device is used to start the bus to transmit data and generate a clock to open the transmitting device. At this time, any addressed device is considered a slave device. The relationship between the master and slave, send and receive on the bus is not constant, but depends on the direction of data transmission at this time. If the host wants to send data to the slave device, the host first addresses the slave device, then actively sends data to the slave device, and finally the host terminates the data transmission; if the host wants to receive data from the slave device, the master device first addresses the slave device, then the host receives the data sent by the slave device, and finally the host terminates the receiving process. In this case, the host is responsible for generating the timing clock and terminating the data transmission.

[0067] (3) QNX is a microkernel real-time operating system whose core provides only four services: process scheduling, inter-process communication, low-level network communication, and interrupt handling. Its processes run in independent address spaces.

[0068] (4) Hypervisor (virtual machine monitor) is used to provide a virtual operating platform to execute guest operating systems and is responsible for managing the execution phase of other guest operating systems; these guest operating systems share virtualized hardware resources. Among them, the computer used by the hypervisor to execute one or more virtual machines is called the host machine, and these virtual machines are called guest machines. Hypervisor virtualization provides key technical support for the same hardware platform to carry multiple different types of operating systems and services with different response times. With the help of Hypervisor virtualization technology, hardware redundancy is eliminated and the overall design is simplified, while the needs of resource reuse, computing power sharing, and security isolation are met.

[0069] (5) OASIS (Organization for the Advancement of Structured Information Standards) formally standardized the VirtIO project, which aims to provide a common framework and standard interface to reduce the workload of hypervisor adaptation and development for different underlying hardware and upper-layer software.

[0070] (6) Virtio is a general I / O semi-virtualization framework that uses virtqueue (virtual queue) to implement its I / O mechanism. It can provide a set of middle-layer APIs (Application Program Interface) that are easy to maintain and develop, and can provide a channel for communication between Host OS (main operating system) and Guest OS (slave operating system). Virtio is a set of general device simulation interfaces that are easy to maintain and expand, consisting of a front-end driver (Front-End Driver), a back-end driver (Back-End Driver) and a Virtio virtual queue (Virtual Queue).

[0071] (7) Virtio-I2C provides a virtual I2C adapter that supports mapping multiple slave devices under multiple native I2C adapters to one Virtio I2C adapter. The address of the slave device does not change, so the slave device driver in the guest operating system does not need to be changed.

[0072] In the in-vehicle smart cockpit system, multiple operating systems are generally run on a SOC (System on Chip), including a master operating system and at least one slave operating system. VirtIO-I2C technology is a technical solution for sharing the I2C bus and I2C devices between the master operating system and the slave operating system.

[0073] However, in the existing solution, the I2C bus and I2C device of VirtIO-I2C need to be dynamically generated for the slave operating system in the master operating system. At this time, if a peripheral is replaced, the configuration information of the master operating system and the slave operating system needs to be replaced at the same time, making the master operating system VirtIO-I2C unable to be universal, reducing development efficiency.

[0074] In view of this, the present application provides a device control method, a car smart cockpit, a car and a medium to solve the problem in the prior art that the main operating system VirtIO-I2C cannot be universalized, thereby reducing development efficiency.

[0075] The inventive concept of the embodiment of the present application can be summarized as follows: in the embodiment of the present application, for the main operating system and the slave operating system in the intelligent cockpit of the automobile, a virtual I2C bus is configured in the main operating system, and a virtual I2C device corresponding to at least one peripheral connected to the intelligent cockpit of the automobile is configured in the slave operating system, and then the virtual I2C device of the slave operating system is mounted on the virtual I2C bus during the process of starting from the kernel of the slave operating system; after the mounting is successful, the drive instruction for the target peripheral in at least one peripheral is obtained from the operating system; the drive instruction includes the identification information of the target peripheral; if it is determined that the configuration information of the virtual I2C device of the slave operating system includes the identification information of the target peripheral obtained from the operating system, the drive instruction is sent to the target peripheral through the virtual I2C bus, so that the target peripheral executes the operation corresponding to the drive instruction. Thus, the coupling degree between the main operating system and the slave operating system is reduced, the generalization of the main operating system VirtIO-I2C is guaranteed, and the main operating system can also be quickly transplanted to other projects to improve development efficiency.

[0076] After introducing the main inventive concept of the embodiment of the present application, an application scenario diagram of a control method for a device provided in the embodiment of the present application is introduced below in conjunction with the accompanying drawings.

[0077] like Figure 1 As shown, an application scenario of an optional device control method of an embodiment of the present application includes a smart cockpit 10 of a car and at least one peripheral device 12 of the car, wherein each peripheral device 12 is connected to the smart cockpit of the car through a physical I2C bus 11;

[0078] The automobile intelligent cockpit 10 obtains the DTB file of the slave operating system through the main operating system, adds the configuration information of the virtual I2C bus of the main operating system to the DTB file, and obtains a reference DTB file; obtains the reference DTB file from the slave operating system, adds the configuration information of the virtual I2C device in the slave operating system in the reference DTB file to the configuration information of the virtual I2C bus in the main operating system, and obtains a target DTB file; obtains a drive instruction for a target peripheral in at least one peripheral from the slave operating system; the drive instruction includes identification information of the target peripheral; if the slave operating system determines that the target DTB file includes identification information of the target peripheral, the drive instruction is sent to the target peripheral through the virtual I2C bus;

[0079] The target peripheral receives the driving instruction and performs corresponding operations according to the driving instruction.

[0080] Of course, the method provided in the embodiment of the present application is not limited to Figure 1 The application scenarios shown can also be used in other possible application scenarios, and the embodiments of the present application are not limited thereto. Figure 1The functions that can be implemented by each system in the application scenario shown will be described in the subsequent method embodiments, and will not be described in detail here.

[0081] To further illustrate the technical solution provided by the embodiment of the present application, this is described in detail below in conjunction with the accompanying drawings and specific implementation methods. Although the embodiment of the present application provides the method operation steps shown in the following embodiments or drawings, more or fewer operation steps may be included in the method based on routine or no creative labor. In the steps where there is no necessary causal relationship logically, the execution order of these steps is not limited to the execution order provided in the embodiment of the present application.

[0082] like Figure 2 As shown in FIG. 1 , a schematic diagram of an intelligent car cockpit in a car according to an embodiment of the present application is shown. The intelligent car cockpit 10 is equivalent to a terminal device including a chip with processing function. Figure 2 The position of the automobile smart cockpit 10 in the automobile is shown in FIG.

[0083] Multiple operating systems can be run in a car's smart cockpit, such as a master operating system and at least one slave operating system. If both the virtual I2C bus and the virtual I2C device are created in the master operating system, when the target peripheral is replaced, the master operating system and the slave operating system need to be replaced at the same time, making the master operating system non-universal and reducing development efficiency. Therefore, the present application provides a device control method.

[0084] like Figure 3 FIG. 1 is a flow chart of a control method for a device according to an embodiment of the present application, and the specific steps are as follows:

[0085] In step 301, the car smart cockpit obtains the DTB file of the slave operating system through the master operating system, adds the configuration information of the virtual I2C bus of the master operating system to the DTB file, and obtains a reference DTB file.

[0086] In a possible implementation, the smart cockpit of the automobile obtains the DTB file of the slave operating system through the master operating system, adds the configuration information of the virtual I2C bus of the master operating system to the DTB file, and obtains a reference DTB file, which can be specifically executed as follows: Figure 4 Steps shown:

[0087] In step 401, the car smart cockpit obtains the DTB file of the slave operating system through the main operating system, stores the DTB file of the slave operating system in the shared memory through the Virtio channel, and records the location information of the DTB file of the slave operating system in the shared memory.

[0088] In step 402, the car smart cockpit adds the configuration information of the virtual I2C bus in the main operating system to the DTB file of the slave operating system based on the location information through the main operating system to obtain a reference DTB file; the reference DTB file is stored in the shared memory.

[0089] In the embodiment of the present application, the main operating system may be a QNX system with a Hypervisor.

[0090] The virtual I2C bus is virtualized and does not exist as a physical entity. In the embodiment of the present application, the virtual I2C bus has the function of transmitting data, determining the actual physical address according to the correspondence between the virtual address of the target peripheral and the pre-configured information, and the function of the physical I2C bus, as well as the function of parsing the acquired control instructions. In specific implementation, such as Figure 5 As shown, configuration information of the virtual I2C bus is generated in the main operating system.

[0091] like Figure 5 As shown, it is a flow chart of generating configuration information of a virtual I2C bus in a main operating system provided by an embodiment of the present application, and the specific steps are as follows:

[0092] In step 501, configuration information of a virtual I2C bus is generated in advance.

[0093] In step 502, parameter values ​​corresponding to configuration information of the virtual I2C bus are obtained.

[0094] In step 503, the configuration information of the virtual I2C bus and the corresponding parameter values ​​are added to the main operating system to generate the configuration information of the virtual I2C bus.

[0095] When implementing it, Figure 6 As shown in FIG. 1 , it is a schematic diagram of the configuration information of the virtual I2C bus generated in the main operating system. Among them, "-loc", "-intr gic" and "-slave" are the configuration information of the virtual I2C bus, and "uini64_t" and "uini8_t" are the parameter values ​​corresponding to the configuration information "-loc" and "-intr gic". In this application, the main operating system stores the obtained DTB file of the slave operating system into the shared memory through the Virtio channel, and then Figure 6 The configuration information of the virtual I2C bus in the master operating system is all added to the DTB file of the slave operating system to obtain a reference DTB file.

[0096] In step 302, the car smart cockpit obtains a reference DTB file from the operating system, and adds the configuration information of the virtual I2C device in the reference DTB file from the operating system to the configuration information of the virtual I2C bus in the main operating system to obtain a target DTB file.

[0097] Wherein, one peripheral corresponds to one virtual I2C device, that is, the virtual I2C device is virtualized from the operating system to the peripheral, and there is no physical entity, but the virtual I2C device and the corresponding peripheral have the same function and role. Wherein, the slave operating system in the embodiment of the present application can be a Linux system, an Android system or a QNX system.

[0098] In one possible implementation, after the main operating system stores the reference DTB file in the shared memory, it sends a startup command to the slave operating system. Therefore, after the car smart cockpit receives the startup command sent by the main operating system through the slave operating system, it obtains the reference DTB file from the shared memory.

[0099] The start command is sent by the master operating system to the slave operating system after the master operating system stores the reference DTB file in the shared memory.

[0100] In a possible implementation, the smart cockpit of the automobile obtains a reference DTB file from the operating system, and adds the configuration information of the virtual I2C device in the slave operating system in the reference DTB file to the configuration information of the virtual I2C bus in the main operating system to obtain a target DTB file, including:

[0101] The car smart cockpit obtains a reference DTB file from the operating system. If it is determined that the reference DTB file includes the configuration information of the virtual I2C device in the slave operating system and the configuration information of the virtual I2C bus in the main operating system, the configuration information of the virtual I2C device in the slave operating system in the reference DTB file is added to the configuration information of the virtual I2C bus in the main operating system to obtain the target DTB file.

[0102] In a possible implementation, according to Figure 7 The steps shown determine that the reference DTB file includes configuration information of the virtual I2C device in the slave operating system and configuration information of the virtual I2C bus in the master operating system:

[0103] In step 701, the car smart cockpit scans the reference DTB file from the operating system. If the reference DTB file includes preset node information corresponding to the virtual I2C device in the operating system, it is determined that the reference DTB file includes configuration information of the virtual I2C device in the operating system.

[0104] When implementing it, Figure 8 As shown, to scan the reference DTB file from the operating system to see if it contains a virtual I2C device, first parse the reference DTB file, then use the early_init_dt_scan_node() function to obtain the system boot parameters such as bootargs and cmd_line required for the early initialization of the kernel, and then parse the chosen node, the size-cells (address length) and address-cells (address information) values ​​of the root node, the memory node, and the virtual I2C device in turn according to the information of the system boot parameters such as bootargs and cmd_line. If the preset node information corresponding to the virtual I2C device in the operating system is parsed when parsing the virtual I2C device, it is determined that the reference DTB file includes the configuration information of the virtual I2C device in the operating system.

[0105] Among them, since the virtual I2C bus dynamically generated by the main operating system is not visible from the operating system dts file (source file) during the development stage, the virtual I2C device can be hung under the preset node information when configuring the virtual I2C device information. The node name of the preset node information can be the virtual I2C bus name generated in the main operating system +-guest, or other characters, and this application does not limit this.

[0106] In step 702, the car smart cockpit scans the reference DTB file again from the operating system. If the reference DTB file includes preset node information corresponding to the virtual I2C bus in the main operating system, it is determined that the reference DTB file includes configuration information of the virtual I2C bus in the main operating system.

[0107] For detailed process, see Figure 8 The contents shown will not be elaborated here.

[0108] In a possible implementation, the configuration information of the virtual I2C device in the slave operating system in the reference DTB file is added to the configuration information of the virtual I2C bus in the main operating system to obtain the target DTB file, which can be executed as follows: Fig. 9 Steps shown:

[0109] In step 901, the smart cockpit of the automobile records the first offset address of the preset node information of the virtual I2C device relative to the reference DTB file header and the second offset address of the preset node information of the virtual I2C bus relative to the reference DTB file header from the operating system;

[0110] In step 902, based on the first offset address and the second offset address, the configuration information of the virtual I2C device in the slave operating system in the reference DTB file is added to the configuration information of the virtual I2C bus in the main operating system to obtain a target DTB file.

[0111] The first offset address is the position information of the preset node information of the virtual I2C device relative to the reference DTB file header, and the second offset address is the position information of the preset node information of the virtual I2C bus relative to the reference DTB file header.

[0112] In specific implementation, the reference DTB file will be parsed during the boot process of the Linux kernel from the operating system, and the device tree required by the operating system will be generated based on the reference DTB file for the subsequent creation of devices and loading of driver modules from the operating system. It can be done in two steps: The first step is to scan whether there is configuration information of the virtual I2C device in the reference DTB file of the operating system. If so, the first offset address offset of the configuration information of the virtual I2C device in the reference DTB file is recorded: The second step is that if the virtual I2C bus is found in the reference DTB file from the operating system Linux, the virtual I2C device is mounted to the virtual I2C bus, and then the device tree of the operating system is generated. It can be executed as follows Fig.10 Steps shown:

[0113] In step 1001, a reference DTB file is scanned, and if the reference DTB file includes preset node information corresponding to a virtual I2C device in an operating system, a first offset address of the preset node information of the virtual I2C device relative to a header of the reference DTB file is recorded;

[0114] In step 1002, the reference DTB file is scanned again, and if the reference DTB file includes preset node information corresponding to the virtual I2C bus in the main operating system, the second offset address of the preset node information of the virtual I2C bus relative to the header of the reference DTB file is recorded;

[0115] In step 1003, based on the first offset address and the second offset address, the configuration information of the virtual I2C device in the slave operating system in the reference DTB file is added to the configuration information of the virtual I2C bus in the master operating system.

[0116] Thus, the reference DTB file can be mounted from the virtual I2C device in the operating system to the virtual I2C bus.

[0117] In one possible implementation, the configuration information of the virtual I2C device in the operating system in the reference DTB file is added to the configuration information of the virtual I2C bus in the main operating system. Before obtaining the target DTB file, the car smart cockpit can also parse the reference DTB file from the unflatten_device_tree interface of the operating system to obtain the configuration information corresponding to the virtual I2C bus in the reference DTB file and the configuration information corresponding to the virtual I2C device in the reference DTB file.

[0118] When implementing it, Fig.11 As shown, Linxu parses the node and property information in the reference DTB file from the operating system kernel through the unflatten_device_tree interface, creates a device node for each parsed node, and adds the parsed property information to the corresponding node. In the process, the virtual I2C device is mounted on the virtual I2C bus, and then the device tree from the operating system is created based on the virtual I2C device and virtual I2C bus after the successful mounting.

[0119] like Fig.12 As shown, it is a schematic diagram of the process of mounting a virtual I2C device on a virtual I2C bus provided by an embodiment of the present application, which is as follows:

[0120] In step 1201, a virtual I2C bus is configured in the main operating system.

[0121] In step 1202, a virtual I2C device is configured from the operating system.

[0122] By virtualizing the target peripheral, a virtual I2C device corresponding to the target peripheral is obtained.

[0123] In step 1203, the virtual I2C device is mounted to the virtual I2C bus.

[0124] Each time a virtual I2C device is configured, a virtual I2C device is added to the configured virtual I2C bus. Fig.13 As shown in FIG. 1 , when two virtual I2C devices are configured in the operating system, both virtual I2C devices need to be mounted on the virtual I2C bus when the virtual I2C devices are mounted on the virtual I2C bus, and the virtual I2C bus and the virtual I2C device each carry the corresponding parameters for configuring the virtual I2C bus or configuring the virtual I2C device. Fig.14As shown, if three virtual I2C devices are configured in the operating system, when the virtual I2C devices are mounted to the virtual I2C bus, all three virtual I2C devices need to be mounted to the virtual I2C bus, and the virtual I2C bus and the virtual I2C devices respectively carry corresponding parameters when configuring the virtual I2C bus or configuring the virtual I2C devices.

[0125] It should be noted that, when each virtual I2C device is configured, it carries the virtual address of the virtual I2C device in the corresponding virtual I2C bus, the physical I2C bus of the target peripheral corresponding to the virtual I2C device, the physical address of the target peripheral corresponding to the virtual I2C device, and the baud rate of the target peripheral controlled.

[0126] It should be noted that a main operating system can configure at least one virtual I2C bus, and the virtual I2C bus can mount at least one virtual I2C device.

[0127] It should be noted that the present application does not limit the number of virtual I2C devices mounted on each virtual I2C bus, and the range of the number can be no less than 1. If the physical I2C control device has a 7-bit address, the maximum number of virtual I2C devices mounted on the virtual I2C bus is 127; if the physical I2C control device has a 10-bit address, the maximum number of virtual I2C devices mounted on the virtual I2C bus is 1023.

[0128] Thus, the virtual I2C device in the slave operating system in the reference DTB file can be mounted to the virtual I2C bus, so that the functions of the peripherals corresponding to the slave operating system can be used, that is, the user can normally control and drive the peripherals corresponding to the slave operating system.

[0129] In step 303, the automobile intelligent cockpit obtains a driving instruction for a target peripheral device in at least one peripheral device from the operating system; the driving instruction includes identification information of the target peripheral device.

[0130] In a possible implementation, the car smart cockpit responds to a control operation triggered by a user on a display screen corresponding to the slave operating system by obtaining a drive instruction for a target peripheral device from the operating system.

[0131] It should be noted that the car smart cockpit can be connected to at least one display screen, and one display screen can correspond to one slave operating system. Optionally, the display screen is connected to the car smart cockpit, and the pin resource of the display screen connected to the car smart cockpit by the user triggering the control operation corresponds to the slave operating system, so that the slave operating system can obtain the user's driving instructions.

[0132] In a possible embodiment, the intelligent cockpit of the automobile automatically triggers driving instructions for the target peripheral device by obtaining a program from the operating system.

[0133] In step 304, if the automobile intelligent cockpit determines from the operating system that the target DTB file includes identification information of the target peripheral, it sends the driving instruction to the target peripheral through the virtual I2C bus, so that the target peripheral executes the operation corresponding to the driving instruction.

[0134] Among them, the target peripheral device is connected to the car's intelligent cockpit, and the car's intelligent cockpit can control the target peripheral device.

[0135] like Fig.15 As shown, a schematic diagram of a display screen corresponding to a slave operating system in an embodiment of the present application. As shown in the figure, the display screen corresponding to one slave operating system can be a central control screen in the middle of the front row of the vehicle, and the display screen corresponding to another slave operating system can be an entertainment screen corresponding to the co-pilot position.

[0136] like Fig.16 As shown, another display screen schematic diagram corresponding to a slave operating system in an embodiment of the present application. As shown in the figure, the display screen corresponding to a slave operating system can be an entertainment screen in the rear row of the vehicle.

[0137] like Fig.17 As shown, a schematic diagram of a display screen corresponding to a slave operating system in an embodiment of the present application. As shown in the figure, the instrument panel display screen corresponding to the main driving position in the vehicle can correspond to the slave operating system.

[0138] In the embodiment of the present application, if the Fig.15 The entertainment screen corresponding to the co-pilot position shown in the figure, the developer can directly change the operating system corresponding to the entertainment screen, without representing the content of the main operating system. The configuration information of the virtual I2C device of the slave operating system can be directly modified to the configuration information of the replaced entertainment screen, and then the virtual I2C device corresponding to the configuration information of the replaced entertainment screen is mounted to the virtual I2C bus according to the method provided in the embodiment of the present application, and then the device tree of the replaced entertainment screen is generated. If the identification information in the driving instruction of the slave operating system is the same as the identification information carried in the device tree of the replaced entertainment screen, the car intelligent cockpit can drive the replaced entertainment screen, that is, the replaced entertainment screen can be used normally.

[0139] It should be noted that since the control system in the vehicle needs to meet different functions in different scenarios, for example, the operating system for controlling the vehicle's driving needs to have higher security, and the operating system for controlling the vehicle's entertainment can have more functional extensions. Then multiple operating systems need to run in the car's smart cockpit, including a main operating system and at least one slave operating system. And the main operating system and the slave operating system run on a SoC. Among them, multiple display screens in the vehicle correspond one-to-one to multiple slave operating systems.

[0140] like Fig.18 As shown, the overall flow chart of a control method of a device in an embodiment of the present application. The specific steps are as follows:

[0141] In step 1801, the automobile intelligent cockpit adds the configuration information of the virtual I2C bus of the main operating system to the DTB file of the slave operating system through the main operating system to obtain a reference DTB file;

[0142] In step 1802, the car smart cockpit obtains a reference DTB file from the operating system;

[0143] In step 1803, the smart cockpit of the automobile scans the reference DTB file from the operating system. If the reference DTB file includes preset node information corresponding to the virtual I2C device in the operating system, the preset node information of the virtual I2C device is recorded relative to the first offset address of the reference DTB file header.

[0144] In step 1804, the smart cockpit of the automobile scans the reference DTB file again from the operating system. If the reference DTB file includes preset node information corresponding to the virtual I2C bus in the main operating system, the preset node information of the virtual I2C bus is recorded relative to the second offset address of the reference DTB file header.

[0145] In step 1805, based on the first offset address and the second offset address, the configuration information of the virtual I2C device in the slave operating system in the reference DTB file is added to the configuration information of the virtual I2C bus in the main operating system to obtain a target DTB file;

[0146] In step 1806, the intelligent cockpit of the automobile obtains a driving instruction for a target peripheral device in at least one peripheral device from the operating system; the driving instruction includes identification information of the target peripheral device;

[0147] In step 1807, if the automobile intelligent cockpit determines from the operating system that the target DTB file includes identification information of the target peripheral, it sends the driving instruction to the target peripheral through the virtual I2C bus so that the target peripheral executes the operation corresponding to the driving instruction.

[0148] Based on the foregoing description, in an embodiment of the present application, for a main operating system and a slave operating system in a smart cockpit of a car, a virtual I2C bus is configured in the main operating system, and a virtual I2C device corresponding to at least one peripheral connected to the smart cockpit of the car is configured in the slave operating system, and then the virtual I2C device of the slave operating system is mounted to the virtual I2C bus during startup from the operating system kernel; after successful mounting, a driving instruction for a target peripheral in at least one peripheral is obtained from the operating system; the driving instruction includes identification information of the target peripheral; if it is determined that the configuration information of the virtual I2C device of the slave operating system includes the identification information of the target peripheral obtained from the operating system, the driving instruction is sent to the target peripheral through the virtual I2C bus, so that the target peripheral executes the operation corresponding to the driving instruction.

[0149] Therefore, in the present application, the main operating system only creates a virtual I2C bus for the slave operating system, and creates a virtual I2C device from the operating system itself, thereby avoiding the separation of the device and driver of the virtual I2C device in different operating systems, and at the same time reducing the coupling degree between the main operating system and the slave operating system, ensuring the universality of the main operating system VirtIO-I2C, making it convenient to replace peripherals without affecting the use of the main operating system, so that the main operating system can be quickly transplanted to other projects, thereby improving development efficiency.

[0150] Refer to the following Fig.19 To describe an automobile smart cockpit provided by the embodiment of the present application based on the same inventive concept, the automobile smart cockpit 1900 includes at least one processor 1901 and at least one memory 1902; the processor 1901 runs a master operating system and a slave operating system, and the processor 1901 is connected to at least one peripheral device through a physical I2C bus;

[0151] The memory 1902 stores program codes. When the program codes are executed by the processor 1901, the processor 1901 performs the following process:

[0152] Obtaining the DTB file of the slave operating system through the master operating system, adding the configuration information of the virtual I2C bus of the master operating system to the DTB file, and obtaining a reference DTB file;

[0153] Acquire the reference DTB file through the slave operating system, add the configuration information of the virtual I2C device in the slave operating system in the reference DTB file to the configuration information of the virtual I2C bus in the master operating system, and obtain a target DTB file;

[0154] Obtaining a driving instruction for a target peripheral device in the at least one peripheral device from the operating system; the driving instruction includes identification information of the target peripheral device;

[0155] If the slave operating system determines that the target DTB file includes identification information of the target peripheral device, the drive instruction is sent to the target peripheral device through the virtual I2C bus, so that the target peripheral device executes the operation corresponding to the drive instruction.

[0156] In a possible implementation manner, the processor 1901 is specifically configured to:

[0157] Obtaining the DTB file of the slave operating system through the master operating system, storing the DTB file of the slave operating system in the shared memory through the Virtio channel, and recording the location information of the DTB file of the slave operating system in the shared memory;

[0158] Through the master operating system, the configuration information of the virtual I2C bus in the master operating system is added to the DTB file of the slave operating system based on the location information to obtain the reference DTB file; the reference DTB file is stored in the shared memory.

[0159] In a possible implementation manner, the processor 1901 is specifically configured to:

[0160] After the slave operating system receives the startup command sent by the master operating system, the reference DTB file is obtained from the shared memory; wherein the startup command is sent to the slave operating system by the master operating system after storing the reference DTB file in the shared memory.

[0161] In a possible implementation manner, the processor 1901 is specifically configured to:

[0162] The reference DTB file is obtained by the slave operating system. If it is determined that the reference DTB file includes the configuration information of the virtual I2C device in the slave operating system and the configuration information of the virtual I2C bus in the master operating system, the configuration information of the virtual I2C device in the slave operating system in the reference DTB file is added to the configuration information of the virtual I2C bus in the master operating system to obtain the target DTB file.

[0163] In a possible implementation manner, the processor 1901 is specifically configured to:

[0164] Scanning the reference DTB file by the slave operating system, if the reference DTB file includes preset node information corresponding to the virtual I2C device in the slave operating system, determining that the reference DTB file includes configuration information of the virtual I2C device in the slave operating system;

[0165] The slave operating system scans the reference DTB file again, and if the reference DTB file includes preset node information corresponding to the virtual I2C bus in the master operating system, it is determined that the reference DTB file includes configuration information of the virtual I2C bus in the master operating system.

[0166] In a possible implementation manner, the processor 1901 is specifically configured to:

[0167] Recording, by the slave operating system, a first offset address of the preset node information of the virtual I2C device relative to the reference DTB file header and a second offset address of the preset node information of the virtual I2C bus relative to the reference DTB file header;

[0168] Based on the first offset address and the second offset address, the configuration information of the virtual I2C device in the slave operating system in the reference DTB file is added to the configuration information of the virtual I2C bus in the master operating system to obtain a target DTB file.

[0169] In a possible implementation manner, the processor 1901 is further configured to:

[0170] The reference DTB file is parsed by the unflatten_device_tree interface of the slave operating system to obtain configuration information corresponding to the virtual I2C bus in the reference DTB file and configuration information corresponding to the virtual I2C device in the reference DTB file.

[0171] like Fig. 20 As shown, the present application embodiment provides a control device for a device, which can be specifically applied to the automobile intelligent cockpit in the above embodiment, including:

[0172] An acquisition module 2001 is used for the automobile intelligent cockpit to acquire the DTB file of the slave operating system through the master operating system, add the configuration information of the virtual I2C bus of the master operating system to the DTB file, and obtain a reference DTB file;

[0173] The mounting module 2002 is used for the automobile intelligent cockpit to obtain the reference DTB file through the slave operating system, add the configuration information of the virtual I2C device in the slave operating system in the reference DTB file to the configuration information of the virtual I2C bus in the master operating system, and obtain the target DTB file;

[0174] The acquisition module 2001 is further used for the automobile intelligent cockpit to obtain a driving instruction for a target peripheral device in the at least one peripheral device through the operating system; the driving instruction includes identification information of the target peripheral device;

[0175] The sending module 2003 is used for the automobile intelligent cockpit to send the driving instruction to the target peripheral through the virtual I2C bus if it is determined by the slave operating system that the target DTB file includes the identification information of the target peripheral, so that the target peripheral executes the operation corresponding to the driving instruction.

[0176] In a possible implementation manner, the acquisition module 2001 is specifically used to:

[0177] Obtaining the DTB file of the slave operating system through the master operating system, storing the DTB file of the slave operating system in the shared memory through the Virtio channel, and recording the location information of the DTB file of the slave operating system in the shared memory;

[0178] Through the master operating system, the configuration information of the virtual I2C bus in the master operating system is added to the DTB file of the slave operating system based on the location information to obtain the reference DTB file; the reference DTB file is stored in the shared memory.

[0179] In a possible implementation manner, the mounting module 2002 is specifically used for:

[0180] After the slave operating system receives the startup command sent by the master operating system, the reference DTB file is obtained from the shared memory; wherein the startup command is sent to the slave operating system by the master operating system after storing the reference DTB file in the shared memory.

[0181] In a possible implementation manner, the mounting module 2002 is specifically used for:

[0182] The reference DTB file is obtained by the slave operating system. If it is determined that the reference DTB file includes the configuration information of the virtual I2C device in the slave operating system and the configuration information of the virtual I2C bus in the master operating system, the configuration information of the virtual I2C device in the slave operating system in the reference DTB file is added to the configuration information of the virtual I2C bus in the master operating system to obtain the target DTB file.

[0183] In a possible implementation manner, the mounting module 2002 is specifically used for:

[0184] Scanning the reference DTB file by the slave operating system, if the reference DTB file includes preset node information corresponding to the virtual I2C device in the slave operating system, determining that the reference DTB file includes configuration information of the virtual I2C device in the slave operating system;

[0185] The slave operating system scans the reference DTB file again, and if the reference DTB file includes preset node information corresponding to the virtual I2C bus in the master operating system, it is determined that the reference DTB file includes configuration information of the virtual I2C bus in the master operating system.

[0186] In a possible implementation manner, the mounting module 2002 is specifically used for:

[0187] Recording, by the slave operating system, a first offset address of the preset node information of the virtual I2C device relative to the reference DTB file header and a second offset address of the preset node information of the virtual I2C bus relative to the reference DTB file header;

[0188] Based on the first offset address and the second offset address, the configuration information of the virtual I2C device in the slave operating system in the reference DTB file is added to the configuration information of the virtual I2C bus in the master operating system to obtain a target DTB file.

[0189] In a possible implementation manner, the mounting module 2002 is further used for:

[0190] The reference DTB file is parsed by the unflatten_device_tree interface of the slave operating system to obtain configuration information corresponding to the virtual I2C bus in the reference DTB file and configuration information corresponding to the virtual I2C device in the reference DTB file.

[0191] In an exemplary embodiment, a computer-readable storage medium including instructions is also provided, such as a memory including instructions, and the above instructions can be executed by a processor to complete the control method of the above device. Optionally, the storage medium can be a non-temporary computer-readable storage medium, for example, the non-temporary computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, and an optical data storage device, etc.

[0192] In an exemplary embodiment, a computer program product is also provided, including a computer program, and when the computer program is executed by a processor, the control method of the device provided in the present application is implemented.

[0193] In an exemplary embodiment, various aspects of a control method for a device provided in the present application may also be implemented in the form of a program product, which includes program code. When the program product is run on a computer device, the program code is used to enable the computer device to execute the steps of the control method for the device according to various exemplary embodiments of the present application described above in this specification.

[0194] The program product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0195] The program product of the control method for the device of the embodiment of the present application can adopt a portable compact disk read-only memory (CD-ROM) and include program code, and can be run on an electronic device. However, the program product of the present application is not limited to this. In this document, the readable storage medium can be any tangible medium containing or storing a program, which can be used by or in combination with an instruction execution system, an apparatus or a device.

[0196] The readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, wherein the readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The readable signal medium may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0197] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.

[0198] The program code for performing the operations of the present application may be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java, C++, etc., and also conventional procedural programming languages ​​such as "like" language or similar programming languages. The program code may be executed entirely on the user electronic device, partially on the user device, as an independent software package, partially on the user electronic device and partially on a remote electronic device, or entirely on a remote electronic device or a server. In cases involving remote electronic devices, the remote electronic device may be connected to the user electronic device via any type of network including a local area network (LAN) or a wide area network (WAN), or may be connected to an external electronic device (e.g., via the Internet using an Internet service provider).

[0199] It should be noted that, although several units or subunits of the device are mentioned in the above detailed description, this division is merely exemplary and not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more units described above can be embodied in one unit. Conversely, the features and functions of one unit described above can be further divided into multiple units to be embodied.

[0200] In addition, although the operations of the method of the present application are described in a specific order in the drawings, this does not require or imply that the operations must be performed in this specific order, or that all the operations shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps.

[0201] Similar parts between the embodiments provided in this application can be referenced to each other. The specific implementation methods provided above are only a few examples under the general concept of this application and do not constitute a limitation on the protection scope of this application. For those skilled in the art, any other implementation methods expanded based on the scheme of this application without creative work belong to the protection scope of this application.

[0202] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0203] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0204] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0205] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps of the functions specified in one or more boxes. Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A method for controlling a device, characterized in that: A car smart cockpit applied to a car, the car smart cockpit is connected to at least one peripheral device, the car smart cockpit includes a main operating system and a slave operating system, and the method includes: The automobile intelligent cockpit obtains the DTB file of the slave operating system through the master operating system, adds the configuration information of the virtual I2C bus of the master operating system to the DTB file, and obtains a reference DTB file; The automobile intelligent cockpit obtains the reference DTB file through the slave operating system, adds the configuration information of the virtual I2C device in the slave operating system in the reference DTB file to the configuration information of the virtual I2C bus in the master operating system, and obtains a target DTB file; The automobile intelligent cockpit obtains a driving instruction for a target peripheral device in the at least one peripheral device through the operating system; the driving instruction includes identification information of the target peripheral device; If the automobile intelligent cockpit determines through the slave operating system that the target DTB file includes the identification information of the target peripheral device, the driving instruction is sent to the target peripheral device through the virtual I2C bus, so that the target peripheral device executes the operation corresponding to the driving instruction.

2. The method according to claim 1, characterized in that The automobile intelligent cockpit obtains the DTB file of the slave operating system through the master operating system, adds the configuration information of the virtual I2C bus of the master operating system to the DTB file, and obtains a reference DTB file, including: The automobile intelligent cockpit obtains the DTB file of the slave operating system through the master operating system, stores the DTB file of the slave operating system in the shared memory through the Virtio channel, and records the location information of the DTB file of the slave operating system in the shared memory; The automobile intelligent cockpit adds the configuration information of the virtual I2C bus in the main operating system to the DTB file of the slave operating system based on the location information through the main operating system to obtain the reference DTB file; the reference DTB file is stored in the shared memory.

3. The method according to claim 2, characterized in that The automobile intelligent cockpit obtains the reference DTB file from the operating system, including: After the automobile intelligent cockpit receives the startup command sent by the main operating system through the slave operating system, it obtains the reference DTB file from the shared memory; wherein, the startup command is sent to the slave operating system by the main operating system after storing the reference DTB file in the shared memory.

4. The method according to claim 1, characterized in that The automobile intelligent cockpit obtains the reference DTB file through the slave operating system, adds the configuration information of the virtual I2C device in the slave operating system in the reference DTB file to the configuration information of the virtual I2C bus in the master operating system, and obtains the target DTB file, including: The automobile intelligent cockpit obtains the reference DTB file through the slave operating system. If it is determined that the reference DTB file includes the configuration information of the virtual I2C device in the slave operating system and the configuration information of the virtual I2C bus in the main operating system, the configuration information of the virtual I2C device in the slave operating system in the reference DTB file is added to the configuration information of the virtual I2C bus in the main operating system to obtain the target DTB file.

5. The method according to claim 4, characterized in that Determine the configuration information of the virtual I2C device in the slave operating system and the configuration information of the virtual I2C bus in the master operating system in the reference DTB file according to the following method: The automobile intelligent cockpit scans the reference DTB file through the slave operating system, and if the reference DTB file includes preset node information corresponding to the virtual I2C device in the slave operating system, determines that the reference DTB file includes configuration information of the virtual I2C device in the slave operating system; The automobile smart cockpit scans the reference DTB file again through the slave operating system. If the reference DTB file includes preset node information corresponding to the virtual I2C bus in the main operating system, it is determined that the reference DTB file includes configuration information of the virtual I2C bus in the main operating system.

6. The method according to claim 5, characterized in that The step of adding the configuration information of the virtual I2C device in the slave operating system in the reference DTB file to the configuration information of the virtual I2C bus in the master operating system to obtain a target DTB file includes: The automobile intelligent cockpit records the first offset address of the preset node information of the virtual I2C device relative to the reference DTB file header and the second offset address of the preset node information of the virtual I2C bus relative to the reference DTB file header through the slave operating system; Based on the first offset address and the second offset address, the configuration information of the virtual I2C device in the slave operating system in the reference DTB file is added to the configuration information of the virtual I2C bus in the master operating system to obtain a target DTB file.

7. The method according to claim 6, characterized in that Before adding the configuration information of the virtual I2C device in the slave operating system in the reference DTB file to the configuration information of the virtual I2C bus in the master operating system to obtain the target DTB file, the method further includes: The automobile intelligent cockpit parses the reference DTB file through the unflatten_device_tree interface of the slave operating system to obtain configuration information corresponding to the virtual I2C bus in the reference DTB file and configuration information corresponding to the virtual I2C device in the reference DTB file.

8. An intelligent car cockpit, characterized in that: The automobile intelligent cockpit includes a processor and a memory, a main operating system and a slave operating system are run on the processor, and the processor is connected to at least one peripheral device through a physical I2C bus; The memory stores program codes, and when the program codes are executed by the processor, the processor performs the following process: Obtaining the DTB file of the slave operating system through the master operating system, adding the configuration information of the virtual I2C bus of the master operating system to the DTB file, and obtaining a reference DTB file; Acquire the reference DTB file through the slave operating system, add the configuration information of the virtual I2C device in the slave operating system in the reference DTB file to the configuration information of the virtual I2C bus in the master operating system, and obtain a target DTB file; Obtaining a driving instruction for a target peripheral device in the at least one peripheral device from the operating system; the driving instruction includes identification information of the target peripheral device; If the slave operating system determines that the target DTB file includes identification information of the target peripheral device, the drive instruction is sent to the target peripheral device through the virtual I2C bus, so that the target peripheral device executes the operation corresponding to the drive instruction.

9. A car, characterized in that: The vehicle intelligent cockpit comprises a vehicle intelligent cockpit and at least one peripheral device, wherein the vehicle intelligent cockpit is connected to the peripheral device via a physical I2C bus, and the vehicle intelligent cockpit comprises a main operating system and a slave operating system: The automobile intelligent cockpit is used to obtain the DTB file of the slave operating system through the master operating system, add the configuration information of the virtual I2C bus of the master operating system to the DTB file, and obtain a reference DTB file; Acquire the reference DTB file through the slave operating system, add the configuration information of the virtual I2C device in the slave operating system in the reference DTB file to the configuration information of the virtual I2C bus in the master operating system, and obtain a target DTB file; Obtaining a driving instruction for a target peripheral device in the at least one peripheral device through the slave operating system; if the slave operating system determines that the target DTB file includes identification information of the target peripheral device, sending the driving instruction to the target peripheral device through the virtual I2C bus; wherein the driving instruction includes identification information of the target peripheral device; The target peripheral device in the at least one peripheral device is used to execute the operation corresponding to the driving instruction.

10. A computer-readable storage medium, characterized in that: It includes program codes. When the program codes are run on a smart cockpit of a car, the program codes are used to enable the smart cockpit of the car to execute the steps of the method according to any one of claims 1 to 7.

Citation Information

Cited By

  • Method for quickly operating I2C bus under Android system, computer program product and computer terminal

    CN120892363A