A general character device driver system and method

By providing a universal character-type device driver system on the Autosar platform, the problem of inconsistent implementation of complex drivers is solved, unified control of different chip equipment is achieved, and development and maintenance costs are reduced.

CN114625358BActive Publication Date: 2025-06-03CHINA FAW CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202210258784.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-16
Publication Date
2025-06-03
Estimated Expiration
2042-03-16

AI Technical Summary

Technical Problem

The Autosar standard lacks the definition of complex drivers, resulting in inconsistent character driver implementation between different hardware platforms and different Autosar platforms, increasing the design, implementation and maintenance costs of software engineers when maintaining complex drivers.

Method used

A general character-type device driving system is provided, including a device registration module, an operation search module and a first calling module. Through these modules, unified control of devices of different chips is achieved.

Benefits of technology

Reduces the cost of software engineers when developing and maintaining complex drivers, improves the versatility, portability and robustness of device drivers, and makes the development process more simplified and efficient.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114625358B_ABST
    Figure CN114625358B_ABST
Patent Text Reader

Abstract

The present application provides a general character device driver system and method. The system includes: a device registration module for registering device information of a device corresponding to a chip; an operation lookup module for storing and calling function functions corresponding to each device; and a first call module for calling the function function of the corresponding device from the operation lookup module by looking up the device information in the device registration module. By constructing corresponding device registration modules, operation lookup modules, and first call modules for different chips, when developing a program, only by calling the function function corresponding to each device can the control of the device be completed. When a software engineer develops, only the corresponding function function needs to be called, without caring about the specific chip type, reducing the costs of designing, implementing, and maintaining complex drivers.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] One or more embodiments of this specification relate to the field of automotive technology, and in particular, to a general character device driver system and method. Background Art

[0002] Autosar (Automotive Open System Architecture), that is, the open automotive system architecture, is currently one of the most widely used general standards in the automotive industry.

[0003] Its purpose is to define a general specification, or an implementation standard, among different types of hardware, different automotive controller components, and different software developers, so that numerous embedded systems with different functions, different chips, and different hardware topologies can carry out efficient design, development, and testing work according to a unified development paradigm.

[0004] However, in the official definition of Autosar, there is a part that is not detailedly constrained and defined, namely the complex driver.

[0005] Due to the congenital deficiency of the Autosar standard in defining this part, the character driver implementations on different hardware platforms are different, the character driver implementations on different Autosar platforms are different, and the implementation methods of different teams on the same platform are different. This has greatly increased the design cost, implementation cost, and maintenance cost that software engineers pay when maintaining Autosar complex drivers. Summary of the Invention

[0006] In view of this, the purpose of one or more embodiments of this specification is to propose a general character device driver system and method, which reduces the development difficulty of software development engineers and reduces the design, implementation, and maintenance costs of Autosar complex drivers.

[0007] In a first aspect, a general character device driver system is provided. The general character device driver system provided in this application is a mechanism designed for complex drivers in the AUTOSAR architecture, which is the basis of the entire mechanism. To make up for the gaps in the AUTOSAR itself specifications, the system includes: a device registration module for registering the device information of the devices corresponding to the chip; an operation lookup module for storing and calling the function functions corresponding to each device; a first call module for calling the function function of the corresponding device from the operation lookup module by looking up the device information in the device registration module. By constructing corresponding device registration modules, operation lookup modules, and first call modules for different chips, when developing a program, only by calling the function function corresponding to each device can the control of the device be completed. When a software engineer develops, only by calling the corresponding function function is needed, without caring about the specific chip type, reducing the costs of designing, implementing, and maintaining complex drivers.

[0008] In a specific feasible implementation, the device registration module includes character device registration entries corresponding to each device of the chip; and the information of the corresponding device is registered in each character device registration entry.

[0009] In a specific feasible implementation, the number of operation lookup modules is multiple, and each operation lookup module corresponds to each character device registration entry one by one.

