Communication method and apparatus of 4g module, computer device and storage medium

By determining the device type and selecting appropriate processing logic and communication mode in the host device, the problem of poor data transmission rate of 4G module is solved, realizing effective management of 4G module and human-computer interaction device and improving data transmission rate.

CN116095879BActive Publication Date: 2025-12-12AMBULANC (SHENZHEN) TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211726194.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-30
Publication Date
2025-12-12
Estimated Expiration
2042-12-30

AI Technical Summary

Technical Problem

Existing host equipment cannot effectively manage the accessed 4G modules and other devices, and the data transmission rate of the 4G modules is poor.

Method used

By obtaining the data descriptor from the device connection request, the device type is determined, and different processing logic is selected according to the type to initialize the 4G module and the human-machine interaction device and perform data communication, including setting the CDC communication mode and obtaining the device descriptor, in order to improve the data transmission rate.

Benefits of technology

It enables effective control over 4G modules and human-computer interaction devices, and improves the data transmission rate of 4G modules.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116095879B_ABST
    Figure CN116095879B_ABST
Patent Text Reader

Abstract

The application discloses a communication method and device of a 4G module, computer equipment and a storage medium, and comprises the following steps: obtaining a device connection request, wherein the device connection request comprises a data descriptor; judging the device type of the current device based on the data descriptor; if the device type is a man-machine interaction device, initializing the communication mode of the current device, and using a first processing logic to perform data communication on the 4G module; if the device type is a 4G module, using a second processing logic to perform data communication on the 4G module. The technical scheme realizes the management and control of the 4G module and the man-machine interaction device, and at the same time, the communication mode of the current device is initialized to the mode most suitable for the data communication of the 4G module by initializing the communication mode of the current device, so that the data transmission rate of the 4G module is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of wireless communication, and particularly relates to a communication method and device of a 4G module, a computer device and a storage medium. BACKGROUND

[0002] With the popularization of the fourth generation mobile communication technology, corresponding 4G modules are increasingly used by various terminals or host devices.

[0003] However, in addition to accessing the 4G module, the existing host device usually accesses other devices, such as human-computer interaction devices (mouse and keyboard, etc.), but the existing host device cannot well manage the accessed 4G module and the accessed other devices at the same time, and the data transmission rate of the 4G module is poor when the 4G module accesses the host device for data transmission. SUMMARY

[0004] Embodiments of the present application provide a communication method and device of a 4G module, a computer device and a storage medium to solve the problem of poor data transmission rate of the existing 4G module.

[0005] A communication method of a 4G module, comprising:

[0006] obtaining a device connection request, wherein the device connection request comprises a data descriptor;

[0007] judging a device type of a current device based on the data descriptor;

[0008] if the device type is a human-computer interaction device, initializing a communication mode of the current device and adopting a first processing logic to perform data communication on the 4G module;

[0009] if the device type is a 4G module, adopting a second processing logic to perform data communication on the 4G module.

[0010] Further, the initializing the communication mode of the current device and the adopting the first processing logic to perform data communication on the 4G module comprises:

[0011] obtaining a target configuration parameter;

[0012] setting a current device mode as a CDC communication mode based on the target configuration parameter;

[0013] detecting an interface state of the human-computer interaction device based on the CDC communication mode;

[0014] if the interface configuration of the human-computer interaction device is successful, obtaining a device descriptor corresponding to the human-computer interaction device;

[0015] Based on the device descriptor corresponding to the human-computer interaction device, the 4G module is communicated with data.

[0016] Further, if the device type is a 4G module, a second processing logic is adopted to communicate with the 4G module with data, including:

[0017] Judging whether the 4G module is ready or not;

[0018] If the 4G module is not ready, the communication mode of the 4G module is initialized, and a first processing logic is adopted to communicate with the 4G module with data;

[0019] If the 4G module is ready, a device descriptor corresponding to the 4G module is acquired, and the 4G module is communicated with data based on the device descriptor corresponding to the 4G module.

[0020] Further, the device descriptor corresponding to the 4G module is acquired, and the 4G module is communicated with data based on the device descriptor corresponding to the 4G module, including:

[0021] The target interface and the target port corresponding to the 4G module are detected;

[0022] If the target interface is normal and the target port is normal, a string descriptor corresponding to the 4G module is acquired based on the target port;

[0023] The 4G module is communicated with data based on the string descriptor corresponding to the 4G module.

[0024] Further, the judgment of whether the 4G module is ready or not includes:

