Module configuration method and device and storage medium
By sending AT commands to multiple AT ports through the module configuration device, the problem of low configuration efficiency when replacing communication modules in terminal equipment is solved, and fast and accurate module adaptation is achieved.
Patent Information
- Application Number
- CN202411426854.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-12
- Publication Date
- 2025-11-04
- Estimated Expiration
- 2044-10-12
AI Technical Summary
When a terminal device replaces its communication module, the module information needs to be reset, resulting in low module configuration efficiency.
The module configuration device sends AT commands to the initial AT port. If no response message is received, it sends commands to other AT ports, obtains module information through response messages, and determines the target AT port.
This improves the accuracy and efficiency of module configuration, ensuring that terminal devices can use the modules to be adapted normally.
Smart Images

Figure CN119363580B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technology, and in particular to a module configuration method, apparatus and storage medium. Background Technology
[0002] A communication module is a functional module that integrates a baseband chip, memory, power amplifier, and other components onto a single circuit board, providing a standard interface. Terminal devices can achieve communication functions using this module. Because communication modules from different manufacturers or with different functions have different module information (including module model and Attention (AT) port), terminal device manufacturers need to adapt the communication module to their terminal devices after obtaining it (specifically, by setting the module information provided by the communication module manufacturer in the terminal device's adaptation program) in order for the terminal device to use the communication module correctly.
[0003] However, when a terminal device needs to replace its communication module, the original module information in the terminal device's adaptation program is no longer applicable. The terminal device manufacturer's maintenance personnel then need to configure the new communication module in the adaptation program. Therefore, improving module configuration efficiency remains a technical problem to be solved. Summary of the Invention
[0004] This application provides a module configuration method, apparatus, and storage medium to improve module configuration efficiency.
[0005] To achieve the above objectives, this application adopts the following technical solution:
[0006] In a first aspect, embodiments of this application provide a module configuration method, wherein a module configuration device sends an AT command to an initial AT port of a module to be adapted; the AT command is used to request module information of the module to be adapted; if no response message is received from the module to be adapted through the initial AT port, the module configuration device sends an AT command to at least one AT port of the module to be adapted other than the initial AT port; the module configuration device receives a response message from the module to be adapted through a first AT port, obtains the module information of the module to be adapted from the response message, and determines the first AT port as the target AT port of the module to be adapted; the first AT port is a port among at least one AT port.
[0007] In one possible implementation, if no response message is received from the module to be adapted via the initial AT within a first preset time period, an AT command is sent to at least one AT port in a preset manner; the preset manner includes: parallel transmission or asynchronous input / output IO.
[0008] In one possible implementation, a module detection command is received; the module detection command is used to detect information about the module to be adapted; module detection information is generated based on the module detection command; the module detection information is used to characterize the state of the module to be adapted; the identifier of the module to be adapted is obtained from the module detection message; the identifier of the module to be adapted includes a supplier identifier (VID) and a product identifier (PID); and the initial AT port of the module to be adapted is determined based on the identifier of the module to be adapted.
[0009] In one possible implementation, a module mapping table is obtained; the module mapping table includes the identifier of at least one module and the AT port corresponding to the identifier of at least one module; based on the identifier of the module to be adapted and the module mapping table, the initial AT port of the module to be adapted is determined.
[0010] In one possible implementation, the status of each module in the module group in the terminal device is monitored; the module group includes modules to be adapted; when the first module in the module group is removed, the module dialing process of the first module is stopped.
[0011] In one possible implementation, when the second module is added to the module group, the identifier of the second module is obtained; based on the identifier of the second module, the AT port of the second module is determined.
[0012] Secondly, this application provides a module configuration apparatus, including: a communication unit and a processing unit; the communication unit is configured to send an AT command to an initial AT port of a module to be adapted; the AT command is used to request module information of the module to be adapted; the communication unit is configured to send an AT command to at least one AT port of the module to be adapted, other than the initial AT port, if no response message is received from the module to be adapted through the initial AT port; the communication unit is configured to instruct the communication unit to receive a response message sent by the module to be adapted through a first AT port, obtain module information of the module to be adapted from the response message, and determine the first AT port as the target AT port of the module to be adapted; the first AT port is a port among at least one AT port.
[0013] In one possible implementation, the processing unit is further configured to instruct the communication unit to send AT commands to at least one AT port in a preset manner if no response message is received from the module to be adapted via the initial AT within a first preset time period; the preset manner includes: parallel transmission mode or asynchronous input / output IO mode.
[0014] In one possible implementation, the communication unit is further configured to receive a module detection command; the module detection command is used to detect information about the module to be adapted; the processing unit is further configured to generate module detection information based on the module detection command; the module detection information is used to characterize the state of the module to be adapted; the processing unit is further configured to obtain the identifier of the module to be adapted from the module detection message; the identifier of the module to be adapted includes a supplier identifier (VID) and a product identifier (PID); the processing unit is further configured to determine the initial AT port of the module to be adapted based on the identifier of the module to be adapted.
[0015] In one possible implementation, the processing unit is further configured to: obtain a module mapping table; the module mapping table includes an identifier of at least one module and an AT port corresponding to the identifier of at least one module; and determine the initial AT port of the module to be adapted based on the identifier of the module to be adapted and the module mapping table.
[0016] In one possible implementation, the processing unit is also used to monitor the status of each module in the module group in the terminal device; the module group includes modules to be adapted; when the first module in the module group is removed, the module dialing process of the first module is stopped.
[0017] In one possible implementation, the processing unit is further configured to: obtain the identifier of the second module when the second module is added to the module group; and determine the AT port of the second module based on the identifier of the second module.
[0018] Thirdly, this application provides a module configuration device, which includes a processor and a memory; wherein the memory is used to store computer execution instructions, and when the module configuration device is running, the processor executes the computer execution instructions stored in the memory to cause the module configuration device to perform the module configuration method as described in the first aspect and any possible implementation thereof.
[0019] Fourthly, this application provides a computer-readable storage medium storing instructions that, when executed by a processor of a module configuration device, enable the module configuration device to perform the module configuration method as described in the first aspect and any possible implementation thereof.
[0020] Fifthly, embodiments of this application provide a chip, which includes a processor and a communication interface, the communication interface and the processor being coupled together. The processor is used to run computer programs or instructions to implement the module configuration method described in the first aspect and any possible implementation thereof.
[0021] In a sixth aspect, a computer program product containing instructions is provided, which, when run on a computer, enables the computer to execute the module configuration method described in the first aspect and any possible implementation thereof.
[0022] These or other aspects of this application will become more readily apparent in the following description.
[0023] The above solution offers at least the following advantages: In this embodiment, the module configuration device sends an AT command to the initial AT port. Since the AT command is used to request module information of the module to be adapted, the module configuration device can configure the communication module of the terminal device based on the response information of the initial AT port. If no response message is received from the module to be adapted via the initial AT port, the module configuration device sends an AT command to at least one AT port of the module to be adapted, excluding the initial AT port. Thus, if the module configuration device cannot obtain the AT port of the module to be adapted through its identifier, it can determine the first AT port capable of transmitting the response message from at least one AT port. The module configuration device obtains the module information of the module to be adapted from the response message and determines the target AT port of the module to be adapted, completing the adaptation between the terminal device and the module. This allows the terminal device to use the module to be adapted normally based on the module information and the target AT port. Therefore, this embodiment can improve the accuracy of module configuration, thereby improving the efficiency of module configuration. Attached Figure Description
[0024] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0025] Figure 1 This is a schematic diagram of the structure of a module configuration system provided in an embodiment of this application;
[0026] Figure 2 This is a schematic diagram of the structure of a module configuration device provided in an embodiment of this application;
[0027] Figure 3 A flowchart illustrating a module configuration method provided in an embodiment of this application;
[0028] Figure 4 A flowchart illustrating a module configuration method provided in an embodiment of this application;
[0029] Figure 5 A flowchart illustrating a module configuration method provided in an embodiment of this application;
[0030] Figure 6 A flowchart illustrating a module configuration method provided in an embodiment of this application;
[0031] Figure 7 A flowchart illustrating a module configuration method provided in an embodiment of this application;
[0032] Figure 8 A flowchart illustrating a module configuration method provided in an embodiment of this application;
[0033] Figure 9 A flowchart illustrating a module configuration method provided in an embodiment of this application;
[0034] Figure 10 This is a schematic diagram of a module configuration device provided in an embodiment of this application. Detailed Implementation
[0035] In this article, the term "and / or" is merely a description of the relationship between related objects, indicating that there can be three relationships. For example, A and / or B can represent three situations: A exists alone, A and B exist simultaneously, and B exists alone.
[0036] The terms "first" and "second," etc., used in the specification and drawings of this application are used to distinguish different objects or to distinguish different treatments of the same object, rather than to describe a specific order of objects.
[0037] Furthermore, the terms "comprising" and "having," and any variations thereof, used in the description of this application are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the steps or units listed, but may optionally include other steps or units not listed, or may optionally include other steps or units inherent to such process, method, product, or apparatus.
[0038] It should be noted that in the embodiments of this application, the words "exemplary" or "for example" are used to indicate examples, illustrations, or explanations. Any embodiment or design scheme described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design schemes. Specifically, the use of the words "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.
[0039] In the description of this application, unless otherwise stated, "a plurality of" means two or more.
[0040] A communication module is a functional module that integrates a baseband chip, memory, power amplifier, and other components onto a single circuit board, providing a standard interface. Terminal devices can achieve communication functions using this module. Because communication modules from different manufacturers or with different functions have different module information (including module model and AT port), terminal device manufacturers need to adapt the communication module to their terminal devices after obtaining it (specifically, by setting the module information provided by the communication module manufacturer in the terminal device's adaptation program) in order for the terminal device to use the communication module correctly.
[0041] However, when a terminal device needs to replace its communication module, the original module information in the terminal device's adaptation program is no longer applicable. The terminal device manufacturer's maintenance personnel then need to configure the new communication module in the adaptation program. Therefore, improving module configuration efficiency remains a technical problem to be solved.
[0042] To address the technical problems existing in related technologies, in this embodiment, the module configuration device sends an AT command to the initial AT port. Since the AT command is used to request module information of the module to be adapted, the module configuration device can configure the communication module of the terminal device based on the response information of the initial AT port. If no response message is received from the module to be adapted through the initial AT port, the module configuration device sends an AT command to at least one AT port of the module to be adapted, excluding the initial AT port. Thus, when the module configuration device cannot obtain the AT port of the module to be adapted through its identifier, it can determine the first AT port capable of transmitting the response message from at least one AT port. The module configuration device obtains the module information of the module to be adapted from the response message and determines the target AT port of the module to be adapted, completing the adaptation between the terminal device and the module. In this way, the terminal device can normally use the module to be adapted based on the module information and the target AT port. Therefore, this embodiment can improve the accuracy of module configuration, thereby improving the efficiency of module configuration.
[0043] The following, in conjunction with the appendix Figure 1 This application provides a detailed description of a module configuration system 10 according to an embodiment, such as... Figure 1 As shown, the module configuration system 10 includes: a module configuration device 11 and a module to be adapted 12.
[0044] The module configuration device 11 is configured to: send an AT command to the initial AT port of the module to be adapted 12; the AT command is used to request module information of the module to be adapted 12; if no response message is received from the module to be adapted 12 through the initial AT port, send an AT command to at least one AT port of the module to be adapted 12 other than the initial AT port; receive a response message from the module to be adapted 12 through the first AT port, and obtain the module information of the module to be adapted 12 from the response message; and determine the first AT port as the target AT port of the module to be adapted 12; the first AT port is a port among at least one AT port.
[0045] The module to be adapted 12 is configured to include multiple AT interfaces and send response messages through the AT ports.
[0046] It should be noted in this application that the module configuration device 11 is a device with wireless communication capabilities, which can be deployed on land, including indoors or outdoors, handheld or vehicle-mounted. It can also be deployed on water (such as on ships). Furthermore, it can be deployed in the air (e.g., on airplanes, balloons, and satellites). User terminal equipment, also known as a mobile station (MS), mobile terminal (MT), or other terminal devices, is a device that provides voice and / or data connectivity to a user. For example, terminal devices include handheld devices with wireless connectivity, vehicle-mounted devices, etc. Currently, terminal devices can include: mobile phones, tablets, laptops, PDAs, mobile internet devices (MIDs), wearable devices (such as smartwatches, smart bracelets, pedometers, etc.), in-vehicle devices (such as cars, bicycles, electric vehicles, airplanes, ships, trains, high-speed trains, etc.), virtual reality (VR) devices, augmented reality (AR) devices, wireless terminal devices in industrial control, smart home devices (such as refrigerators, televisions, air conditioners, electricity meters, etc.), intelligent robots, workshop equipment, wireless terminal devices in self-driving, wireless terminal devices in remote medical surgery, wireless terminal devices in smart grids, wireless terminal devices in transportation safety, wireless terminal devices in smart cities, or wireless terminal devices in smart homes, and flying devices (such as intelligent robots, hot air balloons, drones, airplanes), etc. In one possible application scenario of this application, the module configuration device 11 is a terminal device that frequently operates on the ground, such as an in-vehicle device. In this application, for ease of description, the chip deployed in the above-mentioned device, such as a system-on-a-chip (SOC), a baseband chip, or other chips with communication functions, can also be referred to as a user terminal device.
[0047] Optionally, the module configuration device 11 can be an embedded communication device or a user handheld communication device, including mobile phones, tablets, etc.
[0048] As an example, in this embodiment, the module configuration device 11 can also be a wearable device. Wearable devices, also known as wearable smart devices, are a general term for devices that utilize wearable technology to intelligently design and develop everyday wearables, such as glasses, gloves, watches, clothing, and shoes. Wearable devices are portable devices that are worn directly on the body or integrated into the user's clothing or accessories. Wearable devices are not merely hardware devices, but also achieve powerful functions through software support, data interaction, and cloud interaction. Broadly speaking, wearable smart devices include those that are feature-rich, large in size, and can achieve complete or partial functions without relying on a smartphone, such as smartwatches or smart glasses, as well as those that focus on only one type of application function and require the use of other devices such as smartphones, such as various smart bracelets and smart jewelry for vital sign monitoring.
[0049] This application provides a module configuration device for executing the module configuration system provided in this application. Figure 2 This is a schematic diagram of a module configuration device provided in an embodiment of this application. Figure 2 As shown, the module configuration device 200 includes at least one processor 201, a communication line 202, and at least one communication interface 204, and may also include a memory 203. The processor 201, memory 203, and communication interface 204 can be connected via the communication line 202.
[0050] The processor 201 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of this application, such as one or more digital signal processors (DSPs), or one or more field-programmable gate arrays (FPGAs).
[0051] Communication line 202 may include a path for transmitting information between the aforementioned components.
[0052] The communication interface 204 is used to communicate with other devices or communication networks and can use any transceiver-like device, such as Ethernet, radio access network (RAN), WLAN, etc.
[0053] The memory 203 may be a read-only memory (ROM) or other type of static storage device capable of storing static information and instructions, random access memory (RAM) or other type of dynamic storage device capable of storing information and instructions, or electrically erasable programmable read-only memory (EEPROM), compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium capable of including or storing desired program code having the form of instructions or data structures and accessible by a computer, but not limited thereto.
[0054] In one possible design, the memory 203 can exist independently of the processor 201, meaning the memory 203 can be an external memory of the processor 201. In this case, the memory 203 can be connected to the processor 201 via the communication line 202 to store execution instructions or application code, and its execution is controlled by the processor 201 to implement the module configuration method provided in the following embodiments of this application. In another possible design, the memory 203 can also be integrated with the processor 201, meaning the memory 203 can be an internal memory of the processor 201. For example, the memory 203 can be a cache, which can be used to temporarily store some data and instruction information.
[0055] As one possible implementation, processor 201 may include one or more CPUs, for example Figure 2 CPU0 and CPU1 in the example. Alternatively, the module configuration device 200 may include multiple processors, such as CPU0 and CPU1. Figure 2 The processors 201 and 207 are included. Alternatively, the module configuration device 200 may also include an output device 205 and an input device 206.
[0056] The following, in conjunction with the appendix Figure 3 The module configuration method provided in the embodiments of this application will be described in detail, such as... Figure 3 As shown, the module configuration method includes S301-S303.
[0057] S301, The module configuration device sends AT commands to the initial AT port of the module to be adapted.
[0058] The AT command is used to request module information for the module to be adapted.
[0059] In one possible implementation, the module configuration device sends AT commands to the initial AT port based on the initial AT port number.
[0060] In another possible implementation, the module configuration device sends AT commands to the initial AT port based on the address information of the initial AT port.
[0061] Optionally, AT commands are ATI commands.
[0062] It should be noted that AT commands are pre-set in the terminal by maintenance personnel, and AT commands are standard commands in the 3rd generation partnership project (3GPP), which can be recognized and responded to by communication modules from any manufacturer.
[0063] S302. If no response message is received from the module to be adapted through the initial AT port, the module configuration device sends an AT command to at least one AT port of the module to be adapted, excluding the initial AT port.
[0064] Optionally, at least one AT port is a ttyUSB port.
[0065] It should be explained that after the module configuration device sends the AT command to the initial AT port, within the second preset time period, the module configuration device determines whether the response receiving file is empty; if it is empty, the module configuration device has not received the response message; if it is not empty, the module configuration device determines that it has received the response message.
[0066] Optionally, the response receiving file is pre-set in the terminal by the maintenance personnel and is used to receive response messages sent by the module to be adapted through the AT port.
[0067] It should be explained that if a response message is received from the module to be adapted through the initial AT port, the module configuration device obtains the module information of the module to be adapted from the response message, and determines the initial AT port as the target AT port of the module to be adapted.
[0068] S303, the module configuration device receives the response message sent by the module to be adapted through the first AT port, obtains the module information of the module to be adapted from the response message, and determines the first AT port as the target AT port of the module to be adapted.
[0069] The first AT port is a port among at least one AT ports.
[0070] In one possible implementation, if the module configuration device receives a response message sent by the module to be adapted through the first AT port, the module configuration device reads the response message from the response reception file, obtains the module information of the module to be adapted from the response message, and identifies the first AT port as the AT port of the module to be adapted. Then, the module configuration device stores the module information and AT port in the adaptation program, so that the module configuration device can communicate with the module to be adapted based on the module information number and the AT port.
[0071] Optionally, after determining the target AT port of the module to be adapted, the module configuration device saves the first AT port of the module to be adapted, the module information of the module to be adapted, and the identifier of the module to be adapted to the memory, so that the module configuration device can directly obtain the first AT port of the module to be adapted and the module information of the module to be adapted based on the identifier of the module to be adapted.
[0072] For example, the response message for an ATI command is: root@LHZ04_Redcap:~#
[0073] root@LHZ04_Redcap:~#sendat ati
[0074] port = / dev / ttyUSB1, cmd = ati
[0075] Manufacturer: TD Tech Ltd.
[0076] Model: MT5710-CN
[0077] Revision: V100R001C00B068
[0078] IMEI: 863495060196274
[0079] +GCAP:+CGSM,+DS,+ES.
[0080] It should be explained that the AT port is: root@LHZ04_Redcap:~#sendat ati; the specific command is: port= / dev / ttyUSB1,cmd=ati; the module information in the response message is: Model:MT5710-CN.
[0081] The above solution offers at least the following advantages: In this embodiment, the module configuration device sends an AT command to the initial AT port. Since the AT command is used to request module information of the module to be adapted, the module configuration device can configure the communication module of the terminal device based on the response information of the initial AT port. If no response message is received from the module to be adapted via the initial AT port, the module configuration device sends an AT command to at least one AT port of the module to be adapted, excluding the initial AT port. Thus, if the module configuration device cannot obtain the AT port of the module to be adapted through its identifier, it can determine the first AT port capable of transmitting the response message from at least one AT port. The module configuration device obtains the module information of the module to be adapted from the response message and determines the target AT port of the module to be adapted, completing the adaptation between the terminal device and the module. This allows the terminal device to use the module to be adapted normally based on the module information and the target AT port. Therefore, this embodiment can improve the accuracy of module configuration, thereby improving the efficiency of module configuration.
[0082] In one possible implementation, combining Figure 3 ,like Figure 4 As shown, in step S302, if no response message is received from the module to be adapted through the initial AT port, the process of the module configuration device sending AT commands to at least one AT port of the module to be adapted, other than the initial AT port, can be specifically implemented through step S401.
[0083] S401. If no response message is received from the module to be adapted via the initial AT within the first preset time period, the module configuration device sends an AT command to at least one AT port in a preset manner.
[0084] The preset modes include: parallel sending mode or asynchronous input / output (IO) mode.
[0085] Optionally, the first preset time period is set in advance by the maintenance personnel in the terminal.
[0086] It should be explained that, while sending AT commands to at least one AT port, the module configuration device does not wait for the current transmission task to complete, but continues to execute the transmission of the next task. This improves the efficiency of the module configuration device in sending AT commands to at least one AT port, thereby facilitating the timely receipt of response information.
[0087] For example, at least one AT port of the module to be adapted is ttyUSB0, ttyUSB1, or ttyUSB2. If no response message is received from the module to be adapted through the initial AT port within 20ms, the module configuration device sends AT commands to ttyUSB0, ttyUSB1, and ttyUSB2 simultaneously in parallel.
[0088] For example, if no response message is received from the module to be adapted through the initial AT port within 20ms, the module configuration device will take 5ms to complete sending the AT command to ttyUSB0. The module configuration device sends the AT command to ttyUSB0 at 0ms, sends the AT command to ttyUSB1 at 2ms, and sends the AT command to ttyUSB2 at 4ms.
[0089] The above solution brings at least the following beneficial effects: In this embodiment, if no response message is received from the module to be adapted through the initial AT port within the first preset time period, the module configuration device sends an AT command to at least one AT port in a preset manner. This can improve the efficiency of the module configuration device in sending AT commands, and thus the module configuration device can receive the response message sent by the module to be adapted through the AT port in a timely manner, thereby improving the module configuration efficiency.
[0090] In one possible implementation, combining Figure 3 ,like Figure 5 As shown, before the module configuration device sends an AT command to the initial AT port of the module to be adapted in S301, the module configuration device determines the initial AT port of the module to be adapted. The process of the module configuration device determining the initial AT port of the module to be adapted can be specifically implemented through the following S501-S504.
[0091] S501, The module configuration device receives the module detection command.
[0092] Among them, the module detection command is used to detect information about the module to be adapted.
[0093] In one possible implementation, the module configuration device receives a module detection command from the terminal device.
[0094] Understandably, users can select and press controls on the module configuration device to trigger the module configuration device to receive module detection commands.
[0095] Optionally, the module detection command is the lsusb command.
[0096] It should be noted that the module detection command is pre-set in the terminal by the maintenance personnel.
[0097] S502, The module configuration device generates module detection information based on the module detection command.
[0098] Among them, the module detection information is used to characterize the status of the module to be adapted.
[0099] One possible approach is for the module configuration device to continuously execute preset module detection commands, and generate module detection information after detecting a new module.
[0100] It should be explained that when the module configuration device detects a new module, it means that the module configuration device has successfully adapted the Universal Serial Bus (USB) driver for the module.
[0101] S503, The module configuration device obtains the identifier of the module to be adapted from the module detection message.
[0102] The identifiers for the modules to be adapted include the vendor identity document (VID) and the product identity document (PID).
[0103] Optionally, the identifier for the module to be adapted may also include control commands.
[0104] In one possible implementation, the module configuration device continuously executes lsusb commands. After the terminal detects a new module, it generates an lsusb command message and obtains the VID and PID of the module to be adapted from the lsusb command message.
[0105] S504, The module configuration device determines the initial AT port of the module to be adapted based on the identifier of the module to be adapted.
[0106] In one possible implementation, the module configuration device determines the initial AT port number and / or address information of the module to be adapted based on the identifier of the module to be adapted.
[0107] The above solution brings at least the following beneficial effects: In this embodiment of the application, after receiving the module detection command, the module configuration device generates a module detection message based on the module detection command and obtains the identifier of the module to be adapted from the module detection message. In this way, the module configuration device can quickly and accurately obtain the identifier of the module to be adapted, and thus the module configuration device determines the initial AT port of the module to be adapted based on the identifier of the module to be adapted.
[0108] In one possible implementation, combining Figure 5 ,like Figure 6As shown in S504, the process by which the module configuration device determines the initial AT port of the module to be adapted based on the identifier of the module to be adapted can be specifically implemented through the following S601-S602.
[0109] S601, The module configuration device obtains the module mapping table.
[0110] The module mapping table includes the identifier of at least one module and the AT port corresponding to the identifier of at least one module.
[0111] In one possible implementation, the module configuration device generates a module mapping table based on the module's identifier and the association information between the AT port and the module.
[0112] Optionally, the module mapping table may also include a processing file corresponding to the identifier of at least one module.
[0113] For example, as shown in Table 1, the identifier of module 1 in the module mapping table is VID1 / PID1, which corresponds to processing file 1 and AT port 1; the identifier of module 2 is VID2 / PID2, which corresponds to processing file 2 and AT port 2; and the identifier of module n is VIDn / PIDn, which corresponds to processing file n and AT port n.
[0114] Table 1. Module Mapping Table
[0115]
[0116] S602, The module configuration device determines the initial AT port of the module to be adapted based on the identifier of the module to be adapted and the module mapping table.
[0117] In one possible implementation, the module configuration device obtains the second port corresponding to the identifier of the module to be adapted in the module mapping table, and determines the second port as the initial AT port of the module to be adapted.
[0118] The above solution brings at least the following beneficial effects: In the embodiments of this application, the module configuration device generates a module mapping table based on the module's identifier and port association information, and then, based on the identifier of the module to be adapted and the module mapping table, the initial AT port of the module to be adapted can be quickly and accurately determined.
[0119] In one possible implementation, combining Figure 3 ,like Figure 7 As shown, in S303, the module configuration device receives the response message sent by the module to be adapted through the first AT port, obtains the module information of the module to be adapted from the response message, and determines the first AT port as the target AT port of the module to be adapted. After that, the module configuration device monitors the module. The process of the module configuration device monitoring the module can be specifically implemented through the following S701-S702.
[0120] S701, The module configuration device monitors the status of each module in the module group within the module configuration device.
[0121] The module group includes modules that need to be adapted.
[0122] In one possible implementation, after the module configuration device is powered on, the status of each module in the module group in the module configuration device can be actively monitored through the hotplug mechanism.
[0123] It should be explained that hotplug is a mechanism in the Linux system used to handle device hotplug events.
[0124] S702. When the first module in the module group is removed, the module configuration device stops the module dialing process of the first module.
[0125] Optionally, the module dialing process includes sending and receiving a series of AT commands used to configure the module, detect network status, and establish a connection.
[0126] It should be explained that when the first module is detected to be unplugged from the module group, the module dialing and information query process is stopped to avoid unnecessary continuous sending of AT commands.
[0127] The above solution brings at least the following beneficial effects: In the embodiments of this application, when the first module is pulled out from the module group, the module configuration device can stop the module dialing process of the first module, thus avoiding the waste of resources.
[0128] In one possible implementation, combining Figure 7 ,like Figure 8 As shown in S701, after the module configuration device monitors the status of each module in the module group, the module configuration device adapts the AT port for the second module. The process of the module configuration device adapting the AT port for the second module can be specifically implemented through the following S801-S802.
[0129] S801. When the second module is added to the module group, the module configuration device obtains the identifier of the second module.
[0130] In one possible implementation, the module configuration device executes the lsusb command to generate module detection information for the second module, and obtains the identifier of the second module based on the module detection information.
[0131] S802, The module configuration device determines the AT port of the second module based on the identifier of the second module.
[0132] In one possible implementation, the module configuration device determines the initial AT port of the second module based on the identifier of the second module. The module configuration device sends an AT command to the initial AT port of the second module, receives a response message from the initial AT port of the second module, and determines the AT port of the second module based on the response message.
[0133] In another possible implementation, the module configuration device sends an AT command to all AT ports of the second module; when the module configuration device receives a response message from any AT port of the second module, it determines the AT port of the second module based on the response message.
[0134] It should be explained that when the second module is inserted into the module group, the module configuration device automatically executes the identification and configuration process of the corresponding second module to ensure a smooth transition of the system.
[0135] For example, such as Figure 9 As shown: After the terminal device is powered on, the module configuration device detects the module to be adapted and reads its VID / PID via the lsusb command. The module configuration device determines whether the VID / PID of the module to be adapted exists in the module mapping table. If the VID / PID of the module to be adapted is in the module mapping table, it reads the preset VID / PID file of the module to be adapted from the memory. If the preset VID / PID file is the same as the VID / PID of the module to be adapted, it saves the VID / PID of the module to be adapted and sends an AT command to the initial AT port of the module to be adapted. If the preset VID / PID file is different from the VID / PID of the module to be adapted, the module configuration device copies the initial AT port of a similar module to the module to be adapted and sends an AT command to the initial AT port of the module to be adapted.
[0136] If the initial AT port returns a response, the module configuration device saves the module information and IMEI information from the response; otherwise, it scans all AT ports of the module to be adapted in parallel. Once the module configuration device detects the target AT port of the module to be adapted, it saves the target AT port and then initiates module dialing for the module to be adapted. The AT application interacts with the module to be adapted. These interactions include signal lookup and dialing.
[0137] It should be explained that, in this embodiment of the application, the status of the module can also be monitored by running the hotplug mechanism, and the VID / PID information of the module can be obtained to determine the target AT port of the module.
[0138] For example, such as Figure 9As shown: The terminal device runs a hotplug mechanism. When it detects that the second module has been added to the terminal device, it reads the VID / PID information of the second module to determine the target AT port of the second module. When it detects that the first module has been removed from the terminal device, it reads the VID / PID information of the second module, stops the module dialing process of the first module, and notifies the sending of AT commands.
[0139] The above solution brings at least the following beneficial effects: In this embodiment of the application, by monitoring the status of the modules in the module group in real time, when a newly added second module is detected, the module configuration device automatically executes the identification and configuration process of the corresponding second module.
[0140] As can be seen, the above mainly describes the technical solutions provided by the embodiments of this application from a methodological perspective. To achieve the above functions, it includes hardware structures and / or software modules corresponding to the execution of each function. Those skilled in the art should readily recognize that, in conjunction with the modules and algorithm steps of the various examples described in the embodiments disclosed herein, the embodiments of this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed in hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this invention.
[0141] This application also provides a computer-readable storage medium storing instructions. When a computer executes these instructions, the computer performs each step of the method flow shown in the above-described method embodiments.
[0142] like Figure 10 The diagram shown is a structural schematic of a module configuration device provided in an embodiment of this application. This module configuration device can be used to perform... Figure 3 , Figure 4 , Figure 5 , Figure 6 , Figure 7 , Figure 8 , Figure 9 The method for configuring the modules shown. Figure 10 The module configuration device 100 shown includes a communication unit 1001 and a processing unit 1002.
[0143] Communication unit 1001 is configured to send an AT command to the initial AT port of the module to be adapted; the AT command is used to request module information of the module to be adapted; communication unit 1001 is configured to send an AT command to at least one AT port of the module to be adapted other than the initial AT port if no response message is received from the module to be adapted through the initial AT port; communication unit 1001 is configured to instruct communication unit 1001 to receive the response message sent by the module to be adapted through the first AT port, and to obtain the module information of the module to be adapted from the response message, and to determine the first AT port as the target AT port of the module to be adapted; the first AT port is a port among at least one AT port.
[0144] Optionally, the processing unit 1002 is further configured to instruct the communication unit 1001 to send AT commands to at least one AT port in a preset manner if no response message is received from the module to be adapted via the initial AT within a first preset time period; the preset manner includes: parallel transmission mode or asynchronous IO mode.
[0145] Optionally, the communication unit 1001 is further configured to receive a module detection command; the module detection command is used to detect information about the module to be adapted; the processing unit 1002 is further configured to generate module detection information based on the module detection command; the module detection information is used to characterize the status of the module to be adapted; the processing unit 1002 is further configured to obtain the identifier of the module to be adapted from the module detection message; the identifier of the module to be adapted includes a supplier identifier (VID) and a product identifier (PID); the processing unit 1002 is further configured to determine the initial AT port of the module to be adapted based on the identifier of the module to be adapted.
[0146] Optionally, the processing unit 1002 is further configured to: obtain a module mapping table; the module mapping table includes the identifier of at least one module and the AT port corresponding to the identifier of at least one module; and determine the initial AT port of the module to be adapted based on the identifier of the module to be adapted and the module mapping table.
[0147] Optionally, the processing unit 1002 is also used to monitor the status of each module in the module group in the terminal device; the module group includes modules to be adapted; when the first module in the module group is removed, the module dialing process of the first module is stopped.
[0148] Optionally, the processing unit 1002 is further configured to: obtain the identifier of the second module when the second module is added to the module group; and determine the AT port of the second module based on the identifier of the second module.
[0149] This application also provides a chip, which includes a processor and a communication interface. The communication interface and the processor are coupled. The processor is used to run computer programs or instructions to implement the module configuration method in the above method embodiments.
[0150] Embodiments of this application provide a computer program product containing instructions that, when executed on a computer, cause the computer to perform the module configuration method in the above method embodiments.
[0151] The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), registers, hard disks, optical fibers, compact disc read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing, or any other form of computer-readable storage medium in the art. An exemplary storage medium is coupled to a processor, enabling the processor to read information from and write information to the storage medium. Of course, the storage medium may also be a component of the processor. The processor and the storage medium may reside in an application-specific integrated circuit (ASIC). In embodiments of the present invention, a computer-readable storage medium may be any tangible medium that contains or stores a program that may be used by or in conjunction with an instruction execution system, apparatus, or device.
[0152] Since the apparatus, device, computer-readable storage medium, and computer program product in the embodiments of the present invention can be applied to the above methods, the technical effects that can be obtained can also be referred to the above method embodiments. The embodiments of this application will not be repeated here.
[0153] The above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A module configuration method, characterized in that, The method includes: Send an AT command to the initial AT port of the module to be adapted; the AT command is used to request module information of the module to be adapted. If no response message is received from the module to be adapted through the initial AT port, the AT command is sent to at least one AT port of the module to be adapted, excluding the initial AT port. The system receives the response message sent by the module to be adapted through the first AT port, obtains the module information of the module to be adapted from the response message, and determines the first AT port as the target AT port of the module to be adapted; the first AT port is a port among the at least one AT port.
2. The method according to claim 1, characterized in that, If no response message is received from the module to be adapted through the initial AT port, the AT command is sent to at least one AT port of the module to be adapted, excluding the initial AT port, including: If the response message sent by the module to be adapted via the initial AT is not received within the first preset time period, the AT command is sent to the at least one AT port in a preset manner; the preset manner includes: parallel sending mode or asynchronous input / output IO mode.
3. The method according to claim 1, characterized in that, Before sending AT commands to the initial AT port of the module to be adapted, the method further includes: Receive module detection command; the module detection command is used to detect information of the module to be adapted; Based on the module detection command, module detection information is generated; the module detection information is used to characterize the state of the module to be adapted. The identifier of the module to be adapted is obtained from the module detection message; the identifier of the module to be adapted includes the supplier identifier (VID) and the product identifier (PID); Based on the identifier of the module to be adapted, the initial AT port of the module to be adapted is determined.
4. The method according to claim 3, characterized in that, The step of determining the initial AT port of the module to be adapted based on its identifier includes: Obtain the module mapping table; the module mapping table includes the identifier of at least one module and the AT port corresponding to the identifier of the at least one module; Based on the identifier of the module to be adapted and the module mapping table, the initial AT port of the module to be adapted is determined.
5. The method according to claim 1, characterized in that, The method further includes: The status of each module in the module group of the monitoring terminal device is monitored; the module group includes the module to be adapted. When the first module in the module group is removed, the module dialing process of the first module is stopped.
6. The method according to claim 5, characterized in that, The method further includes: When the second module is added to the module group, the identifier of the second module is obtained; The AT port of the second module is determined based on the identifier of the second module.
7. A module configuration device, characterized in that, The device includes: a communication unit and a processing unit; The communication unit is used to send AT commands to the initial AT port of the module to be adapted; the AT commands are used to request module information of the module to be adapted. The communication unit is configured to send the AT command to at least one AT port of the module to be adapted, other than the initial AT port, if no response message is received from the module to be adapted through the initial AT port. The communication unit is configured to instruct the communication unit to receive the response message sent by the module to be adapted through the first AT port, and to obtain the module information of the module to be adapted from the response message, and to determine the first AT port as the target AT port of the module to be adapted; the first AT port is a port among the at least one AT port.
8. A module configuration device, characterized in that, include: A processor and a memory; wherein the memory is used to store computer execution instructions, and when the module configuration device is running, the processor executes the computer execution instructions stored in the memory to cause the module configuration device to perform the module configuration method according to any one of claims 1-6.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes instructions that, when executed by the module configuration device, cause the computer to perform the module configuration method as described in any one of claims 1-6.
10. A computer program product, the computer program product comprising computer instructions, characterized in that, When executed by a processor, the computer instructions implement the module configuration method according to any one of claims 1-6.
Citation Information
Patent Citations
Module information determination method, terminal and storage medium
CN114070721A
5G communication device based on controller architecture
CN114520971A