Module communication method and apparatus, and electronic device and storage medium

Through serialization of communication modules and serial port protocol encoding and decoding design, combined with RPC protocol, the problems of low efficiency and poor stability of AT instruction are solved, and efficient and stable module communication is achieved.

WO2025140742A1PCT designated stage expired Publication Date: 2025-07-03E SURFING IOT CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2025/078213
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-12-28
Filing Date
2025-02-20
Publication Date
2025-07-03

AI Technical Summary

Technical Problem

The existing communication module uses AT instructions to transmit and receive data with low efficiency, poor stability, and lacks data integrity verification.

Method used

Serialization and serial port protocol encoding and decoding technology are used to binary code calling instructions, and the module function is encapsulated using RPC protocol to achieve efficient transmission of function calls and responses.

Benefits of technology

Improve data communication efficiency and increase communication stability and speed.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025078213_03072025_PF_FP_ABST
    Figure CN2025078213_03072025_PF_FP_ABST
Patent Text Reader

Abstract

Disclosed in the present invention are a module communication method and apparatus, and an electronic device and a storage medium. The method comprises: acquiring a call instruction of a first module for an objective function; performing serialization on the call instruction, so as to obtain binary encoded data; performing serial protocol encoding on the binary encoded data, so as to obtain serial encoded data; sending the serial encoded data to a second module; performing serial protocol decoding on the serial encoded data, so as to obtain the binary encoded data; performing deserialization on the binary encoded data, and performing parsing to obtain an execution instruction for executing the objective function; on the basis of the execution instruction, executing an AT instruction corresponding to the objective function; and on the basis of an execution result of the AT instruction, obtaining an execution result returned to the first module by the second module. On the basis of a serialized binary data design and a serial encoding and decoding design, the embodiments of the present invention can improve the efficiency of data communication, increase the communication speed and enhance the communication stability, and thus can be widely applied to the technical field of data processing.
Need to check novelty before this filing date? Find Prior Art

Description

Module communication method, device, electronic device and storage medium Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to a module communication method, device, electronic device and storage medium. Background Art

[0002] Communication modules are key components for transmitting data between devices. They can include a variety of technologies and protocols for wireless or wired communication. Communication modules play a vital role in modern technology, enabling devices to connect, exchange information, and function in a wide range of applications. Features of communication modules include high scalability, supporting different types of data transmission, such as voice, image, and text. They can also operate in different frequency bands and ranges, adapting to diverse communication needs. Communication modules typically feature optimized power management to ensure long-term availability and can accommodate battery-powered devices. In the Internet of Things (IoT) and smart device sectors, communication modules are becoming increasingly important as they enable devices to connect and communicate with cloud services. This offers unlimited potential for smart cities, smart homes, remote monitoring, and other applications. Common communication modules include Wi-Fi modules, NB modules, LTE-CAT1 modules, and 5G modules. These modules provide management and data communication functions to end devices via serial or USB interfaces. For low-speed modules (Wi-Fi and NB modules), both management and data are handled using serial port protocols, with AT commands used for module configuration and data transmission and reception. AT commands are simple to use and easy to configure and manage modules. However, using AT commands for data transmission and reception is inefficient, unstable, and lacks data integrity verification. Summary of the Invention

[0003] The present invention aims to solve at least one of the technical problems in the related art to a certain extent. To this end, the present invention provides a module communication method, device, electronic device and storage medium, which can effectively perform module communication.

[0004] In one aspect, an embodiment of the present invention provides a module communication method, comprising:

[0005] Obtaining a call instruction of the first module to the target function;

[0006] Serialize the call instruction to obtain binary encoded data;

[0007] Performing serial port protocol encoding on the binary coded data to obtain serial port coded data; and sending the serial port coded data to the second module;

[0008] Perform serial port protocol decoding on the serial port encoded data to obtain binary encoded data;

[0009] Deserialize the binary coded data and parse it to obtain the execution instructions for executing the target function;

[0010] Based on the execution instruction, execute the AT instruction corresponding to the target function;

[0011] Based on the result of executing the AT command, the second module obtains the execution result returned to the first module.

[0012] Optionally, the call instruction is serialized to obtain binary encoded data, including:

[0013] Determine the AT command corresponding to the target function according to the calling instruction;

[0014] The function ID and function type in the binary data format corresponding to the AT command are obtained through serialization of the preset function mapping table;

[0015] Binary coded data is obtained based on the function ID and function type.

[0016] Optionally, deserialize the binary encoded data to obtain the calling instructions of the target function, including:

[0017] Obtain the function ID and function type in binary data format from the binary-encoded data;

[0018] Deserialize the preset function mapping table to obtain the AT command corresponding to the function ID and function type;

[0019] Use the AT command as the execution object of the target function to trigger the execution command.

[0020] Optionally, before obtaining the execution result returned by the second module to the first module, the method further includes:

[0021] The second module serializes the execution result based on a preset response result mapping table to obtain first encoded data;

[0022] The first coded data is encoded according to the serial port protocol to obtain second coded data.

[0023] Optionally, obtaining the execution result returned by the second module to the first module includes:

[0024] Performing serial port protocol decoding on the second encoded data through the first module to obtain the first encoded data;

[0025] The first encoded data is deserialized based on the response result mapping table and parsed to obtain an execution result.

[0026] Optionally, before obtaining the execution result returned by the second module to the first module, the method further includes:

[0027] Executing the event notification function through the second module;

[0028] Serializing the event notification function based on a preset function mapping table to obtain third encoded data;

[0029] Performing serial port protocol encoding on the third encoded data to obtain fourth encoded data;

[0030] Sending the fourth encoded data to the first module, so that the first module executes a callback function according to the fourth encoded data;

[0031] The first module obtains the returned execution result from the second module through the callback function.

[0032] In another aspect, an embodiment of the present invention provides a module communication device, comprising:

[0033] The first module is used to obtain a call instruction of the first module to the target function;

[0034] The second module is used to serialize the call instruction to obtain binary encoded data;

[0035] The third module is used to perform serial port protocol encoding on the binary coded data to obtain serial port coded data; and send the serial port coded data to the second module;

[0036] The fourth module is used to perform serial port protocol decoding on the serial port encoded data to obtain binary encoded data;

[0037] The fifth module is used to deserialize the binary coded data and parse it to obtain the execution instructions for executing the target function;

[0038] The sixth module is used to execute the AT instruction corresponding to the target function based on the execution instruction;

[0039] The seventh module is configured to obtain an execution result returned by the second module to the first module based on the result of executing the AT command.

[0040] Optionally, before the step of obtaining the execution result returned by the second module to the first module in the seventh module, the apparatus further includes:

[0041] An eighth module is configured to serialize the execution result based on a preset response result mapping table by the second module to obtain first encoded data;

[0042] The ninth module is used to perform serial port protocol encoding on the first coded data to obtain second coded data.

[0043] Optionally, before the step of obtaining the execution result returned by the second module to the first module in the seventh module, the apparatus further includes:

[0044] A tenth module, configured to execute an event notification function through the second module;

[0045] An eleventh module is configured to serialize the event notification function based on a preset function mapping table to obtain third encoded data;

[0046] A twelfth module is used to perform serial port protocol encoding on the third encoded data to obtain fourth encoded data;

[0047] The thirteenth module is configured to send the fourth coded data to the first module, so that the first module executes the callback function according to the fourth coded data; wherein the first module obtains the execution result returned from the second module through the callback function.

[0048] On the other hand, an embodiment of the present invention provides an electronic device, including: a processor and a memory; the memory is used to store programs; the processor executes the program to implement the above-mentioned module communication method.

[0049] On the other hand, an embodiment of the present invention provides a computer storage medium storing a program executable by a processor. The program executable by the processor is used to implement the above-mentioned module communication method when executed by the processor.

[0050] The embodiment of the present invention obtains a call instruction for a target function from a first module; serializes the call instruction to obtain binary-coded data; performs serial port protocol encoding on the binary-coded data to obtain serial port encoded data; and sends the serial port encoded data to a second module; performs serial port protocol decoding on the serial port encoded data to obtain binary-coded data; deserializes the binary-coded data and parses it to obtain an execution instruction for executing the target function; executes an AT instruction corresponding to the target function based on the execution instruction; and obtains an execution result returned by the second module to the first module based on the result of the AT instruction execution. Based on the serialized binary data design and the serial port encoding and decoding design, the embodiment of the present invention can improve the efficiency of data communication, increase communication speed, and increase communication stability. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] The accompanying drawings are used to provide a further understanding of the technical solution of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the technical solution of the present invention and do not constitute a limitation to the technical solution of the present invention.