[0025] Judging whether the 4G module matches the target port or not;

[0026] If the 4G module matches the target port, judging whether the networking function of the 4G module is normal or not;

[0027] If the networking function of the 4G module is normal, a file uploading instruction is received;

[0028] Judging whether the target file in the file uploading instruction is complete or not;

[0029] If the target file is complete, it is judged that the 4G module is ready.

[0030] Further, the judgment of whether the 4G module matches the target port or not includes:

[0031] The target port of the 4G module is configured;

[0032] detecting a data transmission state of the target port;

[0033] if the target port is in the data transmission state, determining that the 4G module matches the target port;

[0034] if the target port is not in the data transmission state, determining that the 4G module does not match the target port.

[0035] Further, the communication method of the 4G module further comprises:

[0036] if the 4G module does not match the target port, or the networking function of the 4G module is abnormal, or the file upload instruction is not received, re-enumerating the 4G module, and re-determining whether the 4G module matches the target port.

[0037] A communication device of a 4G module comprises:

[0038] a request acquisition module configured to acquire a device connection request, the device connection request comprising a data descriptor;

[0039] a type determination module configured to determine a device type of a current device based on the data descriptor;

[0040] a first processing module configured to, when the device type is a human-computer interaction device, initialize a communication mode of the current device, and perform data communication with the 4G module using a first processing logic;

[0041] a second processing module configured to, when the device type is a 4G module, perform data communication with the 4G module using a second processing logic.

[0042] Further, the initialization of the communication mode of the current device and the data communication with the 4G module using the first processing logic comprises:

[0043] acquiring a target configuration parameter;

[0044] setting the current device mode to a CDC communication mode based on the target configuration parameter;

[0045] detecting an interface state of the human-computer interaction device based on the CDC communication mode;

[0046] if the interface configuration of the human-computer interaction device is successful, acquiring a device descriptor corresponding to the human-computer interaction device;

[0047] performing data communication with the 4G module based on the device descriptor corresponding to the human-computer interaction device.

[0048] Further, the second processing module comprises:

[0049] A preparation judging submodule is configured to judge whether the 4G module is prepared;

[0050] A first judging submodule is configured to initialize a communication mode of the 4G module and perform data communication with the 4G module by using a first processing logic when the 4G module is not prepared;

[0051] A second judging submodule is configured to acquire a device descriptor corresponding to the 4G module and perform data communication with the 4G module based on the device descriptor corresponding to the 4G module when the 4G module is prepared.

[0052] Further, the second judging submodule comprises:

[0053] A module detecting unit is configured to detect a target interface and a target port corresponding to the 4G module;

[0054] A descriptor acquiring unit is configured to acquire a character string descriptor corresponding to the 4G module based on the target port when the target interface is normal and the target port is normal;

[0055] A data communication unit is configured to perform data communication with the 4G module based on the character string descriptor corresponding to the 4G module.

[0056] Further, the preparation judging submodule comprises:

[0057] A port judging unit is configured to judge whether the 4G module matches a target port;

[0058] A networking judging unit is configured to judge whether a networking function of the 4G module is normal when the 4G module matches the target port;

[0059] An instruction receiving unit is configured to receive a file uploading instruction when the networking function of the 4G module is normal;

[0060] A file judging unit is configured to judge whether a target file in the file uploading instruction is complete;

[0061] A module judging unit is configured to judge that the 4G module is prepared when the target file is complete.

[0062] Further, the port judging unit comprises:

[0063] A port configuring subunit is configured to configure a target port of the 4G module;

[0064] A state detecting subunit is configured to detect a data transmission state of the target port;

[0065] The first state subunit is used for judging that the 4G module matches the target port when the target port is in the data transmission state.

[0066] The second state subunit is used for judging that the 4G module does not match the target port when the target port is not in the data transmission state.

[0067] Further, the communication device of the 4G module further comprises:

[0068] The re-judging module is used for re-enumerating the 4G module and re-judging whether the 4G module matches the target port when the 4G module does not match the target port, or the networking function of the 4G module is abnormal, or the file uploading instruction is not received.

[0069] A computer device comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the communication method of the 4G module when executing the computer program.

[0070] A computer readable storage medium stores a computer program, and the computer program is executable on a processor to implement the communication method of the 4G module.

