Peripheral driver loading method, operating system and electronic equipment system
By implementing the peripheral driver loading method in the electronic device system and actively registering the driver files with external modules, the problems of large workload in the development of peripheral drivers and bloated operating systems in the existing technology are solved, and system performance and maintainability are improved.
Patent Information
- Application Number
- CN202411513340.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-28
- Publication Date
- 2025-03-04
AI Technical Summary
In existing electronic device systems, the development workload of peripheral drivers is huge and maintainable. In order to achieve plug-and-play functions, the operating system needs to preinstall a large number of possible device drivers, resulting in bloated operating system and affecting performance.
By implementing a peripheral driver loading method in the main control device, using the external module to actively register, the driver files are acquired and registered, reducing the use of operating system storage space and reducing the performance requirements for main control chip resources.
It realizes that external modules can be registered actively, reduces the burden on the operating system, improves the overall performance of the system, and simplifies the development and maintenance process of peripheral drivers.
Smart Images

Figure CN119556995A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a peripheral device driver loading method, an operating system, an electronic device system, a machine-readable storage medium and an electronic device. Background Art
[0002] In the current electronic equipment system development, the implementation of peripheral drivers usually relies on the main control device to adapt to the modules of different manufacturers. This not only requires the main control device to have powerful performance, but also requires a lot of development costs. Figure 2 , Figure 2 The schematic diagram shows a framework diagram of an existing traditional operating system. In existing electronic equipment systems, peripheral drivers are installed in the operating system of the main control device. Driver development engineers develop them according to the characteristics of the external devices and need to develop them according to different models of different manufacturers or even different production batches of devices, resulting in a huge development workload and low maintainability.
[0003] However, with the rapid development of technology, many devices are of plug-and-play type. For example, the fusion terminal commonly used in the power industry provides an interface that supports plug-and-play functions, supports communication modules, carrier modules and other devices, and needs to meet the requirements of being able to be used after insertion, that is, external devices from different manufacturers, different models or different production batches must all meet plug-and-play requirements.
[0004] In order to meet the plug-and-play requirements of external devices from different manufacturers, different models, and even different production batches, the commonly used method is the exhaustive method, that is, all possible device drivers are pre-installed into the operating system of the main control device. However, due to the large number of external devices that need to be adapted, the operating system will become bloated, severely expanded, and the non-volatile storage space will be tight, which will affect the overall performance. Summary of the invention
[0005] The purpose of the embodiment of the present invention is to provide a peripheral driver loading method, an operating system, an electronic device system, a machine-readable storage medium and an electronic device, wherein the peripheral driver loading method enables the external module to actively register, reduces the occupation of the operating system storage space, and reduces the performance requirements for the operating system main control chip resources. The execution efficiency of the operating system is improved, and the overall system performance is improved.
[0006] In order to achieve the above-mentioned object, the first aspect of the present application provides a peripheral driver loading method, which is applied to a main control device, and the peripheral driver loading method comprises:
[0007] When an external module is connected to the main control device, parameter information of the external module is obtained, and based on the parameter information, it is determined whether a corresponding peripheral driver exists in the current operating system;
[0008] When it is determined that there is no corresponding peripheral driver in the current operating system, establishing a communication connection with the external module;
[0009] When the communication connection with the external module is successfully established, a driver file is obtained from the external module, and the driver file is registered in the current operating system.
[0010] In the embodiment of the present application, it also includes:
[0011] When it is determined that a corresponding peripheral device driver exists in the current operating system, the corresponding peripheral device driver is registered in the current operating system.
[0012] In an embodiment of the present application, establishing a communication connection with the external module includes:
[0013] Sending a connection establishment instruction to the external module;
[0014] Obtaining connection information returned by the external module;
[0015] Based on the connection information, connection establishment confirmation information is generated, and the connection establishment confirmation information is sent to the external module to establish a communication connection with the external module.
[0016] In the embodiment of the present application, the step of obtaining the driver file from the external module includes:
[0017] Sending a drive information acquisition instruction to the external module;
[0018] Acquire the driving information returned by the external module;
[0019] Confirming the driving information, and after the driving information is confirmed, sending a driving file acquisition instruction to the external module;
[0020] Get the driver file returned by the external module.
[0021] In the embodiment of the present application, the obtaining of the driver file returned by the external module includes:
[0022] A1: Obtain the first frame of the driver file returned by the external module;
[0023] A2: Send a confirmation frame and a command to read the next frame to the external module;
[0024] A3: Obtain the next frame of the driver file returned by the external module;
[0025] A4: Execute A2-A3 in a loop until the last frame of the driver file returned by the external module is obtained, and send a confirmation frame to the external module to obtain the driver file.
[0026] In the embodiment of the present application, when an external module is connected to the main control device, before determining whether a corresponding peripheral driver exists in the current operating system based on the parameter information of the external module, the method further includes:
[0027] Periodically check whether any external module is connected to the main control device.
[0028] In an embodiment of the present application, the operating system includes a first general logic management unit and a first hardware interface, the first hardware interface is used to operate each hardware circuit, and the first general logic management unit is used to manage each hardware circuit based on the first hardware interface;
[0029] The periodic query of whether an external module is connected to the main control device includes:
[0030] The first general logic management unit periodically sends a query command to the first hardware interface;
[0031] The first hardware interface responds to the query command by using a polling method to query whether an external module is connected to each hardware circuit, obtains an external query result, and sends the external query result to the first general logic management unit.
[0032] In the embodiment of the present application, the acquiring the parameter information of the external module and judging whether there is a corresponding peripheral driver in the current operating system based on the parameter information includes:
[0033] Acquiring parameter information of the external module through the first hardware interface, and sending the parameter information to the first general logic management unit;
[0034] The first general logic management unit determines whether a corresponding peripheral driver exists in the current operating system based on the parameter information.
[0035] In the embodiment of the present application, the operating system further includes a first driver logic management unit, and the first driver logic management unit is used to manage existing peripheral drivers;
[0036] The determining, based on the parameter information, whether there is a corresponding peripheral driver in the current operating system includes:
[0037] The first general logic management unit generates a driver query instruction based on the parameter information and sends the instruction to the first driver program logic management unit;
[0038] The first driver logic management unit queries the existing peripheral driver based on the driver query instruction, obtains the driver query result, and returns the driver query result to the first general logic management unit;
[0039] The first general logic management unit determines whether a corresponding peripheral driver exists in the first driver program logic management unit based on the driver query result.
[0040] In the embodiment of the present application, it also includes:
[0041] The first general logic management unit registers the driver file to the first driver program logic management unit.
[0042] A second aspect of the present application is an operating system, applied to a main control device, comprising: a first general logic management unit and an operating system driver management unit;
[0043] The first general logic management unit is used to obtain parameter information of the external module when an external module is connected to the main control device, and based on the parameter information, determine whether there is a corresponding peripheral driver in the current operating system; when it is determined that there is no corresponding peripheral driver in the current operating system, establish a communication connection with the external module, and when the communication connection with the external module is successfully established, obtain the driver file from the external module; and also register the driver file to the operating system driver management unit.
[0044] In the embodiment of the present application, a first driver logic management unit is also included:
[0045] The first general logic management unit is also used to take out the corresponding peripheral driver from the first driver logic management unit and register the corresponding peripheral driver to the operating system driver management unit when it is determined that the corresponding peripheral driver exists in the current operating system.
[0046] In the embodiment of the present application, the first general logic management unit includes a connection subunit;
[0047] The connection subunit is used to send a connection establishment instruction to the external module, obtain connection information returned by the external module, generate connection establishment confirmation information based on the connection information, and send the connection establishment confirmation information to the external module to establish a communication connection with the external module.
[0048] In the embodiment of the present application, the first general logic management unit includes a drive acquisition subunit;
[0049] The driver acquisition subunit is used to send a driver information acquisition instruction to the external module, acquire the driver information returned by the external module, confirm the driver information, and after the driver information is confirmed, send a driver file acquisition instruction to the external module; and is also used to acquire the driver file returned by the external module.
[0050] In the embodiment of the present application, when the driver acquisition subunit is used to acquire the driver file returned by the external module, the following steps are specifically performed:
[0051] B1: Obtain the first frame of the driving file returned by the external module;
[0052] B2: Sending a confirmation frame and a command to read the next frame to the external module;
[0053] B3: Obtain the next frame of the driver file returned by the external module;
[0054] B4: Execute B2-B3 in a loop until the last frame of the driver file returned by the external module is obtained, and send a confirmation frame to the external module to obtain the driver file.
[0055] In the embodiment of the present application, the operating system further includes a first hardware interface;
[0056] The first general logic management unit is further used to periodically send a query command to the first hardware interface;
[0057] The first hardware interface is used to query whether there is an external module connected to each hardware circuit in a polling manner based on the query command, obtain an external query result, and send the external query result to the first general logic management unit.
[0058] In the embodiment of the present application, the first hardware interface is also used to obtain parameter information of the external module when an external module is connected to the main control device, and send the parameter information to the first general logic management unit.
[0059] In the embodiment of the present application, the operating system further includes a first driver logic management unit;
[0060] The first general logic management unit is used to generate a driver query instruction based on the parameter information and send it to the first driver program logic management unit; and is also used to determine whether there is a corresponding peripheral driver in the first driver program logic management unit based on the driver query result;
[0061] The first driver logic management unit is used to query the existing peripheral driver based on the driver query instruction, obtain the driver query result, and return the driver query result to the first general logic management unit.
[0062] In the embodiment of the present application, the first general logic management unit is further used to register the driver file to the first driver program logic management unit.
[0063] A third aspect of the present application provides an electronic device system, including a main control device and an external module, wherein the main control device is provided with an operating system, and the operating system includes: a first general logic management unit and an operating system driver management unit;
[0064] The first general logic management unit is used to obtain parameter information of the external module when the external module is connected to the main control device, and based on the parameter information, determine whether there is a corresponding peripheral driver in the current operating system; and if it is determined that there is no corresponding peripheral driver in the current operating system, establish a communication connection with the external module, and if the communication connection with the external module is successfully established, obtain the driver file from the external module; and also register the driver file to the operating system driver management unit.
[0065] In the embodiment of the present application, the operating system further includes a first driver logic management unit:
[0066] The first general logic management unit is also used to take out the corresponding peripheral driver from the first driver logic management unit and register the corresponding peripheral driver to the operating system driver management unit when it is determined that the corresponding peripheral driver exists in the current operating system.
[0067] In the embodiment of the present application, the first universal logic management unit includes a connection subunit, and the external module includes a second universal logic management unit;
[0068] The connection subunit is used to send a connection establishment instruction to the second universal logic management unit, obtain connection information returned by the second universal logic management unit, generate connection establishment confirmation information based on the connection information, and send the connection establishment confirmation information to the second universal logic management unit to establish a communication connection with the external module.
[0069] In the embodiment of the present application, the first general logic management unit includes a drive acquisition subunit;
[0070] The driver acquisition subunit is used to send a driver information acquisition instruction to the external module, acquire the driver information returned by the external module, confirm the driver information, and after the driver information is confirmed, send a driver file acquisition instruction to the external module; and is also used to acquire the driver file returned by the external module.
[0071] In the embodiment of the present application, when the driver acquisition subunit is used to acquire the driver file returned by the external module, the following steps are specifically performed:
[0072] C1: Obtain the first frame of the driver file returned by the external module;
[0073] C2: Sending a confirmation frame and a command to read the next frame to the external module;
[0074] C3: Obtain the next frame of the driver file returned by the external module;
[0075] C4: Execute C2-C3 in a loop until the last frame of the driver file returned by the external module is obtained, and send a confirmation frame to the external module to obtain the driver file.
[0076] In the embodiment of the present application, the operating system further includes a first hardware interface;
[0077] The first general logic management unit is further used to periodically send a query command to the first hardware interface;
[0078] The first hardware interface is used to query whether there is an external module connected to each hardware circuit in a polling manner based on the query command, obtain an external query result, and send the external query result to the first general logic management unit.
[0079] In an embodiment of the present application, the external module includes a second hardware interface, and the second hardware interface is used to receive the query command and return the query external result to the first hardware interface based on the query command.
[0080] In the embodiment of the present application, the first hardware interface is also used to obtain parameter information of the external module when an external module is connected to the main control device, and send the parameter information to the first general logic management unit.
[0081] In the embodiment of the present application, the operating system further includes a first driver logic management unit;
[0082] The first general logic management unit is used to generate a driver query instruction based on the parameter information and send it to the first driver program logic management unit; and is also used to determine whether there is a corresponding peripheral driver in the first driver program logic management unit based on the driver query result;
[0083] The first driver logic management unit is used to query the existing peripheral driver based on the driver query instruction, obtain the driver query result, and return the driver query result to the first general logic management unit.
[0084] In the embodiment of the present application, the first general logic management unit is further used to register the driver file to the first driver program logic management unit.
[0085] In the embodiment of the present application, the external module further includes a second driver logic management unit;
[0086] The second general logic management unit is further used to receive a driver file acquisition instruction, and based on the driver file acquisition instruction, acquire a driver file from the second driver program logic management unit, and send the driver file to the first general logic management unit.
[0087] A fourth aspect of the present application provides an electronic device, the electronic device comprising:
[0088] at least one processor;
[0089] a memory connected to the at least one processor;
[0090] The memory stores instructions that can be executed by the at least one processor, and the at least one processor implements the above-mentioned peripheral driver loading method by executing the instructions stored in the memory.
[0091] A fifth aspect of the present application provides a machine-readable storage medium, on which instructions are stored. When the instructions are executed by a processor, the processor is configured to execute the above-mentioned peripheral driver loading method.
[0092] Through the above technical solution, when an external module is connected to the main control device, the main control device obtains the parameter information of the external module, and based on the parameter information, determines whether there is a corresponding peripheral driver in the current operating system; when it is determined that there is no corresponding peripheral driver in the current operating system, establishes a communication connection with the external module; when the communication connection with the external module is successfully established, obtains the driver file from the external module, and registers the driver file in the current operating system. By transmitting the driver file in the external module to the main control setting by communication, and registering it in the operating system, the overall scheduling control of the main control device is realized, so that the external module can be actively registered, which can greatly reduce the problem of adapting the external module drivers of various manufacturers, reduce the occupation of the operating system storage space, and reduce the performance requirements of the main control chip resources of the operating system. Since the main control device no longer needs to be compatible with multiple manufacturers and types of external modules, the operating system can be made lightweight to a great extent, thereby improving the execution efficiency of the operating system and improving the overall performance of the system. By actively obtaining the corresponding driver from the external module, there is no need to connect to the Internet or integrate the relevant driver in the main control device in advance. This can reduce some unexpected situations that occur when searching and installing from the Internet or manually searching and installing. It is especially convenient for embedded devices that are not convenient for connecting to the Internet.
[0093] Other features and advantages of the embodiments of the present invention will be described in detail in the subsequent detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0094] The accompanying drawings are used to provide a further understanding of the embodiments of the present invention and constitute a part of the specification. Together with the following specific implementations, they are used to explain the embodiments of the present invention, but do not constitute a limitation on the embodiments of the present invention. In the accompanying drawings:
[0095] Figure 1 A schematic diagram of a flow chart of a peripheral device driver loading method according to an embodiment of the present application is schematically shown;
[0096] Figure 2 A schematic diagram of a conventional operating system is shown;
[0097] Figure 3 A flowchart of an external module actively registering with an operating system according to an embodiment of the present application is schematically shown;
[0098] Figure 4 The schematic diagram shows a flow chart of external module identification according to an embodiment of the present application;
[0099] Figure 5 A schematic diagram of a process for establishing a communication connection according to an embodiment of the present application is shown;
[0100] Figure 6 The following schematically shows a process diagram of obtaining a driver file according to an embodiment of the present application;
[0101] Figure 7 A schematic diagram of a framework of an operating system according to an embodiment of the present application is shown;
[0102] Figure 8 The internal structure diagram of a computer device according to an embodiment of the present application is schematically shown.
[0103] Description of Reference Numerals
[0104] A01-processor; A02-network interface; A03-internal memory; A04-display screen; A05-input device; A06-non-volatile storage medium; B01-operating system; B02-computer program. DETAILED DESCRIPTION
[0105] The specific implementation of the embodiment of the present invention is described in detail below in conjunction with the accompanying drawings. It should be understood that the specific implementation described here is only used to illustrate and explain the embodiment of the present invention, and is not used to limit the embodiment of the present invention.
[0106] It should be noted that if the embodiments of the present application involve directional indications (such as up, down, left, right, front, back...), the directional indications are only used to explain the relative position relationship, movement status, etc. between the components under a certain specific posture (as shown in the accompanying drawings). If the specific posture changes, the directional indication will also change accordingly.
[0107] In addition, if there are descriptions involving "first", "second", etc. in the embodiments of the present application, the descriptions of "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or suggesting their relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the ability of ordinary technicians in the field to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such combination of technical solutions does not exist and is not within the scope of protection required by this application.
[0108] It should be noted that the underlying hardware mentioned in this embodiment refers to the most basic hardware circuits and components. The hardware interface refers to the software driver interface made for different peripheral hardware circuits in the operating system to facilitate the operation of the hardware. Logical management refers to the logical management of the hardware circuits in the operating system based on the hardware interface. The external module may refer to: an independent device with an external plug-in type interface (printer, mobile phone, etc.); an auxiliary module with an external plug-in type interface (communication module, carrier module, etc.); a chip that is directly solidified into the internal and directly communicates with the main control device (WIFI chip, Bluetooth chip, etc.). The main control device refers to the main device that controls the operation of the entire system, usually the core component in the system. The main control device can be a computer, controller, motherboard or other type of hardware device, which is responsible for coordinating and controlling the work of each component in the system to ensure the normal operation of the system and achieve the predetermined functions. The operating system master mentioned in this embodiment refers to the operating system in the main control device.
[0109] Please see Figure 1 , Figure 1 The following is a schematic diagram of a flow chart of a peripheral driver loading method according to an embodiment of the present application. This embodiment provides a peripheral driver loading method, which is applied to a main control device, and the peripheral driver loading method includes the following steps:
[0110] Step 210: when an external module is connected to the main control device, obtaining parameter information of the external module, and judging whether a corresponding peripheral driver exists in the current operating system based on the parameter information;
[0111] In this embodiment, the main control device and the external module can be connected by hardware, and the main control device can be provided with multiple hardware circuits for different external modules to connect. The parameter information of the above-mentioned external module refers to the basic information of the external module, including the manufacturer's identity document (ID) and product ID of the device to which the external module belongs. Through this parameter information, the external module can be identified as a unique device in the operating system of the main control device. When the external module is connected to the main control device, it can be through the main control device sending instructions to the external module, and the external module sends the parameter information to the main control device after receiving the instruction, or it can be after connecting to the main control device, the external module directly sends the parameter information to the main control device, which is not limited in this embodiment. The above-mentioned peripheral driver refers to the driver corresponding to each external module. In the main control device, some peripheral drivers corresponding to the external modules can be pre-stored. These peripheral drivers can be written in advance by the user, or they can be obtained from the external module during the historical communication process with the external module. After obtaining the parameter information of the external module, the existing peripheral driver can be matched according to the parameter information to determine whether there is a corresponding peripheral driver.
[0112] Step 220: when it is determined that there is no corresponding peripheral device driver in the current operating system, establishing a communication connection with the external module;
[0113] In this embodiment, the above-mentioned establishment of communication connection can be respectively deploying a general logic management unit (GMU) in the operating system in the main control device and the external module to form a unified interface. The general logic management unit is responsible for realizing the communication function between the operating system main control and the external module, and can actively realize the verification of external module driver information, the acquisition of driver files, and the dynamic registration of the driver image system. If there is no peripheral driver corresponding to the external module in the current operating system of the main control device, the operating system main control needs to establish a communication connection with the general logic management unit in the external module.
[0114] In some embodiments, establishing a communication connection with the external module includes:
[0115] First, sending a connection establishment instruction to the external module;
[0116] In this embodiment, the above-mentioned connection establishment instruction includes the operating system master sending information to establish the initial connection, that is, the connection establishment instruction, to the external module. The above-mentioned connection establishment instruction includes information such as the window size that can receive data, the sending and receiving sequence number (random), the general logic management unit version, etc.
[0117] Then, obtaining the connection information returned by the external module;
[0118] In this embodiment, after receiving the connection establishment instruction, the external module returns the connection information to the operating system master control. The connection information includes whether the data window of the operating system master control is recognized (if not recognized, the local data window information needs to be sent), the sending and receiving serial numbers, the GMU version matching results and other information.
[0119] Finally, based on the connection information, connection establishment confirmation information is generated, and the connection establishment confirmation information is sent to the external module to establish a communication connection with the external module.
[0120] In this embodiment, the operating system master confirms whether to connect according to the connection information, generates connection establishment confirmation information if confirmed, and sends the establishment confirmation information about the connection establishment to the external module, including whether the connection is successful, the final data window, the sending and receiving sequence numbers, etc., so that the external module and the master control device can start communication. If the connection is not confirmed, no information is returned and the connection is unsuccessful.
[0121] The main control device sends information about establishing the initial connection to the external module, the external module returns the connection information to the main control device, and the main control device sends confirmation information about establishing the connection to the external module. The main control device and the external module use a specific handshake process to confirm each other's identities, negotiate communication parameters, and other operations, so as to accurately establish a communication connection to ensure data transmission between the external module and the main control device.
[0122] The following is a specific example to illustrate the process of establishing a communication connection. Figure 5 , Figure 5 The schematic diagram of the process of establishing a communication connection according to an embodiment of the present application is shown schematically. Figure 5 The method comprises steps S01-S05, wherein:
[0123] Step S01: the operating system master control GMU layer queries the local driver logic management unit (DMU) layer whether it contains relevant drivers.
[0124] Step S02: the DMU layer in the operating system master returns the information not included to the GMU layer.
[0125] Step S03: the operating system master sends information for establishing the initial connection to the external module, the information includes the window size for receiving data, the sending and receiving sequence number (random), the GMU version and other information.
[0126] Step S04: the external module returns connection information to the operating system main control, the information includes whether the data window of the operating system main control is recognized (if not recognized, the local data window information needs to be sent), sending and receiving sequence numbers, GMU version matching results and other information.
[0127] Step S05: the operating system master sends confirmation information about establishing the connection to the external module, including whether the connection is successful, the final data window, the sending and receiving sequence numbers, etc.
[0128] Step 230: When the communication connection with the external module is successfully established, a driver file is obtained from the external module, and the driver file is registered in the current operating system.
[0129] In this embodiment, the driver file may be pre-written in the external module, and may be specifically developed and written by the manufacturer of the external module. After the communication connection is established, the driver file may be obtained from the external module, and the driver file registration may be dynamically loaded into the current operating system, thereby achieving the purpose of active registration of the external module.
[0130] In some embodiments, the acquiring the driver file from the external module includes:
[0131] First, sending a drive information acquisition instruction to the external module;
[0132] In this embodiment, the above-mentioned driver information acquisition instruction refers to the operating system main control actively sending a message to acquire the driver information of the external module to the external module.
[0133] Then, obtaining the driving information returned by the external module;
[0134] In this embodiment, after receiving the drive information acquisition instruction, the external module returns the drive information to the main control device, wherein the drive information includes the drive file size, the check code, etc.
[0135] Then, confirming the driving information, and after the driving information is confirmed, sending a driving file acquisition instruction to the external module;
[0136] In this embodiment, after receiving the driving information, the main control device confirms the driving file size, check code, etc. in the driving information, and after confirming that they are correct, sends a driving file acquisition instruction to the external module to start preparing to acquire the driving file.
[0137] Finally, the driver file returned by the external module is obtained.
[0138] In this embodiment, after receiving the driver file acquisition instruction, the external module starts to transmit the driver file to the main control device, so that the main control device obtains the driver file corresponding to the external module.
[0139] In some embodiments, when the driver file is obtained, it can be obtained by sending and receiving each frame of data, and the obtaining of the driver file returned by the external module includes:
[0140] Step A1: obtaining the first frame of the driving file returned by the external module;
[0141] In this embodiment, the driving file may be composed of multiple data frames. After receiving the driving file acquisition instruction, the external module first sends the first frame of the driving file to the control device.
[0142] Step A2: sending a confirmation frame and a read next frame instruction to the external module;
[0143] In this embodiment, after receiving the first frame, the control device returns a confirmation frame to the external module, and sends a read next frame instruction to the external module to notify the external module to send the next frame data of the drive file.
[0144] Step A3: obtaining the next frame of the driving file returned by the external module;
[0145] In this embodiment, after receiving the instruction to read the next frame, the external module sends the next frame of the driving file to the control device.
[0146] Step A4: Execute steps A2 to A3 in a loop until the last frame of the driver file returned by the external module is obtained, and send a confirmation frame to the external module to obtain the driver file.
[0147] In this embodiment, the above steps A2-A3 are continuously repeated to obtain the driver file frame by frame until all driver files are read, the external module returns the last frame information of the driver file, and the main control device sends a confirmation frame to the external module to end the driver file transmission.
[0148] The first frame of the driver file is returned to the main control device through the external module. After receiving the first frame of the driver file from the external module, the main control device returns a confirmation frame and reads the next frame of the driver file. Then, after receiving the next frame of the driver file from the external module, the main control device returns a confirmation frame and reads the next frame of the driver file. This step is repeated until all frames are transmitted, thereby ensuring that the driver file can be transmitted to the main control device completely and accurately, thereby improving the reliability of driver loading.
[0149] In some embodiments, the method further includes: in a case where it is determined that a corresponding peripheral device driver exists in the current operating system, registering the corresponding peripheral device driver in the current operating system.
[0150] In this embodiment, when the operating system finds that a relevant driver already exists in the system, that is, a corresponding peripheral driver exists, the peripheral driver will be directly loaded into the operating system, thereby improving the efficiency of loading the peripheral driver.
[0151] In the above implementation process, when an external module is connected to the main control device, the main control device obtains the parameter information of the external module, and based on the parameter information, determines whether there is a corresponding peripheral driver in the current operating system; when it is determined that there is no corresponding peripheral driver in the current operating system, establishes a communication connection with the external module; when the communication connection with the external module is successfully established, obtains the driver file from the external module, and registers the driver file in the current operating system. By transmitting the driver file in the external module to the main control setting by communication, and registering it in the operating system, the overall scheduling control of the main control device is realized, so that the main control device can automatically identify the external module and register the corresponding driver, so that modules of different manufacturers and types can be seamlessly connected with the system, so that the external module can be actively registered, which can greatly reduce the problem of adapting the external module drivers of each manufacturer, reduce the occupation of the operating system storage space, and reduce the performance requirements of the main control chip resources of the operating system. Since the main control device no longer needs to be compatible with multiple manufacturers and types of external modules, the operating system can be made lightweight to a great extent, thereby improving the execution efficiency of the operating system. By actively obtaining the corresponding driver from the external module, there is no need to connect to the Internet or integrate the relevant driver in the main control device in advance. This method can reduce some unexpected situations that occur when searching and installing from the Internet or manually searching and installing, which is especially convenient for embedded devices that are not convenient for connecting to the Internet. By establishing a universal interface protocol, it can help external device manufacturers provide more accurate, stable and efficient drivers. At the same time, due to the reduction of intermediate links and adaptation work, the failure rate of the system will be effectively reduced, thereby improving the overall performance of the system and helping to improve the stability and reliability of the main control device itself.
[0152] Since the driver is an active registration method for external modules, there is no need to make matching development within the operating system main control according to different manufacturers and models. It is only necessary to integrate the general logic management unit and the driver logic management unit through a common interface protocol. This simplifies the system development process, reduces not only the intermediate links and adaptation work, but also reduces maintenance costs and system failure rates, making the system more lightweight, efficient, stable and reliable.
[0153] In some embodiments, when an external module is connected to the main control device, before determining whether there is a corresponding peripheral driver in the current operating system based on parameter information of the external module, it also includes: periodically querying whether there is an external module connected to the main control device.
[0154] In this embodiment, the main control device can periodically query the access status of the external module so as to respond to the peripheral driver loading in time.
[0155] In some embodiments, the operating system includes a first general logic management unit and a first hardware interface, the first hardware interface is used to operate each hardware circuit, and the first general logic management unit is used to manage each hardware circuit based on the first hardware interface.
[0156] In this embodiment, the first hardware interface is an encapsulation of the hardware circuit operation part, including the opening, reading and writing of the port. The first hardware interface can be used to operate various hardware circuits in the main control device. The first general logic management unit is responsible for the communication function between the operating system main control and the external module, and can actively realize the verification of the external module driver information, the acquisition of the driver file, and the dynamic registration of the driver image system.
[0157] Accordingly, the periodic query of whether an external module is connected to the main control device includes:
[0158] First, the first general logic management unit periodically sends a query command to the first hardware interface;
[0159] Then, the first hardware interface responds to the query command and uses polling to query whether an external module is connected to each hardware circuit, obtains an external connection query result, and sends the external connection query result to the first general logic management unit.
[0160] In this embodiment, the underlying hardware (DH) of the main control device will be physically connected to the DH of the external module and perform the operation of the first hardware interface; the DH of the external module will be physically connected to the DH of the main control device and perform the operation of the hardware interface of both parties. For the interface that communicates in a polling manner, the first general logic management unit will periodically poll the first hardware interface to inquire whether there is a new external module. After receiving the polling command from the general logic management unit, the first hardware interface will query whether there is a new external device according to the characteristics of this underlying hardware. For example: the hardware interface of the secure digital input and output (SDIO) interface of a WIFI device will scan and identify the WIFI device through the general interface protocol. After receiving the query command, the hardware interface in the external module can return the information with external connection to the main control device to realize the external module identification.
[0161] The first general logic management unit periodically sends a query command to the first hardware interface, and the first hardware interface responds to the query command, and uses a polling method to query whether there is an external module connected to each hardware circuit, obtains a query external connection result, and sends the query external connection result to the first general logic management unit. By querying in a polling manner, the correctness and reliability of external module identification can be guaranteed.
[0162] The following example illustrates the external module identification process. Figure 4 , Figure 4 The schematic diagram of the process of external module identification according to the embodiment of the present application is shown schematically. Figure 4 The method comprises steps S01-S08, wherein:
[0163] Step S01: Check whether there is a new external module. For the interface of the polling communication, the general logic management unit (GMU) will periodically poll the hardware interface (HAPI) to check whether there is a new external module.
[0164] Step S02: After receiving the polling command from the general logic management unit (GMU), the hardware interface (HAPI) queries whether there is a new external device according to the characteristics of the hardware.
[0165] Step S03: The underlying hardware (DH) of the operating system controller is physically connected to the DH of the external module and performs the operation of the HAPI layer of the operating system controller.
[0166] Step S04: The DH of the external module will be physically connected to the DH of the operating system host, and the operations of the HAPI layer of both parties will be performed.
[0167] Step S05: The HAPI layer of the external module returns the existing information (such as the manufacturer ID and product ID of the device), which can be identified as a unique device in the operating system master control.
[0168] Step S06: The DH layer of the external module transmits the returned information to the DH layer of the operating system master control.
[0169] Step S07: the HAPI layer controlled by the operating system receives the data obtained by the DH layer.
[0170] Step S08: The GMU layer of the operating system master receives the data obtained by the HAPI layer.
[0171] Accordingly, in some embodiments, obtaining the parameter information of the external module and determining whether a corresponding peripheral driver exists in the current operating system based on the parameter information includes:
[0172] First, the first hardware interface acquires parameter information of the external module, and sends the parameter information to the first general logic management unit;
[0173] In this embodiment, the parameter information of the external module refers to the basic information of the external module, including the manufacturer ID, product ID and other information of the device to which the external module belongs. Through the parameter information, the external module can be identified as a unique device in the operating system of the main control device. The hardware interface of the external module will return the existing parameter information, and the DH of the external module will pass the returned parameter information to the DH layer of the operating system main control; the first hardware interface of the operating system main control receives the parameter information obtained by the DH and sends it to the first general logic management unit.
[0174] Then, the first general logic management unit determines whether a corresponding peripheral device driver exists in the current operating system based on the parameter information.
[0175] In this embodiment, the first general logic management unit determines whether there is a corresponding peripheral driver in the current operating system according to the parameter information.
[0176] By setting the first universal logic management unit and the first hardware interface, the operating system of the main control device can accurately obtain the parameter information of the external module.
[0177] In some embodiments, the operating system further includes a first driver logic management unit, the first driver logic management unit being used to manage existing peripheral drivers;
[0178] The determining, based on the parameter information, whether there is a corresponding peripheral driver in the current operating system includes:
[0179] Firstly, the first general logic management unit generates a driver query instruction based on the parameter information and sends the instruction to the first driver program logic management unit;
[0180] In this embodiment, since the parameter information includes information of the external module, a driver query instruction can be generated accordingly. The driver query instruction includes driver information of the external module to be queried, such as the external module name, driver version number, etc.
[0181] Then, the first driver logic management unit queries the existing peripheral driver based on the driver query instruction, obtains the driver query result, and returns the driver query result to the first general logic management unit;
[0182] In this embodiment, the first driver logic management unit has a previously loaded peripheral driver or a pre-set peripheral driver. The existing peripheral drivers can be queried according to the driver information of the external module to be queried in the driver query instruction to query whether the driver is included. If not, it returns that it is not included to the first general logic management unit. If included, it returns that it is included to the first general logic management unit.
[0183] Finally, the first general logic management unit determines whether a corresponding peripheral driver exists in the first driver program logic management unit based on the driver query result.
[0184] In this embodiment, the first general logic management unit determines whether a corresponding peripheral device driver exists according to whether the returned result is included or not included.
[0185] In this embodiment, the first general logic management unit generates a driver query instruction based on the parameter information and sends it to the first driver program logic management unit to query whether there is a peripheral driver in the first driver program logic management unit, so as to quickly determine whether there is a corresponding peripheral driver.
[0186] The following is a specific example to illustrate the process of external modules actively registering with the operating system. Please refer to Figure 3 , Figure 3 The flowchart of the external module actively registering with the operating system according to the embodiment of the present application is schematically shown. First, the main control device cyclically detects whether there is a new device inserted. If so, the DMU in the main control device checks whether there is a corresponding driver in the DGU. If so, the driver is dynamically loaded directly into the operating system. After the loading is completed, the cycle continues, and the loop is returned to detect whether there is a new device inserted; if not, the operating system and the external module are established. If the communication handshake connection is established, the operating system obtains the external module driver registration information, and determines whether the operating system successfully obtains the external module driver registration information. If so, it starts to obtain the driver file, and determines whether the operating system successfully obtains the driver file. If successful, the driver is dynamically loaded into the operating system. After the loading is completed, the cycle continues, and the loop is returned to detect whether a new device is inserted.
[0187] In some embodiments, the method further includes: registering the driver file to the first driver program logic management unit by the first general logic management unit.
[0188] In this embodiment, after obtaining the driver file, the driver file can be registered to the first driver program logic management unit as an existing peripheral driver. When the driver file needs to be loaded again in the later stage, the driver file can be directly queried from the first driver program logic management unit, and the driver file can be directly taken out from the first driver program logic management unit and registered with the operating system to complete the driver loading, thereby improving the loading rate.
[0189] The following example illustrates the process of obtaining the driver file. Figure 6 , Figure 6 The schematic diagram of the process of obtaining the driver file according to the embodiment of the present application is shown schematically. Figure 6The method comprises steps S01-S13, wherein:
[0190] Step S01: the operating system master actively sends a message to obtain external module driver information.
[0191] Step S02: The external module returns a message of driver information, including the driver file size, checksum, etc.
[0192] Step S03: The operating system master controller confirms the external module driver information and starts to obtain the driver file.
[0193] Step S04: the external module obtains the driver file from the DMU unit of the external module.
[0194] Step S05: the external module DMU unit sends the driver file to the external module GMU unit.
[0195] Step S06: The external module returns the driver file to the operating system main control.
[0196] Step S07: After receiving the partial driver file of the external module, the operating system main control returns a confirmation frame and reads the next frame of driver file, and then repeats steps S05 and S06.
[0197] Step S08: until all the driver files are read, the external module returns the last frame information of the driver file.
[0198] Step S09: the operating system main control returns a confirmation frame to the peripheral module.
[0199] Step S10: the operating system master registers the driver file into the driver management (SYSD) of the operating system management unit.
[0200] Step S11: SYSD returns the information of successful registration.
[0201] Step S12: the operating system master GMU registers the driver into the operating system master DMU.
[0202] Step S13: The DMU controlled by the operating system returns to confirm that the registration is successful.
[0203] This embodiment provides an operating system, which is applied to a main control device, including: a first general logic management unit and an operating system driver management unit;
[0204] The first general logic management unit is used to obtain parameter information of the external module when an external module is connected to the main control device, and based on the parameter information, determine whether there is a corresponding peripheral driver in the current operating system; when it is determined that there is no corresponding peripheral driver in the current operating system, establish a communication connection with the external module, and when the communication connection with the external module is successfully established, obtain the driver file from the external module; and also register the driver file to the operating system driver management unit.
[0205] In this embodiment, the main control device and the external module can be connected by hardware, and the main control device can be provided with multiple hardware circuits for different external modules to connect. The parameter information of the above-mentioned external module refers to the basic information of the external module, including the manufacturer ID, product ID and other information of the device to which the external module belongs. Through this parameter information, the external module can be identified as a unique device in the operating system of the main control device. When the external module is connected to the main control device, it can be through the main control device sending instructions to the external module, and the external module sends the parameter information to the main control device after receiving the instruction, or it can be after connecting to the main control device, the external module directly sends the parameter information to the main control device, which is not limited in this embodiment. The above-mentioned peripheral driver refers to the driver corresponding to each external module. In the main control device, some peripheral drivers corresponding to the external modules can be pre-stored. These peripheral drivers can be written in advance by the user, or they can be obtained from the external module during the historical communication process with the external module. After obtaining the parameter information of the external module, the existing peripheral driver can be matched according to the parameter information to determine whether there is a corresponding peripheral driver.
[0206] The above-mentioned establishment of communication connection can be achieved by deploying general logic management units in the operating system in the main control device and the external module respectively to form a unified interface. The first general logic management unit is responsible for realizing the communication function between the operating system main control and the external module, and can actively realize the verification of external module driver information, the acquisition of driver files, and the dynamic registration of drivers to the system. If there is no peripheral driver corresponding to the external module in the current operating system of the main control device, the operating system main control needs to establish a communication connection with the general logic management unit in the external module. The operating system implements operations such as calling and removing drivers through the operating system driver management unit.
[0207] The driver file may be pre-written in the external module, and may be specifically developed and written by the manufacturer of the external module. After the communication connection is established, the driver file may be obtained from the external module, and the driver file registration may be dynamically loaded into the current operating system, thereby achieving the purpose of active registration of the external module.
[0208] In the above implementation process, the driver file in the external module is transmitted to the main control setting by the first general logic management unit through communication, and registered in the operating system driver management unit, so as to establish a general interface protocol to realize the overall scheduling control of the main control device, so that the main control device can automatically identify the external module and register the corresponding driver, so that modules of different manufacturers and types can be seamlessly connected to the system, so that the external module can be actively registered, which can greatly reduce the problem of adapting the external module driver of each manufacturer, reduce the occupation of the operating system storage space, and reduce the performance requirements of the operating system main control chip resources. Since the main control device no longer needs to be compatible with multiple manufacturers and types of external modules, the operating system can be made lightweight to a great extent, thereby improving the execution efficiency of the operating system. By actively obtaining the corresponding driver from the external module, there is no need to connect to the Internet or integrate the relevant driver in the main control device in advance. This method can reduce some unexpected situations that occur when searching for installation from the Internet or manually searching for installation, especially for embedded devices that are not convenient for networking. The operating system can automatically identify and load the corresponding driver to achieve true plug-and-play without the need for the Internet and external software. This not only simplifies the development process of the operating system, but also reduces maintenance costs, making the operating system lighter and more efficient, with great convenience and practicality. The operating system establishes a universal interface protocol to help external equipment manufacturers provide more accurate, stable and efficient drivers. At the same time, due to the reduction of intermediate links and adaptation work, the system's failure rate will also be effectively reduced, thereby improving the overall performance of the system. In addition, this operating system also helps to improve the stability and reliability of the main control device itself.
[0209] Since the driver is an active registration method for external modules, there is no need to make matching development within the operating system main control according to different manufacturers and models. It is only necessary to integrate the general logic management unit and the driver logic management unit through a common interface protocol. This simplifies the system development process, reduces not only the intermediate links and adaptation work, but also reduces maintenance costs and system failure rates, making the system more lightweight, efficient, stable and reliable.
[0210] In some embodiments, further comprising a first driver logic management unit:
[0211] The first general logic management unit is also used to take out the corresponding peripheral driver from the first driver logic management unit and register the corresponding peripheral driver to the operating system driver management unit when it is determined that the corresponding peripheral driver exists in the current operating system.
[0212] In this embodiment, the above-mentioned first driver logic management unit is used to manage existing peripheral drivers. If it is determined that a corresponding peripheral driver exists, the first general logic management unit can take the corresponding peripheral driver out of the first driver logic management unit and register it to the operating system driver management unit to complete the external module driver loading, thereby improving the efficiency of peripheral driver loading.
[0213] In some embodiments, the first general logic management unit includes a connection subunit;
[0214] The connection subunit is used to send a connection establishment instruction to the external module, obtain connection information returned by the external module, generate connection establishment confirmation information based on the connection information, and send the connection establishment confirmation information to the external module to establish a communication connection with the external module.
[0215] In this embodiment, the connection subunit is used to establish a communication connection with an external module. The connection establishment instruction includes information sent by the operating system main control to establish the initial connection, that is, the connection establishment instruction, to the external module. The connection establishment instruction includes information such as the window size that can receive data, the send and receive sequence number (random), the general logic management unit version, etc. After receiving the connection establishment instruction, the external module returns the connection information to the operating system main control. The connection information includes information such as whether the data window of the operating system main control is recognized (if the data window information that needs to be sent locally is not recognized), the send and receive sequence number, and the GMU version matching result. The operating system main control confirms whether to connect based on the connection information, and generates connection establishment confirmation information if it is confirmed, and sends the establishment confirmation information about the establishment of the connection to the external module, including whether the connection is successful, the final data window, the send and receive sequence number, etc., so that the external module and the main control device can start communication. If the connection is not confirmed, no information is returned and the connection is unsuccessful.
[0216] The main control device sends information about establishing the initial connection to the external module, the external module returns the connection information to the main control device, and the main control device sends confirmation information about establishing the connection to the external module. The main control device and the external module use a specific handshake process to confirm each other's identities, negotiate communication parameters, and other operations, so as to accurately establish a communication connection to ensure data transmission between the external module and the main control device.
[0217] In some embodiments, the first general logic management unit includes a drive acquisition subunit;
[0218] The driver acquisition subunit is used to send a driver information acquisition instruction to the external module, acquire the driver information returned by the external module, confirm the driver information, and after the driver information is confirmed, send a driver file acquisition instruction to the external module; and is also used to acquire the driver file returned by the external module.
[0219] In this embodiment, the driver acquisition subunit is used to obtain the driver file from the external module. The above-mentioned driver information acquisition instruction refers to the message that the operating system main control actively sends to obtain the driver information of the external module to point to the external module. After receiving the driver information acquisition instruction, the external module returns the driver information to the main control device. Among them, the driver information includes the driver file size, check code, etc. After receiving the driver information, the first general logic management unit confirms the driver file size, check code, etc. in the driver information, and after confirmation, sends the driver file acquisition instruction to the external module to start preparing to obtain the driver file. After receiving the driver file acquisition instruction, the external module starts to transmit the driver file to the main control device, so that the main control device obtains the driver file corresponding to the external module.
[0220] In some embodiments, when the driver acquisition subunit is used to acquire the driver file returned by the external module, the following steps are specifically performed:
[0221] B1: Obtain the first frame of the driving file returned by the external module;
[0222] In this embodiment, the driving file may be composed of multiple data frames. After receiving the driving file acquisition instruction, the external module first sends the first frame of the driving file to the control device.
[0223] B2: Sending a confirmation frame and a command to read the next frame to the external module;
[0224] In this embodiment, after receiving the first frame, the first general logic management unit returns a confirmation frame to the external module and sends a read next frame instruction to the external module to notify the external module to send the next frame data of the driving file.
[0225] B3: Obtain the next frame of the driver file returned by the external module;
[0226] In this embodiment, after receiving the next frame read instruction, the external module sends the next frame of the driving file to the first general logic management unit.
[0227] B4: Execute B2-B3 in a loop until the last frame of the driver file returned by the external module is obtained, and send a confirmation frame to the external module to obtain the driver file.
[0228] In this embodiment, the above steps B2-B3 are continuously repeated to obtain the driver file frame by frame until all driver files are read, the external module returns the last frame information of the driver file, and the driver acquisition subunit sends a confirmation frame to the external module to end the driver file transmission.
[0229] The first frame of the driver file is returned to the driver acquisition subunit through the external module. After receiving the first frame of the driver file from the external module, the driver acquisition subunit returns a confirmation frame and reads the next frame of the driver file. Then, after receiving the next frame of the driver file from the external module, the driver acquisition subunit returns a confirmation frame and reads the next frame of the driver file. This step is repeated until all frames are transmitted, thereby ensuring that the driver file can be transmitted to the main control device completely and accurately, thereby improving the reliability of driver loading.
[0230] In some embodiments, the operating system further comprises a first hardware interface;
[0231] The first general logic management unit is further used to periodically send a query command to the first hardware interface;
[0232] The first hardware interface is used to query whether there is an external module connected to each hardware circuit in a polling manner based on the query command, obtain an external query result, and send the external query result to the first general logic management unit.
[0233] In this embodiment, the first hardware interface is an encapsulation of the hardware circuit operation part, including the opening, reading and writing of the port. Through the first hardware interface, each hardware circuit in the main control device can be operated. The underlying hardware (DH) of the main control device will be physically connected to the DH of the external module and perform the operation of the first hardware interface; the DH of the external module will be physically connected to the DH of the main control device and perform the operation of the hardware interface of both parties. For the interface communicating in polling mode, the first general logic management unit will periodically poll the first hardware interface to inquire whether there is a new external module. After receiving the polling command from the general logic management unit, the first hardware interface will query whether there is a new external device according to the characteristics of this underlying hardware. For example, the hardware interface of the SDIO interface of the WIFI device will scan and identify the WIFI device through the general interface protocol. After receiving the query command, the hardware interface in the external module can return the information with external connection to the main control device to realize the external module identification.
[0234] The first general logic management unit periodically sends a query command to the first hardware interface, and the first hardware interface responds to the query command, and uses a polling method to query whether there is an external module connected to each hardware circuit, obtains a query external connection result, and sends the query external connection result to the first general logic management unit. By querying in a polling manner, the correctness and reliability of external module identification can be guaranteed.
[0235] In some embodiments, the first hardware interface is further used to obtain parameter information of the external module when an external module is connected to the main control device, and send the parameter information to the first general logic management unit.
[0236] In this embodiment, the parameter information of the external module refers to the basic information of the external module, including the manufacturer ID, product ID and other information of the device to which the external module belongs. Through the parameter information, the external module can be identified as a unique device in the operating system of the main control device. The hardware interface of the external module will return the existing parameter information, and the DH of the external module will pass the returned parameter information to the DH layer of the operating system main control; the first hardware interface of the operating system main control receives the parameter information obtained by the DH and sends it to the first general logic management unit.
[0237] In some embodiments, the operating system further comprises a first driver logic management unit;
[0238] The first general logic management unit is used to generate a driver query instruction based on the parameter information and send it to the first driver program logic management unit; and is also used to determine whether there is a corresponding peripheral driver in the first driver program logic management unit based on the driver query result;
[0239] The first driver logic management unit is used to query the existing peripheral driver based on the driver query instruction, obtain the driver query result, and return the driver query result to the first general logic management unit.
[0240] In this embodiment, the first driver logic management unit is used to manage the existing peripheral drivers. Since the parameter information includes the information of the external module, a driver query instruction can be generated accordingly. The driver query instruction includes the driver information of the external module to be queried, for example, the name of the external module, the driver version number, etc. The first driver logic management unit has a previously loaded peripheral driver or a pre-set peripheral driver. According to the driver information of the external module to be queried in the driver query instruction, the existing peripheral drivers can be queried to check whether the driver is included. If not, it returns not included to the first general logic management unit. If included, it returns included to the first general logic management unit.
[0241] In some embodiments, the first general logic management unit is further used to register the driver file to the first driver program logic management unit.
[0242] In this embodiment, after obtaining the driver file, the driver file can be registered to the first driver program logic management unit as an existing peripheral driver. When the driver file needs to be loaded again in the later stage, the driver file can be directly queried from the first driver program logic management unit, and the driver file can be directly taken out from the first driver program logic management unit and registered with the operating system to complete the driver loading, thereby improving the loading rate.
[0243] Please see Figure 7 , Figure 7 The framework diagram of the operating system according to the embodiment of the present application is schematically shown. Through the universal interface protocol including the driver logic management unit and the universal logic management unit, the operating system can automatically identify the external module and register the corresponding driver, so that modules of different manufacturers and types can be seamlessly connected with the system through this interface, and the operating system main control device can automatically trigger the recognition of the external module and automatically load the driver firmware in the external module of each manufacturer, so as to achieve the purpose of active registration of the external module. After the external module is powered on, the operating system will start the driver registration process, and the operating system main control will actively call it after the registration is successful. Different hardware interfaces are formed into a unified interface through the hardware interface (HAPI) driver in the operating system, so that the driver file in the external module can be transmitted to the main control device by communication, and registered in the driver logic management (DMU) of the operating system main control, thereby realizing the overall scheduling control in the operating system main control.
[0244] Since the driver is an active registration method for external modules, there is no need to make matching development within the operating system main control according to different manufacturers and models. It is only necessary to integrate the general logic management unit and the driver logic management unit through a common interface protocol. This simplifies the system development process, reduces not only the intermediate links and adaptation work, but also reduces maintenance costs and system failure rates, making the system more lightweight, efficient, stable and reliable.
[0245] In addition, by establishing a universal interface protocol, it can help external equipment manufacturers provide more accurate, stable and efficient drivers, which can better ensure the stability and reliability of the drivers and improve system utilization and stability.
[0246] This embodiment provides an electronic device system, including a main control device and an external module, wherein the main control device is provided with an operating system, and the operating system includes: a first general logic management unit and an operating system driver management unit;
[0247] The first general logic management unit is used to obtain parameter information of the external module when the external module is connected to the main control device, and based on the parameter information, determine whether there is a corresponding peripheral driver in the current operating system; and if it is determined that there is no corresponding peripheral driver in the current operating system, establish a communication connection with the external module, and if the communication connection with the external module is successfully established, obtain the driver file from the external module; and also register the driver file to the operating system driver management unit.
[0248] In this embodiment, the main control device and the external module can be connected by hardware, and the main control device can be provided with multiple hardware circuits for different external modules to connect. The parameter information of the above-mentioned external module refers to the basic information of the external module, including the manufacturer ID, product ID and other information of the device to which the external module belongs. Through this parameter information, the external module can be identified as a unique device in the operating system of the main control device. When the external module is connected to the main control device, it can be through the main control device sending instructions to the external module, and the external module sends the parameter information to the main control device after receiving the instruction, or it can be after connecting to the main control device, the external module directly sends the parameter information to the main control device, which is not limited in this embodiment. The above-mentioned peripheral driver refers to the driver corresponding to each external module. In the main control device, some peripheral drivers corresponding to the external modules can be pre-stored. These peripheral drivers can be written in advance by the user, or they can be obtained from the external module during the historical communication process with the external module. After obtaining the parameter information of the external module, the existing peripheral driver can be matched according to the parameter information to determine whether there is a corresponding peripheral driver.
[0249] The above-mentioned establishment of communication connection can be achieved by deploying a general logic management unit (GMU) in the operating system in the main control device and the external module respectively to form a unified interface. The first general logic management unit is responsible for realizing the communication function between the operating system main control and the external module, and can actively realize the verification of the external module driver information, the acquisition of the driver file, and the dynamic registration of the driver image system. If there is no peripheral driver corresponding to the external module in the current operating system of the main control device, the operating system main control needs to establish a communication connection with the general logic management unit in the external module. The operating system implements operations such as calling and removing the driver through the operating system driver management unit.
[0250] The driver file may be pre-written in the external module, and may be specifically developed and written by the manufacturer of the external module. After the communication connection is established, the driver file may be obtained from the external module, and the driver file registration may be dynamically loaded into the current operating system, thereby achieving the purpose of active registration of the external module.
[0251] In the above implementation process, the driver file in the external module is transmitted to the main control setting by the first general logic management unit through communication, and registered in the operating system driver management unit, thereby realizing the overall scheduling control of the main control device, so that the main control device can automatically identify the external module and register the corresponding driver, so that modules of different manufacturers and types can be seamlessly connected to the system, so that the external module can be actively registered, which can greatly reduce the problem of adapting the external module drivers of each manufacturer, reduce the occupation of the operating system storage space, and reduce the performance requirements of the operating system main control chip resources. Since the main control device no longer needs to be compatible with multiple manufacturers and types of external modules, the operating system can be made lightweight to a great extent, thereby improving the execution efficiency of the operating system. By actively obtaining the corresponding driver from the external module, there is no need to connect to the Internet or integrate the relevant driver in the main control device in advance. This method can reduce some unexpected situations that occur when searching for installation from the Internet or manually searching for installation, especially for embedded devices that are not convenient for networking. Since the driver is an active registration method for external modules, there is no need to make matching development within the operating system main control according to different manufacturers and models. It is only necessary to integrate the general logic management unit and the driver logic management unit through a common interface protocol. This simplifies the system development process, reduces not only the intermediate links and adaptation work, but also reduces maintenance costs and system failure rates, making the system more lightweight, efficient, stable and reliable.
[0252] In addition, by establishing a universal interface protocol, it can help external equipment manufacturers provide more accurate, stable and efficient drivers, which can better ensure the stability and reliability of the drivers and improve system utilization and stability.
[0253] In some embodiments, the operating system further comprises a first driver logic management unit:
[0254] The first general logic management unit is also used to take out the corresponding peripheral driver from the first driver logic management unit and register the corresponding peripheral driver to the operating system driver management unit when it is determined that the corresponding peripheral driver exists in the current operating system.
[0255] In this embodiment, the above-mentioned first driver logic management unit is used to manage existing peripheral drivers. If it is determined that a corresponding peripheral driver exists, the first general logic management unit can take the corresponding peripheral driver out of the first driver logic management unit and register it to the operating system driver management unit to complete the external module driver loading, thereby improving the efficiency of peripheral driver loading.
[0256] In some embodiments, the first universal logic management unit includes a connection subunit, and the external module includes a second universal logic management unit;
[0257] The connection subunit is used to send a connection establishment instruction to the second universal logic management unit, obtain connection information returned by the second universal logic management unit, generate connection establishment confirmation information based on the connection information, and send the connection establishment confirmation information to the second universal logic management unit to establish a communication connection with the external module.
[0258] In this embodiment, the connection subunit is used to establish a communication connection with an external module. The second general logic management unit has the same function as the first general logic management unit, but is set in the external module, and the connection between the first general logic management unit and the second general logic management unit is realized through the connection subunit. The connection establishment instruction includes the information of the operating system main control sending the initial connection establishment, that is, the connection establishment instruction, to the external module, and the connection establishment instruction includes the window size that can receive data, the sending and receiving sequence number (random), the general logic management unit version and other information. After receiving the connection establishment instruction, the external module returns the connection information to the operating system main control, and the connection information includes whether the data window of the operating system main control is recognized (if the data window information that needs to be sent locally is not recognized), the sending and receiving sequence number, the GMU version matching result and other information. The operating system main control confirms whether to connect according to the connection information, and generates a connection establishment confirmation message if it is confirmed, and sends the establishment confirmation message about the establishment of the connection to the external module, including whether the connection is successful, the final data window, the sending and receiving sequence number, etc., so that the external module and the main control device can start communication. If the connection is not confirmed, no information is returned, and the connection is unsuccessful.
[0259] The connection subunit sends information for establishing an initial connection to the second general logic management unit, and the second general logic management unit returns the connection information to the connection subunit. The connection subunit sends confirmation information about establishing the connection to the external module. The main control device and the external module use a specific handshake process to confirm each other's identities, negotiate communication parameters, and other operations, so as to accurately establish a communication connection to ensure data transmission between the external module and the main control device.
[0260] In some embodiments, the first general logic management unit includes a drive acquisition subunit;
[0261] The driver acquisition subunit is used to send a driver information acquisition instruction to the external module, acquire the driver information returned by the external module, confirm the driver information, and after the driver information is confirmed, send a driver file acquisition instruction to the external module; and is also used to acquire the driver file returned by the external module.
[0262] In this embodiment, the driver acquisition subunit is used to obtain the driver file from the external module. The above-mentioned driver information acquisition instruction refers to the message that the operating system main control actively sends to obtain the driver information of the external module to point to the external module. After receiving the driver information acquisition instruction, the external module returns the driver information to the main control device. Among them, the driver information includes the driver file size, check code, etc. After receiving the driver information, the first general logic management unit confirms the driver file size, check code, etc. in the driver information, and after confirmation, sends the driver file acquisition instruction to the external module to start preparing to obtain the driver file. After receiving the driver file acquisition instruction, the external module starts to transmit the driver file to the main control device, so that the main control device obtains the driver file corresponding to the external module.
[0263] In some embodiments, when the driver acquisition subunit is used to acquire the driver file returned by the external module, the following steps are specifically performed:
[0264] C1: Obtain the first frame of the driver file returned by the external module;
[0265] In this embodiment, the driving file may be composed of multiple data frames. After receiving the driving file acquisition instruction, the external module first sends the first frame of the driving file to the control device.
[0266] C2: Sending a confirmation frame and a command to read the next frame to the external module;
[0267] In this embodiment, after receiving the first frame, the first general logic management unit returns a confirmation frame to the external module and sends a read next frame instruction to the external module to notify the external module to send the next frame data of the driving file.
[0268] C3: Obtain the next frame of the driver file returned by the external module;
[0269] In this embodiment, after receiving the next frame read instruction, the external module sends the next frame of the driving file to the first general logic management unit.
[0270] C4: Execute C2-C3 in a loop until the last frame of the driver file returned by the external module is obtained, and send a confirmation frame to the external module to obtain the driver file.
[0271] In this embodiment, the above steps B2-B3 are continuously repeated to obtain the driver file frame by frame until all driver files are read, the external module returns the last frame information of the driver file, and the driver acquisition subunit sends a confirmation frame to the external module to end the driver file transmission.
[0272] The first frame of the driver file is returned to the driver acquisition subunit through the external module. After receiving the first frame of the driver file from the external module, the driver acquisition subunit returns a confirmation frame and reads the next frame of the driver file. Then, after receiving the next frame of the driver file from the external module, the driver acquisition subunit returns a confirmation frame and reads the next frame of the driver file. This step is repeated until all frames are transmitted, thereby ensuring that the driver file can be transmitted to the main control device completely and accurately, thereby improving the reliability of driver loading.
[0273] In some embodiments, the operating system further comprises a first hardware interface;
[0274] The first general logic management unit is further used to periodically send a query command to the first hardware interface;
[0275] The first hardware interface is used to query whether there is an external module connected to each hardware circuit in a polling manner based on the query command, obtain an external query result, and send the external query result to the first general logic management unit.
[0276] In this embodiment, the first hardware interface is an encapsulation of the hardware circuit operation part of the main control device, including the opening, reading and writing of the port. Through the first hardware interface, each hardware circuit in the main control device can be operated. The underlying hardware (DH) of the main control device will be physically connected to the DH of the external module and perform the operation of the first hardware interface; the DH of the external module will be physically connected to the DH of the main control device and perform the operation of the hardware interface of both parties. For the interface communicating in polling mode, the first general logic management unit will periodically poll the first hardware interface to inquire whether there is a new external module. After receiving the polling command from the general logic management unit, the first hardware interface will query whether there is a new external device according to the characteristics of this underlying hardware. For example, the hardware interface of the SDIO interface of a WIFI device will scan and identify the WIFI device through the general interface protocol. After receiving the query command, the hardware interface in the external module can return the information with external connection to the main control device to realize the external module identification.
[0277] The first general logic management unit periodically sends a query command to the first hardware interface, and the first hardware interface responds to the query command, and uses a polling method to query whether there is an external module connected to each hardware circuit, obtains a query external connection result, and sends the query external connection result to the first general logic management unit. By querying in a polling manner, the correctness and reliability of external module identification can be guaranteed.
[0278] In some embodiments, the external module includes a second hardware interface, and the second hardware interface is used to receive the query command and return the query external result to the first hardware interface based on the query command.
[0279] In this embodiment, the second hardware interface is an encapsulation of the hardware circuit operation part of the external module, including functions such as port opening, reading and writing. Each hardware circuit in the external module can be operated through the second hardware interface. The underlying hardware (DH) of the main control device will be physically connected to the DH of the external module and perform the operation of the first hardware interface; the DH of the external module performs the operation of the first hardware interface and the second hardware interface. After receiving the query command, the second hardware interface returns the query external connection result and sends it to the first hardware interface. The above query external connection result refers to whether it is externally connected.
[0280] In some embodiments, the first hardware interface is further used to obtain parameter information of the external module when an external module is connected to the main control device, and send the parameter information to the first general logic management unit.
[0281] In this embodiment, the parameter information of the external module refers to the basic information of the external module, including the manufacturer ID, product ID and other information of the device to which the external module belongs. Through the parameter information, the external module can be identified as a unique device in the operating system of the main control device. The hardware interface of the external module will return the existing parameter information, and the DH of the external module will pass the returned parameter information to the DH layer of the operating system main control; the first hardware interface of the operating system main control receives the parameter information obtained by the DH and sends it to the first general logic management unit.
[0282] In some embodiments, the operating system further comprises a first driver logic management unit;
[0283] The first general logic management unit is used to generate a driver query instruction based on the parameter information and send it to the first driver program logic management unit; and is also used to determine whether there is a corresponding peripheral driver in the first driver program logic management unit based on the driver query result;
[0284] The first driver logic management unit is used to query the existing peripheral driver based on the driver query instruction, obtain the driver query result, and return the driver query result to the first general logic management unit.
[0285] In this embodiment, the first driver logic management unit is used to manage the existing peripheral drivers. Since the parameter information includes the information of the external module, a driver query instruction can be generated accordingly. The driver query instruction includes the driver information of the external module to be queried, for example, the name of the external module, the driver version number, etc. The first driver logic management unit has a previously loaded peripheral driver or a pre-set peripheral driver. According to the driver information of the external module to be queried in the driver query instruction, the existing peripheral drivers can be queried to check whether the driver is included. If not, it returns not included to the first general logic management unit. If included, it returns included to the first general logic management unit.
[0286] In some embodiments, the first general logic management unit is further used to register the driver file to the first driver program logic management unit.
[0287] In this embodiment, after obtaining the driver file, the driver file can be registered to the first driver program logic management unit as an existing peripheral driver. When the driver file needs to be loaded again in the later stage, the driver file can be directly queried from the first driver program logic management unit, and the driver file can be directly taken out from the first driver program logic management unit and registered with the operating system to complete the driver loading, thereby improving the loading rate.
[0288] In some embodiments, the external module further includes a second driver logic management unit;
[0289] The second general logic management unit is further used to receive a driver file acquisition instruction, and based on the driver file acquisition instruction, acquire a driver file from the second driver program logic management unit, and send the driver file to the first general logic management unit.
[0290] In this embodiment, the second driver program logic management unit is used to manage driver files in the external module. After receiving the driver file acquisition instruction, the second general logic management unit acquires the driver file from the second driver program logic management unit and sends it to the first general logic management unit.
[0291] An embodiment of the present invention provides a machine-readable storage medium on which a program is stored. When the program is executed by a processor, the peripheral device driver loading method is implemented.
[0292] An embodiment of the present invention provides a processor, which is used to run a program, wherein the peripheral device driver loading method is executed when the program is running.
[0293] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Figure 8 As shown. The computer device includes a processor A01, a network interface A02, a display screen A04, an input device A05 and a memory (not shown in the figure) connected through a system bus. Among them, the processor A01 of the computer device is used to provide computing and control capabilities. The memory of the computer device includes an internal memory A03 and a non-volatile storage medium A06. The non-volatile storage medium A06 stores an operating system B01 and a computer program B02. The internal memory A03 provides an environment for the operation of the operating system B01 and the computer program B02 in the non-volatile storage medium A06. The network interface A02 of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor A01, a peripheral driver loading method is implemented. The display screen A04 of the computer device can be a liquid crystal display or an electronic ink display, and the input device A05 of the computer device can be a touch layer covered on the display screen, or a button, trackball or touchpad set on the computer device housing, or an external keyboard, touchpad or mouse, etc.
[0294] Those skilled in the art will understand that Figure 8 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0295] The embodiment of the present application provides a device, which includes a processor, a memory, and a program stored in the memory and executable on the processor, and is applied to a main control device. When the processor executes the program, the following steps are implemented:
[0296] When an external module is connected to the main control device, parameter information of the external module is obtained, and based on the parameter information, it is determined whether a corresponding peripheral driver exists in the current operating system;
[0297] When it is determined that there is no corresponding peripheral driver in the current operating system, establishing a communication connection with the external module;
[0298] When the communication connection with the external module is successfully established, a driver file is obtained from the external module, and the driver file is registered in the current operating system.
[0299] In one embodiment, it further includes:
[0300] When it is determined that a corresponding peripheral device driver exists in the current operating system, the corresponding peripheral device driver is registered in the current operating system.
[0301] In one embodiment, establishing a communication connection with the external module includes:
[0302] Sending a connection establishment instruction to the external module;
[0303] Obtaining connection information returned by the external module;
[0304] Based on the connection information, connection establishment confirmation information is generated, and the connection establishment confirmation information is sent to the external module to establish a communication connection with the external module.
[0305] In one embodiment, obtaining the driver file from the external module includes:
[0306] Sending a drive information acquisition instruction to the external module;
[0307] Acquire the driving information returned by the external module;
[0308] Confirming the driving information, and after the driving information is confirmed, sending a driving file acquisition instruction to the external module;
[0309] Get the driver file returned by the external module.
[0310] In one embodiment, the obtaining the driver file returned by the external module includes:
[0311] A1: Obtain the first frame of the driver file returned by the external module;
[0312] A2: Send a confirmation frame and a command to read the next frame to the external module;
[0313] A3: Obtain the next frame of the driver file returned by the external module;
[0314] A4: Execute A2-A3 in a loop until the last frame of the driver file returned by the external module is obtained, and send a confirmation frame to the external module to obtain the driver file.
[0315] In one embodiment, when an external module is connected to the main control device, before determining whether a corresponding peripheral driver exists in the current operating system based on the parameter information of the external module, the method further includes:
[0316] Periodically check whether any external module is connected to the main control device.
[0317] In one embodiment, the operating system includes a first general logic management unit and a first hardware interface, the first hardware interface is used to operate each hardware circuit, and the first general logic management unit is used to manage each hardware circuit based on the first hardware interface;
[0318] The periodic query of whether an external module is connected to the main control device includes:
[0319] The first general logic management unit periodically sends a query command to the first hardware interface;
[0320] The first hardware interface responds to the query command by using a polling method to query whether an external module is connected to each hardware circuit, obtains an external query result, and sends the external query result to the first general logic management unit.
[0321] In one embodiment, the acquiring the parameter information of the external module and judging whether a corresponding peripheral driver exists in the current operating system based on the parameter information includes:
[0322] Acquiring parameter information of the external module through the first hardware interface, and sending the parameter information to the first general logic management unit;
[0323] The first general logic management unit determines whether a corresponding peripheral driver exists in the current operating system based on the parameter information.
[0324] In one embodiment, the operating system further includes a first driver logic management unit, and the first driver logic management unit is used to manage existing peripheral drivers;
[0325] The determining, based on the parameter information, whether there is a corresponding peripheral driver in the current operating system includes:
[0326] The first general logic management unit generates a driver query instruction based on the parameter information and sends the instruction to the first driver program logic management unit;
[0327] The first driver logic management unit queries the existing peripheral driver based on the driver query instruction, obtains the driver query result, and returns the driver query result to the first general logic management unit;
[0328] The first general logic management unit determines whether a corresponding peripheral driver exists in the first driver program logic management unit based on the driver query result.
[0329] In one embodiment, it further includes:
[0330] The first general logic management unit registers the driver file to the first driver program logic management unit.
[0331] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0332] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0333] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0334] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0335] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0336] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0337] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. 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 technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, 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. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0338] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0339] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.
Claims
1. A peripheral device driver loading method, characterized in that: Applied to a main control device, the peripheral driver loading method includes: When an external module is connected to the main control device, parameter information of the external module is obtained, and based on the parameter information, it is determined whether a corresponding peripheral driver exists in the current operating system; When it is determined that there is no corresponding peripheral driver in the current operating system, establishing a communication connection with the external module; When the communication connection with the external module is successfully established, a driver file is obtained from the external module, and the driver file is registered in the current operating system.
2. The peripheral device driver loading method according to claim 1, characterized in that: Also includes: When it is determined that a corresponding peripheral device driver exists in the current operating system, the corresponding peripheral device driver is registered in the current operating system.
3. The peripheral device driver loading method according to claim 1, characterized in that: The establishing of a communication connection with the external module includes: Sending a connection establishment instruction to the external module; Obtaining connection information returned by the external module; Based on the connection information, connection establishment confirmation information is generated, and the connection establishment confirmation information is sent to the external module to establish a communication connection with the external module.
4. The peripheral device driver loading method according to claim 1, characterized in that: The obtaining of the driver file from the external module includes: Sending a drive information acquisition instruction to the external module; Acquire the driving information returned by the external module; Confirming the driving information, and after the driving information is confirmed, sending a driving file acquisition instruction to the external module; Get the driver file returned by the external module.
5. The peripheral device driver loading method according to claim 4, characterized in that: The obtaining of the driver file returned by the external module includes: A1: Obtain the first frame of the driver file returned by the external module; A2: Send a confirmation frame and a command to read the next frame to the external module; A3: Obtain the next frame of the driver file returned by the external module; A4: Execute A2-A3 in a loop until the last frame of the driver file returned by the external module is obtained, and send a confirmation frame to the external module to obtain the driver file.
6. The peripheral device driver loading method according to claim 1, characterized in that: In the case where an external module is connected to the main control device, before judging whether a corresponding peripheral driver exists in the current operating system based on the parameter information of the external module, the method further includes: Periodically check whether any external module is connected to the main control device.
7. The peripheral device driver loading method according to claim 6, characterized in that: The operating system includes a first general logic management unit and a first hardware interface, the first hardware interface is used to operate each hardware circuit, and the first general logic management unit is used to manage each hardware circuit based on the first hardware interface; The periodic query of whether an external module is connected to the main control device includes: The first general logic management unit periodically sends a query command to the first hardware interface; The first hardware interface responds to the query command by using a polling method to query whether an external module is connected to each hardware circuit, obtains an external connection query result, and sends the external connection query result to the first general logic management unit.
8. The peripheral device driver loading method according to claim 7, characterized in that: The acquiring the parameter information of the external module and judging whether there is a corresponding peripheral driver in the current operating system based on the parameter information includes: Acquiring parameter information of the external module through the first hardware interface, and sending the parameter information to the first general logic management unit; The first general logic management unit determines whether a corresponding peripheral driver exists in the current operating system based on the parameter information.
9. The peripheral device driver loading method according to claim 8, characterized in that: The operating system further includes a first driver logic management unit, wherein the first driver logic management unit is used to manage existing peripheral drivers; The determining, based on the parameter information, whether there is a corresponding peripheral driver in the current operating system includes: The first general logic management unit generates a driver query instruction based on the parameter information and sends the instruction to the first driver program logic management unit; The first driver logic management unit queries the existing peripheral driver based on the driver query instruction, obtains the driver query result, and returns the driver query result to the first general logic management unit; The first general logic management unit determines whether a corresponding peripheral driver exists in the first driver program logic management unit based on the driver query result.
10. The peripheral device driver loading method according to claim 9, characterized in that: Also includes: The first general logic management unit registers the driver file to the first driver program logic management unit.
11. An operating system, characterized in that: Applied to a main control device, comprising: a first general logic management unit and an operating system driver management unit; The first general logic management unit is used to obtain parameter information of the external module when an external module is connected to the main control device, and based on the parameter information, determine whether there is a corresponding peripheral driver in the current operating system; when it is determined that there is no corresponding peripheral driver in the current operating system, establish a communication connection with the external module, and when the communication connection with the external module is successfully established, obtain the driver file from the external module; and also register the driver file to the operating system driver management unit.
12. The operating system according to claim 11, characterized in that: Also included is a first driver logic snap-in: The first general logic management unit is also used to take out the corresponding peripheral driver from the first driver logic management unit and register the corresponding peripheral driver to the operating system driver management unit when it is determined that the corresponding peripheral driver exists in the current operating system.
13. The operating system according to claim 11, characterized in that: The first general logic management unit includes a connection subunit; The connection subunit is used to send a connection establishment instruction to the external module, obtain connection information returned by the external module, generate connection establishment confirmation information based on the connection information, and send the connection establishment confirmation information to the external module to establish a communication connection with the external module.
14. The operating system according to claim 11, characterized in that: The first general logic management unit includes a drive acquisition subunit; The driver acquisition subunit is used to send a driver information acquisition instruction to the external module, acquire the driver information returned by the external module, confirm the driver information, and after the driver information is confirmed, send a driver file acquisition instruction to the external module; It is also used to obtain the driver file returned by the external module.
15. The operating system according to claim 14, characterized in that: When the driver acquisition subunit is used to acquire the driver file returned by the external module, the following steps are specifically performed: B1: Obtain the first frame of the driving file returned by the external module; B2: Sending a confirmation frame and a command to read the next frame to the external module; B3: Obtain the next frame of the driver file returned by the external module; B4: Execute B2-B3 in a loop until the last frame of the driver file returned by the external module is obtained, and send a confirmation frame to the external module to obtain the driver file.
16. The operating system according to claim 11, characterized in that: The operating system also includes a first hardware interface; The first general logic management unit is further used to periodically send a query command to the first hardware interface; The first hardware interface is used to query whether there is an external module connected to each hardware circuit in a polling manner based on the query command, obtain an external query result, and send the external query result to the first general logic management unit.
17. The operating system according to claim 16, characterized in that: The first hardware interface is also used to obtain parameter information of the external module when an external module is connected to the main control device, and send the parameter information to the first general logic management unit.
18. The operating system according to claim 11, characterized in that: The operating system further includes a first driver logic management unit; The first general logic management unit is used to generate a driver query instruction based on the parameter information and send it to the first driver program logic management unit; It is also used to determine whether there is a corresponding peripheral driver in the first driver logic management unit based on the driver query result; The first driver logic management unit is used to query the existing peripheral driver based on the driver query instruction, obtain the driver query result, and return the driver query result to the first general logic management unit.
19. The operating system according to claim 18, characterized in that: The first general logic management unit is further used to register the driver file to the first driver program logic management unit.
20. An electronic equipment system, characterized in that: It includes a main control device and an external module. The main control device is provided with an operating system, and the operating system includes: a first general logic management unit and an operating system driver management unit; The first general logic management unit is used to obtain parameter information of the external module when the external module is connected to the main control device, and based on the parameter information, determine whether there is a corresponding peripheral driver in the current operating system; and when it is determined that there is no corresponding peripheral driver in the current operating system, establish a communication connection with the external module, and when the communication connection with the external module is successfully established, obtain the driver file from the external module; and also register the driver file to the operating system driver management unit.
21. The electronic equipment system according to claim 20, characterized in that: The operating system further comprises a first driver logic management unit: The first general logic management unit is also used to take out the corresponding peripheral driver from the first driver logic management unit and register the corresponding peripheral driver to the operating system driver management unit when it is determined that the corresponding peripheral driver exists in the current operating system.
22. The electronic equipment system according to claim 20, characterized in that: The first universal logic management unit includes a connection subunit, and the external module includes a second universal logic management unit; The connection subunit is used to send a connection establishment instruction to the second universal logic management unit, obtain connection information returned by the second universal logic management unit, generate connection establishment confirmation information based on the connection information, and send the connection establishment confirmation information to the second universal logic management unit to establish a communication connection with the external module.
23. The electronic equipment system according to claim 20, characterized in that: The first general logic management unit includes a drive acquisition subunit; The driver acquisition subunit is used to send a driver information acquisition instruction to the external module, acquire the driver information returned by the external module, confirm the driver information, and after the driver information is confirmed, send a driver file acquisition instruction to the external module; It is also used to obtain the driver file returned by the external module.
24. The electronic equipment system according to claim 23, characterized in that: When the driver acquisition subunit is used to acquire the driver file returned by the external module, the following steps are specifically performed: C1: Obtain the first frame of the driver file returned by the external module; C2: Sending a confirmation frame and a command to read the next frame to the external module; C3: Obtain the next frame of the driver file returned by the external module; C4: Execute C2-C3 in a loop until the last frame of the driver file returned by the external module is obtained, and send a confirmation frame to the external module to obtain the driver file.
25. The electronic equipment system according to claim 20, characterized in that: The operating system also includes a first hardware interface; The first general logic management unit is further used to periodically send a query command to the first hardware interface; The first hardware interface is used to query whether there is an external module connected to each hardware circuit in a polling manner based on the query command, obtain an external query result, and send the external query result to the first general logic management unit.
26. The electronic equipment system according to claim 25, characterized in that: The external module includes a second hardware interface, and the second hardware interface is used to receive the query command and return the query external result to the first hardware interface based on the query command.
27. The electronic equipment system according to claim 25, characterized in that: The first hardware interface is also used to obtain parameter information of the external module when an external module is connected to the main control device, and send the parameter information to the first general logic management unit.
28. The electronic device system according to claim 20, characterized in that: The operating system further includes a first driver logic management unit; The first general logic management unit is used to generate a driver query instruction based on the parameter information and send it to the first driver program logic management unit; It is also used to determine whether there is a corresponding peripheral driver in the first driver logic management unit based on the driver query result; The first driver logic management unit is used to query the existing peripheral driver based on the driver query instruction, obtain the driver query result, and return the driver query result to the first general logic management unit.
29. The electronic equipment system according to claim 28, characterized in that: The first general logic management unit is further used to register the driver file to the first driver program logic management unit.
30. The electronic device system according to claim 22, characterized in that: The external module also includes a second driver logic management unit; The second general logic management unit is further used to receive a driver file acquisition instruction, and based on the driver file acquisition instruction, acquire a driver file from the second driver program logic management unit, and send the driver file to the first general logic management unit.
31. An electronic device, characterized in that: The electronic device includes: at least one processor; a memory connected to the at least one processor; The memory stores instructions that can be executed by the at least one processor, and the at least one processor implements the peripheral driver loading method according to any one of claims 1 to 10 by executing the instructions stored in the memory.
32. A machine-readable storage medium having instructions stored thereon, characterized in that: When the instruction is executed by a processor, the processor is configured to execute the peripheral device driver loading method according to any one of claims 1 to 10.