[0010] In a specific feasible implementation, the information of the corresponding device registered in each character device registration entry includes: the class number of the device, the name of the device, the device number, and the device entity.

[0011] In a specific feasible implementation, the operation lookup module storing and calling the function function corresponding to each device includes:

[0012] Controlling the device open operation function, close operation function, read operation function, write operation function, and IO control operation function.

[0013] In a specific feasible implementation, it further includes:

[0014] A mapping module, the mapping module includes mapping entries corresponding to each character device registration entry in the device registration module;

[0015] The first call module is further used to call the corresponding character device registration entry through the mapping entry.

[0016] In a second aspect, an open automotive system architecture is provided, which includes: a detection module for detecting the type of a chip; a storage module storing a plurality of the general character device driver systems as described in any one of the above, with different general character device driver systems corresponding to different chip types; and a second call module for calling, according to the type of the chip detected by the detection module, the general character device driver system corresponding to the chip type in the storage module. By constructing corresponding device registration modules, operation search modules, and first call modules for different chips, when developing a program, only by calling the function corresponding to each device can the control of the device be completed. When a software engineer is developing, only by calling the corresponding function is required, without the need to concern about the specific chip type, reducing the costs of designing, implementing, and maintaining complex drivers.

[0017] In a third aspect, a general character device driving method is provided, which includes:

[0018] Registering the device information of the device corresponding to the chip;

[0019] Storing and calling the function corresponding to each device;

[0020] By searching for the device information in the device registration module, calling the function of the corresponding device from the operation search module. By constructing corresponding driving methods for different chips, when a software engineer is developing, only by calling the corresponding function is required, without the need to concern about the specific chip type, reducing the costs of designing, implementing, and maintaining complex drivers.

[0021] In a specific feasible implementation, the registering of the device information of the device corresponding to the chip specifically is:

[0022] Establishing a character device registry, where the character device registry contains character device registration entries corresponding to each device of the chip; and the information of the corresponding device is registered in each character device registration entry.

[0023] In a specific feasible implementation, the function corresponding to each device includes: a control device open operation function, a close operation function, a read operation function, a write operation function, and an IO control operation function.

[0024] In a specific feasible implementation, it further includes:

[0025] Constructing a mapping entry corresponding to each character device registration entry;

[0026] Calling the corresponding character device registration entry through the mapping entry.

[0027] Fourthly, a vehicle is provided, which includes a vehicle body and the general character device driving system or the open vehicle system architecture described in any one of the above in the vehicle body. In the above technical solution, by constructing corresponding device registration modules, operation search modules, and first call modules for different chips, when developing a program, only by calling the function corresponding to each device can the control of the device be completed. When a software engineer develops, only by calling the corresponding function is needed, without caring about the specific chip type, reducing the costs of designing, implementing, and maintaining complex drivers.

[0028] Fifthly, an electronic device is provided, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the program, it implements the method described in the third aspect and any possible design in the third aspect.

[0029] Sixthly, a non-transitory computer-readable storage medium is provided. The non-transitory computer-readable storage medium stores computer instructions for causing the computer to execute the method described in the third aspect and any possible design in the third aspect.

[0030] Seventhly, a computer program product is further provided, including instructions that, when running on a computer, cause the computer to execute the method described in the third aspect and any possible design in the third aspect of this application.

[0031] In addition, for the technical effects brought by any possible design manner in the fifth aspect to the seventh aspect, reference can be made to the effects brought by different design manners in the method part, which will not be elaborated here. Description of the Drawings

[0032] In order to more clearly illustrate the technical solutions in one or more embodiments of this specification or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only one or more embodiments of this specification. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0033] Figure 1 It is the structural block diagram of the Autosar platform provided by the embodiment of this application;

[0034] Figure 2 It is the structural block diagram of the general character device driving system provided by the embodiment of this application;

[0035] Figure 3 It is the internal table schematic diagram of each module in the general character device driving system provided by the embodiment of this application;