[0071] The communication method, device, computer device and storage medium of the 4G module, the host device obtains a device connection request, the device connection request comprises a data descriptor, and the device type of the current device is judged based on the data descriptor. When the device type is a human-computer interaction device, the communication mode of the current device is initialized, and the first processing logic is used to perform data communication on the 4G module. When the device type is a 4G module, the second processing logic is used to perform data communication on the 4G module, so as to realize the management and control of the 4G module and the human-computer interaction device, and the communication mode of the current device is initialized to the mode most suitable for the data communication of the 4G module by initializing the communication mode of the current device, thereby improving the data transmission rate of the 4G module. BRIEF DESCRIPTION OF DRAWINGS

[0072] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the description of the embodiments of the present application. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can also be obtained by those skilled in the art without creative labor.

[0073] Figure 1 is an application environment schematic diagram of the communication method of the 4G module in an embodiment of the present application;

[0074] Figure 2 is a flow chart of a communication method of a 4G module in an embodiment of the present application;

[0075] Figure 3 is another flow chart of a communication method of a 4G module in an embodiment of the present application;

[0076] Figure 4 is another flow chart of a communication method of a 4G module in an embodiment of the present application;

[0077] Figure 5 is another flow chart of a communication method of a 4G module in an embodiment of the present application;

[0078] Figure 6 is another flow chart of a communication method of a 4G module in an embodiment of the present application;

[0079] Figure 7 is another flow chart of a communication method of a 4G module in an embodiment of the present application;

[0080] Figure 8 is a schematic diagram of a communication device of a 4G module in an embodiment of the present application;

[0081] Figure 9 is a schematic diagram of a computer device in an embodiment of the present application. DETAILED DESCRIPTION

[0082] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are some but not all of the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the scope of the present application.

[0083] The communication method of a 4G module provided by the embodiments of the present application can be applied in an application environment as shown in Figure 1 . Specifically, the communication method of a 4G module is applied in a communication system of a 4G module, and the communication system of a 4G module includes a host device and a slave device as shown in Figure 1 . The host device and the slave device communicate through a USB (Universal Serial Bus, commonly referred to as USB). The slave device includes but is not limited to a 4G module and a human-computer interaction device. Exemplarily, the human-computer interaction device includes but is not limited to a mouse and a keyboard. Exemplarily, the host device is provided with a plurality of USB interfaces, and the host device is connected with the slave device through the plurality of USB interfaces.

[0084] In an embodiment, as shown in Figure 2As shown, a communication method of a 4G module is provided, and the method is applied to Figure 1 a host device in the 4G module

[0085] S201: Obtain a device connection request, and the device connection request includes a data descriptor.

[0086] S202: Determine a device type of a current device based on the data descriptor.

[0087] S203: If the device type is a human-computer interaction device, initialize a communication mode of the current device, and use a first processing logic to perform data communication of the 4G module.

[0088] S204: If the device type is the 4G module, use a second processing logic to perform data communication of the 4G module.

[0089] The device connection request is a request of a slave device to connect to the host device. The data descriptor is data used to describe the device type of the slave device. The device type includes but is not limited to the 4G module and the human-computer interaction device.

[0090] As an example, in step S201, the host device obtains the device connection request, and performs preliminary analysis on the slave device according to the data descriptor in the device connection request, to determine whether the slave device needs to be connected, so as to facilitate the analysis and connection in the subsequent steps. Optionally, the request length of the device connection request can be set by the user, and the data descriptor in the device connection request can be used to determine the device type in the subsequent steps, which is not limited herein.

[0091] As an example, in step S202, after the host device obtains the device connection request, the device type of the current device can be determined according to the data descriptor in the device connection request. That is, whether the current device is the human-computer interaction device or the 4G module is determined, so as to control the human-computer interaction device and the 4G module, and facilitate the data transmission of the human-computer interaction device and the 4G module.

[0092] The human-computer interaction device includes but is not limited to a mouse and a keyboard. The communication mode is the communication mode of the slave device. The communication mode includes but is not limited to a CDC (Communication Device Class, abbreviated as CDC) mode, a HID mode, and a storage mode. The first processing logic is a processing logic for data communication of the 4G module when the device type is the human-computer interaction device.

[0093] As an example, in step S303, if the device type is a human-computer interaction device, the communication mode of the current device is initialized, and the first processing logic is used to perform data communication with the 4G module. In this embodiment, in some application scenarios, there is a data transmission requirement between the human-computer interaction module and the 4G module. When the host device determines that the current device is a human-computer interaction device, it initializes the communication mode of the current device. Preferably, the initialized communication mode is a CDC-type mode, and the first processing logic is used to perform data communication with the 4G module to meet the data transmission requirement between the human-computer interaction module and the 4G module. It can be understood that by using the CDC-type mode to perform data communication with the 4G module, the data transmission rate between the human-computer interaction module and the 4G module is improved based on an object-oriented structure, while also facilitating maintenance.