[0052] FIG1 is a schematic diagram of an implementation environment for module communication provided by an embodiment of the present invention;

[0053] FIG2 is a schematic flow chart of a module communication method provided in an embodiment of the present invention;

[0054] FIG3 is a schematic diagram of an existing module communication method provided by an embodiment of the present invention;

[0055] FIG4 is a schematic diagram of an AT command communication module provided in an embodiment of the present invention;

[0056] FIG5 is a schematic diagram of a business process of module AT command interaction provided by an embodiment of the present invention;

[0057] FIG6 is a schematic diagram of an integrated RPC terminal and module provided in an embodiment of the present invention;

[0058] FIG7 is a schematic diagram of an RPC module design architecture provided by an embodiment of the present invention;

[0059] FIG8 is a schematic diagram showing the principle of a serial port data packet sending interval according to an embodiment of the present invention;

[0060] FIG9 is a schematic diagram of a flow chart of an RPC function execution according to an embodiment of the present invention;

[0061] FIG10 is a schematic structural diagram of a module communication device provided in an embodiment of the present invention;

[0062] FIG11 is a schematic structural diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0063] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0064] It should be noted that although the system diagrams illustrate functional module divisions and the flowcharts illustrate a logical sequence, in certain circumstances, the steps shown or described may be performed in a sequence that differs from the module divisions in the system or the sequence in the flowcharts. The terms "first / S100," "second / S200," and the like in the specification, claims, and drawings are used to distinguish similar objects and are not necessarily intended to describe a specific sequence or precedence.

[0065] References herein to "embodiments" mean that a particular feature, structure, or characteristic described in connection with the embodiments may be included in at least one embodiment of the present invention. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor does it constitute a separate or alternative embodiment that is mutually exclusive of other embodiments. It is understood, both explicitly and implicitly, by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0066] It should be noted that, in order to facilitate the understanding of the technical solution of the present invention, the technical professional terms that may appear in the embodiments of the present invention are first explained:

[0067] RPC: Remote Process Call.

[0068] A UART (Universal Asynchronous Receiver / Transmitter) is an asynchronous receiver / transmitter (ART), a component of computer hardware that transmits data via serial communication. It performs parallel-to-serial data conversion on the transmitter side and serial-to-parallel data conversion on the receiver side. It is versatile because parameters such as transmission speed and data rate are configurable. UARTs are often used in conjunction with other communication interfaces, such as EIA RS-232. The "A" in UART stands for asynchronous, meaning there is no clock signal to synchronize or verify data sent from the transmitter and received by the receiver (asynchronous serial communication). This is in contrast to synchronous serial communication, which uses a shared clock signal between the transmitter and receiver to synchronize data between them. In a UART, the transmitter and receiver must agree on timing parameters in advance. Furthermore, UARTs use special bits at the beginning and end of each data word to synchronize the transmitter and receiver.

[0069] Serial port: A data communication protocol, generally used for data communication between terminals and other chips or modules.

[0070] MCU: Microcontroller Unit, also known as Single Chip Microcomputer or SCM, is a chip-level computer that reduces the frequency and specifications of the Central Processing Unit (CPU) and integrates memory, timers, USB, A / D converters, UART, PLC, DMA and other peripheral interfaces, and even LCD driver circuits on a single chip, forming a chip-level computer that can provide different control combinations for different applications.

[0071] Serialization: Convert structured data into binary data in a continuous space.

[0072] Deserialization: Convert continuous binary data into a structured data, generally a bit structure, etc.

[0073] CEREG: Regarding the registration information of the EPS network (EPS is a concept that emerged in the 4th generation mobile communications by the 3GPP standards committee), it can be simply understood as when a 4G network uses a CAT1 or NB module to query the network registration status, the instruction query is performed based on whether the actual module is a 4G network or a 2G network.

