Real-time operating system driver adaptation method and apparatus, electronic device, and readable medium

By generating a driver base package and peripheral device code file library, and using a driver graphical development module to automatically adapt to peripheral devices, the problems of excessive time consumption and low matching degree in existing technologies are solved, and fast and efficient real-time operating system driver adaptation is achieved.

CN115826981BActive Publication Date: 2026-04-28INTEWELL (GUANGZHOU) SOFEWARE TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
INTEWELL (GUANGZHOU) SOFEWARE TECH CO LTD
Filing Date
2022-11-10
Publication Date
2026-04-28

AI Technical Summary

Technical Problem

When adapting to real-time operating system drivers, existing technologies require adapting peripheral devices one by one, resulting in excessive time consumption and low compatibility.

Method used

By receiving and parsing the original driver code file package of the target development board, a driver base package and peripheral device code file library are generated. The board-level driver package is generated using the driver graphical development module, and peripheral devices are automatically selected and adapted.

Benefits of technology

It reduces the time required to adapt to real-time operating system drivers and improves the compatibility between peripheral devices and the main control board.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115826981B_ABST
    Figure CN115826981B_ABST
Patent Text Reader

Abstract

Embodiments of the present disclosure disclose a real-time operating system driver adaptation method and device, electronic equipment and readable medium. A specific embodiment of the method comprises: receiving and analyzing an original driver code file package of a target development board; sending the original driver code file package to a driver base package generator to generate a driver base package; using a peripheral device code file library generator to generate a peripheral device code file library according to the driver base package; inputting the driver base package and the peripheral device code file library into a driver graphical development module to obtain a board-level driver package adapted to the target development board. The embodiment reduces the time for adapting the driver of the real-time operating system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of this disclosure relate to the field of computer technology, and more specifically to real-time operating system driver adaptation methods, apparatus, electronic devices, and readable media. Background Technology

[0002] When running a real-time operating system (RTOS) on different main control boards, the different peripheral devices on each board necessitate driver adaptation to ensure the ROS can run on various boards. Currently, the common approach to ROS driver adaptation is for driver developers to adapt each peripheral device individually.

[0003] However, when adapting drivers for real-time operating systems using the above method, the following technical problems often arise:

[0004] First, when the driver developers adapt each peripheral device individually, it may take a long time to adapt the driver for the real-time operating system due to the large number of peripheral devices.

[0005] Secondly, when adapting peripheral devices, it is usually necessary to select the peripheral devices to be adapted from the peripheral device list. Failure to disable peripheral devices not installed in the peripheral device list results in low compatibility between the real-time operating system adapted to each peripheral device and the main control board. Summary of the Invention

[0006] The summary portion of this disclosure is intended to provide a brief overview of the concepts, which will be described in detail in the detailed description portion. This summary portion is not intended to identify key or essential features of the claimed technical solutions, nor is it intended to limit the scope of the claimed technical solutions.

[0007] Some embodiments of this disclosure provide real-time operating system driver adaptation methods, apparatuses, electronic devices, computer-readable media, and computer program products to address one or more of the technical problems mentioned in the background section above.

[0008] In a first aspect, some embodiments of this disclosure provide a real-time operating system driver adaptation method, the method comprising: receiving and parsing the original driver code file package of the target development board; sending the original driver code file package to a driver base package generator to generate a driver base package; generating a peripheral device code file library using a peripheral device code file library generator based on the driver base package; and inputting the driver base package and the peripheral device code file library into the driver graphical development module to obtain a board-level driver package adapted to the target development board.

[0009] Secondly, some embodiments of this disclosure provide a real-time operating system driver adaptation device, the device comprising: a receiving unit configured to receive and parse the original driver code file package of a target development board; a sending unit configured to send the original driver code file package to a driver base package generator to generate a driver base package; a generating unit configured to generate a peripheral device code file library based on the driver base package using a peripheral device code file library generator; and an input unit configured to input the driver base package and the peripheral device code file library into the driver graphical development module to obtain a board-level driver package adapted to the target development board.

[0010] Thirdly, some embodiments of this disclosure provide an electronic device, including: one or more processors; and a storage device having one or more programs stored thereon, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the method described in any implementation of the first aspect above.