[0036] Figure 4 It is a structural block diagram of the Autosar platform provided by the embodiment of the present application;

[0037] Figure 5 It is a structural block diagram of the electronic device provided by the embodiment of the present application. Detailed implementation manners

[0038] To make the objectives, technical solutions and advantages of the present disclosure clearer and more understandable, the following further describes the present disclosure in detail with reference to specific embodiments and the accompanying drawings.

[0039] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in one or more embodiments of this specification should have the ordinary meanings understood by those of ordinary skill in the art to which the present disclosure belongs. The "first", "second" and similar terms used in one or more embodiments of this specification do not denote any order, quantity or importance, but are only used to distinguish different components. The terms such as "including" or "comprising" mean that the elements or objects appearing before the term cover the elements or objects listed after the term and their equivalents, without excluding other elements or objects. The terms such as "connected" or "coupled" are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. The terms such as "upper", "lower", "left" and "right" are only used to represent relative positional relationships, and when the absolute position of the object being described changes, the relative positional relationship may also change accordingly.

[0040] The technical carriers involved in the payment described in the embodiments of this specification may include, for example, Near Field Communication (NFC), WIFI, 3G / 4G / 5G, POS machine card swiping technology, two-dimensional code scanning technology, bar code scanning technology, Bluetooth, infrared, Short Message Service (SMS), Multimedia Message Service (MMS), etc.

[0041] Such as Figure 1As shown in the figure, in the Autosar architecture, the driver module corresponding to the complex driver is located between the controller hardware and the Autosar RTE (runtime environment) layer. When the application is in use, it needs to run on the controller hardware (chip) through the driver module. However, the driver module is a component of the system outside the specification. In the abstract design of Autosar, it does not stipulate how developers design the complex driver of character devices; it does not stipulate how the application interacts with the complex driver of character devices; and it does not stipulate how the complex driver of character devices is implemented internally. Therefore, we call this part a non-standard module of Autosar, and specific users need to design and implement this part of the code according to specific intentions.

[0042] The code of the standard module of Autosar can be implemented manually or generated automatically. Usually, users obtain the system environment and development capabilities on a specific hardware platform by purchasing commercial software development kits and commercial tools. The mainstream suppliers include Vector, ETAS, EB, Parasoft, etc.

[0043] However, in different mainstream Autosar products, there is no unified (even at the conceptual level) definition and design paradigm for complex drivers of character types. As a developer of an Autosar application system, there is no unified framework to develop the character device driver on different hardware platforms and different Autosar platforms.

[0044] Therefore, the embodiment of this application provides a general character device driver system. This system is a mechanism designed for the complex driver in the Autosar architecture, which is the basis of the entire mechanism. To make up for the blank in the Autosar itself specification, in order to provide a capability for Autosar character device driver developers: using the same design paradigm, programming paradigm, and conceptual paradigm to standardize the implementation methods of complex drivers of all character devices, so as to improve the generality, portability, and robustness of such device drivers to a certain extent. The following will describe it in detail with specific drawings.

[0045] First, introduce character devices. From the perspective of the types of computer devices, there is a type of device that can be called a character device. Its characteristics include: sequential reading, sequential erasing, reading and discarding immediately, controllable IO attributes, synchronous and asynchronous reading and writing, the hardware has a buffer, and vector reading and writing can be performed, etc.

[0046] The general character device driver system provided by the embodiments of the present application is used to extend a programming design method and its supporting framework design for Autosar users. It is used to facilitate software development design by development engineers for different chips without being affected by the chip type.

[0047] Reference Figure 2 , Figure 2 FIG. shows the structural block diagram of the general character device driver system provided by the embodiments of the present application. The general character device driver system provided by the embodiments of the present application mainly includes three modules: a device registration module 20, an operation search module 30, and a first call module 10. Among them, the device registration module 20 is used to register the device information of the device corresponding to the chip. The operation search module 30 is used to store and call the function functions corresponding to each device. The first call module 10 is used to call the function function of the corresponding device from the operation search module 30 by searching the device information in the device registration module 20. The following will separately describe its different modules.