[0074] As shown in Figure 1, it is a schematic diagram of an implementation environment provided by an embodiment of the present invention. Referring to Figure 1, the implementation environment includes at least a first module and a second module. It should be noted that the first module and the second module in the embodiment of the present invention are not limited to specific modules. For example, as shown in Figure 1, the first module can be an MCU (single-chip microcomputer) and the second module can be a module chip; specifically, the MCU and the module communicate and interact with each other through RPC binary data based on a serial port (UART).

[0075] For example, based on the implementation environment shown in FIG1 , an embodiment of the present invention provides a module communication method. Referring to FIG2 , FIG2 is a flow chart of the module communication method applied to a server provided by an embodiment of the present invention. Referring to FIG2 , the method includes the following steps:

[0076] S100, obtaining a call instruction of a first module to a target function;

[0077] For example, in some specific embodiments, the embodiments of the present invention encapsulate module functions and use the module functions through function calls.

[0078] S200, serialize the call instruction to obtain binary coded data;

[0079] It should be noted that, in some embodiments, step S200 is executed by the first module, and step S200 may include: determining the AT instruction corresponding to the target function according to the calling instruction; obtaining the function ID and function type in the binary data format corresponding to the AT instruction through serialization of a preset function mapping table; and obtaining binary encoded data based on the function ID and function type.

[0080] For example, in some specific embodiments, by serializing functions and parameters into binary-encoded data, specifically, the present invention uses the RPC concept to encapsulate binary data. In order to be compatible with the operation mode of AT instructions, the present invention designs a set of binary instruction tables for defining the functions and operation modes of the module.

[0081] Among them, the following is a mapping table of common 3GPP AT commands and serial port RPC functions, as shown in Table 1 below:

[0082] Table 1

[0083]

[0084] The following is a description of the binary data format, where [] represents optional parameters. For example, the binary data format of an RPC function request is: function ID (1 Byte) + function type (1 Byte) [+ parameter list (nBytes)].

[0085] S300, performing serial port protocol encoding on the binary coded data to obtain serial port coded data; and sending the serial port coded data to the second module;

[0086] For example, in some specific embodiments, step S300 is performed by the first module, wherein serialization / deserialization: serializing functions and parameters into binary coded data / deserializing binary coded data into function and parameter lists.

[0087] S400, performing serial port protocol decoding on the serial port encoded data to obtain binary encoded data;

[0088] Exemplarily, in some specific embodiments, step S400 is performed by the second module, wherein serialization / deserialization: serializing functions and parameters into binary coded data / deserializing binary coded data into function and parameter lists.

[0089] S500, deserialize the binary coded data and parse it to obtain an execution instruction for executing the target function;

[0090] Among them, in some embodiments, executing step S500 by the second module to deserialize the binary-coded data and obtain the calling instruction of the target function may include: obtaining the function ID and function type in binary data format from the binary-coded data; deserializing through a preset function mapping table to obtain the AT instruction corresponding to the function ID and function type; and using the AT instruction as the execution object of the target function to trigger the execution instruction.

[0091] For example, in some specific embodiments, an RPC function synchronously responds and returns a response result and data (if any). The following is a description of the binary data format, where [] denotes optional parameters. For example, the binary data format of an RPC function synchronous response data is: function ID (1 Byte) + response result (1 Byte) [+ data (n Bytes)].

[0092] S600: Execute the AT command corresponding to the target function based on the execution instruction;

[0093] In some embodiments, step S600 is performed by a second module.

[0094] S700 : Based on the result of executing the AT command, obtain the execution result returned by the second module to the first module.

[0095] It should be noted that in some embodiments, before obtaining the execution result returned by the second module to the first module, the method may further include: serializing the execution result based on a preset response result mapping table by the second module to obtain first encoded data; and performing serial port protocol encoding on the first encoded data to obtain second encoded data. The serialization based on the response result mapping table is similar in principle to the serialization using the function mapping table described above and will not be further described. The first encoded data is also in binary format.

[0096] In some embodiments, obtaining the execution result returned by the second module to the first module may include: decoding the second encoded data through the serial port protocol by the first module to obtain the first encoded data; and deserializing the first encoded data based on the response result mapping table to parse and obtain the execution result. The deserialization based on the response result mapping table is similar to the principle of deserialization using the function mapping table described above and will not be further described.