[0011] Fourthly, some embodiments of this disclosure provide a computer-readable medium having a computer program stored thereon, wherein the program, when executed by a processor, implements the method described in any of the implementations of the first aspect above.

[0012] Fifthly, some embodiments of this disclosure provide a computer program product, including a computer program that, when executed by a processor, implements the method described in any of the implementations of the first aspect above.

[0013] The above embodiments of this disclosure have the following beneficial effects: the real-time operating system driver adaptation method of some embodiments of this disclosure reduces the time required to adapt the real-time operating system driver. Specifically, the reason why it takes a long time to adapt the real-time operating system driver is that when driver developers adapt each peripheral device one by one, it may take a long time due to the large number of peripheral devices. Based on this, the real-time operating system driver adaptation method of some embodiments of this disclosure first receives and parses the original driver code file package of the target development board. This provides a data foundation for generating the driver base package. Second, the original driver code file package is sent to the driver base package generator to generate the driver base package. This allows the peripheral device driver code to be extracted from the generated driver base package. Then, based on the driver base package, a peripheral device code file library generator is used to generate a peripheral device code file library. This allows the extracted peripheral device driver code to be identified as the peripheral device code library, thereby selecting the peripheral devices to be adapted. Finally, the aforementioned driver base package and peripheral device code file library are input into the aforementioned driver graphical development module to obtain a board-level driver package adapted to the target development board. Thus, the peripheral devices requiring adaptation can be selected through the driver graphical development module, and an adapted board-level driver package can be generated. This reduces the time required for adapting drivers to real-time operating systems. Attached Figure Description

[0014] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic, and elements are not necessarily drawn to scale.

[0015] Figure 1 This is a schematic diagram illustrating an application scenario of the real-time operating system driver adaptation method according to some embodiments of this disclosure;

[0016] Figure 2 This is a flowchart of some embodiments of the real-time operating system driver adaptation method according to the present disclosure;

[0017] Figure 3 This is a schematic diagram of the structure of some embodiments of the real-time operating system driver adapter according to the present disclosure;

[0018] Figure 4 This is a schematic diagram of the structure of an electronic device suitable for implementing some embodiments of the present disclosure. Detailed Implementation

[0019] Embodiments of this disclosure will now be described in more detail with reference to the accompanying drawings. While some embodiments of this disclosure are shown in the drawings, it should be understood that this disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this disclosure. It should be understood that the accompanying drawings and embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of protection of this disclosure.

[0020] It should also be noted that, for ease of description, only the parts relevant to the invention are shown in the accompanying drawings. Unless otherwise specified, the embodiments and features described in this disclosure can be combined with each other.

[0021] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are used only to distinguish different devices, modules or units, and are not used to limit the order of functions performed by these devices, modules or units or their interdependencies.

[0022] It should be noted that the terms "a" and "a plurality of" used in this disclosure are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".

[0023] The names of messages or information exchanged between multiple devices in the embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.

[0024] This disclosure will now be described in detail with reference to the accompanying drawings and embodiments.

[0025] Figure 1 This is a schematic diagram illustrating an application scenario of the real-time operating system driver adaptation method according to some embodiments of this disclosure.

[0026] exist Figure 1In the application scenario, firstly, the computing device 101 can receive and parse the original driver code file package 102 of the target development board. Secondly, the computing device 101 can send the original driver code file package 102 to the driver base package generator 103 to generate a driver base package 104. The driver base package 104 includes a peripheral controller, a kernel startup file, and peripheral controller code. Then, the computing device 101 can use the peripheral device code file library generator 105 to generate a peripheral device code file 106 based on the driver base package 104. The peripheral device code file library 106 includes at least one peripheral device code file. Finally, the computing device 101 can input the driver base package 104 and the peripheral device code file library 106 into the driver graphical development module 107 to obtain a board-level driver package 108 adapted to the target development board. Optionally, the driver graphical development module 107 includes a base package import parsing module 109, a driver selection configuration parsing module 110, and a board-level driver package generation module 111. Optionally, the computing device 101 can input the aforementioned driver base package 104 and the aforementioned peripheral device code file library 106 into the aforementioned base package import parsing module 109 to generate a first peripheral device list and a second peripheral device list. Optionally, the computing device 101 can control the aforementioned driver selection configuration parsing module 110 to generate a board-level peripheral device selection list based on the aforementioned first peripheral device list and the aforementioned second peripheral device list. Optionally, the computing device 101 can send the aforementioned board-level peripheral device selection list to the aforementioned board-level driver package generation module 111 to generate a board-level driver package 108.

