A dual-power multi-platform MCU adaptive method and device
By generating configuration files and building MCU layers, adaptive binding and information acquisition of MCU devices are achieved, and the problem that dual power supply products can only use one MCU is solved, the chip usage rate is improved, and the adaptation of multi-platform MCUs is achieved .
Patent Information
- Application Number
- CN202111442561.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-30
- Publication Date
- 2024-11-19
- Estimated Expiration
- 2041-11-30
AI Technical Summary
In the prior art, dual power supply products can only use one MCU chip, resulting in low chip usage and inability to meet the needs of multiple platforms.
By generating configuration files, building application layer, driver model layer and MCU layer, transmitting configuration files to find matching MCU device interfaces and model models, realizing adaptive binding and information acquisition of MCU devices, allowing the use of multi-platform MCUs.
It improves the chip usage rate, solves the technical problem that dual power supply products can only use one MCU, and realizes the adaptive adaptation of multi-platform MCUs.
Smart Images

Figure CN114281418B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of dual power supply conversion switches, and in particular to a dual power supply multi-platform MCU self-adaptation method and device. Background Art
[0002] Insufficient global chip production capacity has led to shortages or unstable supply of MCU chips. In order to increase the utilization rate of domestically produced chips in products, it is necessary to replace the European and American brand MCUs used in some products with domestic MCUs. Over a long period of time, multiple different models of MCUs may be used in the same model of dual-power supply products. Therefore, it is necessary to design an algorithm that can adapt to multiple platforms at the software level. Summary of the invention
[0003] In view of this, the purpose of the present invention is to provide a dual-power multi-platform MCU adaptive method and device to alleviate the technical problem in the prior art that dual-power products can only use one MCU and improve the utilization rate of the chip.
[0004] like Figure 1 As shown, the present invention provides a dual-power multi-platform MCU adaptive method, which is applied to a server and specifically includes the following steps:
[0005] Generate a configuration file, construct an application layer, a driver model layer and an MCU layer, and transmit the configuration file to the driver model layer to drive the first search instruction, wherein the configuration file includes an MCU device interface and an MCU device code;
[0006] In response to the first search instruction, the driver model layer searches the device linked list of the driver model layer based on the configuration file to see whether there is an MCU device interface model that matches the MCU device interface;
[0007] If it exists, generate a second search instruction;
[0008] If it does not exist, the operation ends.
[0009] Preferably, after the step of generating the second search instruction, the method further comprises:
[0010] In response to the second search instruction, searching under the MCU device interface model whether the MCU layer exists in the MCU model model that matches the MCU model;
[0011] If so, the MCU model model of the MCU layer is bound to the MCU model in the configuration file, and a first return instruction is generated.
[0012] If not, end the run.
[0013] Preferably, after the step of binding the MCU model in the configuration file in the MCU layer, the method includes:
[0014] In response to the first return instruction, the MCU device interface model of the driving model layer is bound to the MCU device interface and a second return instruction is generated;
[0015] In response to the second return instruction, the application layer obtains the binding information between the MCU device interface model and the MCU device interface and the binding information between the MCU model model and the MCU model.
[0016] On the other hand, the present invention provides a dual-power multi-platform MCU adaptive device, which is applied to a server, comprising:
[0017] Model construction module: used to generate a configuration file, construct an application layer, a driver model layer and an MCU layer, and transmit the configuration file to the driver model layer to drive the first search instruction, wherein the configuration file includes an MCU device interface and an MCU device code;
[0018] A response module: used for responding to the first search instruction to enable the driver model layer to search the device linked list of the driver model layer based on the configuration file to see whether there is an MCU device interface model that matches the MCU device interface.
[0019] The embodiment of the present invention brings the following beneficial effects: The present invention provides a dual-power multi-platform MCU adaptive method and device, which is applied to a server, and specifically includes the following steps: generating a configuration file, constructing an application layer, a driver model layer, and an MCU layer, transmitting the configuration file to the driver model layer to drive a first search instruction, wherein the configuration file includes an MCU device interface and an MCU device code; responding to the first search instruction so that the driver model layer searches the device list of the driver model layer based on the configuration file to see whether there is an MCU device interface model that matches the MCU device interface; if so, generating a second search instruction; if not, ending the operation. The method and device provided by the present invention can alleviate the technical problem that dual-power products in the prior art can only use one type of MCU, and improve the utilization rate of the chip.
[0020] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention are realized and obtained by the structures particularly pointed out in the description, claims and drawings.
[0021] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0023] Figure 1 A flow chart of a dual-power supply multi-platform MCU adaptive method provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0024] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0025] At present, in order to improve chip utilization, multiple different models of MCUs may be used in the same model of dual-power supply products for a considerable period of time. Based on this, a dual-power supply multi-platform MCU adaptive method and device provided in an embodiment of the present invention can alleviate the technical problem in the prior art that dual-power supply products can only use one type of MCU, thereby improving chip utilization.
[0026] To facilitate understanding of this embodiment, a dual-power multi-platform MCU adaptive method disclosed in an embodiment of the present invention is first introduced in detail.
[0027] Embodiment 1:
[0028] Embodiment 1 of the present invention provides a dual-power multi-platform MCU adaptive method, which is applied to a server and specifically includes the following steps:
[0029] Generate a configuration file, construct an application layer, a driver model layer and an MCU layer, and transmit the configuration file to the driver model layer to drive the first search instruction, wherein the configuration file includes an MCU device interface and an MCU device code;
[0030] Furthermore, the driver model layer provides a hardware interface for the MCU layer, specifically including an I / O module, a CAN bus module, an SPI interface module, etc.;
[0031] The driver model layer provides a device list for each device model. The device list is created when the first device model is added. When the same type of device model is added later, it will be mounted on the corresponding list.
[0032] The MCU layer is implemented by developers for different types of MCUs according to the rules of the driver model. The API needs to implement operations on the underlying hardware of the MCU. The MUC layer contains MCU files of different types. Each MCU needs to implement the interface provided by the driver model separately.
[0033] Furthermore, when the dual power program is initialized, it will read the information in the configuration file and determine which model of MCU interface to call based on the configuration information;
[0034] In response to the first search instruction, the driver model layer searches the device linked list of the driver model layer based on the configuration file to see whether there is an MCU device interface model that matches the MCU device interface;
[0035] If it exists, generate a second search instruction;
[0036] If it does not exist, the operation ends.
[0037] Preferably, after the step of generating the second search instruction, the method further comprises:
[0038] In response to the second search instruction, searching under the MCU device interface model whether the MCU layer exists in the MCU model model that matches the MCU model;
[0039] If so, the MCU model model of the MCU layer is bound to the MCU model in the configuration file, and a first return instruction is generated.
[0040] If not, end the run.
[0041] Preferably, after the step of binding the MCU model in the configuration file in the MCU layer, the method includes:
[0042] In response to the first return instruction, the MCU device interface model of the driving model layer is bound to the MCU device interface and a second return instruction is generated;
[0043] In response to the second return instruction, the application layer obtains the binding information between the MCU device interface model and the MCU device interface and the binding information between the MCU model model and the MCU model.
[0044] Embodiment 2
[0045] Embodiment 2 of the present invention provides a dual-power multi-platform MCU adaptive device, which is applied to a server and includes:
[0046] Model construction module: used to generate a configuration file, construct an application layer, a driver model layer and an MCU layer, and transmit the configuration file to the driver model layer to drive the first search instruction, wherein the configuration file includes an MCU device interface and an MCU device code;
[0047] A response module: used for responding to the first search instruction to enable the driver model layer to search the device linked list of the driver model layer based on the configuration file to see whether there is an MCU device interface model that matches the MCU device interface.
[0048] The device provided in the embodiment of the present invention has the same implementation principle and technical effects as those of the aforementioned method embodiment. For the sake of brief description, for matters not mentioned in the device embodiment, reference may be made to the corresponding contents in the aforementioned method embodiment.
[0049] The flow charts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the system, method and computer program product according to multiple embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0050] In addition, in the description of the embodiments of the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0051] In the description of the present invention, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc., indicating the orientation or positional relationship, are based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, the terms "first", "second", and "third" are used for descriptive purposes only, and cannot be understood as indicating or implying relative importance.
[0052] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0053] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.
[0054] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0055] Finally, it should be noted that the above-described embodiments are only specific implementations of the present invention, which are used to illustrate the technical solutions of the present invention, rather than to limit them. The protection scope of the present invention is not limited thereto. Although the present invention is described in detail with reference to the above-described embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-described embodiments within the technical scope disclosed by the present invention, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Claims
1. A dual-power multi-platform MCU adaptive method, characterized in that: Applied to the server, specifically including the following steps: Generate a configuration file, construct an application layer, a driver model layer and an MCU layer, and transmit the configuration file to the driver model layer to drive the first search instruction, wherein the configuration file includes an MCU device interface and an MCU model; In response to the first search instruction, the driver model layer searches the device linked list of the driver model layer based on the configuration file to see whether there is an MCU device interface model that matches the MCU device interface; If it exists, generate a second search instruction; If it does not exist, the operation ends; In response to the second search instruction, searching under the MCU device interface model whether the MCU layer has an MCU model model that matches the MCU model; If yes, then bind the MCU model of the MCU layer with the MCU model in the configuration file, and generate a first return instruction; If not, end the operation; In response to the first return instruction, the MCU device interface model of the driving model layer is bound to the MCU device interface and a second return instruction is generated; In response to the second return instruction, the application layer obtains the binding information between the MCU device interface model and the MCU device interface and the binding information between the MCU model model and the MCU model.
2. A dual-power multi-platform MCU adaptive device, characterized in that: Applicable to servers, including Model construction module: used to generate a configuration file, construct an application layer, a driver model layer and an MCU layer, and transmit the configuration file to the driver model layer to drive the first search instruction, wherein the configuration file includes an MCU device interface and an MCU model; A response module: used for responding to the first search instruction to enable the driver model layer to search the device chain list of the driver model layer based on the configuration file to see whether there is an MCU device interface model matching the MCU device interface; If it exists, generate a second search instruction; If it does not exist, the operation ends; In response to the second search instruction, searching under the MCU device interface model whether the MCU layer has an MCU model model that matches the MCU model; If yes, then bind the MCU model of the MCU layer with the MCU model in the configuration file, and generate a first return instruction; If not, end the operation; In response to the first return instruction, the MCU device interface model of the driving model layer is bound to the MCU device interface and a second return instruction is generated; In response to the second return instruction, the application layer obtains the binding information between the MCU device interface model and the MCU device interface and the binding information between the MCU model model and the MCU model.