[0097] It should be noted that in some embodiments, before obtaining the execution result returned by the second module to the first module, the method further includes: executing an event notification function via the second module; serializing the event notification function based on a preset function mapping table to obtain third encoded data; performing serial port protocol encoding on the third encoded data to obtain fourth encoded data; and sending the fourth encoded data to the first module so that the first module executes a callback function based on the fourth encoded data; wherein the first module obtains the returned execution result from the second module via the callback function. Serializing the event notification function based on the preset function mapping table is similar to the principle of serializing the call instruction using the function mapping table, and will not be further described. The third encoded data is also in binary format.

[0098] For example, in some specific embodiments, an event notification will return an event ID and data (if any). The following is a description of the binary data format, where [] indicates optional parameters. The binary data format of event notification data is: event ID (1 Byte) [+ event data (n Bytes)].

[0099] In order to explain the principle of the technical solution of the present invention in detail, the overall process of the present invention is described below in combination with some specific embodiments. It is easy to understand that the following is an explanation of the technical principle of the present invention and cannot be regarded as a limitation of the present invention.

[0100] First of all, it should be noted that, as shown in FIG3 and FIG4 , existing module communications use a UART interface or a USB interface for management and communication, wherein the UART interface uses AT commands (the data format is a string format).

[0101] UART: used for module parameter configuration and low-speed data communication, using AT commands to transmit string data.

[0102] USB: Transfers binary data via a dial-up protocol.

[0103] MCU side: Integrates the AT client to encapsulate module configuration and communication commands into AT and parse response data.

[0104] Module side: Integrates the AT server to parse commands, encapsulate response data, and execute event notifications.

[0105] Existing modules use AT commands for configuration and management. As shown in Tables 2 and 3 below, AT commands define data in string format and define basic data manipulation methods and parameter formats.

[0106] Table 2

[0107]

[0108]

[0109] Table 3

[0110]

[0111] Existing modules use AT commands for configuration and management. AT commands use a request-response model to configure the module and send data, and notifications to indicate module events. Figure 5 shows the business process for AT command interaction between the MCU and the module, as well as module event notifications.

[0112] Based on the related problems of the prior art, the present invention improves the AT command protocol used by the UART serial port, uses a binary data format, and uses the RPC protocol for encapsulation in the interactive mode, as shown in Figures 1 and 6.

[0113] MCU side: Integrates the RPC client to encapsulate module configuration and communication instructions and parse response data.

[0114] Module side: Integrates the RPC server to parse commands and encapsulate response data, as well as perform event notifications.

[0115] Specifically, RPC protocol design-architecture:

[0116] This invention uses RPC encapsulation module functionality to convert AT command requests and responses into function calls and responses. Binary data encoding is used, which increases the information payload and transmission efficiency compared to AT command strings. Figure 7 shows the design of the RPC architecture for the module and MCU.

[0117] The RPC structure design is mainly divided into interface functions, serialization / deserialization, serial port data encoding and decoding, and serial port device transceiver unit. Specifically:

[0118] Interface function: realizes the encapsulation of module functions and uses the module functions through function calls.

[0119] Serialization / deserialization: Serialize functions and parameters into binary-encoded data / deserialize binary-encoded data into function and parameter lists.

[0120] Serial port encoding and decoding: Encode serialized data according to the serial port protocol, or decode the encoded data received by the serial port.

[0121] UART serial port device: used for sending and receiving serial port encoded data.

[0122] Specifically, RPC protocol design - binary data format:

[0123] This invention uses RPC to encapsulate binary data. To be compatible with AT command operation, this invention has designed a set of binary instruction tables to define the module's functions and operation methods. The following is a description of the binary data format, where [] indicates optional parameters.

[0124] The binary data format of the RPC function request is: function ID (1 Byte) + function type (1 Byte) [+ parameter list (nBytes)];

[0125] The binary data format of RPC function synchronous response data is: function ID (1 Byte) + response result (1 Byte) [+ data (nBytes)];

[0126] The binary data format of event notification data is: event ID (1 Byte) [+ event data (nBytes)].

[0127] The following RPC function request uses AT+CEREG as an example, as shown in Table 4:

[0128] Table 4

[0129]