[0027] It should be noted that the aforementioned computing device 101 can be either hardware or software. When the computing device is hardware, it can be implemented as a distributed cluster consisting of multiple servers or terminal devices, or as a single server or a single terminal device. When the computing device is software, it can be installed within the hardware devices listed above. It can be implemented as, for example, multiple software programs or software modules used to provide distributed services, or as a single software program or software module. No specific limitations are made here.

[0028] It should be understood that Figure 1 The number of computing devices shown is merely illustrative. Any number of computing devices can be used depending on implementation needs.

[0029] Figure 2 A flow 200 is shown illustrating some embodiments of a real-time operating system driver adaptation method according to the present disclosure. This real-time operating system driver adaptation method includes the following steps:

[0030] Step 201: Receive and parse the original driver code file package of the target development board.

[0031] In some embodiments, the execution entity (e.g., a client) for real-time operating system driver adaptation can receive the original driver code file package of the target development board sent by the target terminal via a wired or wireless connection. The target terminal can be the terminal of the personnel adapting the driver. The target development board can be a motherboard requiring real-time operating system driver adaptation. The original driver code file package can be a file package of original driver code files for the real-time operating system. The original driver code file package includes a set of peripheral device driver code files. The peripheral device driver code files in the peripheral device driver code file set can be driver code files for a specific peripheral device. For example, the driver code file can be a .java file, or it can be a .c file. The driver development engine can be an engine used to adapt drivers for the real-time operating system.

[0032] Step 202: Send the original driver code file package to the driver base package generator to generate the driver base package.

[0033] In some embodiments, the executing entity may send the original driver code file package to a driver base package generator to generate a driver base package. The driver base package generator may be a pre-configured script for generating the driver base package. The driver base package generator takes the original driver code file package as input and outputs the driver base package. The driver base package may include, but is not limited to, CPU (central processing unit) peripheral controllers, kernel startup files, and peripheral controller code.

[0034] In practice, the above-mentioned driver base package is generated through the following steps:

[0035] The first step is to classify the individual original driver code files in the aforementioned original driver code file package to generate a set of original driver code files. In practice, firstly, the executing entity can obtain the classification directory from the terminal device via a wired or wireless connection. This classification directory can be a directory used to classify the individual original driver code files in the original driver code file package. For example, the classification directory can be a tree-structured directory. As an example, the classification directory could be [A(A1, A2, A3), B(B1, B2)], where A and B can be the two root directories of the classification directory. Secondly, the executing entity can classify the individual original driver code files in the aforementioned original driver code file package according to the classification directory to obtain a set of original driver code files. As an example, the original driver code files could be (A1, A2, A3, B1, B2), and the executing entity can classify these individual original driver code files according to the classification directory in the example above to obtain a set of original driver code files [A(A1, A2, A3), B(B1, B2)].

[0036] The second step involves storing each original driver code file group in the aforementioned original driver code file group set into a newly created code file package corresponding to that original driver code file group, and combining the newly created code file packages containing the original driver code file groups to generate combined newly created code file packages as the driver base package. In practice, firstly, the executing entity can create new code file packages based on the root directories included in the aforementioned category directory. For example, two new code file packages corresponding to root directories A and B in the aforementioned category directory [A(A1, A2, A3), B(B1, B2)] can be generated, with the names of the two new code file packages being the names of the root directories corresponding to the new code file packages. Secondly, the executing entity can store each original driver code file group into the corresponding newly created code file package. Thirdly, the executing entity can combine the newly created code file packages containing the original driver code file groups to generate combined newly created code file packages as the driver base package. Here, the combination process can be a merging process.