[0048] Specifically, the device registration module 20 is used to register the device information of the device corresponding to the chip. During specific registration, it is registered by the debugging engineer according to the device corresponding to the chip. Exemplarily, taking the Qualcomm chip as an example, the corresponding devices include: Bluetooth, graphics card, network cable, touch screen, liquid crystal screen, Ethernet and other different devices. Therefore, when registering the devices corresponding to the Qualcomm chip, each device is registered.

[0049] During specific registration, the device registration module 20 includes a character device registration table, which contains multiple character device registration items. Among them, the character device registration items correspond one-to-one with the devices corresponding to the chip, that is, each device corresponds to a character device registration item. And the information of the corresponding device is registered in each character device registration item. Exemplarily, the information of the corresponding device registered in each character device registration item includes: the class number of the device, the name of the device, the device number, and the device entity. During specific construction, CharDevRegTbl (device registration table) is responsible for statically registering (temporarily excluding dynamic registration) a table of a driver type, and the table entry is called CharDevRegItem (character device registration item). Each character device registration item contains the following data members:

[0050] Class number: The same device type uses the same device class number, such as uint32;

[0051] Device name: The name given to the device by the debugger, such as char*, which must be unique globally

[0052] Device number: The same type of device is not allowed to use the same device number, such as uint32;

[0053] Device entity: One entity is equal to one device, CharDevEntity*

[0054] Exemplarily, taking a graphics card as an example, when the category named by the debugger for the graphics card is 1, the device numbers corresponding to the discrete graphics card and the integrated graphics card are 1 and 2 respectively. Then 11 represents the discrete graphics card, and 12 represents the integrated graphics card.

[0055] Refer to together Figure 3 , when constructing the CharDevRegTbl, the type of construction can be set as needed. Taking the previous item pointing to another CharDevRegItem and the next item pointing to another CharDevRegItem as an example, the two pointers of the previous item and the next item enable the CharDevRegTbl to construct tables with linear, circular, balanced tree and other structures. However, the embodiment of the present application does not limit the construction of the CharDevRegTbl, and the speed of searching and inserting data can be improved according to specific performance requirements.

[0056] The operation search module 30 is used to store and call the function corresponding to each device. Specifically, the number of operation search modules 30 is multiple, and each operation search module 30 corresponds to each character device registration item one by one. Taking one of the search operation modules as an example, the operation search module 30 stores and calls the function corresponding to each device, including: the control device open operation function, the close operation function, the read operation function, the write operation function, and the IO control operation function. Thus, the device can be operated according to the above function. As Figure 3 shown in, the operation search module 30 contains a CharDevOp (character device operation search table), and this character device operation search table contains controls such as the operation of opening the device, the operation of closing the driver, the read operation, the write operation, and the IO control operation. The above function is written by the debugger engineer according to the function of the character corresponding to the device of the chip.

[0057] When making a call, the first call module 10 can call the function corresponding to the device from the operation search module 30 by searching the device information in the device registration module 20. Exemplarily, when a certain device is needed, the device can be searched through the device registration module 20. When finding the character device registration item corresponding to the device, the corresponding character device operation search table can be found through this character device registration item, and the operation to be performed on the device can be found in this operation search table. Taking a graphics card as an example, when it is necessary to open the graphics card, first find the character device registration item corresponding to the graphics card, then open the character device operation search table corresponding to the character device registration item, and find the function corresponding to the open operation in this character device operation search table, then the graphics card can be opened.

[0058] As can be seen from the above description, for different types of chips, the corresponding devices are different, so the corresponding functional functions are also different. However, for development engineers, when developing programs, they only need to find the corresponding functional function to implement the execution of the device functions of this type of chip, without caring about the type of chip corresponding to the device, which facilitates the design of development engineers, reduces the design cost, and also facilitates maintenance.