[0130] The RPC function responds synchronously and returns the response result and data (if any). The following uses AT+CEREG? as an example, as shown in Table 5:

[0131] Table 5

[0132]

[0133] Event notification will return the event ID and data (if any). The following is an example of +CEREG: as shown in Table 6:

[0134] Table 6

[0135]

[0136]

[0137] RPC protocol design - function mapping table and event notification table:

[0138] The common 3GPP AT commands and serial port RPC function mapping tables are listed in Table 1 above. The common 3GPP event notification and serial port RPC event function mapping tables are listed in Table 7 below:

[0139] Table 7

[0140]

[0141] RPC protocol design-serial port encoding and decoding format design:

[0142] The UART serial port is used to send and receive RPC data. In order to ensure the stability of data transmission, an encoding rule needs to be designed.

[0143] The following is the binary format of serial port data:

[0144] Message identifier (1 Byte) + data length (2 Bytes) + RPC data (n Bytes) + CRC16 (2 Bytes);

[0145] Message ID Description:

[0146] The lower 6 bits represent the message ID;

[0147] The highest 2 bits identify the message type (00: request message, 01: synchronous response message, 10: event notification, 11: reserved);

[0148] As shown in Figure 8, serial port data transmission uses a stream method. To handle the packet sticking problem, after sending a packet of data, the serial port data must wait for at least 1ms before sending the next packet of data.

[0149] RPC protocol interaction:

[0150] As shown in Figure 9, the RPC protocol also uses a request-response model and an event notification model. Based on the previous design, the process shown in Figure 9 shows how RPC calls module functions and how the module returns event notifications.

[0151] In summary, this embodiment of the present invention integrates the deployment of a serial port RPC server within the module, instantiates functions, and then exports a list of RPC service functions. Based on the exported RPC service list, a corresponding RPC client is generated and integrated into the terminal. This completes the full deployment of RPC. This embodiment of the present invention, through serialized binary data design and serial port codec design, can improve data communication efficiency, increase communication speed, and enhance communication stability.

[0152] On the other hand, as shown in Figure 10, an embodiment of the present invention provides a module communication device 1000, including: a first module 1010, used to obtain a call instruction for a target function from the first module; a second module 1020, used to serialize the call instruction to obtain binary encoded data; a third module 1030, used to perform serial port protocol encoding on the binary encoded data to obtain serial port encoded data; and send the serial port encoded data to the second module; a fourth module 1040, used to perform serial port protocol decoding on the serial port encoded data to obtain binary encoded data; a fifth module 1050, used to deserialize the binary encoded data and parse it to obtain an execution instruction for executing the target function; a sixth module 1060, used to execute the AT instruction corresponding to the target function based on the execution instruction; and a seventh module 1070, used to obtain the execution result returned by the second module to the first module based on the result of executing the AT instruction.

[0153] In some embodiments, before the step of obtaining the execution result returned by the second module to the first module in the seventh module, the device also includes: an eighth module, used to serialize the execution result based on a preset response result mapping table through the second module to obtain first encoded data; and a ninth module, used to perform serial port protocol encoding on the first encoded data to obtain second encoded data.

[0154] In some embodiments, before the step of obtaining the execution result returned by the second module to the first module in the seventh module, the device also includes: a tenth module, used to execute the event notification function through the second module; an eleventh module, used to serialize the event notification function based on a preset function mapping table to obtain third encoded data; a twelfth module, used to perform serial port protocol encoding on the third encoded data to obtain fourth encoded data; a thirteenth module, used to send the fourth encoded data to the first module, so that the first module executes the callback function according to the fourth encoded data; wherein, the first module obtains the returned execution result from the second module through the callback function.

[0155] The contents of the method embodiments of the present invention are all applicable to the device embodiments. The functions specifically implemented by the device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0156] On the other hand, as shown in FIG11 , an embodiment of the present invention further provides an electronic device 1100 , which includes at least one processor 1110 and at least one memory 1120 for storing at least one program; taking a processor 1110 and a memory 1120 as an example.

[0157] The processor 1110 and the memory 1120 may be connected via a bus or other means.