[0037] Step 203: Based on the driver base package, use the peripheral device code file library generator to generate the peripheral device code file library.

[0038] In some embodiments, the aforementioned execution entity may generate a peripheral device code file library based on the aforementioned driver base package using a peripheral device code file library generator.

[0039] In practice, the aforementioned peripheral device code library can be generated through the following steps:

[0040] The first step is to identify the newly created code file package containing the target raw driver code file group within the aforementioned driver base package as the target code file package. Here, the aforementioned target raw driver code file group refers to the raw driver code file group that represents the peripheral device driver code file.

[0041] The second step is to create a set of peripheral bus folders within the aforementioned target code file package. The names of the peripheral bus folders in this set correspond to the preset bus names in the preset bus name set. These preset bus names can be pre-stored peripheral bus names.

[0042] The third step is to move each target original driver code file in the target original driver code file group to the peripheral bus folder corresponding to the target original driver code file in the peripheral bus folder set.

[0043] The fourth step is to define the peripheral bus folder set containing the original driver code file groups of each target as the peripheral device code file library.

[0044] Step 204: Input the driver base package and peripheral device code file library into the driver graphical development module to obtain the board-level driver package adapted to the target development board.

[0045] In some embodiments, the executing entity can input the driver base package and the peripheral device code file library into the driver graphical development module to obtain a board-level driver package adapted to the target development board. The driver graphical development module may include a base package import and parsing module, a driver selection and configuration parsing module, and a board-level driver package generation module. The base package import and parsing module may be a module for parsing the driver base package and the peripheral device code file library. The driver selection and configuration parsing module may be a module for selecting peripheral devices. The board-level driver package generation module may be a module for generating a board-level driver package.

[0046] In practice, the aforementioned execution entity can input the aforementioned driver base package and the aforementioned peripheral device code file library into the aforementioned driver graphical development module through the following steps to obtain a board-level driver package adapted to the aforementioned target development board:

[0047] The first step is to input the aforementioned driver base package and peripheral device code file library into the aforementioned base package import and parsing module to generate the first peripheral device list and the second peripheral device list.

[0048] In practice, the aforementioned executing entity can generate the first peripheral device list and the second peripheral device list through the following sub-steps:

[0049] The first sub-step is to determine whether a peripheral bus controller directory exists in the aforementioned driver base package. This peripheral bus controller directory can be a directory of the bus controllers of peripheral devices.

[0050] The second sub-step, in response to the existence of the peripheral bus controller directory in the aforementioned driver base package, generates a first peripheral device list based on the peripheral bus controller directory. In practice, the names of each peripheral bus controller in the aforementioned peripheral bus controller directory can be filled into the peripheral device list template to generate the first peripheral device list. The aforementioned peripheral device list template can be a pre-defined list template for filling in peripheral devices.

[0051] The third sub-step involves determining whether a peripheral device code file package exists in the aforementioned peripheral device code file library. The peripheral device code files in the aforementioned peripheral device code file package can be code files used to adapt to a specific peripheral device. Each peripheral bus controller in the aforementioned peripheral bus controller directory corresponds to at least one peripheral device code file in the aforementioned peripheral device code file package.

[0052] The fourth sub-step involves generating a second peripheral device list based on the peripheral device code file package, in response to the existence of the aforementioned peripheral device code file package in the peripheral device code file library. In practice, the names of each peripheral device corresponding to each peripheral device code file in the aforementioned peripheral device code file package can be added to the aforementioned peripheral device list template to generate the second peripheral device list.

[0053] The second step involves controlling the driver selection configuration parsing module to generate a board-level peripheral device selection list based on the first peripheral device list and the second peripheral device list.

[0054] In practice, the above list of board-level peripheral devices can be generated through the following sub-steps:

[0055] The first sub-step involves generating a set of peripheral device selection icons based on the aforementioned first peripheral device list and second peripheral device list. In practice, the executing entity can first obtain the preset peripheral device selection icon set from the target terminal via a wired or wireless connection. The preset peripheral device selection icons in the preset peripheral device selection icon set can be pre-generated peripheral device selection icons. Then, in response to the fact that the sum of the number of first peripheral devices included in the first peripheral device list and the number of second peripheral devices included in the second peripheral device list is less than or equal to the number of preset peripheral device selection icons included in the preset peripheral device selection icon set, the preset peripheral device selection icon set is determined as the peripheral device selection icon set. Each preset peripheral device selection icon in the preset peripheral device selection icon set corresponds to a peripheral device.