[0059] As an optional solution, it may further include a mapping module 40, and the mapping module 40 includes mapping items corresponding to each character device registration item in the device registration module 20. Specifically, when specifically setting the mapping module 40, the mapping module 40 includes a CharDevMappingTbl (character device mapping table), and the character device mapping table includes multiple CharDevMappingItem (character device mapping table items). Among them, each Item (abbreviated as Item for CharDevMappingItem) is responsible for associating a device name and an identifier for use by the client (development engineer). When in use, the development engineer can find the mapped parameters according to the request, and has functions of duplicate checking, verification, and error correction. Among them, the CharDevMappingTbl structure is as follows: Identifier: globally unique and recyclable. Pointing to a certain table item CharDevRegItem in the registry. Status: maintaining the status associated with the identifier, such as open, closed, error, etc., which is convenient for recycling and reuse.

[0060] Exemplarily, 1000 refers to the network card device in CharDevRegItem. When looking up the network card device, the system first looks up the network card device in the CharDevRegTbl (device registry). When the network card device is found and 1000 is returned, the corresponding mapping relationship between 1000 and the network card device is established. When the graphics card needs to be looked up again, 1000 can be directly input. Through the corresponding relationship between 1000 and the network card device, the network card device can be directly found, and the system does not need to look up in the device registry one by one, thereby improving the efficiency of looking up the network card device and reducing the memory calculation requirements.

[0061] The first calling module 10 is further configured to call the corresponding character device registration item through the mapping item. Exemplarily, when the first calling module 10 is used to call and operate on the network card device, the corresponding character device registration item can be directly called through the mapping relationship between the mapping item in the character device mapping table and the character device registration item corresponding to the graphics card device, and the corresponding functional function can be directly found through the corresponding relationship between the character device registration item and the character device operation lookup table, so as to implement the operation on the network card device.

[0062] As can be seen from the above description, when connecting different chip hardwares on the Autosar platform, the debugging engineer constructs the corresponding device registration module 20, operation search module 30, and first call module 10 for different chips. Thus, during program development, the development engineer only needs to call the function corresponding to each device to complete the control of the device. When the software engineer is developing, they only need to call the corresponding function, without caring about the specific chip type, reducing the costs of designing, implementing, and maintaining complex drivers.

[0063] Reference Figure 4 , Figure 4 shows an open automotive system architecture provided by an embodiment of the present application. The architecture includes a detection module 200, a storage module 400, and a second call module 300. Among them, the detection module 200 is used to detect the type of the chip. The storage module 400 is used to store multiple general character device driver systems 100 of any of the above, and different general character device driver systems 100 correspond to different chip types. In addition, the second call module 300 is used to call the general character device driver system 100 corresponding to the type of chip detected by the detection module 200 in the storage module 400. Exemplarily, the storage module 400 stores multiple different types of character device driver systems 100, and the character device driver system 100 contains function functions written by the debugging engineer according to the character driving rules of devices of different chips. Exemplarily, when the Autosar platform uses a Qualcomm chip, when the detection module 200 in the Autosar platform detects that it is a Qualcomm chip through some data characteristics of the Qualcomm chip, then the second call module 300 searches for the character device driver system 100 corresponding to the Qualcomm module in the storage module 400 and runs this system on the Qualcomm chip. Thus, when the development engineer develops software, they only need to use this character device driver system 100 to complete the control of the devices of the Qualcomm chip. Similarly, when using an Intel chip, the character device driver system 100 corresponding to the Intel chip can be called. As can be seen from the above description, when different types of chips are used on the Autosar platform, only the character device driver system 100 needs to be established by the debugging engineer in the initial stage. For subsequent development engineers during software development, they do not need to pay attention to the type of the chip and only need to develop through the corresponding function functions.