[0094] The first processing logic refers to the processing logic for data communication with the 4G module when the device type is a 4G module.

[0095] As an example, in step S304, if the device type is a 4G module, the second processing logic is used to perform data communication with the 4G module. In this embodiment, when the device type is a 4G module, the host device can directly use the second processing logic to perform data communication with the 4G module, thereby facilitating the host device's management of the 4G module and the human-machine interaction device.

[0096] In this embodiment, the host device acquires a device connection request, which includes a data descriptor. Based on the data descriptor, the host device determines the device type. If the device type is a human-computer interaction device, the host device initializes its communication mode and uses a first processing logic to perform data communication with the 4G module. If the device type is a 4G module, the host device uses a second processing logic to perform data communication with the 4G module. This enables control over both the 4G module and the human-computer interaction device. Simultaneously, by initializing the current device's communication mode, the host device optimizes the communication mode for data communication with the 4G module, thereby improving the data transmission rate of the 4G module.

[0097] In one embodiment, such as Figure 3 As shown, in step S203, which initializes the communication mode of the current device and uses the first processing logic to perform data communication with the 4G module, the following steps are included:

[0098] S301: Obtain target configuration parameters.

[0099] S302: Based on the target configuration parameters, set the current device mode to CDC communication mode.

[0100] S303: Based on CDC communication mode, detect the interface status of human-computer interaction devices.

[0101] S304: If the interface configuration of the human-computer interaction device is successful, a device descriptor corresponding to the human-computer interaction device is acquired.

[0102] S305: Data communication is performed on the 4G module based on the device descriptor corresponding to the human-computer interaction device.

[0103] The target configuration parameter is a parameter set by the user, and is used to configure the parameter of the CDC communication mode. The target configuration parameter includes a communication mode type and a device descriptor address. The communication mode type is the CDC communication mode. The device descriptor address is an address used to save the device descriptor.

[0104] As an example, in step S301, the host device acquires the target configuration parameter to initialize the current device based on the target configuration parameter.

[0105] As an example, in step S302, the host device sets the current device mode to the CDC communication mode according to the communication mode type in the target configuration parameter. Since the CDC mode is used to perform data communication on the 4G module, the data transmission rate of the data transmission between the human-computer interaction module and the 4G module is improved based on the object-oriented structure, and maintenance is facilitated.

[0106] As an example, in step S303, the interface state of the human-computer interaction device is detected based on the CDC communication mode. In this embodiment, the interface state of the human-computer interaction device is detected based on the CDC communication mode to determine whether the human-computer interaction device is normally connected.

[0107] As an example, in step S304, if the interface configuration of the human-computer interaction device is successful, a device descriptor corresponding to the human-computer interaction device is acquired. In this embodiment, if the interface configuration of the human-computer interaction device is successful, a device descriptor corresponding to the human-computer interaction device is acquired, and the device descriptor corresponding to the human-computer interaction device is saved based on the device descriptor address in the target configuration parameter.

[0108] Further, if the interface configuration of the human-computer interaction device is not successful, the device connection request is reacquired.

[0109] As an example, in step S305, data communication is performed on the 4G module based on the device descriptor corresponding to the human-computer interaction device. In this embodiment, the host device establishes communication between the human-computer interaction device and the 4G module based on the device descriptor corresponding to the human-computer interaction device, so as to realize data communication on the 4G module.

[0110] In the embodiment, the host device acquires the target configuration parameter, sets the current device mode to the CDC communication mode based on the target configuration parameter, detects the interface state of the human-computer interaction device based on the CDC communication mode, acquires the device descriptor corresponding to the human-computer interaction device when the interface configuration of the human-computer interaction device is successful, and finally establishes the communication between the human-computer interaction device and the 4G module based on the device descriptor corresponding to the human-computer interaction device, so as to realize the data communication of the 4G module.

[0111] In an embodiment, as shown in FIG. 4, in step S204, if the device type is the 4G module, the second processing logic is used to perform the data communication of the 4G module, including: Figure 4

[0112] S401: judging whether the 4G module is ready.

[0113] S402: if the 4G module is not ready, initializing the communication mode of the 4G module and using the first processing logic to perform the data communication of the 4G module.