[0056] The second sub-step involves sending the aforementioned set of peripheral device selection icons to the peripheral device selection control on the target terminal for display. The peripheral device selection control can be a control for selecting from the displayed peripheral device selection icons. The peripheral device selection control includes a peripheral device icon display control and an icon confirmation control. The peripheral device icon display control displays each peripheral device selection icon from the aforementioned set of peripheral device selection icons. The icon confirmation control confirms the transmission of information representing the selected peripheral device.

[0057] The third sub-step involves, in response to receiving peripheral device selection information from the target terminal that acts on the peripheral device selection control, generating a board-level peripheral device selection list based on the peripheral device selection information. The peripheral device selection information can represent the various peripheral device selection icons selected by the target terminal. In practice, the executing entity can fill in the names of the peripheral devices corresponding to the peripheral device selection icons selected by the target terminal into an empty board-level peripheral device selection list to generate the board-level peripheral device selection list.

[0058] Optionally, after the first sub-step, from the peripheral devices corresponding to the preset peripheral device selection icon set, each peripheral device representing a peripheral bus controller is selected as a peripheral bus controller set, and each peripheral device that is not selected is determined as a peripheral device set. Wherein, the peripheral bus controller in the peripheral bus controller set corresponds to at least one peripheral device in the peripheral device set.

[0059] Optionally, after the first sub-step, for each peripheral bus controller in the aforementioned peripheral bus controller set, in response to the fact that the aforementioned peripheral bus controller is different from each peripheral device in the aforementioned first peripheral device list, a selectability prohibition flag corresponding to the aforementioned peripheral bus controller is generated, and for each peripheral device in the aforementioned peripheral bus controller, a selectability prohibition flag corresponding to the aforementioned peripheral device is generated. The selectability prohibition flag can indicate that a certain peripheral bus controller or a certain peripheral device is prohibited from being selected. For example, the selectability prohibition flag can be "AT1, 0", where "AT1" can represent a certain peripheral device, and "0" indicates that peripheral device "AT1" is prohibited from being selected.

[0060] Optionally, after the first sub-step, the aforementioned peripheral device selection icon set and each of the corresponding prohibited selection flags in the aforementioned peripheral device selection icon set are sent to the aforementioned peripheral device selection control for display.

[0061] The relevant content in the above optional part, as an inventive point of the present disclosure, solves the second technical problem mentioned in the background art: "When adapting peripheral devices, it is usually necessary to select the peripheral devices to be adapted from the peripheral device list. The peripheral devices not installed in the peripheral device list are not disabled, resulting in a low matching degree between the real-time operating system adapted to each peripheral device and the main control board." The factors that cause a low matching degree between the real-time operating system adapted to each peripheral device and the main control board are often as follows: When adapting peripheral devices, it is usually necessary to select the peripheral devices to be adapted from the peripheral device list. The peripheral devices not installed in the peripheral device list are not disabled, resulting in a low matching degree between the real-time operating system adapted to each peripheral device and the main control board. If the above factors are solved, the effect of improving the matching degree between the real-time operating system adapted to each peripheral device and the main control board can be achieved. To achieve this effect, first, select each peripheral device representing the peripheral bus controller from each peripheral device corresponding to the above preset peripheral device selection icon set as the peripheral bus controller set, and determine each unselected peripheral device as the peripheral device set. Thus, the icons of the peripheral bus controller and the peripheral devices in the preset peripheral device selection icon set can be distinguished. Second, for each peripheral bus controller in the above peripheral bus controller set, in response to the fact that the peripheral bus controller is different from each peripheral device in the above first peripheral device list, generate a prohibited selection identifier corresponding to the peripheral bus controller, and for each peripheral device in each peripheral device corresponding to the peripheral bus controller, generate a prohibited selection identifier corresponding to the peripheral device. Thus, the peripheral bus controller or peripheral device that does not exist on the main control board can be prohibited from being selected, avoiding the problem of a low matching degree between the real-time operating system adapted to the peripheral device and the main control board caused by selecting un-installed peripheral devices, and improving the matching degree between the real-time operating system adapted to the peripheral device and the main control board. Third, send the above peripheral device selection icon set and each prohibited selection identifier corresponding to the peripheral device selection icon set to the above peripheral device selection control for display. Thus, the disabling operation of the un-installed peripheral devices is completed, and the problem of a low matching degree between the real-time operating system adapted to each peripheral device and the main control board is improved.

