Control method and device of wireless communication module and wireless communication module
By determining and initializing the interface link parameters of the wireless communication module when the terminal starts up, the complexity of adapting traditional wireless communication modules to terminals with different interfaces is solved, and efficient adaptation of wireless communication modules is achieved.
Patent Information
- Application Number
- CN202210944256.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-05
- Publication Date
- 2025-12-23
- Estimated Expiration
- 2042-08-05
AI Technical Summary
The firmware replacement process for traditional wireless communication modules is complex and difficult to adapt to terminals with different interfaces.
By enabling the first and second preset interfaces of the wireless communication module when the terminal starts up, determining the link parameters, and initializing and disabling the corresponding interfaces according to the link parameters, the wireless communication module can be adapted to terminals with different interfaces.
It simplifies the implementation of wireless communication modules for terminals with different interfaces, improves efficiency, and reduces the complexity of firmware replacement.
Smart Images

Figure CN115437697B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of communication, and in particular to a control method and device of a wireless communication module and the wireless communication module. BACKGROUND
[0002] The wireless communication module is a module with wireless communication function. The wireless communication module is arranged in a terminal, so that the terminal has wireless communication function.
[0003] In the prior art, the firmware of the wireless communication module can only be used to implement one interface. If the interface of the wireless communication module needs to be replaced by another interface, the firmware of the other interface needs to be used. The process of replacing the firmware of the wireless communication module is complex and inefficient, which makes the wireless communication module difficult to be applied to terminals with different interfaces. SUMMARY
[0004] Therefore, it is necessary to provide a control method and device of a wireless communication module, a wireless communication module, a computer readable storage medium and a computer program product, so that the wireless communication module can be applied to terminals with different interfaces.
[0005] In a first aspect, the present application provides a control method of a wireless communication module. The method comprises:
[0006] In response to the terminal being started, enabling a first preset interface and a second preset interface of the wireless communication module;
[0007] Determining a link parameter of the first preset interface;
[0008] If the link parameter meets a first preset condition, initializing the first preset interface and disabling the second preset interface;
[0009] If the link parameter does not meet the first preset condition, initializing the second preset interface and disabling the first preset interface.
[0010] In one embodiment, the determining the link parameter of the first preset interface comprises:
[0011] Detecting whether a physical layer link of the first preset interface has been established between the wireless communication module and the terminal;
[0012] If the physical layer link of the first preset interface has been established, determining the link parameter of the first preset interface as a first link parameter;
[0013] If the physical layer link of the first preset interface has not been established, determining the link parameter of the first preset interface as a second link parameter.
[0014] In one of the embodiments, the first preset condition comprises: the link parameter is the first link parameter; and the initializing the first preset interface and disabling the second preset interface if the link parameter meets the first preset condition comprises:
[0015] enumerating the first preset interface if the link parameter is the first link parameter;
[0016] disabling the second preset interface if the enumeration of the first preset interface succeeds.
[0017] In one of the embodiments, the initializing the second preset interface and disabling the first preset interface if the link parameter does not meet the first preset condition comprises:
[0018] enumerating the second preset interface if the link parameter is the second link parameter;
[0019] disabling the first preset interface if the enumeration of the second preset interface succeeds.
[0020] In one of the embodiments, the method further comprises:
[0021] disabling the first preset interface and the second preset interface if the enumeration of the first preset interface fails.
[0022] In one of the embodiments, the method further comprises:
[0023] disabling the first preset interface and the second preset interface if the enumeration of the second preset interface fails.
[0024] In a second aspect, the application further provides a control device of a wireless communication module. The device comprises:
[0025] an enabling module configured to enable a first preset interface and a second preset interface of the wireless communication module in response to a terminal starting;
[0026] a link parameter determining module configured to determine a link parameter of the first preset interface;
[0027] a first initializing module configured to initialize the first preset interface and disable the second preset interface if the link parameter meets a first preset condition;
[0028] a second initializing module configured to initialize the second preset interface and disable the first preset interface if the link parameter does not meet the first preset condition.
[0029] In a third aspect, the present application provides a wireless communication module. The wireless communication module comprises a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:
[0030] In response to the terminal starting, enabling a first preset interface and a second preset interface of the wireless communication module;
[0031] Determining a link parameter of the first preset interface;
[0032] If the link parameter meets a first preset condition, initializing the first preset interface and disabling the second preset interface;
[0033] If the link parameter does not meet the first preset condition, initializing the second preset interface and disabling the first preset interface.
[0034] In a fourth aspect, the present application provides a computer readable storage medium. The computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement the following steps:
[0035] In response to the terminal starting, enabling a first preset interface and a second preset interface of the wireless communication module;
[0036] Determining a link parameter of the first preset interface;
[0037] If the link parameter meets a first preset condition, initializing the first preset interface and disabling the second preset interface;
[0038] If the link parameter does not meet the first preset condition, initializing the second preset interface and disabling the first preset interface.
[0039] In a fifth aspect, the present application provides a computer program product. The computer program product comprises a computer program, and the computer program is executed by a processor to implement the following steps:
[0040] In response to the terminal starting, enabling a first preset interface and a second preset interface of the wireless communication module;
[0041] Determining a link parameter of the first preset interface;
[0042] If the link parameter meets a first preset condition, initializing the first preset interface and disabling the second preset interface;
[0043] If the link parameter does not meet the first preset condition, initializing the second preset interface and disabling the first preset interface.
[0044] The control method, device, wireless communication module, storage medium and computer program product of the wireless communication module enable the first preset interface and the second preset interface of the wireless communication module when the terminal starts, determine the link parameter of the first preset interface, if the link parameter meets the first preset condition, it indicates that the interface used by the terminal to connect the wireless communication module is the first preset interface, initialize the first preset interface, and disable the second preset interface, if the link parameter does not meet the first preset condition, it indicates that the interface used by the terminal to connect the wireless communication module is the second preset interface, initialize the second preset interface, and disable the first preset interface; the wireless communication module on the terminal will execute the control method of the wireless communication module each time the terminal starts, in this way, whether the wireless communication module is used for the first time in a certain terminal or the wireless communication module is replaced from one terminal to another terminal, the firmware in the wireless communication module does not need to be changed; the application can initialize the corresponding preset interface (the first preset interface or the second preset interface) in the wireless communication module according to the interface used by the terminal to connect the wireless communication module, so that the wireless communication module can be applied to terminals with different interfaces, compared with changing the firmware in the wireless communication module to be applied to terminals with different interfaces, the application greatly simplifies the implementation and improves the efficiency. BRIEF DESCRIPTION OF DRAWINGS
[0045] Figure 1 An application environment diagram of the control method of the wireless communication module in one embodiment;
[0046] Figure 2 A flowchart of the control method of the wireless communication module in one embodiment;
[0047] Figure 3 A schematic diagram of the wireless communication module including a first interface controller and a second interface controller in one embodiment;
[0048] Figure 4 A flowchart of the control method of the wireless communication module in one specific embodiment;
[0049] Figure 5 A flowchart of the control method of the wireless communication module in one scene embodiment;
[0050] Figure 6 A structural block diagram of the control device of the wireless communication module in one embodiment;
[0051] Figure 7 An internal structure diagram of the wireless communication module in one embodiment. DETAILED DESCRIPTION
[0052] In order to make the purposes, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and not intended to limit the present application.
[0053] The control method of the wireless communication module provided by the embodiments of the present application can be applied to the application environment as shown in Figure 1 . In the application environment, the terminal 102 interacts with the wireless communication module 104.
[0054] In a possible scenario, the control method of the wireless communication module can be applied to the wireless communication module 104, and in response to the terminal 102 being started, the wireless communication module 104 enables the first preset interface and the second preset interface. The wireless communication module 104 determines the link parameters of the first preset interface. If the link parameters meet the first preset condition, the wireless communication module 104 initializes the first preset interface and disables the second preset interface. If the link parameters do not meet the first preset condition, the wireless communication module 104 initializes the second preset interface and disables the first preset interface.
[0055] The terminal 102 can be, but is not limited to, various personal computers, notebook computers, smart phones, tablet computers, Internet of Things devices, and portable wearable devices. The Internet of Things device can be a smart speaker, a smart television, a smart air conditioner, a smart vehicle-mounted device, etc. The portable wearable device can be a smart watch, a smart bracelet, a head-mounted device, etc. The wireless communication module 104 can be, but is not limited to, various wireless network cards and wireless communication modules.
[0056] In one embodiment, as shown in Figure 2 , a control method of a wireless communication module is provided. The method is applied to the wireless communication module in Figure 1 for example, and includes the following steps:
[0057] Step S202, in response to the terminal being started, enabling the first preset interface and the second preset interface of the wireless communication module.
[0058] The wireless communication module is arranged on the terminal and is used to realize the wireless communication function of the terminal. The wireless communication module is provided with the first preset interface and the second preset interface on the hardware structure. In actual application, the first preset interface can be a PCIE (peripheral component interconnect express, high-speed serial computer expansion bus standard) interface, and the second preset interface can be a USB (Universal Serial Bus, serial bus standard) interface. After the wireless communication module is started, the wireless communication module enables the PCIE interface and the USB interface.
[0059] Specifically, in response to the terminal starting, the wireless communication module starts; the wireless communication module enabling the first preset interface and the second preset interface comprises: the wireless communication module powering on the first interface controller of the first preset interface and the second interface controller of the second preset interface. As shown in Figure 3 The wireless communication module comprises: the first interface controller and the second interface controller, which are hardware structures on the wireless communication module.
[0060] It should be noted that enabling the first preset interface and the second preset interface of the wireless communication module is performed simultaneously, that is, powering on the first interface controller of the first preset interface and the second interface controller of the second preset interface simultaneously.
[0061] Step S204, determining the link parameter of the first preset interface.
[0062] The link parameter of the first preset interface can be used to reflect whether the terminal and the wireless communication module have established the physical layer link corresponding to the first preset interface, and further can be used to reflect whether the interface for the terminal and the wireless communication module to perform data transmission is the first preset interface.
[0063] Exemplarily, when the terminal is a desktop computer, the physical layer link corresponding to the first preset interface between the terminal and the wireless communication module can be the physical layer link corresponding to the first preset interface between the host of the desktop computer and the wireless communication module, and correspondingly, the interface for the terminal and the wireless communication module to perform data transmission can be the interface for connecting the wireless communication module in the host of the desktop computer.
[0064] Exemplarily, when the terminal is a notebook computer, the physical layer link corresponding to the first preset interface between the terminal and the wireless communication module can be the physical layer link corresponding to the first preset interface between the mainboard of the notebook computer and the wireless communication module, and correspondingly, the interface for the terminal and the wireless communication module to perform data transmission can be the interface for connecting the wireless communication module on the mainboard of the notebook computer.
[0065] Specifically, the link parameter of the first preset interface is determined according to whether the physical layer link corresponding to the first preset interface is established between the terminal and the wireless communication module.
[0066] Exemplarily, the link parameter of the first preset interface is parameter 1, which can reflect that the physical layer link of the first preset interface has been established between the terminal and the wireless communication module, and the link parameter of the first preset interface is parameter 2, which can reflect that the physical layer link of the first preset interface has not been established between the terminal and the wireless communication module.
[0067] Step S206, if the link parameter meets the first preset condition, initializing the first preset interface and disabling the second preset interface.
[0068] Specifically, the link parameter satisfying the first preset condition can reflect that the physical layer link of the first preset interface has been established between the terminal and the wireless communication module, and further can reflect that the interface used by the terminal to connect the wireless communication module is the first preset interface.
[0069] The first preset interface is initialized, and in a case that the first preset interface is initialized successfully, the second preset interface is disabled. The disabling of the second preset interface includes: turning off the power supply for the second interface controller, and turning off the clock signal for the second interface controller.
[0070] Exemplarily, when the first preset interface is a PCIE interface and the second preset interface is a USB interface, if the link parameter satisfies the first preset condition, the wireless communication module initializes the PCIE interface, and in a case that the PCIE interface is initialized successfully, the USB interface is disabled.
[0071] In step S208, if the link parameter does not satisfy the first preset condition, the second preset interface is initialized, and the first preset interface is disabled.
[0072] Specifically, the link parameter not satisfying the first preset condition can reflect that the physical layer link of the first preset interface has not been established between the terminal and the wireless communication module, and further can reflect that the interface used by the terminal to connect the wireless communication module is not the first preset interface, that is, the interface used by the terminal to connect the wireless communication module is the second preset interface.
[0073] The second preset interface is initialized, and in a case that the second preset interface is initialized successfully, the first preset interface is disabled. The disabling of the first preset interface includes: turning off the power supply for the first interface controller, and turning off the clock signal for the first interface controller.
[0074] Exemplarily, when the first preset interface is a PCIE interface and the second preset interface is a USB interface, if the link parameter does not satisfy the first preset condition, the wireless communication module initializes the USB interface, and in a case that the USB interface is initialized successfully, the PCIE interface is disabled.
[0075] The control method of the wireless communication module includes the following steps. When the terminal is started, the first preset interface and the second preset interface of the wireless communication module are enabled, the link parameter of the first preset interface is determined, and if the link parameter meets the first preset condition, it is indicated that the interface used by the terminal to connect the wireless communication module is the first preset interface, the first preset interface is initialized, and the second preset interface is disabled. If the link parameter does not meet the first preset condition, it is indicated that the interface used by the terminal to connect the wireless communication module is the second preset interface, the second preset interface is initialized, and the first preset interface is disabled. The wireless communication module on the terminal is executed every time the terminal is started. Thus, whether the wireless communication module is used in a terminal for the first time or the wireless communication module is replaced from one terminal to another, the firmware in the wireless communication module does not need to be changed. The preset interface (the first preset interface or the second preset interface) in the wireless communication module can be initialized according to the interface used by the terminal to connect the wireless communication module, so that the wireless communication module can be applied to terminals with different interfaces. Compared with changing the firmware in the wireless communication module to be applied to terminals with different interfaces, the application greatly simplifies the implementation and improves the efficiency.
[0076] In one embodiment, the link parameter of the first preset interface is determined by detecting whether a physical layer link of the first preset interface between the wireless communication module and the terminal is established. If the physical layer link of the first preset interface is established, the link parameter of the first preset interface is determined as the first link parameter. If the physical layer link of the first preset interface is not established, the link parameter of the first preset interface is determined as the second link parameter.
[0077] The first link parameter includes a link identifier of the first preset interface and a first link value of the first preset interface. The second link parameter includes the link identifier of the first preset interface and a second link value of the first preset interface.
[0078] Specifically, when the first preset interface is a PCIE interface and the second preset interface is a USB interface, the wireless communication module detects whether a physical layer link of the PCIE interface between the wireless communication module and the terminal is established. If the physical layer link of the PCIE interface is established, the link parameter is determined as the first link parameter. If the physical layer link of the PCIE interface is not established, the link parameter is determined as the second link parameter.
[0079] If the physical layer link of the first preset interface has been established between the wireless communication module and the terminal, it is determined that the terminal and the wireless communication module communicate through the first preset interface. If the physical layer link of the first preset interface has not been established between the wireless communication module and the terminal, it is determined that the terminal and the wireless communication module communicate through the second preset interface. That is, if the link parameter is the first link parameter, it is determined that the terminal and the wireless communication module communicate through the first preset interface. If the link parameter is the second link parameter, it is determined that the terminal and the wireless communication module communicate through the second preset interface.
[0080] Exemplarily, the first link parameter can be PCIE linkup = 1, and the second link parameter can be PCIE linkup = 0. In this example, the link identifier of the first preset interface is PCIE linkup, the first link value is 1, and the second link value is 0. It is conceivable that the link identifier of the first preset interface, the first link value and the second link value can also be in other forms, and the embodiments of the present application do not limit the specific forms of the link identifier of the first preset interface, the first link value and the second link value.
[0081] In the above embodiment, different link parameters are used to represent the interface used by the terminal and the wireless communication module to communicate, so as to facilitate subsequent determination of the initialized preset interface based on the link parameter.
[0082] In one embodiment, the first preset condition includes that the link parameter is the first link parameter. If the link parameter meets the first preset condition, the first preset interface is initialized and the second preset interface is disabled, including: if the link parameter is the first link parameter, enumeration is performed on the first preset interface; and if the enumeration on the first preset interface is successful, the second preset interface is disabled.
[0083] Specifically, in the case where the link parameter is the first link parameter, the link parameter meets the first preset condition. Then the wireless communication module performs enumeration on the first preset interface. The wireless communication module completes the enumeration on the first preset interface, the initialization of the first preset interface is completed, and the second preset interface is disabled.
[0084] If the enumeration on the first preset interface is successful, the terminal can communicate with the wireless communication module through the first preset interface. The implementation of the terminal and the wireless communication module communicating through the first preset interface includes a hardware implementation process and a software implementation process. In the present application, enabling the first preset interface of the wireless communication module completes the hardware implementation process, and completing the enumeration on the first preset interface completes the software implementation process.
[0085] Exemplarily, when the first preset interface is a PCIE interface and the second preset interface is a USB interface, if the link parameter is PCIE linkup = 1, indicating that a physical layer link between the terminal and the wireless communication module has been established, the PCIE interface is enumerated, and if the enumeration of the PCIE interface is completed, the power supply and the clock signal of the USB interface are turned off to disable the USB interface.
[0086] It should be noted that in the embodiment, the first preset interface is enumerated on the side of the wireless communication module, and after the enumeration of the first preset interface is successful, the wireless communication module can be abstracted as a first preset interface device on the operating system of the terminal. Therefore, on the side of the terminal, the process of the embodiment can also be regarded as a process of enumerating the first preset interface device.
[0087] In the above embodiment, if the interface used by the terminal to communicate with the wireless communication module is the first preset interface, the first preset interface is enumerated, and after the enumeration of the first preset interface is completed, the second preset interface is disabled to save power consumption.
[0088] In some embodiments, the control method of the wireless communication module further includes: if the enumeration of the first preset interface fails, the first preset interface and the second preset interface are disabled.
[0089] Specifically, in the case where a physical layer link has been established between the terminal and the wireless communication module, it is indicated that the interface used by the terminal to communicate with the wireless communication module is the first preset interface. If the enumeration of the first preset interface fails, it is indicated that there is other failure, resulting in that the terminal and the wireless communication module cannot communicate through the first preset interface. Therefore, the first preset interface and the second preset interface are disabled.
[0090] In an implementation manner, if the enumeration of the first preset interface lasts for a preset time length, it is determined that the enumeration of the first preset interface fails. The preset time length can be set as needed, and the specific value of the preset time length is not limited in the present application.
[0091] Exemplarily, when the first preset interface is a PCIE interface and the second preset interface is a USB interface, the link parameter is PCIE linkup = 1, the PCIE interface is enumerated, and if the enumeration of the PCIE interface is not completed, the power supply and the clock signal of the PCIE interface are turned off to disable the PCIE interface, and the power supply and the clock signal of the USB interface are turned off to disable the USB interface.
[0092] In the above embodiment, in the case where the interface used by the terminal to communicate with the wireless communication module is the first preset interface, and due to other failure, the terminal and the wireless communication module cannot communicate through the first preset interface, the first preset interface and the second preset interface are disabled, thereby saving power consumption.
[0093] In one embodiment, if the link parameter does not satisfy the first preset condition, the second preset interface is initialized and the first preset interface is disabled, including: if the link parameter is the second link parameter, the second preset interface is enumerated; if the enumeration of the second preset interface succeeds, the first preset interface is disabled.
[0094] Specifically, in the case that the link parameter is the second link parameter, if the link parameter does not satisfy the first preset condition, the wireless communication module enumerates the second preset interface; if the wireless communication module completes the enumeration of the second preset interface, the initialization of the second preset interface is completed and the second preset interface is disabled.
[0095] If the enumeration of the second preset interface succeeds, the terminal can communicate with the wireless communication module through the second preset interface. The implementation of the terminal and the wireless communication module communicating through the second preset interface includes a hardware implementation process and a software implementation process. In this application, enabling the second preset interface of the wireless communication module completes the hardware implementation process, and completing the enumeration of the second preset interface completes the software implementation process.
[0096] Exemplarily, when the first preset interface is a PCIE interface and the second preset interface is a USB interface, if the link parameter is PCIE linkup=0, indicating that the physical layer link between the terminal and the wireless communication module is not established, the terminal communicates with the wireless communication module through the USB interface, the USB interface is enumerated, and if the enumeration of the USB interface is completed, the power supply and the clock signal of the PCIE interface are turned off to disable the PCIE interface.
[0097] It should be noted that in this embodiment, the second preset interface is enumerated on the wireless communication module side, and after the enumeration of the second preset interface succeeds, the wireless communication module can be abstracted as a second preset interface device on the operating system of the terminal. Therefore, on the terminal side, the process of this embodiment can also be regarded as a process of enumerating the second preset interface device.
[0098] In the above embodiment, if the interface used by the terminal to communicate with the wireless communication module is the second preset interface, the second preset interface is enumerated, and after the enumeration of the second preset interface is completed, the second preset interface is disabled to save power consumption.
[0099] In some embodiments, the control method of the wireless communication module further includes: if the enumeration of the second preset interface fails, the first preset interface and the second preset interface are disabled.
[0100] Specifically, in the case that the physical layer link is not established between the terminal and the wireless communication module, the interface used by the terminal to communicate with the wireless communication module is the second preset interface, and if the enumeration for the second preset interface fails, it indicates that there is other failure, which causes the terminal and the wireless communication module to be unable to communicate through the second preset interface, and then the first preset interface and the second preset interface are disabled.
[0101] In an implementation manner, if the enumeration for the second preset interface lasts for a preset time length, it is determined that the enumeration for the second preset interface fails.
[0102] For example, when the first preset interface is a PCIE interface and the second preset interface is a USB interface, the link parameter is PCIE linkup=0, the USB interface is enumerated, if the enumeration of the USB interface is not completed, the power supply and the clock signal of the PCIE interface are turned off to disable the PCIE interface, and the power supply and the clock signal of the USB interface are turned off to disable the USB interface.
[0103] In the above embodiment, in the case that the interface used by the terminal to communicate with the wireless communication module is the second preset interface, and due to other failure, the terminal and the wireless communication module are unable to communicate through the second preset interface, the first preset interface and the second preset interface are disabled, and the power consumption is saved.
[0104] In the control method of the wireless communication module, when the terminal is started, the first preset interface and the second preset interface of the wireless communication module are enabled, the link parameter of the first preset interface is determined, if the link parameter meets the first preset condition, it indicates that the interface used by the terminal to connect the wireless communication module is the first preset interface, the first preset interface is initialized, and the second preset interface is disabled, if the link parameter does not meet the first preset condition, it indicates that the interface used by the terminal to connect the wireless communication module is the second preset interface, the second preset interface is initialized, and the first preset interface is disabled; the wireless communication module on the terminal is executed every time the terminal is started, and thus, whether the wireless communication module is used in a terminal for the first time or the wireless communication module is replaced from one terminal to another terminal, the firmware in the wireless communication module does not need to be changed; the application can initialize the corresponding preset interface (the first preset interface or the second preset interface) in the wireless communication module according to the interface used by the terminal to connect the wireless communication module, so that the wireless communication module can be applied to terminals with different interfaces, compared with changing the firmware in the wireless communication module to be applied to terminals with different interfaces, the application greatly simplifies the implementation manner and improves the efficiency.
[0105] In one specific embodiment, as shown in Figure 4 the control method of the wireless communication module comprises:
[0106] S401, enabling a first preset interface and a second preset interface of the wireless communication module in response to the terminal starting;
[0107] S402, detecting whether a physical layer link of the first preset interface has been established between the wireless communication module and the terminal;
[0108] S403, determining a link parameter of the first preset interface as a first link parameter if the physical layer link of the first preset interface has been established, or determining the link parameter of the first preset interface as a second link parameter if the physical layer link of the first preset interface has not been established;
[0109] S404, performing enumeration for the first preset interface if the link parameter is the first link parameter;
[0110] S405, disabling the second preset interface if the enumeration for the first preset interface is successful;
[0111] S406, disabling the first preset interface and the second preset interface if the enumeration for the first preset interface fails;
[0112] S407, performing enumeration for the second preset interface if the link parameter is the second link parameter;
[0113] S408, disabling the first preset interface if the enumeration for the second preset interface is successful;
[0114] S409, disabling the first preset interface and the second preset interface if the enumeration for the first preset interface fails.
[0115] In an application scenario, the first preset interface is a PCIE interface, and the second preset interface is a USB interface, as shown in FIG. 1, the control method of the wireless communication module comprises: Figure 5
[0116] S501, enabling the wireless communication module in response to the terminal starting;
[0117] S502, enabling a controller of the PCIE interface and enabling a controller of the USB interface by the wireless communication module;
[0118] S503, detecting whether a physical layer link of the PCIE interface has been established between the wireless communication module and the terminal by the wireless communication module, entering S504 if yes, or entering S506 if no;
[0119] S504, performing enumeration for the PCIE interface by the wireless communication module, entering S505 if the enumeration for the PCIE interface is successful, or entering S508 if the enumeration for the PCIE interface fails;
[0120] S505, the wireless communication module disables the USB interface and enters step S509;
[0121] S506, the wireless communication module performs enumeration of the USB interface, if the enumeration of the USB interface succeeds, it enters S507, if the enumeration of the PCIE interface fails, it enters S508;
[0122] S507, the wireless communication module disables the PCIE interface and enters S509;
[0123] S508, the wireless communication module disables the PCIE interface and the USB interface and enters S509;
[0124] S509, end.
[0125] In an application scenario, the wireless communication module manufacturer provides the wireless communication module to the terminal manufacturer. In the prior art, the wireless communication module manufacturer needs to configure the firmware of different interfaces for the wireless communication module to adapt to different terminals with different wireless communication interfaces (interfaces used by the host of the terminal to communicate with the wireless communication module). For example, the wireless communication interface of an A model terminal is a PCIE interface, and the wireless communication module manufacturer needs to configure the PCIE interface corresponding firmware for the wireless communication module 1, so that the wireless communication module 1 and the A model terminal can communicate through the PCIE interface. The wireless communication interface of a B model terminal is a USB interface, and the wireless communication module manufacturer needs to configure the USB interface corresponding firmware for the wireless communication module 2, so that the wireless communication module 2 and the B model terminal can communicate through the USB interface. The wireless communication module 1 and the wireless communication module 2 cannot be interchanged, resulting in that the wireless communication module manufacturer needs to maintain different interface corresponding firmware, which is difficult and has a large workload. The terminal manufacturer also needs to distinguish and manage the wireless communication modules with different firmware, which is complex and prone to errors.
[0126] Through the above control method of the wireless communication module, the wireless communication module can be adapted to different terminals with different wireless communication interfaces. For example, the wireless communication interface of an A model terminal is a PCIE interface, and when the wireless communication module is assembled on the A model terminal, the PCIE interface of the wireless communication module is initialized, and the USB interface of the wireless communication module is disabled, so that the wireless communication module and the A model terminal can communicate through the PCIE interface. The wireless communication interface of a B model terminal is a USB interface, and when the wireless communication module is assembled on the B model terminal, the USB interface of the wireless communication module is initialized, and the PCIE interface of the wireless communication module is disabled, so that the wireless communication module and the B model terminal can communicate through the USB interface. The wireless communication module manufacturer only needs to maintain one firmware, which reduces the technical difficulty and workload, and the terminal manufacturer only needs to manage one kind of wireless communication module, which reduces the management complexity and is not prone to errors.
[0127] In an application scenario, a user dismounts the wireless communication module arranged on the A type terminal to the B type terminal. In the prior art, if the wireless communication interface of the A type terminal is different from the wireless communication interface of the B type terminal, the wireless communication module cannot be applicable to the B type terminal, and the user needs to purchase the adaptive wireless communication module for the B type terminal.
[0128] Through the control method of the wireless communication module, for example, the wireless communication interface of the A type terminal is a USB interface, and the wireless communication interface of the A type terminal is a PCIE interface. After the user dismounts the wireless communication module arranged on the A type terminal to the B type terminal, the B type terminal starts, the wireless communication module starts, the wireless communication module detects that the physical layer link of the PCIE interface has been established between the wireless communication module and the B type terminal, the PCIE interface of the wireless communication module is initialized, and the USB interface of the wireless communication module is disabled, so that the wireless communication module and the B type terminal can communicate through the PCIE interface. In this way, the wireless communication module can be used on terminals with different communication interfaces, and resources are saved.
[0129] It should be understood that, although each step in the flowchart involved in each embodiment as described above is displayed in sequence according to the arrow, these steps are not necessarily executed in sequence according to the arrow. Unless otherwise specified herein, the execution of these steps is not strictly limited in sequence, and these steps can be executed in other sequences. Moreover, at least part of the steps in the flowchart involved in each embodiment as described above can include multiple steps or multiple stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution sequence of these steps or stages is not necessarily sequential, but can be executed in rotation or alternation with at least part of other steps or steps or stages in other steps.
[0130] Based on the same inventive concept, the embodiments of the present application also provide a control device of a wireless communication module for implementing the control method of the wireless communication module as described above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme described in the above method, and therefore the specific limitations in one or more control device embodiments of the wireless communication module provided below can refer to the limitations of the control method of the wireless communication module described above, which will not be repeated here.
[0131] In one embodiment, as shown in Figure 6 A control device of a wireless communication module is provided, comprising: an enabling module 601, a link parameter determination module 602, a first initialization module 603 and a second initialization module 604, wherein:
[0132] The enabling module 601 is configured to enable the first preset interface and the second preset interface of the wireless communication module in response to the terminal starting;
[0133] The link parameter determining module 602 is configured to determine a link parameter of the first preset interface;
[0134] The first initialization module 603 is configured to initialize the first preset interface and disable the second preset interface if the link parameter meets a first preset condition.
[0135] The second initialization module 604 is configured to initialize the second preset interface and disable the first preset interface if the link parameter does not meet the first preset condition.
[0136] In one embodiment, the link parameter determining module 602 comprises:
[0137] The detecting unit is configured to detect whether a physical layer link of the first preset interface has been established between the wireless communication module and the terminal;
[0138] The first parameter determining unit is configured to determine the link parameter of the first preset interface as a first link parameter if the physical layer link of the first preset interface has been established.
[0139] The second parameter determining unit is configured to determine the link parameter of the first preset interface as a second link parameter if the physical layer link of the first preset interface has not been established.
[0140] In one embodiment, the first preset condition comprises that the link parameter is the first link parameter, and the first initialization module 603 comprises:
[0141] The first interface enumeration unit is configured to enumerate the first preset interface if the link parameter is the first link parameter.
[0142] The first disabling unit is configured to disable the second preset interface if the enumeration of the first preset interface is successful.
[0143] In one embodiment, the second initialization module 604 comprises:
[0144] The second interface enumeration unit is configured to enumerate the second preset interface if the link parameter is the second link parameter.
[0145] The second disabling unit is configured to disable the first preset interface if the enumeration of the second preset interface is successful.
[0146] In one embodiment, the control device of the wireless communication module further comprises:
[0147] The third disabling unit is configured to disable the first preset interface and the second preset interface if the enumeration of the first preset interface fails.
[0148] The third disabling unit is further configured to disable the first preset interface and the second preset interface if the enumeration for the second preset interface fails.
[0149] The modules in the control device of the wireless communication module can be implemented by software, hardware, or a combination thereof.
[0150] In one embodiment, a wireless communication module is provided, which has an internal structure as shown in Figure 7 The wireless communication module includes a first preset interface, a second preset interface, a first interface controller of the first preset interface, a second interface controller of the second preset interface, a processor, and a memory. The processor is configured to provide computing and control capabilities. The memory includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for running the computer program in the non-volatile storage medium.
[0151] Those skilled in the art can understand that Figure 7 The structure shown in the figure is only a block diagram of part of the structure related to the scheme of the present application, and does not constitute a limitation on the wireless communication module to which the scheme of the present application is applied. A specific wireless communication module can include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0152] In one embodiment, a wireless communication module is provided, which includes a memory and a processor. The memory stores a computer program. The processor implements the following steps when executing the computer program:
[0153] In response to the terminal being started, enabling the first preset interface and the second preset interface of the wireless communication module;
[0154] Determining a link parameter of the first preset interface;
[0155] If the link parameter meets a first preset condition, initializing the first preset interface and disabling the second preset interface;
[0156] If the link parameter does not meet the first preset condition, initializing the second preset interface and disabling the first preset interface.
[0157] In one embodiment, the processor further implements the following steps when executing the computer program:
[0158] Determining a link parameter of the first preset interface includes:
[0159] Detecting whether a physical layer link of the first preset interface has been established between the wireless communication module and the terminal;
[0160] If the physical layer link of the first preset interface is established, the link parameter of the first preset interface is determined as the first link parameter;
[0161] If the physical layer link of the first preset interface is not established, the link parameter of the first preset interface is determined as the second link parameter.
[0162] In one embodiment, the processor, when executing the computer program, further implements the following steps:
[0163] The first preset condition includes: the link parameter is the first link parameter; if the link parameter meets the first preset condition, the first preset interface is initialized, and the second preset interface is disabled, including:
[0164] If the link parameter is the first link parameter, enumeration is performed on the first preset interface;
[0165] If the enumeration on the first preset interface is successful, the second preset interface is disabled.
[0166] In one embodiment, the processor, when executing the computer program, further implements the following steps:
[0167] If the link parameter does not meet the first preset condition, the second preset interface is initialized, and the first preset interface is disabled, including:
[0168] If the link parameter is the second link parameter, enumeration is performed on the second preset interface;
[0169] If the enumeration on the second preset interface is successful, the first preset interface is disabled.
[0170] In one embodiment, the processor, when executing the computer program, further implements the following steps:
[0171] If the enumeration on the first preset interface fails, the first preset interface and the second preset interface are disabled.
[0172] In one embodiment, the processor, when executing the computer program, further implements the following steps:
[0173] If the enumeration on the second preset interface fails, the first preset interface and the second preset interface are disabled.
[0174] In one embodiment, a computer readable storage medium is provided, and the computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement the following steps:
[0175] In response to the terminal starting, enabling the first preset interface and the second preset interface of the wireless communication module;
[0176] Determining the link parameter of the first preset interface;
[0177] If the link parameter satisfies the first preset condition, the first preset interface is initialized and the second preset interface is disabled.
[0178] If the link parameter does not satisfy the first preset condition, the second preset interface is initialized and the first preset interface is disabled.
[0179] In one embodiment, the computer program, when executed by the processor, further implements the following steps:
[0180] The link parameter of the first preset interface is determined, comprising:
[0181] It is detected whether a physical layer link of the first preset interface has been established between the wireless communication module and the terminal;
[0182] If the physical layer link of the first preset interface has been established, the link parameter of the first preset interface is determined as the first link parameter;
[0183] If the physical layer link of the first preset interface has not been established, the link parameter of the first preset interface is determined as the second link parameter.
[0184] In one embodiment, the computer program, when executed by the processor, further implements the following steps:
[0185] The first preset condition comprises that the link parameter is the first link parameter; if the link parameter satisfies the first preset condition, the first preset interface is initialized and the second preset interface is disabled, comprising:
[0186] If the link parameter is the first link parameter, enumeration is performed on the first preset interface;
[0187] If the enumeration on the first preset interface is successful, the second preset interface is disabled.
[0188] In one embodiment, the computer program, when executed by the processor, further implements the following steps:
[0189] If the link parameter does not satisfy the first preset condition, the second preset interface is initialized and the first preset interface is disabled, comprising:
[0190] If the link parameter is the second link parameter, enumeration is performed on the second preset interface;
[0191] If the enumeration on the second preset interface is successful, the first preset interface is disabled.
[0192] In one embodiment, the computer program, when executed by the processor, further implements the following steps:
[0193] If the enumeration on the first preset interface fails, the first preset interface and the second preset interface are disabled.
[0194] In one embodiment, the computer program, which is executed by the processor, further implements the following steps:
[0195] If the enumeration for the second preset interface fails, the first preset interface and the second preset interface are disabled.
[0196] In one embodiment, a computer program product is provided, comprising a computer program which, when executed by the processor, implements the following steps:
[0197] In response to the terminal starting, the first preset interface and the second preset interface of the wireless communication module are enabled;
[0198] The link parameter of the first preset interface is determined;
[0199] If the link parameter meets the first preset condition, the first preset interface is initialized, and the second preset interface is disabled;
[0200] If the link parameter does not meet the first preset condition, the second preset interface is initialized, and the first preset interface is disabled.
[0201] In one embodiment, the computer program, which is executed by the processor, further implements the following steps:
[0202] The link parameter of the first preset interface is determined, comprising:
[0203] It is detected whether a physical layer link of the first preset interface has been established between the wireless communication module and the terminal;
[0204] If the physical layer link of the first preset interface has been established, the link parameter of the first preset interface is determined as a first link parameter;
[0205] If the physical layer link of the first preset interface has not been established, the link parameter of the first preset interface is determined as a second link parameter.
[0206] In one embodiment, the computer program, which is executed by the processor, further implements the following steps:
[0207] The first preset condition comprises: the link parameter is the first link parameter; if the link parameter meets the first preset condition, the first preset interface is initialized, and the second preset interface is disabled, comprising:
[0208] If the link parameter is the first link parameter, enumeration is performed for the first preset interface;
[0209] If the enumeration for the first preset interface succeeds, the second preset interface is disabled.
[0210] In one embodiment, the computer program, which is executed by the processor, further implements the following steps:
[0211] If the link parameter does not satisfy the first preset condition, the second preset interface is initialized and the first preset interface is disabled, including:
[0212] If the link parameter is the second link parameter, enumeration is performed for the second preset interface;
[0213] If the enumeration for the second preset interface is successful, the first preset interface is disabled.
[0214] In one embodiment, the computer program, when executed by the processor, further implements the following steps:
[0215] If the enumeration for the first preset interface fails, the first preset interface and the second preset interface are disabled.
[0216] In one embodiment, the computer program, when executed by the processor, further implements the following steps:
[0217] If the enumeration for the second preset interface fails, the first preset interface and the second preset interface are disabled.
[0218] It should be noted that the user information (including but not limited to user equipment information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the present application are all information and data authorized by the user or authorized by all parties.
[0219] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer readable storage medium, and when the computer program is executed, the processes of the above-mentioned embodiments of the methods can be included. Any reference to memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. The non-volatile memory can include read-only memory (Read-Only Memory, ROM), magnetic tape, floppy disk, flash memory, optical storage, high-density embedded non-volatile memory, resistive memory (ReRAM), magnetoresistive random access memory (Magnetoresistive Random Access Memory, MRAM), ferroelectric memory (Ferroelectric Random Access Memory, FRAM), phase change memory (Phase Change Memory, PCM), graphene memory, etc. The volatile memory can include random access memory (Random Access Memory, RAM) or external cache memory, etc. As an illustration but not limitation, the RAM can be in various forms, such as static random access memory (Static Random Access Memory, SRAM) or dynamic random access memory (Dynamic Random Access Memory, DRAM), etc. The database involved in the embodiments provided in the present application can include at least one of a relational database and a non-relational database. The non-relational database can include a distributed database based on a block chain, etc., without being limited thereto. The processor involved in the embodiments provided in the present application can be a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., without being limited thereto.
[0220] Any combination of the technical features of the above embodiments can be made. In order to make the description simple, all possible combinations of the technical features in the above embodiments are not described, however, as long as the combination of the technical features does not exist contradictory, it should be considered as the scope of the present application.
[0221] The above embodiments only express several implementation manners of the present application, and the description is more specific and detailed, but it should not be understood as a limitation on the scope of the patent of the present application. It should be pointed out that for ordinary skilled in the art, without departing from the concept of the present application, a number of modifications and improvements can be made, which are within the scope of protection of the present application. Therefore, the protection scope of the present application should be subject to the appended claims.
Claims
1. A control method of a wireless communication module, characterized by, The method comprises: in response to terminal starting, enabling a first preset interface and a second preset interface of a wireless communication module; determining a link parameter of the first preset interface; if the link parameter meets a first preset condition, initializing the first preset interface and disabling the second preset interface; if the link parameter does not meet the first preset condition, initializing the second preset interface and disabling the first preset interface; the determining the link parameter of the first preset interface comprises: detecting whether a physical layer link of the first preset interface has been established between the wireless communication module and the terminal; if the physical layer link of the first preset interface has been established, determining the link parameter of the first preset interface as a first link parameter; if the physical layer link of the first preset interface has not been established, determining the link parameter of the first preset interface as a second link parameter; wherein the first link parameter comprises a link identifier of the first preset interface and a first link value of the first preset interface, and the second link parameter comprises the link identifier of the first preset interface and a second link value of the first preset interface.
2. The method of claim 1, wherein, the first preset condition comprises that the link parameter is the first link parameter; and the if the link parameter meets the first preset condition, initializing the first preset interface and disabling the second preset interface comprises: if the link parameter is the first link parameter, enumerating the first preset interface; if the enumeration of the first preset interface is successful, disabling the second preset interface.
3. The method according to claim 1 or 2, characterized in that, the if the link parameter does not meet the first preset condition, initializing the second preset interface and disabling the first preset interface comprises: if the link parameter is the second link parameter, enumerating the second preset interface; if the enumeration of the second preset interface is successful, disabling the first preset interface.
4. The method of claim 2, wherein, The method further comprises: if the enumeration of the first preset interface fails, disabling the first preset interface and the second preset interface.
5. The method of claim 3, wherein, The method further comprises: if the enumeration of the second preset interface fails, disabling the first preset interface and the second preset interface.
6. A control device of a wireless communication module, characterized by comprising: The apparatus comprises: an enabling module, configured to enable a first preset interface and a second preset interface of a wireless communication module in response to terminal starting; a link parameter determination module, configured to determine a link parameter of the first preset interface; a first initialization module, configured to initialize the first preset interface and disable the second preset interface if the link parameter meets a first preset condition; a second initialization module, configured to initialize the second preset interface and disable the first preset interface if the link parameter does not meet the first preset condition; The link parameter determination module is further configured to detect whether a physical layer link of the first preset interface has been established between the wireless communication module and the terminal; if the physical layer link of the first preset interface has been established, determine a link parameter of the first preset interface as a first link parameter; if the physical layer link of the first preset interface has not been established, determine the link parameter of the first preset interface as a second link parameter; wherein the first link parameter comprises a link identifier of the first preset interface and a first link value of the first preset interface; and the second link parameter comprises the link identifier of the first preset interface and a second link value of the first preset interface. 7.A wireless communication module, comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the computer program to implement the method according to any one of claims 1-6. The processor, when executing the computer program, implements the steps of the method of any one of claims 1 to 5.
8. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program, when executed by the processor, implements the steps of the method of any one of claims 1 to 5.
9. A computer program product comprising a computer program, characterized in that, The computer program, when executed by the processor, implements the steps of the method of any one of claims 1 to 5. The computer program, when executed by the processor, implements the steps of the method of any one of claims 1 to 5.
Citation Information
Patent Citations
Data communication method and mobile terminal
CN108268410A
Wireless communication module and function recovery method thereof, electronic equipment and storage medium
CN114448779A
Communication method and device
CN114759944A