[0114] S403: if the 4G module is ready, acquiring the device descriptor corresponding to the 4G module and performing the data communication of the 4G module based on the device descriptor corresponding to the 4G module.

[0115] As an example, in step S401, the host device judges whether the 4G module is ready, so as to perform the data communication of the 4G module according to whether the 4G module is ready in the subsequent steps.

[0116] As an example, in step S402, if the 4G module is not ready, the communication mode of the 4G module is initialized and the first processing logic is used to perform the data communication of the 4G module. For example, if the 4G module is not ready, the communication mode of the 4G module is set to the CDC communication mode and the target configuration parameter is acquired, so as to improve the data transmission rate of the data transmission between the human-computer interaction module and the 4G module based on the object-oriented structure, and facilitate maintenance. The communication mode of the 4G module is set to the CDC communication mode based on the target configuration parameter. The interface state of the 4G module is detected based on the CDC communication mode. If the interface configuration of the 4G module is successful, the device descriptor corresponding to the 4G module is acquired, and the device descriptor corresponding to the 4G module is used to facilitate the host device to establish the communication with the 4G module based on the device descriptor corresponding to the 4G module, so as to perform the data communication of the 4G module.

[0117] ​As an example, in step S403, if the 4G module is ready, the device descriptor corresponding to the 4G module is acquired, and data communication with the 4G module is performed based on the device descriptor corresponding to the 4G module. In this embodiment, if the 4G module is ready, the host device can directly acquire the device descriptor corresponding to the 4G module, and perform data communication with the 4G module based on the device descriptor corresponding to the 4G module.

[0118] In this embodiment, the host device judges whether the 4G module is ready. If the 4G module is not ready, the communication mode of the 4G module is initialized, and the first processing logic is used to perform data communication with the 4G module. If the 4G module is ready, the device descriptor corresponding to the 4G module is acquired, and data communication with the 4G module is performed based on the device descriptor corresponding to the 4G module. In this way, different processing manners are selected according to whether the 4G module is ready, communication with the 4G module is established, and data communication with the 4G module is implemented.

[0119] In an embodiment, as shown in FIG. 5, step S403, i.e., acquiring the device descriptor corresponding to the 4G module and performing data communication with the 4G module based on the device descriptor corresponding to the 4G module, includes the following steps. Figure 5

[0120] S501: The target interface and the target port corresponding to the 4G module are detected.

[0121] S502: If the target interface is normal and the target port is normal, the device descriptor corresponding to the 4G module is acquired based on the target port.

[0122] S503: Data communication with the 4G module is performed based on the device descriptor corresponding to the 4G module.

[0123] As an example, in step S501, the target interface and the target port corresponding to the 4G module are detected to detect whether the target interface and the target port corresponding to the 4G module are normal.

[0124] As an example, in step S502, if the target interface is normal and the target port is normal, the device descriptor corresponding to the 4G module is acquired based on the target port. If there is an abnormality in the target interface and / or the target port, the target interface and the target port corresponding to the 4G module are detected again. In this embodiment, if the target interface is normal and the target port is normal, the device descriptor corresponding to the 4G module is acquired based on the target port, so that the 4G module can be normally connected in the subsequent steps, and the reliability of data communication of the 4G module is improved.

[0125] ​As an example, in step S503, data communication is performed with the 4G module based on the device descriptor corresponding to the 4G module. In this embodiment, the host device establishes communication with the 4G module based on the device descriptor corresponding to the 4G module, thereby enabling data communication with the 4G module.

[0126] In this embodiment, the host device detects the target interface and target port corresponding to the 4G module. When both the target interface and target port are normal, the host device obtains the device descriptor corresponding to the 4G module based on the target port. This ensures that the 4G module can connect normally in subsequent steps, improves the reliability of data communication by the 4G module, and enables the host device to establish communication with the 4G module based on the device descriptor corresponding to the 4G module, thereby enabling data communication with the 4G module.

[0127] In one embodiment, such as Figure 6 As shown, step S401, which determines whether the 4G module is ready, includes:

[0128] S601: Determine if the 4G module matches the target port.

[0129] S602: If the 4G module matches the target port, determine whether the 4G module's network connectivity function is normal.

[0130] S603: If the 4G module's network connectivity is normal, then receive file upload commands.

[0131] S604: Determine whether the target file in the file upload command is complete.

[0132] S605: If the target file is complete, then the 4G module is ready.