[0062] In the third step, send the above board-level peripheral device selection list to the above board-level driver package generation module to generate a board-level driver package.

[0063] In practice, the above board-level driver package can be generated through the following sub-steps:

[0064] The first sub-step is to use the pre-stored cropping and organizing script to perform cropping and organizing processing on the above-mentioned driver base package and the above-mentioned peripheral device code file library according to the above-mentioned list of selected board-level peripheral devices, so as to generate a board-level driver package. In practice, first, the above-mentioned execution entity can delete the peripheral device code files corresponding to the unselected peripheral device selection icons in the above-mentioned driver base package and the above-mentioned peripheral device code file library. Then, the driver base package and the peripheral device code file library are organized according to the preset driver package directory to generate a board-level driver package. Among them, the above-mentioned preset driver package directory can be the directory of the preset board-level driver package. Here, each directory folder corresponding to the above-mentioned preset driver package directory can be generated, and each file in the driver base package and the peripheral device code file library is stored in the corresponding directory folder.

[0065] The above-mentioned various embodiments of the present disclosure have the following beneficial effects: Through the real-time operating system driver adaptation method of some embodiments of the present disclosure, the time for adapting the driver of the real-time operating system is reduced. Specifically, the reason for the need to spend a long time adapting the driver of the real-time operating system is that when the driver developer adapts each peripheral device one by one, it may take a long time to adapt the driver of the real-time operating system due to the large number of peripheral devices. Based on this, the real-time operating system driver adaptation method of some embodiments of the present disclosure first receives and analyzes the original driver code file package of the target development board. Thus, a data basis can be provided for generating the driver base package. Secondly, the above-mentioned original driver code file package is sent to the driver base package generator to generate a driver base package. Thus, the peripheral device driver code in the generated driver base package can be extracted. Then, according to the above-mentioned driver base package, a peripheral device code file library generator is used to generate a peripheral device code file library. Thus, the extracted peripheral device driver code can be determined as the peripheral device code library, and the peripheral devices that need to be adapted can be selected. Finally, the above-mentioned driver base package and the above-mentioned peripheral device code file library are input into the above-mentioned driver graphical development module to obtain a board-level driver package adapted to the above-mentioned target development board. Thus, the peripheral devices that need to be adapted can be selected through the driver graphical development module, and an adapted board-level driver package can be generated. The time for adapting the driver of the real-time operating system is reduced.

[0066] For further reference Figure 3 , as an implementation of the methods shown in the above figures, the present disclosure provides some embodiments of a real-time operating system driver adaptation device. These device embodiments correspond to Figure 2 the method embodiments shown, and the real-time operating system driver adaptation device can be specifically applied to various electronic devices.

[0067] As Figure 3As shown, a real-time operating system driver adaptation device 300 in some embodiments includes: a receiving unit 301, a sending unit 302, a generating unit 303, and an input unit 304. The receiving unit 301 is configured to receive and parse the original driver code file package of the target development board; the sending unit 302 is configured to send the original driver code file package to a driver base package generator to generate a driver base package; the generating unit 303 is configured to generate a peripheral device code file library based on the driver base package using a peripheral device code file library generator; and the input unit 304 is configured to input the driver base package and the peripheral device code file library into the driver graphical development module to obtain a board-level driver package adapted to the target development board.

[0068] It is understandable that the units described in the real-time operating system driver adapter 300 are related to the reference Figure 2 The steps in the described method correspond accordingly. Therefore, the operations, features, and beneficial effects described above for the method also apply to the real-time operating system driver adapter 300 and the units contained therein, and will not be repeated here.