[0064] To facilitate understanding of the character device driver system 100 provided by the embodiment of the present application, the embodiment of the present application also provides a general character device driving method, which includes:

[0065] Step 001: Register the device information of the device corresponding to the chip;

[0066] Specifically, the device information of the device corresponding to the registered chip is as follows:

[0067] Create a character device registration table, which contains character device registration entries corresponding to each device of the chip; the information of the corresponding device is registered in each character device registration entry. For details, refer to Figure 2 the detailed description in the corresponding device in

[0068] Step 002: Store and call the function corresponding to each device;

[0069] Specifically, the function corresponding to each device includes: a control device open operation function, a close operation function, a read operation function, a write operation function, and an IO control operation function. For details, refer to Figure 2 the detailed description in the corresponding device in

[0070] Step 003: Call the function of the corresponding device from the operation search module 30 by searching for the device information in the device registration module 20.

[0071] Specifically, refer to Figure 2 the detailed description in the corresponding device in

[0072] Step 004: Construct a mapping entry corresponding to each character device registration entry;

[0073] Specifically, refer to Figure 2 the detailed description in the corresponding device in

[0074] Step 005: Call the corresponding character device registration entry through the mapping entry.

[0075] Specifically, refer to Figure 2 the detailed description in the corresponding device in

[0076] By constructing a corresponding driver method for different chips, software engineers only need to call the corresponding function during development, without caring about the specific chip type, reducing the costs of designing, implementing, and maintaining complex drivers.

[0077] An embodiment of the present application further provides a vehicle, which includes a vehicle body and the general character device drive system or the open vehicle system architecture described in any one of the above in the vehicle body. In the above technical solution, by constructing corresponding device registration modules 20, operation search modules 30, and first call modules 10 for different chips, when developing a program, only by calling the function function corresponding to each device can the control of the device be completed. When a software engineer develops, only the corresponding function function needs to be called, without caring about the specific chip type, reducing the costs of designing, implementing, and maintaining complex drivers.

[0078] It should be noted that the method of one or more embodiments of this specification can be executed by a single device, such as a computer or a server. The method of this embodiment can also be applied to a distributed scenario and completed by multiple devices cooperating with each other. In this case of a distributed scenario, one of the multiple devices can only execute one or more steps of the method of one or more embodiments of this specification, and these multiple devices will interact with each other to complete the described method.

[0079] The above describes specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims can be executed in a different order than in the embodiments and still achieve the desired results. Additionally, the processes depicted in the drawings do not necessarily require the specific order or sequential order shown to achieve the desired results. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0080] For convenience of description, when describing the above device, it is divided into various modules according to functions and described separately. Of course, when implementing one or more embodiments of this specification, the functions of each module can be implemented in the same or multiple software and / or hardware.

[0081] The device of the above embodiment is used to implement the corresponding method in the foregoing embodiment and has the beneficial effects of the corresponding method embodiment, which will not be repeated here.

[0082] Figure 5 A more specific schematic diagram of the hardware structure of an electronic device provided in this embodiment is shown. The device may include: a processor 1010, a memory 1020, an input / output interface 1030, a communication interface 1040, and a bus 1050. Among them, the processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040 are communicatively connected to each other inside the device through the bus 1050.

[0083] The processor 1010 can be implemented in the form of a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, etc., and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this specification.

[0084] The memory 1020 can be implemented in the form of a ROM (Read Only Memory), a RAM (Random Access Memory), a static storage device, a dynamic storage device, etc. The memory 1020 can store an operating system and other application programs. When implementing the technical solutions provided in the embodiments of this specification through software or firmware, the relevant program codes are stored in the memory 1020 and are called and executed by the processor 1010.

[0085] The input / output interface 1030 is used to connect to the input / output module to achieve information input and output. The input / output module can be configured as a component in the device (not shown in the figure) or externally connected to the device to provide corresponding functions. Among them, the input device can include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output device can include a display, a speaker, a vibrator, an indicator light, etc.