[0158] The memory 1120 is a non-transient computer-readable storage medium that can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory 1120 may include a high-speed random access memory and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory 1120 may optionally include a memory remotely located relative to the processor, and these remote memories may be connected to the device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0159] The electronic device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, i.e., they may be located in one location or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of this embodiment.

[0160] Another aspect of an embodiment of the present invention further provides a computer-readable storage medium, wherein the storage medium stores a program, and the program is executed by a processor to implement the above method.

[0161] The contents of the method embodiments of the present invention are all applicable to the computer-readable storage medium embodiments. The functions specifically implemented by the computer-readable storage medium embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method.

[0162] The embodiments of the present invention further disclose a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device can read the computer instructions from the computer-readable storage medium and execute the computer instructions, causing the computer device to perform the above method.

[0163] It should be noted that the computer-readable medium shown in the embodiments of the present invention may be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or component, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, device, or component. In the present invention, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer-readable medium may be transmitted using any suitable medium, including but not limited to wireless, wired, or any suitable combination thereof.

[0164] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present invention. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the above-mentioned module, program segment, or a part of code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0165] It should be noted that although several modules of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to an embodiment of the present invention, the features and functions of two or more modules or units described above can be concretized in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided into multiple modules or units to be concretized.

[0166] Through the description of the above embodiments, it is easy for those skilled in the art to understand that the example embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the embodiments of the present invention can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes a number of instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the embodiments of the present invention.

[0167] In some optional embodiments, the function / operation mentioned in the block diagram may not occur in the order mentioned in the operation diagram. For example, depending on the function / operation involved, the two boxes shown in succession can actually be executed substantially simultaneously or the boxes can sometimes be executed in reverse order. In addition, the embodiment presented and described in the flow chart of the present invention is provided in an exemplary manner for the purpose of providing a more comprehensive understanding of the technology. The disclosed method is not limited to the operation and logic flow presented herein. Optional embodiments are contemplated in which the order of the various operations is changed and the sub-operations described as a part of a larger operation are performed independently.

[0168] In addition, although the present invention is described in the context of functional modules, it should be understood that, unless otherwise stated, one or more of the functions and / or features may be integrated into a single physical device and / or software module, or one or more functions and / or features may be implemented in separate physical devices or software modules. It will also be understood that a detailed discussion of the actual implementation of each module is not necessary for understanding the present invention. More specifically, given the properties, functions, and internal relationships of the various functional modules in the devices disclosed herein, the actual implementation of the module will be understood within the ordinary skill of an engineer. Therefore, a person skilled in the art will be able to implement the present invention as set forth in the claims using ordinary skill without undue experimentation. It will also be understood that the specific concepts disclosed are merely illustrative and are not intended to limit the scope of the present invention, which is determined by the full scope of the appended claims and their equivalents.

[0169] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the various embodiments of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, and other media that can store program code.

[0170] The logic and / or steps represented in the flowcharts or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing the logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution apparatus, device, or apparatus (e.g., a computer-based apparatus, a device including a processor, or other apparatus that can fetch instructions from and execute instructions on an instruction execution apparatus, device, or apparatus). For purposes of this specification, a "computer-readable medium" can be any device that can contain, store, communicate, propagate, or transport a program for use by, or in conjunction with, an instruction execution apparatus, device, or apparatus.

[0171] More specific examples (a non-exhaustive list) of computer-readable media include the following: an electrical connection with one or more wires (electronic devices), a portable computer disk cartridge (magnetic devices), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disc read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, deciphering, or processing in another suitable manner as necessary, and then stored in a computer memory.

[0172] It should be understood that various parts of the present invention can be implemented using hardware, software, firmware, or a combination thereof. In the above-described embodiments, multiple steps or methods can be implemented using software or firmware stored in a memory and executed by a suitable instruction execution device. For example, if implemented using hardware, as in another embodiment, any one of the following technologies known in the art or a combination thereof can be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application-specific integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0173] Throughout this specification, reference to terms such as "one embodiment," "some embodiments," "examples," "specific examples," or "some examples" means that a specific feature, structure, material, or characteristic described in conjunction with that embodiment or example is included in at least one embodiment or example of the present invention. In this specification, schematic representations of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.

[0174] While embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions, and variations may be made to the embodiments without departing from the principles and spirit of the invention, and that the scope of the invention is defined by the claims and their equivalents.