[0069] The following is for reference. Figure 4 This document illustrates a structural schematic of an electronic device 400 suitable for implementing some embodiments of the present disclosure. The electronic devices in some embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 4 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments of this disclosure.

[0070] like Figure 4 As shown, electronic device 400 may include a processing device (e.g., a central processing unit, a graphics processor, etc.) 401, which can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 402 or a program loaded from storage device 408 into random access memory (RAM) 403. RAM 403 also stores various programs and data required for the operation of electronic device 400. Processing device 401, ROM 402, and RAM 403 are interconnected via bus 404. Input / output (I / O) interface 405 is also connected to bus 404.

[0071] Typically, the following devices can be connected to I / O interface 405: input devices 405 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 407 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 408 including, for example, magnetic tapes, hard disks, etc.; and communication devices 409. Communication device 409 allows electronic device 400 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 4 An electronic device 400 with various devices is shown; however, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively. Figure 4 Each box shown can represent a device or multiple devices as needed.

[0072] In particular, according to some embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, some embodiments of this disclosure include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication device 409, or installed from storage device 408, or installed from ROM 402. When the computer program is executed by processing device 401, it performs the functions defined above in the methods of some embodiments of this disclosure.

[0073] It should be noted that, in some embodiments of this disclosure, the computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium may be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In some embodiments of this disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In some embodiments of this disclosure, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.

[0074] In some implementations, clients and servers can communicate using any currently known or future-developed network protocol such as HTTP (Hypertext Transfer Protocol) and can interconnect with digital data communication (e.g., communication networks) of any form or medium. Examples of communication networks include local area networks (“LANs”), wide area networks (“WANs”), the Internet (e.g., the Internet of Things), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future-developed networks.

[0075] The aforementioned computer-readable medium may be included within the aforementioned electronic device; or it may exist independently and not assembled into the electronic device. The aforementioned computer-readable medium carries one or more programs that, when executed by the electronic device, cause the electronic device to: receive and parse the original driver code file package of the target development board; send the original driver code file package to a driver base package generator to generate a driver base package; generate a peripheral device code file library using a peripheral device code file library generator based on the driver base package; and input the driver base package and the peripheral device code file library into the aforementioned driver graphical development module to obtain a board-level driver package adapted to the aforementioned target development board.

[0076] Computer program code for performing operations of some embodiments of this disclosure can be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, and C++, and conventional procedural programming languages ​​such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0077] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0078] The units described in some embodiments of this disclosure can be implemented in software or hardware. The described units can also be housed in a processor; for example, a processor may be described as including a receiving unit, a transmitting unit, a generating unit, and an input unit. The names of these units do not necessarily limit the specific unit; for example, a receiving unit may also be described as "a unit that receives and parses the original driver code file package of the target development board."

[0079] The functions described above in this document can be performed, at least in part, by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: Field Programmable Gate Arrays (FPGAs), Application-Specific Integrated Circuits (ASICs), Application Standard Products (ASSPs), System-on-Chip (SoCs), Complex Programmable Logic Devices (CPLDs), and so on.

[0080] Some embodiments of this disclosure also provide a computer program product, including a computer program that, when executed by a processor, implements any of the above-described real-time operating system driver adaptation methods.

[0081] The above description is merely a selection of preferred embodiments of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of the invention involved in the embodiments of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described inventive concept. For example, technical solutions formed by substituting the above-described features with (but not limited to) technical features with similar functions disclosed in the embodiments of this disclosure.

Claims

1. A real-time operating system driver adaptation method, applied to a driver development engine, the driver development engine including a driver base package generator, a peripheral device code file library generator, and a driver graphical development module, the method comprising: Receive and parse the original driver code file package of the target development board, wherein the original driver code file package includes a set of peripheral device driver code files; The original driver code file package is sent to the driver base package generator to generate a driver base package, wherein the driver base package includes a peripheral controller, a kernel startup file, and peripheral controller code; Based on the driver base package, a peripheral device code file library is generated using a peripheral device code file library generator, wherein the peripheral device code file library includes at least one peripheral device code file; The driver base package and the peripheral device code file library are input into the driver graphical development module to obtain a board-level driver package adapted to the target development board.