[0133] As an example, in step S601, the host device determines whether the 4G module matches the target port in order to determine whether the 4G module is ready in subsequent steps.

[0134] As an example, in step S602, if the 4G module matches the target port, it is determined whether the 4G module's network connectivity function is normal to ensure that the 4G module's network connectivity function can be used normally. Optionally, if the 4G module does not match the target port, the 4G module and the target port are reconfigured.

[0135] As an example, in step S603, if the 4G module's network connectivity is normal, a file upload command is received. This file upload command refers to the command to upload the target file. When the 4G module's network connectivity is normal, the host device receives the file upload command output by the 4G module to determine whether the target file is complete in subsequent steps. The target file includes a device descriptor.

[0136] As an example, in step S604, the host device judges whether the target file in the file uploading instruction is complete, so as to ensure that the device descriptor in the target file is complete, thereby ensuring the reliability in the process of establishing communication with the 4G module.

[0137] As an example, in step S605, if the target file is complete, it is judged that the 4G module is ready, so that step S403 can be performed, i.e. obtaining the device descriptor corresponding to the 4G module, and performing data communication with the 4G module based on the device descriptor corresponding to the 4G module.

[0138] In this embodiment, the host device judges whether the 4G module matches the target port, and when the 4G module matches the target port, judges whether the networking function of the 4G module is normal, and when the networking function of the 4G module is normal, receives the file uploading instruction. It is judged whether the target file in the file uploading instruction is complete, and when the target file is complete, it is judged that the 4G module is ready, so as to ensure that the device descriptor in the target file is complete, thereby ensuring the reliability in the process of establishing communication with the 4G module.

[0139] In an embodiment, as shown in FIG. 7, Figure 7

[0140] S701: configuring the target port of the 4G module.

[0141] S702: detecting the data transmission state of the target port.

[0142] S703: if the target port is in the data transmission state, judging that the 4G module matches the target port.

[0143] S704: if the target port is not in the data transmission state, judging that the 4G module does not match the target port.

[0144] As an example, in step S701, the host device first configures the target port of the 4G module to judge whether the 4G module matches the target port in the subsequent steps.

[0145] As an example, in step S702, after the host device configures the target port of the 4G module, the data transmission state of the target port is detected to judge whether the 4G module matches the target port. The data transmission state refers to the state of whether the target port is transmitting data. Illustratively, the transmitted data can be a self-checking instruction, such as a self-checking instruction for detecting signal strength or starting the networking function.

[0146] ​As an example, in step S703, if the target port is in a data transmission state, it is determined that the 4G module matches the target port, which means that the target port is transmitting data, and it is determined that the 4G module matches the target port.

[0147] As an example, in step S703, if the target port is not in a data transmission state, it is determined that the target port is not transmitting data, and it is determined that the 4G module does not match the target port.

[0148] In this embodiment, the master device configures the target port of the 4G module and detects the data transmission state of the target port. When the target port is in a data transmission state, it is determined that the 4G module matches the target port. When the target port is not in a data transmission state, it is determined that the 4G module does not match the target port, thereby realizing the determination of whether the 4G module matches the target port.

[0149] In an embodiment, the communication method of the 4G module further includes: if the 4G module does not match the target port, or the networking function of the 4G module is abnormal, or a file upload instruction is not received, re-enumerating the 4G module and re-determining whether the 4G module matches the target port.

[0150] In this embodiment, if the 4G module does not match the target port, or the networking function of the 4G module is abnormal, or a file upload instruction is not received, the 4G module is re-enumerated and it is re-determined whether the 4G module matches the target port, so as to ensure normal transmission of the 4G module.

[0151] It should be understood that the size of the serial number of each step in the above embodiment does not mean the order of execution, and the execution order of each process should be determined according to its function and inherent logic, and should not constitute any limitation on the implementation process of the embodiment of the present application.

[0152] In an embodiment, a 4G module communication device is provided, which corresponds to the 4G module communication method in the above embodiment. As shown in the figure, the 4G module communication device includes a request acquisition module 801, a type determination module 802, a first processing module 803, and a second processing module 804. The functions of each module are described in detail as follows: Figure 8

[0153] The request acquisition module 801 is configured to acquire a device connection request, and the device connection request includes a data descriptor.

[0154] The type determination module 802 is configured to determine the device type of the current device based on the data descriptor.

[0155] ​The first processing module 803 is configured to initialize the communication mode of the current device when the device type is the human-computer interaction device, and perform data communication with the 4G module by using the first processing logic.

