CAN interface mode switching method, device and system and terminal equipment
By modifying the CAN interface mode options in the BIOS Setup interface and passing it to the ACPI code, the problems of low switching efficiency and high error rate in the existing technology are solved, and a more efficient and reliable switching process is achieved.
Patent Information
- Application Number
- CN202411994323.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-30
- Publication Date
- 2025-05-02
AI Technical Summary
In the prior art, the switching efficiency of the CAN interface mode is low and the error rate is high. Users need to uninstall and install different CAN interface drivers, which is cumbersome and prone to errors.
By displaying the BIOS Setup interface, the user can modify the CAN interface mode option. The system passes the target option value to the ACPI code corresponding to the CAN interface, obtains the updated ACPI code, and sends it to the CAN drive to switch to the target CAN interface mode.
It improves the switching efficiency of CAN interface mode and reduces the error rate during the switching process. Users can complete the switching without being familiar with the operating system.
Smart Images

Figure CN119917436A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of CAN bus communication technology, and in particular, relates to a CAN interface mode switching method, device, system and terminal equipment. Background Art
[0002] The Controller Area Network (CAN) bus is a serial bus used for real-time control and communication, and is commonly used in the automotive, aviation, industrial automation and other fields. Adding a CAN interface to a terminal device can enable communication and data exchange with CAN bus devices, making it convenient for applications such as vehicle diagnosis and industrial equipment control.
[0003] The processor in the terminal device (e.g., the central processing unit (CPU)) will integrate a CAN controller (also called a CAN driver), which is compatible with different CAN interface protocols, that is, the CAN interface can work in the mode corresponding to each CAN interface protocol. In the related art, in order to make the CAN interface work in different modes, the user needs to uninstall and install different CAN interface drivers. In this way, the switching efficiency of the CAN interface mode is too low and there is a certain error rate.
[0004] Currently, no effective solution has been proposed for the problems of low switching efficiency and high error rate of CAN interface modes in related technologies. Summary of the invention
[0005] The embodiments of the present application provide a CAN interface mode switching method, apparatus, system, terminal device and computer program product to at least solve the problems of low switching efficiency and high error rate of CAN interface mode in related technologies.
[0006] In the first aspect, an embodiment of the present application provides a CAN interface mode switching method, including: displaying a BIOS Setup interface, the BIOS Setup interface including a CAN interface mode option; after detecting a modification operation on the CAN interface mode option, passing a target option value to an ACPI code corresponding to the CAN interface to obtain an updated ACPI code, wherein the modification operation is used to modify a default option value in the CAN interface mode option to a target option value; sending the updated ACPI code to a CAN driver, so that the CAN driver switches the working mode of the CAN interface to a target CAN interface mode corresponding to the target option value.
[0007] In some embodiments, passing the target option value to the ACPI code corresponding to the CAN interface to obtain the updated ACPI code includes: finding the target node corresponding to the CAN interface from the ACPI namespace; updating the string corresponding to the target node to the target option value to obtain the updated ACPI code.
[0008] In some embodiments, finding a target node corresponding to the CAN interface from the ACPI namespace includes: using an AML interpreter to construct an ACPI namespace; and traversing the ACPI namespace from a preset reference node until finding the target node corresponding to the CAN interface.
[0009] In some embodiments, the option value in the CAN interface mode option includes CAN FD mode or CAN 2.0 mode.
[0010] In some embodiments, the modification operation on the CAN interface mode option includes a selection operation on the CAN 2.0 mode in the CAN interface mode option, or a selection operation on the CAN FD mode in the CAN interface mode option.
[0011] In some embodiments, sending an updated ACPI code to the CAN driver so that the CAN driver switches the operating mode of the CAN interface to a target CAN interface mode corresponding to the target option value includes: when the target option value is CAN 2.0 mode, sending the updated ACPI code to the CAN driver so that the CAN driver switches the operating mode of the CAN interface to CAN 2.0 mode; or when the target option value is CAN FD mode, sending the updated ACPI code to the CAN driver so that the CAN driver switches the operating mode of the CAN interface to CAN FD mode.
[0012] In the second aspect, an embodiment of the present application provides a CAN interface mode switching device, including: a display module, used to display a BIOS Setup interface, the BIOS Setup interface including a CAN interface mode option; a transfer module, used to, after detecting a modification operation on the CAN interface mode option, transfer a target option value to the ACPI code corresponding to the CAN interface to obtain an updated ACPI code, wherein the modification operation is used to modify the default option value in the CAN interface mode option to the target option value; a switching module, used to send the updated ACPI code to the CAN driver, so that the CAN driver switches the working mode of the CAN interface to a target CAN interface mode corresponding to the target option value.
[0013] In the third aspect, an embodiment of the present application provides a CAN interface mode switching system, including a CAN driver and a CAN interface mode switching module; the CAN interface mode switching module is used to execute the CAN interface mode switching method of any one of the above-mentioned first aspects; the CAN driver is used to receive an updated ACPI code sent by the CAN interface mode switching device, parse the updated ACPI code, obtain the target option value in the updated ACPI code, and switch the working mode of the CAN interface to a target CAN interface mode corresponding to the target option value.
[0014] In a fourth aspect, an embodiment of the present application provides a terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the CAN interface mode switching method of any one of the above-mentioned first aspects is implemented.
[0015] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program. When the computer program is run, the CAN interface mode switching method described in any one of the above-mentioned first aspects is executed.
[0016] Compared with the related art, the CAN interface mode switching method, device, system, terminal device and computer program product provided in the embodiment of the present application, by displaying the BIOS Setup interface including the CAN interface mode option, after detecting the user's modification operation of the CAN interface mode option (the modification operation is used to modify the default option value in the CAN interface mode option to the target option value), the target option value is passed to the ACPI code corresponding to the CAN interface to obtain an updated ACPI code, and then the updated ACPI code can be sent to the CAN driver so that the CAN driver switches the working mode of the CAN interface to the target CAN interface mode corresponding to the target option value. The user only needs to enter the BIOS Setup interface and modify the CAN interface mode option to complete the switching of the working mode of the CAN interface, without uninstalling and installing different CAN interface drivers. In this way, the switching efficiency of the CAN interface mode can be improved; and the user can complete the switching of the working mode of the CAN interface through the BIOS Setup interface without being familiar with the operating system, which helps to reduce the switching error rate of the CAN interface mode. Through this application, the problems of low switching efficiency and high error rate of the CAN interface mode in the related art are solved, and the technical effects of improving the switching efficiency of the CAN interface mode and reducing the switching error rate of the CAN interface mode are achieved.
[0017] Details of one or more embodiments of the present application are set forth in the following drawings and description to make other features, objects, and advantages of the present application more readily apparent. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0019] Figure 1 is a flow chart of a CAN interface mode switching method according to an embodiment of the present application;
[0020] Figure 2 is a flow chart of transferring a target option value to an ACPI code corresponding to a CAN interface according to an embodiment of the present application;
[0021] Figure 3 is a structural schematic diagram of a CAN interface mode switching device according to an embodiment of the present application;
[0022] Figure 4 It is a structural diagram of a terminal device according to an embodiment of the present application. DETAILED DESCRIPTION
[0023] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0024] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.
[0025] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0026] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.
[0027] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0028] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0029] This application involves some professional terms, please refer to the following term explanations.
[0030] CPU: Central Processing Unit.
[0031] BIOS: Basic Input Output System, basic input output system.
[0032] BIOS Setup: BIOS setup function.
[0033] CAN: Controller Area Network.
[0034] CAN 2.0: Controller Area Network 2.0, CAN2.0 supports the Standard Frame Format, which has an identifier length of 11 bits and is suitable for application scenarios that do not require a large number of nodes or complex network structures. It also introduces the Extended Frame Format, whose identifier length is increased to 29 bits, which greatly expands the number of addressable nodes and data diversity in the network, and solves the problem of insufficient identifier resources that may exist in the CAN network.
[0035] CAN FD: CAN with Flexible Data rate is an upgraded version of CAN bus. With the advancement of communication technology and the widespread application of bus technology, higher requirements are placed on bus bandwidth and transmission rate. CAN FD came into being, which inherits the main characteristics of CAN and makes up for the limitations of CAN data length and bandwidth.
[0036] ACPI: Advanced Configuration and Power Management Interface, advanced configuration and power interface.
[0037] ASL: ACPI Source Language, ACPI source code language, ASL is a low-level language used to define ACPI (Advanced Configuration and Power Interface) tables and related data structures. ACPI tables provide information about hardware, power management, and other system-specific functions to the BIOS. ASL is mainly used to describe the control methods and data objects used by ACPI.
[0038] AML: ACPI Machine Language, ACPI machine language.
[0039] Linux: generally refers to GNU / Linux (the Linux kernel alone cannot be used directly, and is usually paired with the GNU suite, hence the name), which is a free-to-use and free-to-distribute UNIX-like operating system.
[0040] CAN bus is a serial bus used for real-time control and communication, commonly used in the fields of automobiles, aviation, industrial automation, etc. Adding a CAN interface to the terminal device can realize communication and data exchange with CAN bus devices, which is convenient for applications such as vehicle diagnosis and industrial control equipment control.
[0041] The processor in the terminal device (for example, Feiteng CPU) will integrate a CAN controller (also called a CAN driver), which is compatible with different CAN interface protocols (for example, CAN 2.0 standard protocol and ISO 11898-1 (2015) CAN FD standard protocol), that is, the CAN interface can work in the mode corresponding to each CAN interface protocol. Under different CAN interface protocols, the various parameters of the CAN interface may be different. For example, in CAN2.0 mode, the baud rate of the CAN interface supports 5Kbps (kilobits per second) to 1Mbps (megabits per second) configuration; in CAN FD mode, the arbitration field baud rate of the CAN interface supports 5Kbps to 1Mbps configuration, and the data field baud rate supports 5Kbps to 5Mbps configuration. Therefore, according to the actual application environment of the CAN interface, the user needs to select a suitable CAN interface protocol so that the CAN interface works in a mode that matches the actual application environment.
[0042] Currently, the operating system switches the CAN interface mode through the driver. The CAN 2.0 driver is not compatible with the driver corresponding to CANFD. The operating system can only control the CAN interface to work in CAN 2.0 mode when using the CAN 2.0 driver; the CAN FD driver is compatible with the CAN 2.0 driver, so the operating system can use the CAN FD mode by default, because the CAN FD driver will identify the option value of the CAN interface mode option in the BIOS, and the option value defaults to CAN FD.
[0043] In the related art, in order to make the CAN interface work in different modes, the user needs to uninstall and install different CAN interface drivers. In this way, the switching efficiency of the CAN interface mode is too low. In addition, when the user is not familiar with the operating system (for example, Linux), the CAN interface driver is frequently uninstalled and installed, and the CAN interface system driver may not be correctly installed or uninstalled, which may cause functional abnormalities and even errors in switching the CAN interface mode.
[0044] Currently, no effective solution has been proposed for the problems of low switching efficiency and high error rate of CAN interface modes in related technologies.
[0045] In view of this, the embodiment of the present application provides a CAN interface mode switching method, by displaying a BIOS Setup interface including a CAN interface mode option, after detecting a user's modification operation on the CAN interface mode option (the modification operation is used to modify the default option value in the CAN interface mode option to a target option value), the target option value is passed to the ACPI code corresponding to the CAN interface to obtain an updated ACPI code, and then the updated ACPI code can be sent to the CAN driver so that the CAN driver switches the working mode of the CAN interface to the target CAN interface mode corresponding to the target option value. The user only needs to enter the BIOS Setup interface and modify the CAN interface mode option to complete the switching of the working mode of the CAN interface, without uninstalling and installing different CAN interface drivers. In this way, the switching efficiency of the CAN interface mode can be improved; and the user can complete the switching of the working mode of the CAN interface through the BIOS Setup interface without being familiar with the operating system, which helps to reduce the switching error rate of the CAN interface mode. Through this application, the problem of low switching efficiency and high error rate of the CAN interface mode in the related art is solved, and the technical effect of improving the switching efficiency of the CAN interface mode and reducing the switching error rate of the CAN interface mode is achieved.
[0046] The following will be combined Figure 1 For an explanation of the CAN interface mode switching method provided by an embodiment of the present application, see Figure 1 , Figure 1 is a flow chart of a CAN interface mode switching method according to an embodiment of the present application, such as Figure 1 As shown, the method includes:
[0047] Step S101, displaying a BIOS Setup interface, wherein the BIOS Setup interface includes a CAN interface mode option.
[0048] In this embodiment, the BIOS provides a BIOS Setup interface, which is entered by pressing a corresponding hot key when the terminal device (for example, a computer) is started. The BIOS Setup interface includes setting items for multiple BIOS-related functions. A CAN interface mode option can be added to the BIOS Setup interface. The user can enter the BIOS Setup interface to modify the CAN interface mode option, thereby switching the CAN interface mode.
[0049] For example, when the terminal device is a computer, after the user presses the power button, he can press the corresponding shortcut key according to the corresponding prompt. For example, the user presses the F2 shortcut key to enter the BIOS Setup interface, then finds the CAN interface mode option in the BIOS Setup interface, performs modification operations on the CAN interface mode option, and then presses the corresponding shortcut key to save according to the prompt. In this way, the user only needs to enter the BIOS Setup interface and modify the CAN interface mode option to complete the switching of the CAN interface working mode. There is no need to uninstall and install different CAN interface drivers, which can improve the switching efficiency of the CAN interface mode; and the user does not need to be familiar with the operating system to complete the switching of the CAN interface working mode through the BIOS Setup interface, which helps to reduce the error rate of switching the CAN interface mode.
[0050] Step S102, after detecting the modification operation on the CAN interface mode option, the target option value is passed to the ACPI code corresponding to the CAN interface to obtain an updated ACPI code, wherein the modification operation is used to modify the default option value in the CAN interface mode option to the target option value.
[0051] In this embodiment, the option value in the CAN interface mode option includes a CAN FD mode or a CAN 2.0 mode. Specifically, the default option value in the CAN interface mode option may be a CAN FD mode or a CAN 2.0 mode. If the CAN interface needs to be controlled to operate in a mode different from the default option value, a modification operation may be performed on the CAN interface mode option to modify the default option value to a target option value.
[0052] Specifically, the modification operation on the CAN interface mode option may include a selection operation on the CAN2.0 mode in the CAN interface mode option, or a selection operation on the CAN FD mode in the CAN interface mode option.
[0053] For example, when the default option value in the CAN interface mode option is CAN FD mode, the user can select the CAN 2.0 mode option of the CAN interface mode option, and then follow the prompts and press the corresponding shortcut key to save, thereby switching the working mode of the CAN interface from CAN FD mode to CAN 2.0 mode; or, when the default option value in the CAN interface mode option is CAN 2.0 mode, the user can select the CAN FD mode option of the CAN interface mode option, and then follow the prompts and press the corresponding shortcut key to save, thereby switching the working mode of the CAN interface from CAN 2.0 mode to CAN FD mode.
[0054] It should be noted that the option value in the CAN interface mode option may include not only the CAN FD mode or the CAN 2.0 mode, for example, the CAN 2.0 mode may also be subdivided into the CAN 2.0A mode and the CAN 2.0B mode, which correspond to the CAN 2.0A protocol and the CAN 2.0B protocol, respectively. Among them, CAN 2.0A is called the standard CAN (Classical CAN), which is the most common CAN bus communication protocol. It uses an 11-bit identifier (ID) field and supports a maximum transmission rate of 1Mbps; CAN 2.0B is similar to CAN 2.0A, but uses a 29-bit identifier (ID) field, provides more ID encoding space, and supports a maximum transmission rate of 1Mbps.
[0055] Combine the following Figure 2 The step S102 of “transferring the target option value to the ACPI code corresponding to the CAN interface to obtain an updated ACPI code” is described and illustrated. Figure 2 is a flowchart of transferring a target option value to an ACPI code corresponding to a CAN interface according to an embodiment of the present application, such as Figure 2 As shown, in one embodiment, passing the target option value to the ACPI code corresponding to the CAN interface includes:
[0056] Step S201, searching the target node corresponding to the CAN interface from the ACPI namespace.
[0057] Step S202: Update the character string corresponding to the target node to the target option value to obtain an updated ACPI code.
[0058] In this embodiment, the ACPI namespace may be constructed by an AML interpreter. For example, finding a target node corresponding to the CAN interface from the ACPI namespace may include: using the AML interpreter to construct the ACPI namespace; and traversing from a preset reference node in the ACPI namespace until finding the target node corresponding to the CAN interface.
[0059] Specifically, the AML interpreter builds the ACPI namespace based on the AML table contained in the firmware package. The ACPI namespace is a tree data structure that maps variable names to internal objects. When the operating system queries the AML interpreter, the AML interpreter searches for the requested variable in the ACPI namespace, calculates the object associated with the variable, and returns the calculation result. ACPI serves as a bridge between the operating system and the firmware. Among them, ACPI defines two different data structures and associates the BIOS and the operating system through the ACPI subsystem. The two data structures are data tables and definition blocks. Among them, Data tables are used for device drivers, and Definition blocks contain many bytecodes that can be executed by the AML interpreter. When building the ACPI namespace, the AML interpreter can extract bytecodes from definition blocks as enumerable objects, and these enumerable objects constitute the ACPI namespace of the operating system.
[0060] In one embodiment, the specific steps of step S201 may include:
[0061] Step 1: Initialize the first backward stream, which is used to store the absolute path of the AML interpreter.
[0062] Step 2: Establish an absolute path of the AML interpreter based on a preset reference node and an ASL relative path, wherein the reference node may be a root node or an ACPI namespace node, and the root node is located at the top of the device tree.
[0063] Step 3, traverse the search upward from the reference node until the root node is found.
[0064] Step 4, initialize the second backward flow, which is used to store the current node path. The second backward flow needs to have a large enough storage space to accommodate the current node path during enumeration to prevent multiple allocation / release operations from being performed.
[0065] Step 5: Find the target node according to the absolute path of the AML interpreter and the current node path. The target node is the node corresponding to the CAN interface.
[0066] In the related art, data corresponding to the CAN interface mode is often stored through a third storage tool. For example, EC RAM / CMOS is used to transfer data corresponding to the CAN interface mode. ECRAM / CMOS may not exist in some terminal devices, so the transfer of data corresponding to the CAN interface mode cannot be completed. In this embodiment, the target option value of the CAN interface mode option in the BIOSSetup interface is transferred to the ACPI code corresponding to the CAN interface without relying on a third-party storage tool. Even if the third-party storage tool (EC RAM / CMOS) fails, the target option value can be accurately transferred to the ACPI code corresponding to the CAN interface, thereby reducing the error rate of switching the CAN interface mode.
[0067] Step S103: sending the updated ACPI code to the CAN driver, so that the CAN driver switches the working mode of the CAN interface to the target CAN interface mode corresponding to the target option value.
[0068] In this embodiment, the CAN driver is used to parse the updated ACPI code and obtain the target option value in the updated ACPI code. For example, the CAN driver can use the AML interpreter to parse the updated ACPI code and read the target option value in the updated ACPI code; or, the AML interpreter can be used inside the operating system to parse the updated ACPI code first, then read the target option value in the updated ACPI code, and send the target option value directly to the CAN driver.
[0069] In one embodiment, the CAN driver is further used to switch the working mode of the CAN interface to CAN 2.0 mode when the target option value is CAN 2.0 mode; or the CAN driver is further used to switch the working mode of the CAN interface to CAN FD mode when the target option value is CAN FD mode.
[0070] Specifically, sending the updated ACPI code to the CAN driver so that the CAN driver switches the working mode of the CAN interface to the target CAN interface mode corresponding to the target option value may include: when the target option value is CAN 2.0 mode, sending the updated ACPI code to the CAN driver so that the CAN driver switches the working mode of the CAN interface to CAN2.0 mode; or when the target option value is CAN FD mode, sending the updated ACPI code to the CAN driver so that the CAN driver switches the working mode of the CAN interface to CAN FD mode.
[0071] Specifically, the CAN driver can select a suitable driver according to the target option value. For example, when the target option value is CAN 2.0 mode, the first driver corresponding to the CAN 2.0 mode is loaded, thereby switching the working mode of the CAN interface to CAN 2.0 mode; or, when the target option value is CAN FD mode, the second driver corresponding to the CAN FD mode is loaded, thereby switching the working mode of the CAN interface to CAN FD mode.
[0072] Through the above steps S101 to S103, by displaying the BIOS Setup interface including the CAN interface mode option, after detecting the user's modification operation on the CAN interface mode option (the modification operation is used to modify the default option value in the CAN interface mode option to the target option value), the target option value is transferred to the ACPI code corresponding to the CAN interface to obtain an updated ACPI code, and then the updated ACPI code can be sent to the CAN driver so that the CAN driver switches the working mode of the CAN interface to the target CAN interface mode corresponding to the target option value. The user only needs to enter the BIOS Setup interface and modify the CAN interface mode option to complete the switching of the working mode of the CAN interface, without uninstalling and installing different CAN interface drivers. In this way, the switching efficiency of the CAN interface mode can be improved; and the user can complete the switching of the working mode of the CAN interface through the BIOS Setup interface without being familiar with the operating system, and the failure of switching the CAN interface mode will not be caused by the loss of the transmitted data. This helps to reduce the switching error rate of the CAN interface mode. Through this application, the problems of low switching efficiency and high error rate of the CAN interface mode in the related art are solved, and the technical effects of improving the switching efficiency of the CAN interface mode and reducing the switching error rate of the CAN interface mode are achieved.
[0073] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0074] Corresponding to the CAN interface mode switching method described in the above embodiment, Figure 3 A schematic structural diagram of a CAN interface mode switching device according to an embodiment of the present application is shown. For ease of explanation, only the parts related to the embodiment of the present application are shown.
[0075] See also Figure 3The CAN interface mode switching device 3 includes: a display module 30, which is used to display a BIOS Setup interface, and the BIOS Setup interface includes a CAN interface mode option; a transfer module 31, which is used to transfer the target option value to the ACPI code corresponding to the CAN interface after detecting a modification operation on the CAN interface mode option, so as to obtain an updated ACPI code, wherein the modification operation is used to modify the default option value in the CAN interface mode option to the target option value; a switching module 32, which is used to send the updated ACPI code to the CAN driver, so that the CAN driver switches the working mode of the CAN interface to the target CAN interface mode corresponding to the target option value.
[0076] In one embodiment, the transfer module 31 is further used to find a target node corresponding to the CAN interface from the ACPI namespace; and update the character string corresponding to the target node to the target option value to obtain an updated ACPI code.
[0077] In one embodiment, the transfer module 31 is further used to construct an ACPI namespace using an AML interpreter; in the ACPI namespace, traverse from a preset reference node until a target node corresponding to the CAN interface is found.
[0078] In one embodiment, the option value in the CAN interface mode option includes CAN FD mode or CAN 2.0 mode.
[0079] In one embodiment, the modification operation on the CAN interface mode option includes a selection operation on the CAN 2.0 mode in the CAN interface mode option, or a selection operation on the CAN FD mode in the CAN interface mode option.
[0080] In one embodiment, the switching module 32 is also used to send the updated ACPI code to the CAN driver when the target option value is CAN 2.0 mode, so that the CAN driver switches the working mode of the CAN interface to CAN 2.0 mode; or when the target option value is CAN FD mode, send the updated ACPI code to the CAN driver, so that the CAN driver switches the working mode of the CAN interface to CAN FD mode.
[0081] Corresponding to the CAN interface mode switching method of the above embodiment, the embodiment of the present application also provides a CAN interface mode switching system, including: a CAN driver and a CAN interface mode switching module; the CAN interface mode switching module is used to execute the steps in any of the above-mentioned CAN interface mode switching method embodiments; the CAN driver is used to receive the updated ACPI code sent by the CAN interface mode switching device, parse the updated ACPI code, obtain the target option value in the updated ACPI code, and switch the working mode of the CAN interface to the target CAN interface mode corresponding to the target option value.
[0082] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.
[0083] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0084] Figure 4 is a schematic diagram of the structure of a terminal device according to an embodiment of the present application. Figure 4 As shown, the terminal device 4 includes: at least one processor 40 ( Figure 4 Only one is shown in the figure) a processor, a memory 41, and a computer program 42 stored in the memory 41 and executable on at least one processor 40. When the processor 40 executes the computer program 42, the steps in any of the above-mentioned CAN interface mode switching method embodiments are implemented.
[0085] The terminal device 4 may be a computing device such as a desktop computer, a notebook, a PDA, or a cloud server. The terminal device 4 may include but is not limited to a processor 40 and a memory 41. It is understood by those skilled in the art that Figure 4It is only an example of the terminal device 4 and does not constitute a limitation on the terminal device 4. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, it may also include input and output devices, network access devices, etc.
[0086] The processor 40 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0087] In some embodiments, the memory 41 may be an internal storage unit of the terminal device 4, such as a hard disk or memory of the terminal device 4. In other embodiments, the memory 41 may also be an external storage device of the terminal device 4, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the terminal device 4. In other embodiments, the memory 41 may also include both an internal storage unit and an external storage device of the terminal device 4. The memory 41 is used to store an operating system, an application program, a boot loader (BootLoader), data, and other programs, such as program codes of a computer program 42. The memory 41 may also be used to temporarily store data that has been output or is to be output.
[0088] An embodiment of the present application further provides a computer-readable storage medium storing a computer program, which, when executed by a processor, can implement the steps in each of the above-mentioned CAN interface mode switching method embodiments.
[0089] An embodiment of the present application provides a computer program product. When the computer program product runs on a mobile terminal, the mobile terminal can implement the steps in the above-mentioned CAN interface mode switching method embodiments when executing the computer program product.
[0090] The present application implements all or part of the processes in the above-mentioned embodiment method, and can instruct the relevant hardware to complete through a computer program, and the computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may at least include: any entity or device capable of carrying the computer program code to the terminal device, a recording medium, a computer memory, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), an electric carrier signal, a telecommunication signal, and a software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk.
[0091] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0092] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0093] In the embodiments provided in the present application, it should be understood that the disclosed devices / network equipment and methods can be implemented in other ways. For example, the device / network equipment embodiments described above are only schematic. For example, the division of modules or units is only a logical function division. There may be other division methods in actual implementation, such as 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 interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0094] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0095] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A CAN interface mode switching method, characterized in that: include: Displaying a BIOS Setup interface, wherein the BIOS Setup interface includes a CAN interface mode option; After detecting a modification operation on the CAN interface mode option, passing a target option value to an ACPI code corresponding to the CAN interface to obtain an updated ACPI code, wherein the modification operation is used to modify a default option value in the CAN interface mode option to the target option value; The updated ACPI code is sent to a CAN driver, so that the CAN driver switches the working mode of the CAN interface to a target CAN interface mode corresponding to the target option value.
2. The method according to claim 1, characterized in that The target option value is passed to the ACPI code corresponding to the CAN interface, and the updated ACPI code includes: Find the target node corresponding to the CAN interface from the ACPI namespace; The character string corresponding to the target node is updated to the target option value to obtain the updated ACPI code.
3. The method according to claim 2, characterized in that Finding the target node corresponding to the CAN interface from the ACPI namespace includes: Using the AML interpreter to construct the ACPI namespace; In the ACPI namespace, traverse from a preset reference node until the target node corresponding to the CAN interface is found.
4. The method according to any one of claims 1 to 3, characterized in that The option value in the CAN interface mode option includes CAN FD mode or CAN 2.0 mode.
5. The method according to claim 4, characterized in that The modification operation on the CAN interface mode option includes a selection operation on the CAN 2.0 mode in the CAN interface mode option, or a selection operation on the CAN FD mode in the CAN interface mode option.
6. The method according to claim 4, characterized in that Sending the updated ACPI code to a CAN driver so that the CAN driver switches the working mode of the CAN interface to a target CAN interface mode corresponding to the target option value includes: When the target option value is the CAN 2.0 mode, sending the updated ACPI code to the CAN driver so that the CAN driver switches the working mode of the CAN interface to the CAN 2.0 mode; or When the target option value is the CAN FD mode, the updated ACPI code is sent to the CAN driver, so that the CAN driver switches the working mode of the CAN interface to the CAN FD mode.
7. A CAN interface mode switching device, characterized in that: include: A display module, used for displaying a BIOS Setup interface, wherein the BIOS Setup interface includes a CAN interface mode option; a transfer module, configured to transfer the target option value to the ACPI code corresponding to the CAN interface after detecting a modification operation on the CAN interface mode option, so as to obtain an updated ACPI code, wherein the modification operation is used to modify the default option value in the CAN interface mode option to the target option value; The switching module is used to send the updated ACPI code to the CAN driver, so that the CAN driver switches the working mode of the CAN interface to a target CAN interface mode corresponding to the target option value.
8. A CAN interface mode switching system, characterized in that: include: CAN driver and CAN interface mode switching module; The CAN interface mode switching module is used to execute the CAN interface mode switching method according to any one of claims 1 to 6; The CAN driver is used to receive the updated ACPI code sent by the CAN interface mode switching device, parse the updated ACPI code, obtain the target option value in the updated ACPI code, and switch the working mode of the CAN interface to the target CAN interface mode corresponding to the target option value.
9. A terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the CAN interface mode switching method according to any one of claims 1 to 6 is implemented.
10. A computer program product, characterized in that It comprises a computer program, and when the computer program is executed, the CAN interface mode switching method according to any one of claims 1 to 6 is executed.
Citation Information
Patent Citations
Multi-displayer switching method and device
CN107704228A
Control method and device of central processing unit, equipment and storage medium
CN115291953A
Method and device for setting Setup option of BIOS (Basic Input / Output System) under operating system
CN117785300A
CAN FD conversion method and conversion terminal adopting RJ45 communication interface
CN117811965A