2. The method according to claim 1, wherein, The original driver code file package includes driver code files corresponding to the target development board, and the driver base package is generated through the following steps: The original driver code files in the original driver code file package are classified and processed to generate a set of original driver code files; Each original driver code file group in the original driver code file group set is stored in a newly created code file package corresponding to the original driver code file group, and the newly created code file packages storing each original driver code file group are combined to generate the combined newly created code file packages as driver base packages.

3. The method according to claim 2, wherein, The peripheral device code file library is generated through the following steps: The newly created code file package that stores the target original driver code file group in the driver base package is identified as the target code file package, wherein the target original driver code file group is the original driver code file group that represents the peripheral device driver code file; Create a peripheral bus folder set in the target code file package, wherein the name of the peripheral bus folder in the peripheral bus folder corresponds to a preset bus name in the preset bus name set; For each target original driver code file in the target original driver code file group, move the target original driver code file to the peripheral bus folder in the peripheral bus folder set corresponding to the target original driver code file; The peripheral bus folder set containing the original driver code file groups of each target is defined as the peripheral device code file library.

4. The method according to claim 1, wherein, The driver graphical development module includes a basic package import and parsing module, a driver selection and configuration parsing module, and a board-level driver package generation module. as well as The step of inputting the driver base package and the peripheral device code file library into the driver graphical development module to obtain a board-level driver package adapted to the target development board includes: The driver base package and the peripheral device code file library are input into the base package import parsing module to generate a first peripheral device list and a second peripheral device list. The first peripheral device in the first peripheral device list is the name of the peripheral bus controller included in the driver base package, and the second peripheral device in the second peripheral device list is the name of the peripheral device included in the driver base package. Based on the first peripheral device list and the second peripheral device list, the driver selection configuration parsing module is controlled to generate a board-level peripheral device selection list; The list of selected board-level peripheral devices is sent to the board-level driver package generation module to generate the board-level driver package.

5. The method according to claim 4, wherein, The first peripheral device list and the second peripheral device list are generated through the following steps: Determine whether a peripheral bus controller directory exists in the driver base package; In response to the existence of the peripheral bus controller directory in the driver base package, a first peripheral device list is generated based on the peripheral bus controller directory; Determine whether a peripheral device code file package exists in the peripheral device code file library; In response to the existence of the peripheral device code file package in the peripheral device code file library, a second peripheral device list is generated based on the peripheral device code file package.

6. The method according to claim 4, wherein, The board-level peripheral device selection list is generated through the following steps: Based on the first peripheral device list and the second peripheral device list, generate a set of peripheral device selection icons; The peripheral device selection icon set is sent to the peripheral device selection control of the target terminal for display. In response to receiving peripheral device selection information sent by the target terminal and applied to the peripheral device selection control, a board-level peripheral device selection list is generated based on the peripheral device selection information.

7. The method according to claim 6, wherein, The board-level driver package is generated through the following steps: Using a pre-stored trimming and organizing script, the driver base package and the peripheral device code file library are trimmed and organized according to the board-level peripheral device selection list to generate a board-level driver package.

8. A real-time operating system driver adapter, comprising: The receiving unit is configured to receive and parse the original driver code file package of the target development board, wherein the original driver code file package includes a set of peripheral device driver code files; The sending unit is configured to send the original driver code file package to the driver base package generator to generate the driver base package; The generation unit is configured to generate a peripheral device code file library based on the driver base package using a peripheral device code file library generator; The input unit is configured to input the driver base package and the peripheral device code file library into the driver graphical development module to obtain a board-level driver package adapted to the target development board.

9. An electronic device, comprising: One or more processors; A storage device on which one or more programs are stored; When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in any one of claims 1 to 7.

10. A computer-readable medium having a computer program stored thereon, wherein, When the program is executed by the processor, it implements the method as described in any one of claims 1 to 7.

11. A computer program product comprising a computer program that, when executed by a processor, implements the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Standardized BSP graphical configuration system and method based on domestic operating system

    CN112764739A

  • Board-level support packet processing method and device, electronic equipment and storage medium

    CN114356423A