[0086] The communication interface 1040 is used to connect to a communication module (not shown in the figure) to achieve communication interaction between this device and other devices. Among them, the communication module can achieve communication through a wired method (such as USB, network cable, etc.) or through a wireless method (such as a mobile network, WIFI, Bluetooth, etc.).

[0087] The bus 1050 includes a path for transmitting information between various components of the device (such as the processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040).

[0088] It should be noted that although the above device only shows the processor 1010, the memory 1020, the input / output interface 1030, the communication interface 1040, and the bus 1050, in the specific implementation process, this device may also include other components necessary for normal operation. In addition, those skilled in the art can understand that the above device may also only include the components necessary to implement the solutions of the embodiments of this specification, and does not necessarily include all the components shown in the figure.

[0089] The computer-readable media of this embodiment include both permanent and non-permanent, removable and non-removable media that can implement information storage by any method or technology. The information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette tapes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission media that can be used to store information that can be accessed by a computing device.

[0090] Those of ordinary skill in the art should understand that: the discussion of any of the above embodiments is merely exemplary and is not intended to imply that the scope of the present disclosure (including the claims) is limited to these examples; under the concept of the present disclosure, the technical features between the above embodiments or different embodiments can also be combined, the steps can be implemented in any order, and there are many other variations in different aspects of one or more embodiments of the present specification as described above, and for the sake of brevity, they are not provided in detail.

[0091] In addition, for the sake of simplicity of description and discussion, and in order not to make one or more embodiments of this specification difficult to understand, the well-known power / ground connections to integrated circuit (IC) chips and other components may or may not be shown in the provided drawings. In addition, the devices may be shown in block diagram form in order to avoid making one or more embodiments of this specification difficult to understand, and this also takes into account the fact that the details of the implementation of these block diagram devices are highly dependent on the platform on which one or more embodiments of this specification will be implemented (i.e., these details should be fully within the understanding of those skilled in the art). In the case where specific details (such as circuits) are set forth to describe the exemplary embodiments of the present disclosure, it will be apparent to those skilled in the art that one or more embodiments of this specification can be implemented without these specific details or with variations of these specific details. Therefore, these descriptions should be considered illustrative rather than restrictive.

[0092] Although the present disclosure has been described in connection with specific embodiments of the present disclosure, many alternatives, modifications, and variations of these embodiments will be apparent to those of ordinary skill in the art based on the foregoing description. For example, other memory architectures (such as dynamic RAM (DRAM)) can be used with the embodiments discussed.

[0093] One or more embodiments of this specification are intended to cover all such substitutions, modifications, and variations that fall within the broad scope of the appended claims. Accordingly, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of one or more embodiments of this specification shall be included within the scope of protection of this disclosure.

Claims

1. A general character device driver system is applied to the Autosar system. It is characterized in that the general character device driver system includes: A device registration module for registering the device information of the device corresponding to the chip. An operation lookup module for storing and calling the function functions corresponding to each device. A first call module for calling the function function of the corresponding device from the operation lookup module by looking up the device information in the device registration module. Among them, the device registration module includes character device registration items corresponding to each device of the chip; and the information of the corresponding device is registered in each character device registration item. The information of the device includes: the class number of the device, the name of the device, the device number, and the device entity. Among them, it includes constructing a device registration table CharDevRegTbl, which is responsible for statically registering a table of a driver type. Among them, the table entry name is CharDevRegItem, and each character device registration item includes the following data members: Class number: The same device type uses the same device class number. Device name: The name given to the device by the debugger. Device number: The same device number is not allowed for the same type of device. Device entity: One entity is equal to one device. Among them, when constructing CharDevRegTbl, it is constructed according to the type to be set as needed. It includes that when the previous item points to another CharDevRegItem and the next item points to another CharDevRegItem, the two pointers of the previous item and the next item make CharDevRegTbl have a table including a linear, circular, or balanced tree structure.