[0175] The above is a specific description of the preferred implementation of the present invention, but the present invention is not limited to the embodiments. Those skilled in the art can make various equivalent modifications or substitutions without violating the spirit of the present invention. These equivalent modifications or substitutions are all included in the scope defined by the claims of the present invention.

Claims

1. A module communication method, characterized in that, The method includes: Obtaining a call instruction of a first module to a target function; Serializing the call instruction to obtain binary encoded data; Performing serial port protocol encoding on the binary encoded data to obtain serial port encoded data; and sending the serial port encoded data to a second module; Performing serial port protocol decoding on the serial port encoded data to obtain the binary encoded data; Deserializing the binary encoded data to parse and obtain an execution instruction for executing the target function; Based on the execution instruction, executing an AT instruction corresponding to the target function; Based on the result of the execution of the AT instruction, obtaining an execution result returned by the second module to the first module.

2. The module communication method according to claim 1, wherein The serializing the call instruction to obtain binary encoded data includes: Determining an AT instruction corresponding to the target function according to the call instruction; Serializing through a preset function mapping table to obtain a function ID and a function type in a binary data format corresponding to the AT instruction; Sorting out the binary encoded data based on the function ID and the function type.

3. The module communication method according to claim 1, characterized in that The deserializing the binary encoded data to obtain the call instruction of the target function includes: Obtaining a function ID and a function type in a binary data format from the binary encoded data; Deserializing through a preset function mapping table to obtain the AT instruction corresponding to the function ID and the function type; Taking the AT instruction as an execution object of the target function to trigger the execution instruction.

4. The module communication method according to claim 1, wherein Before the step of obtaining the execution result returned by the second module to the first module, the method further includes: Serializing the execution result through the second module based on a preset response result mapping table to obtain first encoded data; Performing serial port protocol encoding on the first encoded data to obtain second encoded data.

5. The module communication method according to claim 4, wherein The obtaining the execution result returned by the second module to the first module includes: Performing serial port protocol decoding on the second encoded data through the first module to obtain the first encoded data; Deserializing the first encoded data based on the response result mapping table to parse and obtain the execution result.

6. The module communication method according to claim 1, characterized in that Before the step of obtaining the execution result returned by the second module to the first module, the method further includes: Executing an event notification function through the second module; Serializing the event notification function based on a preset function mapping table to obtain third encoded data; Performing serial port protocol encoding on the third encoded data to obtain fourth encoded data; Sending the fourth encoded data to the first module so that the first module executes a callback function according to the fourth encoded data; Wherein, the first module obtains the returned execution result from the second module through the callback function.

7. A module communication device, characterized in that, including: A first module, configured to obtain a call instruction of a first module to a target function; A second module, configured to serialize the call instruction to obtain binary encoded data; A third module, configured to perform serial port protocol encoding on the binary encoded data to obtain serial port encoded data; and send the serial port encoded data to a second module; The fourth module is used to perform serial port protocol decoding on the serial port encoded data to obtain the binary encoded data; The fifth module is used to deserialize the binary encoded data and parse to obtain an execution instruction for executing the target function; The sixth module is used to execute the AT instruction corresponding to the target function based on the execution instruction; The seventh module is used to obtain the execution result returned by the second module to the first module based on the result of the execution of the AT instruction.

8. The module communication device according to claim 7, wherein The device further includes: The eighth module is used to serialize the execution result through the second module based on a preset response result mapping table to obtain first encoded data; The ninth module is used to perform serial port protocol encoding on the first encoded data to obtain second encoded data.

9. An electronic device, characterized in that, It includes a processor and a memory; The memory is used to store programs; The processor executes the program to implement the method according to any one of claims 1 to 7.

10. A computer storage medium storing a program executable by a processor, characterized in that, The program executable by the processor, when executed by the processor, is used to implement the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Flow distribution module and flow distribution system

    CN111555985A

  • Medical Internet of Things gateway

    CN111711563A

  • Method and system for realizing soft bus of embedded operating system of object model

    CN112083914A

  • Method and system for realizing voice age and / or gender recognition service, and medium

    CN113192510A

  • Serial port communication method and device

    CN114519026A