[0156] The second processing module 804 is configured to perform data communication with the 4G module by using the second processing logic when the device type is the 4G module.

[0157] Further, the initialization of the communication mode of the current device and the data communication with the 4G module by using the first processing logic include:

[0158] Obtaining a target configuration parameter;

[0159] Setting the current device mode to the CDC communication mode based on the target configuration parameter,

[0160] Detecting the interface state of the human-computer interaction device based on the CDC communication mode;

[0161] If the interface configuration of the human-computer interaction device is successful, obtaining a device descriptor corresponding to the human-computer interaction device;

[0162] Performing data communication with the 4G module based on the device descriptor corresponding to the human-computer interaction device.

[0163] Further, the second processing module 804 includes:

[0164] A preparation judgment submodule is configured to judge whether the 4G module is prepared;

[0165] A first judgment submodule is configured to initialize the communication mode of the 4G module and perform data communication with the 4G module by using the first processing logic when the 4G module is not prepared;

[0166] A second judgment submodule is configured to obtain a device descriptor corresponding to the 4G module and perform data communication with the 4G module based on the device descriptor corresponding to the 4G module when the 4G module is prepared.

[0167] Further, the second judgment submodule includes:

[0168] A module detection unit is configured to detect a target interface and a target port corresponding to the 4G module;

[0169] A descriptor obtaining unit is configured to obtain a character string descriptor corresponding to the 4G module based on the target port when the target interface is normal and the target port is normal;

[0170] A data communication unit is configured to perform data communication with the 4G module based on the character string descriptor corresponding to the 4G module.

[0171] Further, the preparation judgment submodule includes:

[0172] a port judging unit, configured to judge whether the 4G module matches the target port;

[0173] a networking judging unit, configured to judge whether the networking function of the 4G module is normal when the 4G module matches the target port;

[0174] an instruction receiving unit, configured to receive a file uploading instruction when the networking function of the 4G module is normal;

[0175] a file judging unit, configured to judge whether a target file in the file uploading instruction is complete;

[0176] a module judging unit, configured to judge that the 4G module is ready when the target file is complete.

[0177] Further, the port judging unit comprises:

[0178] a port configuring sub-unit, configured to configure the target port of the 4G module;

[0179] a state detecting sub-unit, configured to detect a data transmission state of the target port;

[0180] a first state sub-unit, configured to judge that the 4G module matches the target port when the target port is in the data transmission state;

[0181] a second state sub-unit, configured to judge that the 4G module does not match the target port when the target port is not in the data transmission state.

[0182] Further, the communication device of the 4G module further comprises:

[0183] a re-judging module, configured to re-enumerate the 4G module and re-judge whether the 4G module matches the target port when the 4G module does not match the target port, or the networking function of the 4G module is abnormal, or the file uploading instruction is not received.

[0184] The specific limitation of the communication device of the 4G module can refer to the limitation of the communication method of the 4G module in the above, which will not be repeated here. Each module in the above communication device of the 4G module can be realized by software, hardware and combination thereof in whole or in part. The above each module can be embedded in or independent of the processor in the computer device in hardware form, or can be stored in the memory in the computer device in software form, so as to call and execute the operation corresponding to each module by the processor.

[0185] In one embodiment, a computer device, which can be a server, is provided, and an internal structure diagram of the computer device can be as shown in Figure 9As shown. The computer device includes a processor, a memory, a network interface and a database connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium, an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data in the communication process of the 4G module. The network interface of the computer device is used to communicate with the external terminal through the network connection. The computer program is executed by the processor to realize a communication method of the 4G module.

[0186] In one embodiment, a computer device is provided, including a memory, a processor and a computer program stored on the memory and executable on the processor, and the processor executes the computer program to realize the communication method of the 4G module in the above-mentioned embodiments, which will not be repeated here. Alternatively, the processor executes the computer program to realize the functions of the modules / units in the communication device of the 4G module in this embodiment, which will not be repeated here.

[0187] 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 the processor to realize the communication method of the 4G module in the above-mentioned embodiments, which will not be repeated here. Alternatively, the computer program is executed by the processor to realize the functions of the modules / units in the communication device of the 4G module in this embodiment, which will not be repeated here.

[0188] 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 executed, can include the processes of the above-mentioned embodiment methods. Any reference to memory, storage, database or other medium used in the embodiments provided by the present application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration but not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0189] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the above-mentioned division of functional units and modules is exemplified. In actual application, the above-mentioned functions can be completed by different functional units and modules according to needs, that is, the internal structure of the device is divided into different functional units or modules to complete all or part of the above-described functions.