2. The general character device driver system according to claim 1. It is characterized in that The number of the operation lookup modules is multiple, and each operation lookup module corresponds to each character device registration item one by one.

3. The general character device driver system according to claim 2. It is characterized in that The construction of CharDevRegTbl is not limited, including setting the construction of CharDevRegTbl according to specific performance requirements. It includes setting the construction of CharDevRegTbl according to the requirement of improving the speed of looking up and inserting data.

4. The general character device driver system according to claim 3. It is characterized in that The operation lookup module stores and calls the function functions corresponding to each device, including: Controlling the device open operation function, close operation function, read operation function, write operation function, and IO control operation function.

5. The general character device driver system according to any one of claims 1 to 4. It is characterized in that It further includes: A mapping module, and the mapping module includes mapping items corresponding to each character device registration item in the device registration module. The first call module is further used to call the corresponding character device registration item through the mapping item.

6. An open automotive system architecture. It is characterized in that It includes: A detection module, and the detection module is used to detect the type of the chip. A storage module stores multiple general character device driver systems as claimed in any one of claims 1 to 5, and different general character device driver systems correspond to different chip types; A second calling module is used to call, in the storage module, the general character device driver system corresponding to the type of the chip detected by the detection module.

7. A general character device driving method, characterized in that, it includes: registering the device information of the device corresponding to the chip; storing and calling the function functions corresponding to each device; calling the function function of the corresponding device from the operation search module by searching the device information in the device registration module; wherein, the device information of the device corresponding to the registered chip is specifically: establishing a character device registration table, and the character device registration table contains character device registration items corresponding to each device of the chip; information of the corresponding device is registered in each character device registration item; The information of the device includes: the class number of the device, the name of the device, the device number, and the device entity; wherein, it includes constructing a device registration table CharDevRegTbl, which is responsible for statically registering a table of a driving type. Among them, the table item name is CharDevRegItem, and each character device registration item includes the following data members: Class number: The same device type uses the same device class number; Device name: The name given to the device by the debugger; Device number: The same type of device is not allowed to use the same device number; Device entity: One entity is equal to one device; wherein, when constructing CharDevRegTbl, it is constructed according to the type set as needed; including, when the previous item points to another CharDevRegItem and the next item points to another CharDevRegItem, the two pointers of the previous item and the next item enable CharDevRegTbl to have a table including a linearly constructed, circularly constructed, or balanced tree structure.

8. The general character device driving method according to claim 7, characterized in that, it is not limited to the construction of CharDevRegTbl, including setting the construction of CharDevRegTbl according to specific performance requirements; including setting the construction of CharDevRegTbl according to the requirement of improving the speed of searching and inserting data.

9. The general character device driving method according to claim 8, characterized in that, the function functions corresponding to each device include: a control device opening operation function, a closing operation function, a read operation function, a write operation function, and an IO control operation function.

10. The general character device driving method according to claim 9, characterized in that, it further includes: constructing a mapping item corresponding to each character device registration item; calling the corresponding character device registration item through the mapping item.

11. An automobile, characterized in that, it includes a vehicle body and a general character device driver system as claimed in any one of claims 1 to 5 or an open automobile system architecture as claimed in claim 6 provided in the vehicle body.

12. An electronic device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein, when the processor executes the program, it implements the general character device driver method described in any one of claims 7 to 10.

13. A non-transitory computer-readable storage medium, wherein, the non-transitory computer-readable storage medium stores computer instructions for causing the computer to execute the general character device driver method described in any one of claims 7 to 10.

Citation Information

Patent Citations

  • Method capable of dynamically loading different terminal exchange chip drives

    CN102830983A

  • Method, control terminal and system for controlling electronic devices

    CN103856377A

  • Hardware equipment driving system based on microkernel and driving method thereof

    CN113268275A

  • Block device complex driving method and driving system

    CN117331616A