[0190] The above-mentioned embodiments are only used to illustrate the technical solutions of the present application, but not to limit it. Although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that they can modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement for part of the technical features. Such modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application.

Claims

1. A communication method of a 4G module, characterized by, The method comprises the following steps: acquiring a device connection request, wherein the device connection request comprises a data descriptor; judging a device type of a current device based on the data descriptor; if the device type is a human-computer interaction device, initializing a communication mode of the current device, and performing data communication on a 4G module by using a first processing logic; if the device type is the 4G module, performing data communication on the 4G module by using a second processing logic; the step of initializing the communication mode of the current device and performing data communication on the 4G module by using the first processing logic comprises the following steps: acquiring a target configuration parameter; setting the current device mode as a CDC communication mode based on the target configuration parameter; detecting an interface state of the human-computer interaction device based on the CDC communication mode; if the interface configuration of the human-computer interaction device is successful, acquiring a device descriptor corresponding to the human-computer interaction device; performing data communication on the 4G module based on the device descriptor corresponding to the human-computer interaction device.

2. The communication method of the 4G module according to claim 1, wherein, the step of performing data communication on the 4G module by using the second processing logic comprises the following steps: judging whether the 4G module is ready; if the 4G module is not ready, initializing a communication mode of the 4G module, and performing data communication on the 4G module by using the first processing logic; if the 4G module is ready, acquiring a device descriptor corresponding to the 4G module, and performing data communication on the 4G module based on the device descriptor corresponding to the 4G module.

3. The communication method of the 4G module according to claim 2, wherein, the step of acquiring the device descriptor corresponding to the 4G module and performing data communication on the 4G module based on the device descriptor corresponding to the 4G module comprises the following steps: detecting a target interface and a target port corresponding to the 4G module; if the target interface is normal and the target port is normal, acquiring a string descriptor corresponding to the 4G module based on the target port; performing data communication on the 4G module based on the string descriptor corresponding to the 4G module.

4. The communication method of the 4G module according to claim 2, wherein, the step of judging whether the 4G module is ready comprises the following steps: judging whether the 4G module matches a target port; if the 4G module matches the target port, judging whether a networking function of the 4G module is normal; if the networking function of the 4G module is normal, receiving a file upload instruction; judging whether a target file in the file upload instruction is complete; if the target file is complete, judging that the 4G module is ready.

5. The communication method of the 4G module according to claim 4, wherein, the step of judging whether the 4G module matches the target port comprises the following steps: configuring a target port of the 4G module; detecting a data transmission state of the target port; if the target port is in the data transmission state, judging that the 4G module matches the target port; if the target port is not in the data transmission state, judging that the 4G module does not match the target port.

6. The communication method of the 4G module according to claim 5, wherein, the communication method of the 4G module further comprises the following steps: If the 4G module does not match the target port, or the networking function of the 4G module is abnormal, or the file upload instruction is not received, the 4G module is re-enumerated, and it is re-judged whether the 4G module matches the target port.

7. A communication device of a 4G module, characterized in that, Comprise: Request acquisition module, for acquiring device connection request, the device connection request includes data descriptor; Type judgment module, for judging the device type of the current device based on the data descriptor; The first processing module is used for initializing the communication mode of the current device when the device type is a man-machine interaction device, and using a first processing logic to perform data communication on the 4G module; The second processing module is used for using a second processing logic to perform data communication on the 4G module when the device type is a 4G module; The first processing module is also used for acquiring target configuration parameters; based on the target configuration parameters, setting the current device mode to the CDC communication mode; Based on the CDC communication mode, detecting the interface state of the man-machine interaction device; If the interface configuration of the man-machine interaction device is successful, the device descriptor corresponding to the man-machine interaction device is acquired; based on the device descriptor corresponding to the man-machine interaction device, data communication is performed on the 4G module.

8. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, The processor executes the computer program to realize the communication method of the 4G module as claimed in any one of claims 1 to 6.

9. A computer-readable storage medium storing a computer program, the computer program comprising instructions that, when executed by a computer, cause the computer to perform the method of any one of claims 1 to 8. The computer program is executed by the processor to realize the communication method of the 4G module as claimed in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Combinable distributed control system and realization method thereof

    CN109960225A

  • Communication system and communication method compatible with multiple communication protocols

    CN111343196A