Embedded system application 5g communication module middle layer framework implementation method and device

By introducing a 5G communication module intermediate layer framework into the embedded system, the problems of communication command complexity and single-channel serial transmission in the embedded system are solved, the 5G communication efficiency of the high-level language interface is realized, and the terminal application is simplified.

CN115550941BActive Publication Date: 2025-11-11STATE GRID ZHEJIANG ELECTRIC POWER CO LTD NINGBO POWER SUPPLY CO +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211159092.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-22
Publication Date
2025-11-11
Estimated Expiration
2042-09-22

AI Technical Summary

Technical Problem

In existing technologies, 5G communication modules in embedded systems suffer from problems such as complex combinational logic and timing relationships in communication instruction execution, support only single-channel serial transmission, low level of communication instruction access details, and difficulty in providing high-level language interfaces, which limits the application of 5G communication modules in embedded systems.

Method used

This paper provides an intermediate layer framework for 5G communication modules in embedded systems, including a hardware interface layer, a hardware interface driver layer, a communication primitive layer, and an application software interface layer. The intermediate layer framework enables the conversion between hardware protocols and software protocols, supports parallel multi-task communication, and configures a circular buffer queue for data reception, parsing, and transmission to realize the communication functions of a high-level language interface.

Benefits of technology

It enables embedded system application layers to efficiently execute 5G communication functions through a high-level language interface, solves communication barriers in existing technologies, improves 5G communication efficiency, and is similar to an operating system for communication functions, simplifying terminal applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115550941B_ABST
    Figure CN115550941B_ABST
Patent Text Reader

Abstract

This invention provides a method and apparatus for implementing a middleware framework for an embedded system's 5G communication module. The method includes: the middleware framework receiving communication requests from a remote communication object uploaded by the 5G communication module, parsing and processing these requests to convert the hardware protocol of the 5G communication module to the application layer software protocol, obtaining a communication request conforming to the application layer software protocol, and uploading it to the application layer; the middleware framework receiving communication instructions issued by the application layer, organizing and processing these instructions to convert the application layer software protocol to the 5G communication module hardware protocol, obtaining a communication instruction conforming to the 5G communication module hardware protocol, and sending it to the 5G communication module. This invention implements a middleware software framework for the application layer of an embedded system to access the 5G network, improving 5G communication efficiency. The middleware framework acts as an "operating system" for communication functions, overcoming the difficulties and technical barriers in the application of 5G communication modules in existing technologies.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of program processing technology, specifically relating to a method and apparatus for implementing a 5G communication module intermediate layer framework in an embedded system, as well as a storage medium and computer equipment. Background Technology

[0002] The rapid development of 5G communication networks and the application of 5G communication in intelligent embedded terminals have led to continuous evolution from baseband and baseband chips to highly integrated independent modules. Compared to the self-designed hardware and software approach for baseband, 5G communication modules, by integrating comprehensive 5G communication functions, provide only serial communication commands to the calling end, simplifying the design and decoupling the system. However, in practical applications, the transmission of communication commands between the 5G communication module and the upper application layer presents several challenges: complex combinational logic and timing relationships in command execution; support for only single-channel serial transmission; low level of detail in command access; and difficulty in directly providing high-level language interfaces. Therefore, the application of 5G communication modules is severely limited by these factors, creating significant obstacles for their use in embedded systems. Summary of the Invention

[0003] To address the shortcomings of existing technologies, this invention provides a method and apparatus for implementing a 5G communication module intermediate layer framework in embedded systems, which can effectively solve the above-mentioned problems.

[0004] The embodiments of the present invention provide a method and apparatus for implementing a 5G communication module intermediate layer framework in an embedded system, as well as a storage medium and a computer device.

[0005] According to one aspect of the present invention, a method for implementing a middleware framework for a 5G communication module in an embedded system is provided, comprising the following steps:

[0006] The 5G communication module receives communication requests from remote communication objects and uploads them to the middleware framework.

[0007] The intermediate layer framework receives communication requests from the remote communication object uploaded by the 5G communication module, parses and processes the communication requests, realizes the conversion between the hardware protocol of the 5G communication module and the software protocol of the application layer, obtains communication requests that conform to the software protocol of the application layer, and uploads the communication requests that conform to the software protocol of the application layer to the application layer.

[0008] The intermediate layer framework receives communication instructions issued by the application layer, organizes and processes the communication instructions, realizes the conversion of the application layer's software protocol to the hardware protocol of the 5G communication module, obtains communication instructions that conform to the hardware protocol of the 5G communication module, and issues the communication instructions that conform to the hardware protocol of the 5G communication module to the 5G communication module.

[0009] The 5G communication module receives communication instructions from the intermediate layer framework and sends them to the remote communication object.

[0010] Optionally, in the above-described method embodiments of the present invention, the intermediate layer framework, in a bottom-up direction, includes a hardware interface layer, a hardware interface driver layer (HAL), a communication primitive layer, a communication protocol layer, and an application software interface layer.

[0011] The hardware interface layer has different types of hardware interfaces, which are bidirectionally connected to the 5G communication module to receive communication requests uploaded by the 5G communication module and to issue communication commands to the 5G communication module.

[0012] The Hardware Interface Driver Layer (HAL) maintains a mapping table between virtual serial port numbers and hardware interface identifiers. When sending a communication request to the upper layer, it looks up the mapping table to map the hardware interface identifier of the hardware interface currently connected to the 5G communication module to a virtual serial port number, and encapsulates the virtual serial port number into the communication request, using the virtual serial port number as the identifier for upper-layer communication calls. When sending a communication command to the lower layer, it looks up the mapping table to map the virtual serial port number in the communication command to a hardware interface identifier, and encapsulates the hardware interface identifier into the communication command, using the hardware interface identifier as the identifier for lower-layer communication calls.

[0013] The communication meta-layer is used to receive communication requests uploaded by the hardware interface driver layer (HAL), parse the communication requests, and then upload the parsed communication requests to the communication protocol layer; and to receive communication instructions issued by the communication protocol layer, organize the communication instructions into a data structure, generate AT instructions, and send them to the hardware interface driver layer (HAL).

[0014] The communication protocol layer is configured to receive communication requests uploaded by the communication metaphrase layer, and upload the communication requests to the application software interface layer using a parallel multi-target multi-task communication method; and to receive communication instructions issued by the application software interface layer and send the communication instructions to the communication metaphrase layer.

[0015] The application software interface layer is used to receive communication requests uploaded by the communication protocol layer and upload them to the application software of the application layer; or, it is used to receive communication instructions issued by the application software of the application layer and send them to the communication protocol layer.

[0016] Optionally, in the above-described method embodiments of the present invention, the types of hardware interfaces of the hardware interface layer include: high-speed serial interfaces and universal serial interfaces.

[0017] Optionally, in the above-described method embodiments of the present invention, the hardware interface driver layer (HAL) defines four driver interface functions:

[0018] The hardware interface initialization function is used to initialize the hardware interface, using the defined hardware interface identifier to initialize the specified hardware interface entity;

[0019] The hardware interface receive function is used to receive communication requests uploaded by the hardware interface and send them to the upper-layer communication meta-level.

[0020] The hardware interface sending function is used to send communication commands issued by the communication meta-layer to the corresponding hardware interface.

[0021] The function for destroying hardware interface-related resources is used to destroy hardware interface-related resources when the hardware interface is no longer in use.

[0022] Optionally, in the above-described method embodiments of the present invention, the communication primitive layer specifically adopts the following method to receive communication requests:

[0023] Configure a circular buffer queue for data reception in the memory space of the embedded system;

[0024] The data receiving circular buffer queue has three control nodes arranged in a circular order: a first head control node, a first middle control node, and a first tail control node; wherein, n first idle nodes are initially configured between the first head control node and the first tail control node.

[0025] The execution logic of the data receiving circular buffer queue is as follows:

[0026] For each communication request uploaded by the hardware interface driver layer HAL to the communication primitive layer, each first idle node of the data receiving circular buffer queue is stored, so that each first idle node that has stored the communication request forms a first-in-first-out queue.

[0027] Each of the first free nodes that have stored communication requests is moved sequentially between the first intermediate control node and the first head control node. At this time, the first free nodes that have stored communication requests are called preprocessing nodes, and each preprocessing node forms the first-in-first-out queue.

[0028] The communication requests stored in each preprocessing node are preprocessed in the following way: the communication requests stored in the preprocessing node are preprocessed directly to obtain the preprocessed communication requests, and the preprocessed communication requests replace the original communication requests stored in the preprocessing node to obtain the node that writes the preprocessed communication requests.

[0029] Each node that has written the preprocessed communication request is moved sequentially between the first tail control node and the first middle control node. The nodes that have written the preprocessed communication request are called parsing nodes, and each parsing node forms the first to third first-in-first-out queue.

[0030] When communication requests stored in each parsing node need to be copied to the data parsing circular buffer queue, the data receiving circular buffer queue is first paused; after the copying is completed, the data receiving circular buffer queue resumes operation; in the data receiving circular buffer queue, the contents of the parsing nodes that have been used by the data parsing circular buffer queue are cleared and moved to the tail of the first-in-first-out queue in sequence.

[0031] Optionally, in the above-described method embodiments of the present invention, the communication primitive layer specifically parses the communication request in the following manner:

[0032] Configure a data parsing circular buffer queue in the memory space of the embedded system;

[0033] The data parsing circular buffer queue has three control nodes arranged in a circular order: the second head control node, the second middle control node, and the second tail control node; wherein, n second idle nodes are initially configured between the second head control node and the second tail control node.

[0034] The execution logic of the data parsing circular buffer queue is as follows:

[0035] The notification data receiving ring buffer queue is paused. The communication requests stored by each node used for parsing are copied to each of the second idle nodes in the data parsing ring buffer queue, so that each of the second idle nodes that have stored communication requests forms the 2-1 first-in-first-out queue.

[0036] Each second free node that has stored a communication request is moved sequentially between the second middle control node and the second head control node. At this point, the second free node that has stored a communication request is called a parsing node. Each parsing node forms a 2-2 first-in-first-out queue. The communication requests stored in each parsing node are parsed and processed in the following way: the communication requests stored in the parsing node are parsed and processed directly to obtain the parsed communication requests. The parsed communication requests are then used to replace the original communication requests stored in the parsing node, resulting in the node that has written the parsed communication requests.

[0037] Each node that has written the parsed communication request is moved sequentially between the second tail control node and the second middle control node. The node that has written the parsed communication request is called the node for use by the upper layer. Each node for use by the upper layer forms the second-third first-in-first-out queue.

[0038] When the upper-level communication protocol layer or application layer needs to execute the parsed communication request, it first pauses the data parsing circular buffer queue, and then directly processes the communication request stored in the upper-level node at the head of the 2nd-3rd first-in-first-out queue to obtain the communication command to be issued; and replaces the original data stored in the upper-level node with the communication command to be issued to obtain the command to be issued node.

[0039] When the communication instructions stored in each instruction-issuing node need to be copied to the data sending circular buffer queue, the data parsing circular buffer queue is first paused; after the copying is completed, the data parsing circular buffer queue resumes operation; in the data parsing circular buffer queue, the contents of the instruction-issuing nodes that have been used by the data sending circular buffer queue are cleared and moved to the tail of the 2-1 first-in-first-out queue in sequence.

[0040] Optionally, in the above-described method embodiments of the present invention, the communication primitive layer specifically employs the following method to send communication commands:

[0041] Configure a circular buffer queue for data transmission in the memory space of the embedded system;

[0042] The data transmission circular buffer queue has three control nodes arranged in a circular order: the third head control node, the third middle control node, and the third tail control node; wherein, n third idle nodes are initially configured between the third head control node and the third tail control node.

[0043] The execution logic of the data transmission ring buffer queue is as follows:

[0044] The notification data parsing ring buffer queue is paused. The communication instructions stored in each node that needs to issue instructions are copied to each of the third idle nodes in the data sending ring buffer queue, so that each of the third idle nodes that have stored communication instructions forms the 3-1 first-in-first-out queue.

[0045] Each of the third idle nodes that have stored communication instructions is moved sequentially between the third middle control node and the third head control node. At this point, the third idle nodes that have stored communication instructions are called data structure organization nodes. Each data structure organization node forms the 3-2 first-in-first-out queue. The communication instructions stored in each data structure organization node are processed by directly processing the communication instructions stored in the data structure organization node to generate AT instructions. The AT instructions then replace the original communication instructions stored in the data structure organization node, thus obtaining the node that writes the AT instructions.

[0046] Each node that writes AT commands is moved sequentially between the third tail control node and the third middle control node. The node that writes AT commands at this time is called the AT command node, and each AT command node forms the 3-3 first-in-first-out queue.

[0047] When AT commands need to be sent down via the hardware interface, the data transmission ring buffer queue is first paused. Then, the AT commands stored in the AT command node are sent down. When the sending is finished, the data transmission ring buffer queue is resumed. In the data transmission ring buffer queue, the contents of the AT command nodes that have finished sending are cleared and moved to the tail of the 3-1 first-in-first-out queue in sequence to form an idle node.

[0048] Optionally, in the above-described method embodiments of the present invention, the data receiving ring buffer queue, the data parsing ring buffer queue, and the data sending ring buffer queue adopt a time-division control method to realize node movement and data processing.

[0049] Optionally, in the above-described method embodiments of the present invention, the application software interface layer and the various application software in the application layer adopt a Socket multi-channel parallel communication method; the 5G communication module and the various remote communication objects adopt a polling serial communication method; and the conversion between parallel communication method and serial communication method is realized by time-division multiplexing the hardware interface driver layer HAL.

[0050] Specifically:

[0051] The Hardware Interface Driver Layer (HAL) maintains a mapping table of communication objects from hardware identifiers to software identifiers.

[0052] The hardware interface driver layer (HAL) continuously determines the event status, which includes three types: the event status of the application software issuing communication instructions; the event status of the remote communication object reporting a communication request; and the idle event status.

[0053] If an event occurs where the application software issues a communication command, the communication command issued by the application software is converted into an AT command, and a mapping relationship between the software identifier and hardware identifier of the remote communication object is established to realize the binding of the logical channel between the remote communication object and the application software, and the AT command is transmitted through the logical channel.

[0054] If an event occurs in which a remote communication object reports a communication request, the communication request of the remote communication object is converted into an application software protocol, and a mapping relationship between the software identifier and hardware identifier of the remote communication object is established to realize the binding of the corresponding logical channel between the remote communication object and the application software, and the communication request is transmitted through the corresponding logical channel.

[0055] If an idle event occurs, the hardware interface driver layer (HAL) polls each remote communication object in the communication object mapping table and processes the data sent and reported by each remote communication object one by one. For data that needs to be sent, the data is transmitted through the corresponding logical channel; for data that needs to be reported, the data is transmitted through the corresponding logical channel.

[0056] According to another aspect of the present invention, an apparatus for implementing a 5G communication module middleware framework for embedded system applications is provided, comprising a 5G communication module and a middleware framework:

[0057] The 5G communication module is used to receive communication requests from remote communication objects and upload them to the middleware framework; and to receive communication instructions issued by the middleware framework and send them to the remote communication objects.

[0058] The intermediate layer framework is configured to receive communication requests uploaded by the 5G communication module from the remote communication object, parse and process the communication requests to convert the hardware protocol of the 5G communication module to the software protocol of the application layer, obtain communication requests conforming to the software protocol of the application layer, and upload the communication requests conforming to the software protocol of the application layer to the application layer; and to receive communication instructions issued by the application layer, parse and process the communication instructions to convert the software protocol of the application layer to the hardware protocol of the 5G communication module, obtain communication instructions conforming to the hardware protocol of the 5G communication module, and send the communication instructions conforming to the hardware protocol of the 5G communication module to the 5G communication module.

[0059] Optionally, in the above-described device embodiments of the present invention, the intermediate layer framework, in the bottom-up direction, includes a hardware interface layer, a hardware interface driver layer (HAL), a communication primitive layer, a communication protocol layer, and an application software interface layer.

[0060] The hardware interface layer has different types of hardware interfaces, which are bidirectionally connected to the 5G communication module, specifically including:

[0061] The first receiving submodule is used to receive communication requests uploaded by the 5G communication module;

[0062] The first sending submodule is used to send communication commands to the 5G communication module;

[0063] The hardware interface driver layer (HAL) includes:

[0064] The mapping table maintenance submodule is used to maintain the mapping relationship between virtual serial port numbers and hardware interface identifiers;

[0065] The first upload submodule is used to, when sending a communication request to the upper layer, look up the mapping relationship table maintained by the mapping relationship table maintenance submodule, map the hardware interface identifier of the hardware interface currently connected to the 5G communication module to a virtual serial port number, encapsulate the virtual serial port number into the communication request, and use the virtual serial port number as the identifier for the upper layer communication call.

[0066] The second sending submodule is used to, when sending a communication command to the lower layer, look up the mapping relationship table maintained by the mapping relationship table maintenance submodule, map the virtual serial port number in the communication command to a hardware interface identifier, encapsulate the hardware interface identifier into the communication command, and use the hardware interface identifier as the identifier for the lower layer communication call;

[0067] The communication primitive layer includes:

[0068] The second receiving submodule is used to receive the communication request uploaded by the first uploading submodule of the hardware interface driver layer HAL.

[0069] A parsing submodule is used to parse the communication request received by the second receiving submodule;

[0070] The second upload submodule is used to upload the communication request parsed by the parsing submodule to the communication protocol layer.

[0071] The third receiving submodule is used to receive communication instructions issued by the communication protocol layer;

[0072] The AT command generation module is used to organize the communication commands received by the third receiving submodule into a data structure and generate AT commands.

[0073] The AT command sending submodule is used to send the AT commands generated by the AT command generation module to the hardware interface driver layer (HAL).

[0074] The communication protocol layer includes:

[0075] The fourth receiving submodule is used to receive the communication request uploaded by the communication meta-layer;

[0076] The third upload submodule is used to upload the communication request received by the fourth receiving submodule to the application software interface layer using a parallel multi-target multi-task communication method.

[0077] The fifth receiving submodule is used to receive communication instructions sent by the application software interface layer;

[0078] The third sending submodule is used to send the communication instructions received by the fifth receiving submodule to the communication meta-layer;

[0079] The application software interface layer includes:

[0080] The sixth receiving submodule is used to receive communication requests uploaded by the communication protocol layer;

[0081] The fourth upload submodule is used to upload the communication request received by the sixth receiving submodule to the application software in the application layer.

[0082] The seventh receiving submodule is used to receive communication commands issued by the application software in the application layer;

[0083] The fourth sending submodule is used to send the communication instructions received by the seventh receiving submodule to the communication protocol layer.

[0084] Optionally, in the above-described device embodiments of the present invention, the types of hardware interfaces of the hardware interface layer include: high-speed serial interfaces and universal serial interfaces.

[0085] Optionally, in the above-described device embodiments of the present invention, the hardware interface driver layer (HAL) defines four driver interface functions:

[0086] The hardware interface initialization function is used to initialize the hardware interface, using the defined hardware interface identifier to initialize the specified hardware interface entity;

[0087] The hardware interface receive function is used to receive communication requests uploaded by the hardware interface and send them to the upper-layer communication meta-level.

[0088] The hardware interface sending function is used to send communication commands issued by the communication meta-layer to the corresponding hardware interface.

[0089] The function for destroying hardware interface-related resources is used to destroy hardware interface-related resources when the hardware interface is no longer in use.

[0090] Optionally, in the above-described device embodiments of the present invention, the second receiving submodule of the communication primitive layer specifically adopts the following method to receive communication requests:

[0091] Configure a circular buffer queue for data reception in the memory space of the embedded system;

[0092] The data receiving circular buffer queue has three control nodes arranged in a circular order: a first head control node, a first middle control node, and a first tail control node; wherein, n first idle nodes are initially configured between the first head control node and the first tail control node.

[0093] The execution logic of the data receiving circular buffer queue is as follows:

[0094] For each communication request uploaded by the hardware interface driver layer HAL to the communication primitive layer, each first idle node of the data receiving circular buffer queue is stored, so that each first idle node that has stored the communication request forms a first-in-first-out queue.

[0095] Each of the first free nodes that have stored communication requests is moved sequentially between the first intermediate control node and the first head control node. At this time, the first free nodes that have stored communication requests are called preprocessing nodes, and each preprocessing node forms the first-in-first-out queue.

[0096] The communication requests stored in each preprocessing node are preprocessed in the following way: the communication requests stored in the preprocessing node are preprocessed directly to obtain the preprocessed communication requests, and the preprocessed communication requests replace the original communication requests stored in the preprocessing node to obtain the node that writes the preprocessed communication requests.

[0097] Each node that has written the preprocessed communication request is moved sequentially between the first tail control node and the first middle control node. The nodes that have written the preprocessed communication request are called parsing nodes, and each parsing node forms the first to third first-in-first-out queue.

[0098] When communication requests stored in each parsing node need to be copied to the data parsing circular buffer queue, the data receiving circular buffer queue is first paused; after the copying is completed, the data receiving circular buffer queue resumes operation; in the data receiving circular buffer queue, the contents of the parsing nodes that have been used by the data parsing circular buffer queue are cleared and moved to the tail of the first-in-first-out queue in sequence.

[0099] Optionally, in the above-described device embodiments of the present invention, the parsing submodule of the communication primitive layer specifically performs the parsing of communication requests in the following manner:

[0100] Configure a data parsing circular buffer queue in the memory space of the embedded system;

[0101] The data parsing circular buffer queue has three control nodes arranged in a circular order: the second head control node, the second middle control node, and the second tail control node; wherein, n second idle nodes are initially configured between the second head control node and the second tail control node.

[0102] The execution logic of the data parsing circular buffer queue is as follows:

[0103] The notification data receiving ring buffer queue is paused. The communication requests stored by each node used for parsing are copied to each of the second idle nodes in the data parsing ring buffer queue, so that each of the second idle nodes that have stored communication requests forms the 2-1 first-in-first-out queue.

[0104] Each second free node that has stored a communication request is moved sequentially between the second middle control node and the second head control node. At this point, the second free node that has stored a communication request is called a parsing node. Each parsing node forms a 2-2 first-in-first-out queue. The communication requests stored in each parsing node are parsed and processed in the following way: the communication requests stored in the parsing node are parsed and processed directly to obtain the parsed communication requests. The parsed communication requests are then used to replace the original communication requests stored in the parsing node, resulting in the node that has written the parsed communication requests.

[0105] Each node that has written the parsed communication request is moved sequentially between the second tail control node and the second middle control node. The node that has written the parsed communication request is called the node for use by the upper layer. Each node for use by the upper layer forms the second-third first-in-first-out queue.

[0106] When the upper-level communication protocol layer or application layer needs to execute the parsed communication request, it first pauses the data parsing circular buffer queue, and then directly processes the communication request stored in the upper-level node at the head of the 2nd-3rd first-in-first-out queue to obtain the communication command to be issued; and replaces the original data stored in the upper-level node with the communication command to be issued to obtain the command to be issued node.

[0107] When the communication instructions stored in each instruction-issuing node need to be copied to the data sending circular buffer queue, the data parsing circular buffer queue is first paused; after the copying is completed, the data parsing circular buffer queue resumes operation; in the data parsing circular buffer queue, the contents of the instruction-issuing nodes that have been used by the data sending circular buffer queue are cleared and moved to the tail of the 2-1 first-in-first-out queue in sequence.

[0108] Optionally, in the above-described device embodiments of the present invention, the T-command generation module and AT-command sending submodule of the communication primitive layer specifically employ the following methods to send communication commands:

[0109] Configure a circular buffer queue for data transmission in the memory space of the embedded system;

[0110] The data transmission circular buffer queue has three control nodes arranged in a circular order: the third head control node, the third middle control node, and the third tail control node; wherein, n third idle nodes are initially configured between the third head control node and the third tail control node.

[0111] The execution logic of the data transmission ring buffer queue is as follows:

[0112] The notification data parsing ring buffer queue is paused. The communication instructions stored in each node that needs to issue instructions are copied to each of the third idle nodes in the data sending ring buffer queue, so that each of the third idle nodes that have stored communication instructions forms the 3-1 first-in-first-out queue.

[0113] Each of the third idle nodes that have stored communication instructions is moved sequentially between the third middle control node and the third head control node. At this point, the third idle nodes that have stored communication instructions are called data structure organization nodes. Each data structure organization node forms the 3-2 first-in-first-out queue. The communication instructions stored in each data structure organization node are processed by directly processing the communication instructions stored in the data structure organization node to generate AT instructions. The AT instructions then replace the original communication instructions stored in the data structure organization node, thus obtaining the node that writes the AT instructions.

[0114] Each node that writes AT commands is moved sequentially between the third tail control node and the third middle control node. The node that writes AT commands at this time is called the AT command node, and each AT command node forms the 3-3 first-in-first-out queue.

[0115] When AT commands need to be sent down via the hardware interface, the data transmission ring buffer queue is first paused. Then, the AT commands stored in the AT command node are sent down. When the sending is finished, the data transmission ring buffer queue is resumed. In the data transmission ring buffer queue, the contents of the AT command nodes that have finished sending are cleared and moved to the tail of the 3-1 first-in-first-out queue in sequence to form an idle node.

[0116] Optionally, in the above-described device embodiments of the present invention, the data receiving ring buffer queue, the data parsing ring buffer queue, and the data sending ring buffer queue adopt a time-division control method to realize node movement and data processing.

[0117] Optionally, in the above-described device embodiments of the present invention, the application software interface layer and the various application software in the application layer adopt a Socket multi-channel parallel communication method; the 5G communication module and the various remote communication objects adopt a polling serial communication method; the conversion between parallel communication method and serial communication method is realized by time-division multiplexing the hardware interface driver layer HAL.

[0118] Specifically:

[0119] The Hardware Interface Driver Layer (HAL) maintains a mapping table of communication objects from hardware identifiers to software identifiers.

[0120] The hardware interface driver layer (HAL) continuously determines the event status, which includes three types: the event status of the application software issuing communication instructions; the event status of the remote communication object reporting a communication request; and the idle event status.

[0121] If an event occurs where the application software issues a communication command, the communication command issued by the application software is converted into an AT command, and a mapping relationship between the software identifier and hardware identifier of the remote communication object is established to realize the binding of the logical channel between the remote communication object and the application software, and the AT command is transmitted through the logical channel.

[0122] If an event occurs in which a remote communication object reports a communication request, the communication request of the remote communication object is converted into an application software protocol, and a mapping relationship between the software identifier and hardware identifier of the remote communication object is established to realize the binding of the corresponding logical channel between the remote communication object and the application software, and the communication request is transmitted through the corresponding logical channel.

[0123] If an idle event occurs, the hardware interface driver layer (HAL) polls each remote communication object in the communication object mapping table and processes the data sent and reported by each remote communication object one by one. For data that needs to be sent, the data is transmitted through the corresponding logical channel; for data that needs to be reported, the data is transmitted through the corresponding logical channel.

[0124] According to another aspect of the present invention, a storage medium is provided, wherein a computer program is stored on the storage medium, and when a processor executes the computer program stored on the storage medium, it implements, for example, a method for implementing a 5G communication module intermediate layer framework in an embedded system, or an apparatus for implementing a 5G communication module intermediate layer framework in an embedded system.

[0125] According to another aspect of the present invention, a computer device is provided, the computer device including a memory and a processor, the memory being used to store a computer executable program, and the processor being used to run the computer executable program to implement a method for implementing an embedded system application 5G communication module middleware framework, or to implement an apparatus for implementing an embedded system application 5G communication module middleware framework.

[0126] The embedded system application 5G communication module intermediate layer framework implementation method and device provided by the present invention have the following advantages:

[0127] This invention realizes an intermediate layer software framework for the application layer of an embedded system to access the 5G network, enabling the application layer to execute 5G communication functions by calling the communication interface of a high-level language, thereby achieving 5G communication efficiency. The intermediate layer framework is equivalent to the "operating system" for communication functions, solving the difficulties and technical barriers in the application of 5G communication modules in the terminal in the prior art.

[0128] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. Attached Figure Description

[0129] The above and other objects, features, and advantages of the present invention will become more apparent from the more detailed description of the embodiments of the invention in conjunction with the accompanying drawings. The drawings are provided to further illustrate the embodiments of the invention and form part of the specification. They are used together with the embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings, the same reference numerals generally represent the same parts or steps.

[0130] Figure 1 This is a flowchart illustrating an exemplary embodiment of the present invention regarding the implementation method of an intermediate layer framework for an embedded system application of a 5G communication module.

[0131] Figure 2 This is an overall architecture diagram of an embedded system application 5G communication module intermediate layer framework implementation method provided by an exemplary embodiment of the present invention;

[0132] Figure 3 This is a structural diagram of a data receiving circular buffer queue provided in an exemplary embodiment of the present invention;

[0133] Figure 4 This is a structural diagram of a data parsing circular buffer queue provided in an exemplary embodiment of the present invention;

[0134] Figure 5 This is a structural diagram of a data transmission ring buffer queue provided in an exemplary embodiment of the present invention;

[0135] Figure 6This is a schematic diagram of a memory model for processing data in an intermediate layer framework provided by an exemplary embodiment of the present invention;

[0136] Figure 7 This is a flowchart illustrating data parsing using a circular buffer queue, provided in an exemplary embodiment of the present invention.

[0137] Figure 8 This is a flowchart illustrating data transmission using a circular buffer queue, provided in an exemplary embodiment of the present invention.

[0138] Figure 9 This is a schematic diagram illustrating the principle of time-division multiplexing of the hardware interface driver layer (HAL) provided in an exemplary embodiment of the present invention, which enables the conversion between parallel and serial communication modes:

[0139] Figure 10 This is a schematic diagram of the structure of an embedded system application 5G communication module intermediate layer framework implementation device provided by an exemplary embodiment of the present invention;

[0140] Figure 11 This is a schematic diagram of the structure of a computer device provided in an exemplary embodiment of the present invention. Detailed Implementation

[0141] Hereinafter, exemplary embodiments according to the present invention will be described in detail with reference to the accompanying drawings. Obviously, the described embodiments are merely some embodiments of the present invention, and not all embodiments of the present invention. It should be understood that the present invention is not limited to the exemplary embodiments described herein.

[0142] It should be noted that, unless otherwise specifically stated, the relative arrangement, numerical expressions, and values ​​of the components and steps described in these embodiments do not limit the scope of the invention.

[0143] Those skilled in the art will understand that the terms "first," "second," etc., in the embodiments of the present invention are only used to distinguish different steps, devices, or modules, and do not represent any specific technical meaning, nor do they indicate a necessary logical order between them.

[0144] It should also be understood that in the embodiments of the present invention, "multiple" can refer to two or more, and "at least one" can refer to one, two or more.

[0145] It should also be understood that any component, data or structure mentioned in the embodiments of the present invention can generally be understood as one or more unless explicitly defined or given contrary instructions in the context.

[0146] Furthermore, the term "and / or" in this invention is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Additionally, the character " / " in this invention generally indicates that the preceding and following related objects have an "or" relationship.

[0147] It should also be understood that the description of the various embodiments in this invention emphasizes the differences between the various embodiments, and the similarities or similarities can be referred to each other. For the sake of brevity, they will not be described in detail.

[0148] At the same time, it should be understood that, for ease of description, the dimensions of the various parts shown in the accompanying drawings are not drawn according to actual scale.

[0149] The following description of at least one exemplary embodiment is merely illustrative and is in no way intended to limit the invention or its application or use.

[0150] Techniques, methods, and equipment known to those skilled in the art may not be discussed in detail, but where appropriate, they should be considered part of the specification.

[0151] It should be noted that similar labels and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be discussed further in subsequent figures.

[0152] The embodiments of this invention can be applied to electronic devices such as terminal devices, computer systems, and servers, and can operate together with a wide range of other general-purpose or special-purpose computing system environments or configurations. Well-known examples of terminal devices, computing systems, environments, and / or configurations suitable for use with electronic devices such as terminal devices, computer systems, and servers include, but are not limited to: personal computer systems, server computer systems, thin clients, thick clients, handheld or laptop devices, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputer systems, mainframe computer systems, and distributed cloud computing environments including any of the above systems, etc.

[0153] Electronic devices such as terminal devices, computer systems, and servers can be described in the general context of computer system executable instructions (such as program modules) executed by a computer system. Typically, program modules can include routines, programs, object programs, components, logic, data structures, etc., which perform specific tasks or implement specific abstract data types. Computer systems / servers can be implemented in distributed cloud computing environments, where tasks are executed by remote processing devices linked through communication networks. In distributed cloud computing environments, program modules can reside on local or remote computing system storage media, including storage devices.

[0154] Exemplary methods

[0155] The highly integrated development of 5G access layer technology has led to the emergence of 5G communication modules that invoke communication commands such as AT commands. A typical 5G communication module integrates a baseband, baseband driver hardware and software, a communication function control processor, and a communication command system. The 5G access function of the 5G communication module is to provide a communication command protocol in the form of a serial interface hardware, which is then invoked by the application layer of the embedded system to implement 5G communication functions. The application layer of the embedded system uses the communication commands of the 5G communication module to execute the required communication functions.

[0156] 5G communication modules provide hardware interfaces such as high-speed serial interfaces or universal serial USB interfaces, and software protocols that are associated with communication command functions, data, and timing. This approach has the following shortcomings: Taking AT commands as an example, AT commands are a distributed, independent instruction system, similar to assembly language. Their data definitions, instruction paths, timing relationships, result judgments, and error handling require understanding low-level details, posing a challenge for application layers using communication functions. AT commands do not support parallel and multitasking capabilities; for communication functions, this is equivalent to software without operating system support, making it impractical for application developers to implement a parallel and multitasking mechanism. High-level business logic layers often focus on communication functions such as centralized send / receive meta-statements. The hardware-level interface of AT commands is too low-level; many details that are not of concern to the business should be shielded or adapted independently. An intermediate framework that abstracts and bridges these barriers is an effective way to solve these problems.

[0157] Therefore, this invention provides a method for implementing an intermediate layer framework for an embedded system application 5G communication module. This method enables the application layer of the embedded system to access the 5G network through an intermediate layer software framework. The application layer executes 5G communication functions by calling the communication interface of a high-level language, thereby improving 5G communication efficiency. The intermediate layer framework is equivalent to the "operating system" for communication functions, thus solving the difficulties and technical barriers in the application of 5G communication modules in existing technologies.

[0158] The intermediate layer framework has the following technical characteristics:

[0159] (1) The middle layer framework uses a layered design, and the architecture is simple and clear.

[0160] (2) In the memory space of the embedded system, three circular buffer queues are configured: data receiving circular buffer queue, data parsing circular buffer queue and data sending circular buffer queue, so as to realize the orderly management and processing of receiving and sending data.

[0161] (3) It also has system-level memory management, instruction processing and real-time retention functions.

[0162] (4) Provides a communication meta-layer, which allows the application layer to easily call the communication meta-layer to realize communication functions.

[0163] (5) The middle layer framework abstraction implements parallel communication, including: multiple remote communication objects, communication tasks, and parallel execution of multiple sockets. Direct calls do not require involvement in parallel details.

[0164] Figure 1 This is a flowchart illustrating an exemplary embodiment of the present invention regarding the implementation method of an intermediate layer framework for an embedded system application 5G communication module.

[0165] The embedded system application 5G communication module middleware framework implementation method provided in this embodiment can be applied to electronic devices, such as... Figure 1 As shown, the specific steps include:

[0166] Step 1: The 5G communication module receives the communication request from the remote communication object and uploads it to the middleware framework;

[0167] Step 2: The intermediate layer framework receives the communication request from the remote communication object uploaded by the 5G communication module, parses and processes the communication request, realizes the conversion between the hardware protocol of the 5G communication module and the software protocol of the application layer, obtains the communication request that conforms to the software protocol of the application layer, and uploads the communication request that conforms to the software protocol of the application layer to the application layer.

[0168] Step 3: The intermediate layer framework receives the communication instructions issued by the application layer, organizes and processes the communication instructions, realizes the conversion of the application layer's software protocol to the hardware protocol of the 5G communication module, obtains communication instructions that conform to the hardware protocol of the 5G communication module, and issues the communication instructions that conform to the hardware protocol of the 5G communication module to the 5G communication module.

[0169] Step 4: The 5G communication module receives the communication command issued by the intermediate layer framework and sends it to the remote communication object.

[0170] This embodiment provides a method for implementing an intermediate layer framework for an embedded system application 5G communication module. An intermediate layer framework is established between the 5G communication module and the application layer. Through this framework, the hardware protocol of the 5G communication module and the software protocol of the application layer are mutually converted. The intermediate layer framework encapsulates communication details and complex instruction timing, providing a simple and stable communication logic interface that only needs to be considered in advanced applications. It supports the strict correctness of communication instructions and the normal execution of timing for the 5G communication module. Simultaneous communication of multiple tasks and processes is achieved through time-sharing parallelism.

[0171] The main innovation of this invention is to establish an intermediate layer framework between the 5G communication module and the application layer, and to design the intermediate layer framework. The intermediate layer framework encapsulates communication details and complex instruction timing, thereby establishing a continuous and smooth system mechanism between the hardware protocol of the 5G communication module and the software protocol of the application layer. When the application layer makes calls, it simplifies the process at the high level and only uses the communication functions that it cares about, while other details are shielded or handled on demand in the system.

[0172] refer to Figure 2 The above is a system architecture diagram corresponding to the implementation method of the intermediate layer framework of the 5G communication module in the embedded system provided by an exemplary embodiment of the present invention. The intermediate layer framework is the core of the design of the present invention. The intermediate layer framework includes, from bottom to top, a hardware interface layer, a hardware interface driver layer (HAL), a communication primitive layer, a communication protocol layer, and an application software interface layer.

[0173] The hardware interface layer, hardware interface driver layer (HAL), communication primitive layer, communication protocol layer, and application software interface layer are described in detail below:

[0174] (I) Hardware Interface Layer

[0175] The hardware interface layer has different types of hardware interfaces, which are bidirectionally connected to the 5G communication module to receive communication requests uploaded by the 5G communication module and to issue communication commands to the 5G communication module.

[0176] As a specific implementation method, the types of hardware interfaces in the hardware interface layer include, but are not limited to: high-speed serial interfaces and universal serial interfaces.

[0177] (II) Hardware Interface Driver Layer (HAL)

[0178] The Hardware Interface Driver Layer (HAL) maintains a mapping table between virtual serial port numbers and hardware interface identifiers. When sending a communication request to the upper layer, it looks up the mapping table to map the hardware interface identifier of the hardware interface currently connected to the 5G communication module to a virtual serial port number, and encapsulates the virtual serial port number into the communication request, using the virtual serial port number as the identifier for upper-layer communication calls. When sending a communication command to the lower layer, it looks up the mapping table to map the virtual serial port number in the communication command to a hardware interface identifier, and encapsulates the hardware interface identifier into the communication command, using the hardware interface identifier as the identifier for lower-layer communication calls.

[0179] As a specific implementation, the Hardware Interface Driver Layer (HAL) defines four driver interface functions:

[0180] hal_hardware_serial_init() is a hardware interface initialization function used to initialize the hardware interface. It initializes the specified hardware interface entity using the defined hardware interface identifier.

[0181] hal_hardware_serial_write() is a hardware interface receive function used to receive communication requests uploaded by the hardware interface and send them to the upper-level communication meta-layer.

[0182] hal_hardware_serial_read() is a hardware interface sending function used to send communication commands issued by the communication meta-layer to the corresponding hardware interface.

[0183] hal_hardware_serial_destroy() is a function for destroying hardware interface-related resources when the hardware interface is no longer in use.

[0184] The Hardware Interface Driver Layer (HAL) defines the general actions of the driver in an abstract sense, and encapsulates and adapts the usage details and action methods of specific hardware models and types. For example, for high-speed serial UART ports, it corresponds to the HAL_UART_Init() function in the STM32 library; for general serial USB ports, it corresponds to the usb_device_open() and usb_device_read() functions of the USB driver.

[0185] The Hardware Interface Driver Layer (HAL) implements the mapping relationship between virtual serial port numbers and hardware interface identifiers, for example:

[0186] HARDWARE_SERIAL_0→STM UART1→USBPORT0

[0187] HARDWARE_SERIAL_1→STM UART2→USBPORT1

[0188] HARDWARE_SERIAL_2→STM UART3→USBPORT2

[0189] HARDWARE_SERIAL_3→STM UART4→USBPORT3

[0190] This means that there are four high-speed serial interfaces: STM UART1, STM UART2, STM UART3, and STM UART4. There are also four general-purpose serial interfaces: USBPORT0, USBPORT1, USBPORT2, and USBPORT3. Correspondingly, four virtual serial ports are configured: HARDWARE_SERIAL_0, HARDWARE_SERIAL_1, HARDWARE_SERIAL_2, and HARDWARE_SERIAL_3. By establishing the above mapping table, the mapping between each general-purpose serial interface and the virtual serial port, as well as the mapping between each high-speed serial interface and the virtual serial port, can be realized. Therefore, for the upper layer, regardless of which hardware interface the communication request comes from, the corresponding virtual serial port number is used as the identifier, facilitating the upper layer's invocation and processing of communication requests.

[0191] The hardware interface driver layer (HAL) defines four driver interface functions, which implement the virtual serial port driver and achieve the corresponding functions in the following ways:

[0192] hal_hardware_serial_init()→HAL_UART_Init()→usb_device_open()

[0193] hal_hardware_serial_write()→HAL_UART_Transmit()→usb_device_write()

[0194] hal_hardware_serial_read()→HAL_UART_Receive()→usb_device_read()

[0195] hal_hardware_serial_destroy()→HAL_UART_DeInit()→usb_device_close()

[0196] (III) Communication Metaphrase Layer

[0197] The communication meta-layer abstracts the basic functions of communication, including communication function modules and data function modules. The communication function modules enable communication with upper and lower layers; the data function modules handle data caching, parsing, and processing.

[0198] Specifically, the communication meta-layer is used to receive communication requests uploaded by the hardware interface driver layer (HAL), parse the communication requests, and then upload the parsed communication requests to the communication protocol layer; and to receive communication instructions issued by the communication protocol layer, organize the communication instructions into a data structure, generate AT instructions, and send them to the hardware interface driver layer (HAL).

[0199] The communication primitive layer specifically employs the following methods to receive, parse, and send communication commands downwards:

[0200] In the memory space of the embedded system, three circular buffer queues are configured: a data receiving circular buffer queue, a data parsing circular buffer queue, and a data sending circular buffer queue.

[0201] The implementation principles of the data receiving circular buffer queue, the data parsing circular buffer queue, and the data sending circular buffer queue are as follows:

[0202] refer to Figure 3 The data receiving circular buffer queue has three control nodes arranged in a circular order: a first head control node, a first middle control node, and a first tail control node; wherein, n first idle nodes are initially configured between the first head control node and the first tail control node.

[0203] refer to Figure 4 The data parsing circular buffer queue has three control nodes arranged in a circular order: the second head control node, the second middle control node, and the second tail control node; wherein, n second idle nodes are initially configured between the second head control node and the second tail control node.

[0204] refer to Figure 5 The data transmission circular buffer queue has three control nodes arranged in a circular order: the third head control node, the third middle control node, and the third tail control node; wherein, n third idle nodes are initially configured between the third head control node and the third tail control node.

[0205] but:

[0206] The execution logic of the data receiving circular buffer queue is as follows:

[0207] For each communication request uploaded by the hardware interface driver layer HAL to the communication primitive layer, each first idle node of the data receiving circular buffer queue is stored, so that each first idle node that has stored the communication request forms a first-in-first-out queue.

[0208] Each of the first free nodes that have stored communication requests is moved sequentially between the first intermediate control node and the first head control node. At this point, the first free node that has stored communication requests is called a preprocessing node, and each preprocessing node forms the first-in-first-out queue. The communication requests stored in each preprocessing node are preprocessed in the following way: the communication requests stored in the preprocessing node are preprocessed directly to obtain the preprocessed communication requests, and the preprocessed communication requests replace the original communication requests stored in the preprocessing node, thus obtaining the node that writes the preprocessed communication requests.

[0209] Each node that has written the preprocessed communication request is moved sequentially between the first tail control node and the first middle control node. The nodes that have written the preprocessed communication request are called parsing nodes, and each parsing node forms the first to third first-in-first-out queue.

[0210] The notification pauses the data receiving ring buffer queue, and copies the communication requests stored in each node used for parsing to each of the second idle nodes in the data parsing ring buffer queue, so that each of the second idle nodes that have stored communication requests forms the 2-1 first-in-first-out queue; when the copying is completed, the notification resumes the operation of the data receiving ring buffer queue; in the data receiving ring buffer queue, the contents of the nodes used by the data parsing ring buffer queue are cleared and moved to the tail of the 1-1 first-in-first-out queue in sequence;

[0211] The execution logic of the data parsing circular buffer queue is as follows:

[0212] Each second free node that has stored a communication request is moved sequentially between the second middle control node and the second head control node. At this point, the second free node that has stored a communication request is called a parsing node. Each parsing node forms a 2-2 first-in-first-out queue. The communication requests stored in each parsing node are parsed and processed in the following way: the communication requests stored in the parsing node are parsed and processed directly to obtain the parsed communication requests. The parsed communication requests are then used to replace the original communication requests stored in the parsing node, resulting in the node that has written the parsed communication requests.

[0213] Each node that has written the parsed communication request is moved sequentially between the second tail control node and the second middle control node. The node that has written the parsed communication request is called the node for use by the upper layer. Each node for use by the upper layer forms the second-third first-in-first-out queue.

[0214] When the upper-level communication protocol layer or application layer needs to execute the parsed communication request, it first pauses the data parsing circular buffer queue, and then directly processes the communication request stored in the upper-level node at the head of the 2nd-3rd first-in-first-out queue to obtain the communication command to be issued; and replaces the original data stored in the upper-level node with the communication command to be issued to obtain the command to be issued node.

[0215] The notification pauses the data parsing circular buffer queue, copies the communication instructions stored in each instruction-issuing node to each of the third idle nodes in the data receiving circular buffer queue, so that each of the third idle nodes that have stored communication instructions forms the 3-1 first-in-first-out queue; when the copying is completed, the notification resumes the operation of the data parsing circular buffer queue; in the data parsing circular buffer queue, the contents of the instruction-issuing nodes that have been used by the data receiving circular buffer queue are cleared, and they are moved to the tail of the 2-1 first-in-first-out queue in sequence;

[0216] The execution logic of the data receiving circular buffer queue is as follows:

[0217] Each of the third idle nodes that have stored communication instructions is moved sequentially between the third middle control node and the third head control node. At this point, the third idle nodes that have stored communication instructions are called data structure organization nodes. Each data structure organization node forms the 3-2 first-in-first-out queue. The communication instructions stored in each data structure organization node are processed by directly processing the communication instructions stored in the data structure organization node to generate AT instructions. The AT instructions then replace the original communication instructions stored in the data structure organization node, thus obtaining the node that writes the AT instructions.

[0218] Each node that writes AT commands is moved sequentially between the third tail control node and the third middle control node. The node that writes AT commands at this time is called the AT command node, and each AT command node forms the 3-3 first-in-first-out queue.

[0219] When AT commands need to be sent down via the hardware interface, the data receiving circular buffer queue is first paused. Then, the AT commands stored in the AT command node are sent down. When the sending is finished, the data receiving circular buffer queue is resumed. In the data receiving circular buffer queue, the contents of the AT command nodes that have finished sending are cleared and moved to the tail of the 3-1 first-in-first-out queue in sequence to form an idle node.

[0220] As a specific implementation, in this invention, the data receiving ring buffer queue, the data parsing ring buffer queue, and the data sending ring buffer queue adopt a time-division control method to realize node movement and data processing.

[0221] In this embodiment of the invention, the data receiving, data parsing, and data sending processes are completed through a data receiving circular buffer queue, a data parsing circular buffer queue, and a data sending circular buffer queue. Combined with memory management, the execution logic of each circular queue, memory space allocation and deallocation, etc., form a memory model for data processing in the intermediate layer framework. Its overall implementation process is as follows: Figure 6 As shown:

[0222] (1) The communication request uploaded by the 5G communication module is a data line command, which is uploaded through the serial interface and placed into the first idle node of the data receiving ring buffer queue;

[0223] (2) Transfer the first idle node containing the data row commands between the first intermediate control node and the first head control node, which is called the preprocessing node; preprocess the data row commands stored in the preprocessing node to obtain the preprocessed data row commands;

[0224] (3) When preparing to parse the preprocessed data line command, the preprocessing node that writes the preprocessed data line command is transferred between the first tail control node and the first middle control node, and is called the parsing node.

[0225] (4) Copy the data row commands stored in the node to be used for parsing to the second free node of the data parsing circular buffer queue;

[0226] (5) The second free node storing the data row commands is moved between the second middle control node and the second head control node, and is called the parsing node;

[0227] (6) Parse the data row commands stored in the parsing node;

[0228] In this step, as a specific implementation method, one approach can be to use... Figure 7 The data is parsed in the manner shown, specifically as follows:

[0229] 1. Determine if the data to be parsed is an event. If it is, the event parsing is complete and the parsing ends. If it is not an event, further determine if it is an expected response. If it is, the expected response parsing is complete and the parsing ends. If it is not an expected response, further determine if it is a normal response. If it is, the normal response parsing is complete and the parsing ends. If it is not a normal response, further determine if it is a new data row. If it is, the new data row parsing is complete and the parsing ends. If it is not a new data row, return to parse the next data.

[0230] In other words, the data to be parsed includes five types: events, expected responses, normal responses, new data rows, and others. This step involves analyzing the data type to complete the parsing process.

[0231] in:

[0232] An event refers to an event sent from the other end to this end, which requires this end to execute the corresponding event.

[0233] Expected response and normal response refer to the following: First, the local end sends an event to the peer end and simultaneously stores the expected response to the peer end on the local end; then, when the local end receives data sent by the peer end, it determines whether the data is consistent with the expected response already stored on the local end. If they are consistent, it means that the data type received by the local end is the expected response; if they are inconsistent, the local end further determines whether it is an unexpected but normal response uploaded by the peer end.

[0234] A new data line refers to a data line sent from the peer to this end, but which does not require execution by this end and only needs to be received by this end;

[0235] (7) After the parsing is completed, the parsing result is written to the parsing node, and the parsing node with the parsing result is moved between the second tail control node and the second middle control node. At this time, it is called the node for use by the upper layer, so that the upper application layer can use it.

[0236] (8) The upper-level communication protocol layer or application layer receives the parsed data line, performs application communication, performs data processing operations using the communication channel, and generates communication instructions to be sent.

[0237] (9) Place the communication command to be sent into the third idle node of the data receiving circular buffer queue;

[0238] (10) The third idle node, which is written with the communication instructions to be sent, is moved between the third middle control node and the third head control node and is called the data structure organization node;

[0239] Organize the communication instructions within the data structure organization node into a data structure to generate AT commands;

[0240] (11) The data structure organization node for writing AT commands is moved between the third tail control node and the third middle control node, and is called the AT command node;

[0241] (12) Send AT command nodes to the 5G communication module through the serial interface.

[0242] The specific process of AT command generation and issuance, such as Figure 8 As shown, it includes:

[0243] 1. When the local end needs to send a certain AT command to the remote end, the local end defines the expected command response data (respond) from the remote end to the AT command.

[0244] 2. Create and store the initialization command response data (respond).

[0245] 3. The local end executes AT commands and sends them to the remote end;

[0246] This end receives data uploaded by the other end and determines whether the data uploaded by the other end is a command response. If it is, it means that the command execution has ended and the data is cleared; if not, it means that the command execution failed and the data is cleared directly.

[0247] (iv) Communication Protocol Layer

[0248] The communication protocol layer defines and implements basic functions related to the application layer, such as communication protocols, basic communication functions, parallel multi-target multi-task communication, and communication memory management.

[0249] Specifically, the communication protocol layer is used to receive communication requests uploaded by the communication metaphrase layer, and to upload the communication requests to the application software interface layer using a parallel multi-target multi-task communication method; and to receive communication instructions issued by the application software interface layer and to issue the communication instructions to the communication metaphrase layer.

[0250] (v) Application Software Interface Layer

[0251] The application software interface layer is used to receive communication requests uploaded by the communication protocol layer and upload them to the application software of the application layer; or, it is used to receive communication instructions issued by the application software of the application layer and send them to the communication protocol layer.

[0252] In practical implementation, the application software interface layer defines how terminal service functions using 5G communication modules call interface functions of the middleware framework through high-level languages ​​such as Java and Python. The defined high-level language interface standards are: Comm_Mod_Open, Comm_Mod_Read, Comm_Mod_Write, Comm_Mod_Close, and Comm_Mod_Ioctl.

[0253] Smart terminals commonly use the TCP protocol and application protocols such as MQTT on top of TCP in the fields of IoT and mobile communication. In these cases, TCP communication inevitably needs to support scenarios where multiple communication objects and multiple tasks are executed in parallel. However, 5G communication modules are characterized by using serial port AT commands, which functionally only support single-path, single-task communication. This invention designs and implements a logical channel, comm_chanel, which uses channel identifiers and channel management bits in data communication to allow logically different communication functions to run on the same hardware. The logical channel achieves logical independence through physical layer data mechanisms. The multi-target, multi-task socket of the terminal using the 5G communication module can be bound to the logical channel of the communication middleware framework, realizing a parallel mechanism of time-sharing processing at the logical level.

[0254] Logical channels are defined through the structure Comm_Chanel, and data organization is also defined through a circular queue structure as follows:

[0255]

[0256] As a specific implementation method, a logical channel can be implemented as follows: When a communication function needs to be called, a logical channel is initialized by requesting comm_chanel_init(), then free memory space is requested through the circular queue management part, the logical channel is mapped to the buffer part, the logical channel is stored, the logical channel operation preparation work is performed, and finally the channel number is returned. When the user further calls the communication function, the logical channel number is bound to the IP address and port of the user's communication counterpart terminal, and finally the user's data communication with the terminal IP address and port begins. The middleware framework is transformed into reading and writing to the logical channel.

[0257] In this invention, the parallel data transmission and reception function of multiple sockets in the application layer to multiple remote communication objects with different IP addresses is realized through Socket multi-channel parallel communication.

[0258] Specifically, since each application layer in the application layer is multi-threaded, the communication interface is called independently and simultaneously for each remote communication object. However, the 5G communication module runs serially with a single instruction. Therefore, software modules are needed in the middle layer to perform modulation and demodulation, converting this one-to-many and many-to-many state to realize the time-division multiplexing driver layer.

[0259] like Figure 9 The diagram shown illustrates the principle of HAL (Hardware Interface Driver) time-division multiplexing, which enables the conversion between parallel and serial communication modes.

[0260] The hardware interface driver layer (HAL) is time-division multiplexed and runs in the middle part. It maintains the state of a group of remote communication objects. By sending instructions to the 5G communication module, it continuously polls the state of each remote communication object and returns data to the upper middle layer framework to maintain communication with the remote communication objects. Since the polling speed of the time-division multiplexing module is very fast, it can be considered to be much faster than the application's data processing speed. Therefore, at the user application level, the data transmission and reception of multiple remote communication objects are simultaneous, realizing parallel communication at the user level.

[0261] Regarding the data structure for user parallel communication, the IP / PORT identifier of the other party in the TCP / IP protocol layer is mapped to the low-level communication object identifier in the AT commands of the mobile module. By maintaining the mapping table in the driver layer software, channel binding from software protocol communication objects to hardware protocol communication objects is achieved.

[0262] In this invention, the application software interface layer and the various application software in the application layer adopt a Socket multi-channel parallel communication method; the 5G communication module and each remote communication object adopt a polling serial communication method; the conversion between parallel communication method and serial communication method is realized by time-division multiplexing the hardware interface driver layer HAL.

[0263] Specifically:

[0264] The Hardware Interface Driver Layer (HAL) maintains a mapping table of communication objects from hardware identifiers to software identifiers.

[0265] The hardware interface driver layer (HAL) continuously determines the event status, which includes three types: the event status of the application software issuing communication instructions; the event status of the remote communication object reporting a communication request; and the idle event status.

[0266] If an event occurs where the application software issues a communication command, the communication command issued by the application software is converted into an AT command, and a mapping relationship between the software identifier and hardware identifier of the remote communication object is established to realize the binding of the logical channel between the remote communication object and the application software, and the AT command is transmitted through the logical channel.

[0267] If an event occurs in which a remote communication object reports a communication request, the communication request of the remote communication object is converted into an application software protocol, and a mapping relationship between the software identifier and hardware identifier of the remote communication object is established to realize the binding of the corresponding logical channel between the remote communication object and the application software, and the communication request is transmitted through the corresponding logical channel.

[0268] If an idle event occurs, the hardware interface driver layer (HAL) polls each remote communication object in the communication object mapping table and processes the data sent and reported by each remote communication object one by one. For data that needs to be sent, the data is transmitted through the corresponding logical channel; for data that needs to be reported, the data is transmitted through the corresponding logical channel.

[0269] The main innovative technical points of the embedded system application 5G communication module middleware framework implementation method provided in this embodiment are as follows:

[0270] (a) The intermediate layer framework implements the data receiving buffer, parsing and sending methods through three circular queues.

[0271] (ii) Methods for executing communication function commands.

[0272] (III) Definition and implementation method of protocol layer logical channel.

[0273] (iv) A method for achieving multi-target, multi-task parallel communication by binding application sockets through logical channels.

[0274] (v) Memory management data space allocation and destruction mechanism and data processing mechanism.

[0275] The embedded system application 5G communication module middleware framework implementation method provided in this embodiment has the following advantages:

[0276] This invention adds an intermediate layer framework between the 5G communication module and the application layer. Through innovative design, this intermediate layer framework stably supports the communication functions of the 5G communication module and provides a high-level language interface to directly implement 5G communication. This reduces the difficulty and barriers to 5G communication module integration. By abstracting and shielding details, it enables direct invocation of application layer functions without requiring modification to existing 4G or Ethernet applications. The intermediate layer framework also enables parallel operation and supports memory management mechanisms, essentially providing an "operating system" level software for communication between the 5G communication hardware module and the application layer.

[0277] Exemplary device

[0278] Figure 10 This invention provides an exemplary embodiment of an embedded system application 5G communication module intermediate layer framework implementation device, such as... Figure 10As shown, this embodiment includes:

[0279] The 5G communication module 11 is used to receive communication requests from a remote communication object and upload them to the middleware framework; and to receive communication instructions issued by the middleware framework and send them to the remote communication object.

[0280] The intermediate layer framework 12 is used to receive communication requests uploaded by the 5G communication module from the remote communication object, parse and process the communication requests to realize the conversion between the hardware protocol of the 5G communication module and the software protocol of the application layer, obtain communication requests that conform to the software protocol of the application layer, and upload the communication requests that conform to the software protocol of the application layer to the application layer; and to receive communication instructions issued by the application layer, parse and process the communication instructions to realize the conversion between the software protocol of the application layer and the hardware protocol of the 5G communication module, obtain communication instructions that conform to the hardware protocol of the 5G communication module, and send the communication instructions that conform to the hardware protocol of the 5G communication module to the 5G communication module.

[0281] The embedded system application 5G communication module intermediate layer framework implementation device of this invention corresponds to the embedded system application 5G communication module intermediate layer framework implementation method of another embodiment of this invention, the specific contents of which are as follows:

[0282] In an exemplary embodiment of the present invention, the intermediate layer framework, in a bottom-up direction, includes a hardware interface layer, a hardware interface driver layer (HAL), a communication primitive layer, a communication protocol layer, and an application software interface layer.

[0283] The hardware interface layer has different types of hardware interfaces, which are bidirectionally connected to the 5G communication module, specifically including:

[0284] The first receiving submodule is used to receive communication requests uploaded by the 5G communication module;

[0285] The first sending submodule is used to send communication commands to the 5G communication module;

[0286] The hardware interface driver layer (HAL) includes:

[0287] The mapping table maintenance submodule is used to maintain the mapping relationship between virtual serial port numbers and hardware interface identifiers;

[0288] The first upload submodule is used to, when sending a communication request to the upper layer, look up the mapping relationship table maintained by the mapping relationship table maintenance submodule, map the hardware interface identifier of the hardware interface currently connected to the 5G communication module to a virtual serial port number, encapsulate the virtual serial port number into the communication request, and use the virtual serial port number as the identifier for the upper layer communication call.

[0289] The second sending submodule is used to, when sending a communication command to the lower layer, look up the mapping relationship table maintained by the mapping relationship table maintenance submodule, map the virtual serial port number in the communication command to a hardware interface identifier, encapsulate the hardware interface identifier into the communication command, and use the hardware interface identifier as the identifier for the lower layer communication call;

[0290] The communication primitive layer includes:

[0291] The second receiving submodule is used to receive the communication request uploaded by the first uploading submodule of the hardware interface driver layer HAL.

[0292] A parsing submodule is used to parse the communication request received by the second receiving submodule;

[0293] The second upload submodule is used to upload the communication request parsed by the parsing submodule to the communication protocol layer.

[0294] The third receiving submodule is used to receive communication instructions issued by the communication protocol layer;

[0295] The AT command generation module is used to organize the communication commands received by the third receiving submodule into a data structure and generate AT commands.

[0296] The AT command sending submodule is used to send the AT commands generated by the AT command generation module to the hardware interface driver layer (HAL).

[0297] The communication protocol layer includes:

[0298] The fourth receiving submodule is used to receive the communication request uploaded by the communication meta-layer;

[0299] The third upload submodule is used to upload the communication request received by the fourth receiving submodule to the application software interface layer using a parallel multi-target multi-task communication method.

[0300] The fifth receiving submodule is used to receive communication instructions sent by the application software interface layer;

[0301] The third sending submodule is used to send the communication instructions received by the fifth receiving submodule to the communication meta-layer;

[0302] The application software interface layer includes:

[0303] The sixth receiving submodule is used to receive communication requests uploaded by the communication protocol layer;

[0304] The fourth upload submodule is used to upload the communication request received by the sixth receiving submodule to the application software in the application layer.

[0305] The seventh receiving submodule is used to receive communication commands issued by the application software in the application layer;

[0306] The fourth sending submodule is used to send the communication instructions received by the seventh receiving submodule to the communication protocol layer.

[0307] In an exemplary embodiment of the present invention, the types of hardware interfaces of the hardware interface layer include: high-speed serial interfaces and universal serial interfaces.

[0308] In an exemplary embodiment of the present invention, the hardware interface driver layer (HAL) defines four driver interface functions:

[0309] The hardware interface initialization function is used to initialize the hardware interface, using the defined hardware interface identifier to initialize the specified hardware interface entity;

[0310] The hardware interface receive function is used to receive communication requests uploaded by the hardware interface and send them to the upper-layer communication meta-level.

[0311] The hardware interface sending function is used to send communication commands issued by the communication meta-layer to the corresponding hardware interface.

[0312] The function for destroying hardware interface-related resources is used to destroy hardware interface-related resources when the hardware interface is no longer in use.

[0313] In an exemplary embodiment of the present invention, the second receiving submodule of the communication primitive layer specifically adopts the following method to receive communication requests:

[0314] Configure a circular buffer queue for data reception in the memory space of the embedded system;

[0315] The data receiving circular buffer queue has three control nodes arranged in a circular order: a first head control node, a first middle control node, and a first tail control node; wherein, n first idle nodes are initially configured between the first head control node and the first tail control node.

[0316] The execution logic of the data receiving circular buffer queue is as follows:

[0317] For each communication request uploaded by the hardware interface driver layer HAL to the communication primitive layer, each first idle node of the data receiving circular buffer queue is stored, so that each first idle node that has stored the communication request forms a first-in-first-out queue.

[0318] Each of the first free nodes that have stored communication requests is moved sequentially between the first intermediate control node and the first head control node. At this time, the first free nodes that have stored communication requests are called preprocessing nodes, and each preprocessing node forms the first-in-first-out queue.

[0319] The communication requests stored in each preprocessing node are preprocessed in the following way: the communication requests stored in the preprocessing node are preprocessed directly to obtain the preprocessed communication requests, and the preprocessed communication requests replace the original communication requests stored in the preprocessing node to obtain the node that writes the preprocessed communication requests.

[0320] Each node that has written the preprocessed communication request is moved sequentially between the first tail control node and the first middle control node. The nodes that have written the preprocessed communication request are called parsing nodes, and each parsing node forms the first to third first-in-first-out queue.

[0321] When communication requests stored in each parsing node need to be copied to the data parsing circular buffer queue, the data receiving circular buffer queue is first paused; after the copying is completed, the data receiving circular buffer queue resumes operation; in the data receiving circular buffer queue, the contents of the parsing nodes that have been used by the data parsing circular buffer queue are cleared and moved to the tail of the first-in-first-out queue in sequence.

[0322] In an exemplary embodiment of the present invention, the parsing submodule of the communication primitive layer specifically performs the parsing of communication requests in the following manner:

[0323] Configure a data parsing circular buffer queue in the memory space of the embedded system;

[0324] The data parsing circular buffer queue has three control nodes arranged in a circular order: the second head control node, the second middle control node, and the second tail control node; wherein, n second idle nodes are initially configured between the second head control node and the second tail control node.

[0325] The execution logic of the data parsing circular buffer queue is as follows:

[0326] The notification data receiving ring buffer queue is paused. The communication requests stored by each node used for parsing are copied to each of the second idle nodes in the data parsing ring buffer queue, so that each of the second idle nodes that have stored communication requests forms the 2-1 first-in-first-out queue.

[0327] Each second free node that has stored a communication request is moved sequentially between the second middle control node and the second head control node. At this point, the second free node that has stored a communication request is called a parsing node. Each parsing node forms a 2-2 first-in-first-out queue. The communication requests stored in each parsing node are parsed and processed in the following way: the communication requests stored in the parsing node are parsed and processed directly to obtain the parsed communication requests. The parsed communication requests are then used to replace the original communication requests stored in the parsing node, resulting in the node that has written the parsed communication requests.

[0328] Each node that has written the parsed communication request is moved sequentially between the second tail control node and the second middle control node. The node that has written the parsed communication request is called the node for use by the upper layer. Each node for use by the upper layer forms the second-third first-in-first-out queue.

[0329] When the upper-level communication protocol layer or application layer needs to execute the parsed communication request, it first pauses the data parsing circular buffer queue, and then directly processes the communication request stored in the upper-level node at the head of the 2nd-3rd first-in-first-out queue to obtain the communication command to be issued; and replaces the original data stored in the upper-level node with the communication command to be issued to obtain the command to be issued node.

[0330] When the communication instructions stored in each instruction-issuing node need to be copied to the data sending circular buffer queue, the data parsing circular buffer queue is first paused; after the copying is completed, the data parsing circular buffer queue resumes operation; in the data parsing circular buffer queue, the contents of the instruction-issuing nodes that have been used by the data sending circular buffer queue are cleared and moved to the tail of the 2-1 first-in-first-out queue in sequence.

[0331] In an exemplary embodiment of the present invention, the T-instruction generation module and the AT-instruction sending submodule of the communication meta-layer specifically employ the following methods to send communication instructions:

[0332] Configure a circular buffer queue for data transmission in the memory space of the embedded system;

[0333] The data transmission circular buffer queue has three control nodes arranged in a circular order: the third head control node, the third middle control node, and the third tail control node; wherein, n third idle nodes are initially configured between the third head control node and the third tail control node.

[0334] The execution logic of the data transmission ring buffer queue is as follows:

[0335] The notification data parsing ring buffer queue is paused. The communication instructions stored in each node that needs to issue instructions are copied to each of the third idle nodes in the data sending ring buffer queue, so that each of the third idle nodes that have stored communication instructions forms the 3-1 first-in-first-out queue.

[0336] Each of the third idle nodes that have stored communication instructions is moved sequentially between the third middle control node and the third head control node. At this point, the third idle nodes that have stored communication instructions are called data structure organization nodes. Each data structure organization node forms the 3-2 first-in-first-out queue. The communication instructions stored in each data structure organization node are processed by directly processing the communication instructions stored in the data structure organization node to generate AT instructions. The AT instructions then replace the original communication instructions stored in the data structure organization node, thus obtaining the node that writes the AT instructions.

[0337] Each node that writes AT commands is moved sequentially between the third tail control node and the third middle control node. The node that writes AT commands at this time is called the AT command node, and each AT command node forms the 3-3 first-in-first-out queue.

[0338] When AT commands need to be sent down via the hardware interface, the data transmission ring buffer queue is first paused. Then, the AT commands stored in the AT command node are sent down. When the sending is finished, the data transmission ring buffer queue is resumed. In the data transmission ring buffer queue, the contents of the AT command nodes that have finished sending are cleared and moved to the tail of the 3-1 first-in-first-out queue in sequence to form an idle node.

[0339] In an exemplary embodiment of the present invention, the data receiving ring buffer queue, the data parsing ring buffer queue, and the data sending ring buffer queue are implemented using a time-division control method to realize node movement and data processing.

[0340] In an exemplary embodiment of the present invention, the application software interface layer and the various application software in the application layer adopt a Socket multi-channel parallel communication method; the 5G communication module and the various remote communication objects adopt a polling serial communication method; the conversion between parallel communication method and serial communication method is realized by time-division multiplexing the hardware interface driver layer HAL.

[0341] Specifically:

[0342] The Hardware Interface Driver Layer (HAL) maintains a mapping table of communication objects from hardware identifiers to software identifiers.

[0343] The hardware interface driver layer (HAL) continuously determines the event status, which includes three types: the event status of the application software issuing communication instructions; the event status of the remote communication object reporting a communication request; and the idle event status.

[0344] If an event occurs where the application software issues a communication command, the communication command issued by the application software is converted into an AT command, and a mapping relationship between the software identifier and hardware identifier of the remote communication object is established to realize the binding of the logical channel between the remote communication object and the application software, and the AT command is transmitted through the logical channel.

[0345] If an event occurs in which a remote communication object reports a communication request, the communication request of the remote communication object is converted into an application software protocol, and a mapping relationship between the software identifier and hardware identifier of the remote communication object is established to realize the binding of the corresponding logical channel between the remote communication object and the application software, and the communication request is transmitted through the corresponding logical channel.

[0346] If an idle event occurs, the hardware interface driver layer (HAL) polls each remote communication object in the communication object mapping table and processes the data sent and reported by each remote communication object one by one. For data that needs to be sent, the data is transmitted through the corresponding logical channel; for data that needs to be reported, the data is transmitted through the corresponding logical channel.

[0347] Exemplary computer device

[0348] Figure 11 This is the structure of a computer device provided in an exemplary embodiment of the present invention. The computer device includes a processor 111 and a processor 112;

[0349] The processor 112 may be a central processing unit (CPU) or other form of processing unit with data processing and / or instruction execution capabilities, and may control other components in the computer device to perform desired functions.

[0350] The memory 111 may include one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may include, for example, random access memory (RAM) and / or cache memory. The non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium, and the processor may execute the program instructions to implement the embedded system application 5G communication module middleware framework implementation method of the software program disclosed in the various embodiments above, and / or other desired functions. In one example, the computer device may further include an input device 113 and an output device 114, which are interconnected via a bus system and / or other forms of connection mechanisms (not shown).

[0351] In addition, the input device 113 may also include, for example, a keyboard, a mouse, etc.

[0352] The output device 114 can output various information to the outside. The output device 114 may include, for example, a display, a speaker, a printer, and a communication network and its connected remote output devices, etc.

[0353] Of course, for the sake of simplicity, Figure 11 Only some of the components of the computer device relevant to this disclosure are shown, omitting components such as buses, input / output interfaces, etc. In addition, the computer device may include any other suitable components depending on the specific application.

[0354] Exemplary computer program products and computer-readable storage media

[0355] In addition to the methods and devices described above, embodiments of this disclosure may also be computer program products, including computer program instructions that, when executed by a processor, cause the processor to perform the steps in the embedded system application 5G communication module middleware framework implementation method according to various embodiments of this disclosure as described in the "Exemplary Methods" section above.

[0356] The computer program product can be written in any combination of one or more programming languages ​​to perform the operations of the embodiments of this disclosure. The programming languages ​​include object-oriented programming languages ​​such as Java and C++, as well as conventional procedural programming languages ​​such as C or similar languages. The program code can be executed entirely on a user's computing device, partially on a user's computing device, as a standalone software package, partially on a user's computing device and partially on a remote computing device, or entirely on a remote computing device or server.

[0357] Furthermore, embodiments of this disclosure may also be computer-readable storage media storing computer program instructions that, when executed by a processor, cause the processor to perform the steps of the method for implementing a 5G communication module middleware framework for an embedded system according to various embodiments of this disclosure as described in the "Exemplary Methods" section above.

[0358] The computer-readable storage medium may be any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may, for example, include, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatuses, or devices, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: electrical connections having one or more wires, portable disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0359] The basic principles of this disclosure have been described above with reference to specific embodiments. However, it should be noted that the advantages, benefits, and effects mentioned in this disclosure are merely examples and not limitations, and should not be considered as essential features of each embodiment of this disclosure. Furthermore, the specific details disclosed above are for illustrative and facilitative purposes only, and are not limitations. These details do not limit the scope of this disclosure to the necessity of employing the aforementioned specific details for implementation.

[0360] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For system embodiments, since they largely correspond to method embodiments, the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments.

[0361] The block diagrams of devices, apparatuses, devices, and systems disclosed herein are merely illustrative examples and are not intended to require or imply that they must be connected, arranged, or configured in the manner shown in the block diagrams. As those skilled in the art will recognize, these devices, apparatuses, devices, and systems can be connected, arranged, and configured in any manner. Words such as “comprising,” “including,” “having,” etc., are open-ended terms meaning “including but not limited to,” and are used interchangeably with them. The terms “or” and “and” as used herein refer to the terms “and / or,” and are used interchangeably with them unless the context clearly indicates otherwise. The term “such as” as used herein refers to the phrase “such as but not limited to,” and is used interchangeably with it.

[0362] The methods and apparatus of this disclosure may be implemented in many ways. For example, they may be implemented by software, hardware, firmware, or any combination of software, hardware, and firmware. The above-described order of steps for the methods is for illustrative purposes only, and the steps of the methods of this disclosure are not limited to the order specifically described above unless otherwise specifically stated. Furthermore, in some embodiments, this disclosure may also be implemented as a program recorded on a recording medium, the program including machine-readable instructions for implementing the methods according to this disclosure. Thus, this disclosure also covers recording media storing programs for performing the methods according to this disclosure.

[0363] It should also be noted that in the apparatus, devices, and methods of this disclosure, the components or steps are decomposable and / or recombinable. Such decomposition and / or recombination should be considered equivalent to the present disclosure. The above description of the disclosed aspects is provided to enable any person skilled in the art to make or use this disclosure. Various modifications to these aspects will be readily apparent to those skilled in the art, and the general principles defined herein can be applied to other aspects without departing from the scope of this disclosure. Therefore, this disclosure is not intended to be limited to the aspects shown herein, but rather to be carried out within the widest scope consistent with the principles and novel features disclosed herein.

[0364] The above description has been given for purposes of illustration and description. Furthermore, this description is not intended to limit the embodiments of this disclosure to the forms disclosed herein. Although numerous exemplary aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, alterations, additions, and sub-combinations therein.

Claims

1. A method for implementing a middleware framework for a 5G communication module in an embedded system, characterized in that, Includes the following steps: The 5G communication module receives communication requests from remote communication objects and uploads them to the middleware framework. The intermediate layer framework receives communication requests from the remote communication object uploaded by the 5G communication module, parses and processes the communication requests, realizes the conversion between the hardware protocol of the 5G communication module and the software protocol of the application layer, obtains communication requests that conform to the software protocol of the application layer, and uploads the communication requests that conform to the software protocol of the application layer to the application layer. The intermediate layer framework receives communication instructions issued by the application layer, parses and processes the communication instructions, realizes the conversion of the application layer's software protocol to the hardware protocol of the 5G communication module, obtains communication instructions that conform to the hardware protocol of the 5G communication module, and sends the communication instructions that conform to the hardware protocol of the 5G communication module to the 5G communication module. The 5G communication module receives communication instructions from the intermediate layer framework and sends them to the remote communication object. The intermediate layer framework, from bottom to top, includes a hardware interface layer, a hardware interface driver layer (HAL), a communication primitive layer, a communication protocol layer, and an application software interface layer. The communication primitive layer is configured with three circular buffer queues in the memory space of the embedded system: a data receiving circular buffer queue, a data parsing circular buffer queue, and a data sending circular buffer queue. The communication request uploaded by the 5G communication module is a data line command, which is uploaded through the serial interface and placed into the first idle node of the data receiving circular buffer queue. The data receiving circular buffer queue transfers the first idle node containing the data line command between the first intermediate control node and the first head control node, which is called the preprocessing node; The data row commands stored in the preprocessing node are preprocessed to obtain the preprocessed data row commands. When preparing to parse the preprocessed data line commands, the preprocessing node that wrote the preprocessed data line commands is moved between the first tail control node and the first middle control node, and is called the parsing node; the data line commands stored in the parsing node are copied to the second free node of the data parsing circular buffer queue. The data parsing circular buffer queue moves the second free node containing the data row command between the second middle control node and the second head control node, and this node is called the parsing node. Parse the data lines stored within the parsing node; Once parsing is complete, the parsing result is written to the parsing node, and the parsing node containing the parsing result is moved between the second tail control node and the second middle control node. At this point, it is called the node for use by the upper layer, for use by the upper application layer. The upper communication protocol layer or application layer receives the parsed data line, performs application communication, uses the communication channel to perform data processing operations, and generates communication instructions to be sent. The communication instructions to be sent are placed into the third idle node of the data transmission circular buffer queue. The data transmission circular buffer queue will write the communication command to be sent to the third idle node, and move it between the third middle control node and the third head control node, which is called the data structure organization node; The communication instructions within the data structure organization node are organized into data structures to generate AT instructions; the data structure organization node containing the AT instructions is moved between the third tail control node and the third middle control node, and is called the AT instruction node. The AT command node sends the command to the 5G communication module via the serial interface.

2. The method for implementing the intermediate layer framework of an embedded system application 5G communication module according to claim 1, characterized in that, The hardware interface layer has different types of hardware interfaces, which are bidirectionally connected to the 5G communication module to receive communication requests uploaded by the 5G communication module and to issue communication commands to the 5G communication module. The Hardware Interface Driver Layer (HAL) maintains a mapping table between virtual serial port numbers and hardware interface identifiers. When sending a communication request to the upper layer, it looks up the mapping table to map the hardware interface identifier of the hardware interface currently connected to the 5G communication module to a virtual serial port number, and encapsulates the virtual serial port number into the communication request, using the virtual serial port number as the identifier for upper-layer communication calls. When sending a communication command to the lower layer, it looks up the mapping table to map the virtual serial port number in the communication command to a hardware interface identifier, and encapsulates the hardware interface identifier into the communication command, using the hardware interface identifier as the identifier for lower-layer communication calls. The communication meta-layer is used to receive communication requests uploaded by the hardware interface driver layer (HAL), parse the communication requests, and then upload the parsed communication requests to the communication protocol layer. And, for receiving communication instructions issued by the communication protocol layer, organizing the communication instructions into a data structure, generating AT instructions, and issuing them to the hardware interface driver layer HAL; The communication protocol layer is used to receive communication requests uploaded by the communication meta-language layer, and to upload the communication requests to the application software interface layer using a parallel multi-target multi-task communication method. And, for receiving communication instructions issued by the application software interface layer, and for issuing the communication instructions to the communication meta-layer; The application software interface layer is used to receive communication requests uploaded by the communication protocol layer and upload them to the application software of the application layer; or, it is used to receive communication instructions issued by the application software of the application layer and send them to the communication protocol layer.

3. The method for implementing the intermediate layer framework of an embedded system application 5G communication module according to claim 2, characterized in that, The types of hardware interfaces in the hardware interface layer include: high-speed serial interfaces and universal serial interfaces.

4. The method for implementing the intermediate layer framework of an embedded system application 5G communication module according to claim 2, characterized in that, The hardware interface driver layer (HAL) defines four driver interface functions: The hardware interface initialization function is used to initialize the hardware interface, using the defined hardware interface identifier to initialize the specified hardware interface entity; The hardware interface receive function is used to receive communication requests uploaded by the hardware interface and send them to the upper-layer communication meta-level. The hardware interface sending function is used to send communication commands issued by the communication meta-layer to the corresponding hardware interface. The function for destroying hardware interface-related resources is used to destroy hardware interface-related resources when the hardware interface is no longer in use.

5. The method for implementing the intermediate layer framework of an embedded system application 5G communication module according to claim 2, characterized in that, The communication primitive layer specifically uses the following method to receive communication requests: Configure a circular buffer queue for data reception in the memory space of the embedded system; The data receiving circular buffer queue has three control nodes arranged in a circular order: a first head control node, a first middle control node, and a first tail control node; wherein, n first idle nodes are initially configured between the first head control node and the first tail control node. The execution logic of the data receiving circular buffer queue is as follows: For each communication request uploaded by the hardware interface driver layer HAL to the communication primitive layer, each first idle node of the data receiving circular buffer queue is stored, so that each first idle node that has stored the communication request forms a first-in-first-out queue. Each of the first free nodes that have stored communication requests is moved sequentially between the first intermediate control node and the first head control node. At this time, the first free nodes that have stored communication requests are called preprocessing nodes, and each preprocessing node forms the first-in-first-out queue. The communication requests stored in each preprocessing node are preprocessed in the following way: the communication requests stored in the preprocessing node are preprocessed directly to obtain the preprocessed communication requests, and the preprocessed communication requests replace the original communication requests stored in the preprocessing node to obtain the node that writes the preprocessed communication requests. Each node that has written the preprocessed communication request is moved sequentially between the first tail control node and the first middle control node. The nodes that have written the preprocessed communication request are called parsing nodes, and each parsing node forms the first to third first-in-first-out queue. When communication requests stored in each parsing node need to be copied to the data parsing circular buffer queue, the data receiving circular buffer queue is first paused; after the copying is completed, the data receiving circular buffer queue resumes operation; in the data receiving circular buffer queue, the contents of the parsing nodes that have been used by the data parsing circular buffer queue are cleared and moved to the tail of the first-in-first-out queue in sequence.

6. The method for implementing the intermediate layer framework of an embedded system application 5G communication module according to claim 5, characterized in that, The communication primitive layer specifically uses the following method to parse communication requests: Configure a data parsing circular buffer queue in the memory space of the embedded system; The data parsing circular buffer queue has three control nodes arranged in a circular order: the second head control node, the second middle control node, and the second tail control node; wherein, n second idle nodes are initially configured between the second head control node and the second tail control node. The execution logic of the data parsing circular buffer queue is as follows: The notification data receiving ring buffer queue is paused. The communication requests stored by each node used for parsing are copied to each of the second idle nodes in the data parsing ring buffer queue, so that each of the second idle nodes that have stored communication requests forms the 2-1 first-in-first-out queue. Each second free node that has stored a communication request is moved sequentially between the second middle control node and the second head control node. At this point, the second free node that has stored a communication request is called a parsing node. Each parsing node forms a 2-2 first-in-first-out queue. The communication requests stored in each parsing node are parsed and processed in the following way: the communication requests stored in the parsing node are parsed and processed directly to obtain the parsed communication requests. The parsed communication requests are then used to replace the original communication requests stored in the parsing node, resulting in the node that has written the parsed communication requests. Each node that has written the parsed communication request is moved sequentially between the second tail control node and the second middle control node. The node that has written the parsed communication request is called the node for use by the upper layer. Each node for use by the upper layer forms the second-third first-in-first-out queue. When the upper-level communication protocol layer or application layer needs to execute the parsed communication request, it first pauses the data parsing circular buffer queue, and then directly processes the communication request stored in the upper-level node at the head of the 2nd-3rd first-in-first-out queue to obtain the communication command to be issued; and replaces the original data stored in the upper-level node with the communication command to be issued to obtain the command to be issued node. When the communication instructions stored in each instruction-issuing node need to be copied to the data sending circular buffer queue, the data parsing circular buffer queue is first paused; after the copying is completed, the data parsing circular buffer queue resumes operation; in the data parsing circular buffer queue, the contents of the instruction-issuing nodes that have been used by the data sending circular buffer queue are cleared and moved to the tail of the 2-1 first-in-first-out queue in sequence.

7. The method for implementing the intermediate layer framework of an embedded system application 5G communication module according to claim 6, characterized in that, The communication primitive layer specifically uses the following methods to send communication commands: Configure a circular buffer queue for data transmission in the memory space of the embedded system; The data transmission circular buffer queue has three control nodes arranged in a circular order: the third head control node, the third middle control node, and the third tail control node; wherein, n third idle nodes are initially configured between the third head control node and the third tail control node. The execution logic of the data transmission ring buffer queue is as follows: The notification data parsing ring buffer queue is paused. The communication instructions stored in each node that needs to issue instructions are copied to each of the third idle nodes in the data sending ring buffer queue, so that each of the third idle nodes that have stored communication instructions forms the 3-1 first-in-first-out queue. Each of the third idle nodes that have stored communication instructions is moved sequentially between the third middle control node and the third head control node. At this point, the third idle nodes that have stored communication instructions are called data structure organization nodes. Each data structure organization node forms the 3-2 first-in-first-out queue. The communication instructions stored in each data structure organization node are processed by directly processing the communication instructions stored in the data structure organization node to generate AT instructions. The AT instructions then replace the original communication instructions stored in the data structure organization node, thus obtaining the node that writes the AT instructions. Each node that writes AT commands is moved sequentially between the third tail control node and the third middle control node. The node that writes AT commands at this time is called the AT command node, and each AT command node forms the 3-3 first-in-first-out queue. When AT commands need to be sent down via the hardware interface, the data transmission ring buffer queue is first paused. Then, the AT commands stored in the AT command node are sent down. When the sending is finished, the data transmission ring buffer queue is resumed. In the data transmission ring buffer queue, the contents of the AT command nodes that have finished sending are cleared and moved to the tail of the 3-1 first-in-first-out queue in sequence to form an idle node.

8. The method for implementing the intermediate layer framework of an embedded system application 5G communication module according to claim 7, characterized in that, The data receiving ring buffer queue, the data parsing ring buffer queue, and the data sending ring buffer queue adopt a time-division control method to realize node movement and data processing.

9. The method for implementing the intermediate layer framework of an embedded system application 5G communication module according to claim 2, characterized in that, The application software interface layer and the various application software in the application layer adopt a Socket multi-channel parallel communication method; the 5G communication module and the various remote communication objects adopt a polling serial communication method; the conversion between parallel communication method and serial communication method is realized by time-division multiplexing the hardware interface driver layer HAL. Specifically: The Hardware Interface Driver Layer (HAL) maintains a mapping table of communication objects from hardware identifiers to software identifiers. The hardware interface driver layer (HAL) continuously determines the event status, which includes three types: the event status of the application software issuing communication instructions; the event status of the remote communication object reporting a communication request; and the idle event status. If an event occurs where the application software issues a communication command, the communication command issued by the application software is converted into an AT command, and a mapping relationship between the software identifier and hardware identifier of the remote communication object is established to realize the binding of the logical channel between the remote communication object and the application software, and the AT command is transmitted through the logical channel. If an event occurs in which a remote communication object reports a communication request, the communication request of the remote communication object is converted into an application software protocol, and a mapping relationship between the software identifier and hardware identifier of the remote communication object is established to realize the binding of the corresponding logical channel between the remote communication object and the application software, and the communication request is transmitted through the corresponding logical channel. If an idle event occurs, the hardware interface driver layer (HAL) polls each remote communication object in the communication object mapping table and processes the data sent and reported by each remote communication object one by one. For data that needs to be sent, the data is transmitted through the corresponding logical channel; for data that needs to be reported, the data is transmitted through the corresponding logical channel.

10. A device for implementing a 5G communication module intermediate layer framework in an embedded system, characterized in that, Includes 5G communication modules and middleware framework; The 5G communication module is used to receive communication requests from remote communication objects and upload them to the middleware framework; and to receive communication instructions issued by the middleware framework and send them to the remote communication objects. The intermediate layer framework is used to receive communication requests from the remote communication object uploaded by the 5G communication module, parse and process the communication requests, realize the conversion between the hardware protocol of the 5G communication module and the software protocol of the application layer, obtain communication requests that conform to the software protocol of the application layer, and upload the communication requests that conform to the software protocol of the application layer to the application layer. And, for receiving communication instructions issued by the application layer, parsing and processing the communication instructions, realizing the conversion of the software protocol of the application layer to the hardware protocol of the 5G communication module, obtaining communication instructions that conform to the hardware protocol of the 5G communication module, and issuing the communication instructions that conform to the hardware protocol of the 5G communication module to the 5G communication module. The intermediate layer framework, from bottom to top, includes a hardware interface layer, a hardware interface driver layer (HAL), a communication primitive layer, a communication protocol layer, and an application software interface layer. The communication primitive layer is configured with three circular buffer queues in the memory space of the embedded system: a data receiving circular buffer queue, a data parsing circular buffer queue, and a data sending circular buffer queue. The communication request uploaded by the 5G communication module is a data line command, which is uploaded through the serial interface and placed into the first idle node of the data receiving circular buffer queue. The data receiving circular buffer queue transfers the first idle node containing the data line command between the first intermediate control node and the first head control node, which is called the preprocessing node; The data row commands stored in the preprocessing node are preprocessed to obtain the preprocessed data row commands. When preparing to parse the preprocessed data line commands, the preprocessing node that wrote the preprocessed data line commands is moved between the first tail control node and the first middle control node, and is called the parsing node; the data line commands stored in the parsing node are copied to the second free node of the data parsing circular buffer queue. The data parsing circular buffer queue moves the second free node containing the data row command between the second middle control node and the second head control node, and this node is called the parsing node. Parse the data lines stored within the parsing node; Once parsing is complete, the parsing result is written to the parsing node, and the parsing node containing the parsing result is moved between the second tail control node and the second middle control node. At this point, it is called the node for use by the upper layer, for use by the upper application layer. The upper communication protocol layer or application layer receives the parsed data line, performs application communication, uses the communication channel to perform data processing operations, and generates communication instructions to be sent. The communication instructions to be sent are placed into the third idle node of the data transmission circular buffer queue. The data transmission circular buffer queue will write the communication command to be sent to the third idle node, and move it between the third middle control node and the third head control node, which is called the data structure organization node; The communication instructions within the data structure organization node are organized into data structures to generate AT instructions; the data structure organization node containing the AT instructions is moved between the third tail control node and the third middle control node, and is called the AT instruction node. The AT command node sends the command to the 5G communication module via the serial interface.

11. The device for implementing an intermediate layer framework of a 5G communication module in an embedded system according to claim 10, characterized in that, The hardware interface layer has different types of hardware interfaces, which are bidirectionally connected to the 5G communication module, specifically including: The first receiving submodule is used to receive communication requests uploaded by the 5G communication module; The first sending submodule is used to send communication commands to the 5G communication module; The hardware interface driver layer (HAL) includes: The mapping table maintenance submodule is used to maintain the mapping relationship between virtual serial port numbers and hardware interface identifiers; The first upload submodule is used to, when sending a communication request to the upper layer, look up the mapping relationship table maintained by the mapping relationship table maintenance submodule, map the hardware interface identifier of the hardware interface currently connected to the 5G communication module to a virtual serial port number, encapsulate the virtual serial port number into the communication request, and use the virtual serial port number as the identifier for the upper layer communication call. The second sending submodule is used to, when sending a communication command to the lower layer, look up the mapping relationship table maintained by the mapping relationship table maintenance submodule, map the virtual serial port number in the communication command to a hardware interface identifier, encapsulate the hardware interface identifier into the communication command, and use the hardware interface identifier as the identifier for the lower layer communication call; The communication primitive layer includes: The second receiving submodule is used to receive the communication request uploaded by the first uploading submodule of the hardware interface driver layer HAL. A parsing submodule is used to parse the communication request received by the second receiving submodule; The second upload submodule is used to upload the communication request parsed by the parsing submodule to the communication protocol layer. The third receiving submodule is used to receive communication instructions issued by the communication protocol layer; The AT command generation module is used to organize the communication commands received by the third receiving submodule into a data structure and generate AT commands. The AT command sending submodule is used to send the AT commands generated by the AT command generation module to the hardware interface driver layer (HAL). The communication protocol layer includes: The fourth receiving submodule is used to receive the communication request uploaded by the communication meta-layer; The third upload submodule is used to upload the communication request received by the fourth receiving submodule to the application software interface layer using a parallel multi-target multi-task communication method. The fifth receiving submodule is used to receive communication instructions sent by the application software interface layer; The third sending submodule is used to send the communication instructions received by the fifth receiving submodule to the communication meta-layer; The application software interface layer includes: The sixth receiving submodule is used to receive communication requests uploaded by the communication protocol layer; The fourth upload submodule is used to upload the communication request received by the sixth receiving submodule to the application software in the application layer. The seventh receiving submodule is used to receive communication commands issued by the application software in the application layer; The fourth sending submodule is used to send the communication instructions received by the seventh receiving submodule to the communication protocol layer.

12. The device for implementing a 5G communication module intermediate layer framework in an embedded system according to claim 11, characterized in that, The types of hardware interfaces in the hardware interface layer include: high-speed serial interfaces and universal serial interfaces.

13. The device for implementing a 5G communication module intermediate layer framework in an embedded system according to claim 11, characterized in that, The hardware interface driver layer (HAL) defines four driver interface functions: The hardware interface initialization function is used to initialize the hardware interface, using the defined hardware interface identifier to initialize the specified hardware interface entity; The hardware interface receive function is used to receive communication requests uploaded by the hardware interface and send them to the upper-layer communication meta-level. The hardware interface sending function is used to send communication commands issued by the communication meta-layer to the corresponding hardware interface. The function for destroying hardware interface-related resources is used to destroy hardware interface-related resources when the hardware interface is no longer in use.

14. The device for implementing a 5G communication module intermediate layer framework in an embedded system according to claim 11, characterized in that, The second receiving submodule of the communication primitive layer specifically uses the following method to receive communication requests: Configure a circular buffer queue for data reception in the memory space of the embedded system; The data receiving circular buffer queue has three control nodes arranged in a circular order: a first head control node, a first middle control node, and a first tail control node; wherein, n first idle nodes are initially configured between the first head control node and the first tail control node. The execution logic of the data receiving circular buffer queue is as follows: For each communication request uploaded by the hardware interface driver layer HAL to the communication primitive layer, each first idle node of the data receiving circular buffer queue is stored, so that each first idle node that has stored the communication request forms a first-in-first-out queue. Each of the first free nodes that have stored communication requests is moved sequentially between the first intermediate control node and the first head control node. At this time, the first free nodes that have stored communication requests are called preprocessing nodes, and each preprocessing node forms the first-in-first-out queue. The communication requests stored in each preprocessing node are preprocessed in the following way: the communication requests stored in the preprocessing node are preprocessed directly to obtain the preprocessed communication requests, and the preprocessed communication requests replace the original communication requests stored in the preprocessing node to obtain the node that writes the preprocessed communication requests. Each node that has written the preprocessed communication request is moved sequentially between the first tail control node and the first middle control node. The nodes that have written the preprocessed communication request are called parsing nodes, and each parsing node forms the first to third first-in-first-out queue. When communication requests stored in each parsing node need to be copied to the data parsing circular buffer queue, the data receiving circular buffer queue is first paused; after the copying is completed, the data receiving circular buffer queue resumes operation; in the data receiving circular buffer queue, the contents of the parsing nodes that have been used by the data parsing circular buffer queue are cleared and moved to the tail of the first-in-first-out queue in sequence.

15. The device for implementing a 5G communication module intermediate layer framework in an embedded system according to claim 14, characterized in that, The parsing submodule of the communication primitive layer specifically parses communication requests in the following manner: Configure a data parsing circular buffer queue in the memory space of the embedded system; The data parsing circular buffer queue has three control nodes arranged in a circular order: the second head control node, the second middle control node, and the second tail control node; wherein, n second idle nodes are initially configured between the second head control node and the second tail control node. The execution logic of the data parsing circular buffer queue is as follows: The notification data receiving ring buffer queue is paused. The communication requests stored by each node used for parsing are copied to each of the second idle nodes in the data parsing ring buffer queue, so that each of the second idle nodes that have stored communication requests forms the 2-1 first-in-first-out queue. Each second free node that has stored a communication request is moved sequentially between the second middle control node and the second head control node. At this point, the second free node that has stored a communication request is called a parsing node. Each parsing node forms a 2-2 first-in-first-out queue. The communication requests stored in each parsing node are parsed and processed in the following way: the communication requests stored in the parsing node are parsed and processed directly to obtain the parsed communication requests. The parsed communication requests are then used to replace the original communication requests stored in the parsing node, resulting in the node that has written the parsed communication requests. Each node that has written the parsed communication request is moved sequentially between the second tail control node and the second middle control node. The node that has written the parsed communication request is called the node for use by the upper layer. Each node for use by the upper layer forms the second-third first-in-first-out queue. When the upper-level communication protocol layer or application layer needs to execute the parsed communication request, it first pauses the data parsing circular buffer queue, and then directly processes the communication request stored in the upper-level node at the head of the 2nd-3rd first-in-first-out queue to obtain the communication command to be issued; and replaces the original data stored in the upper-level node with the communication command to be issued to obtain the command to be issued node. When the communication instructions stored in each instruction-issuing node need to be copied to the data sending circular buffer queue, the data parsing circular buffer queue is first paused; after the copying is completed, the data parsing circular buffer queue resumes operation; in the data parsing circular buffer queue, the contents of the instruction-issuing nodes that have been used by the data sending circular buffer queue are cleared and moved to the tail of the 2-1 first-in-first-out queue in sequence.

16. The device for implementing a 5G communication module intermediate layer framework in an embedded system according to claim 15, characterized in that, The T-command generation module and AT-command sending submodule of the communication primitive layer specifically use the following methods to send communication commands: Configure a circular buffer queue for data transmission in the memory space of the embedded system; The data transmission circular buffer queue has three control nodes arranged in a circular order: the third head control node, the third middle control node, and the third tail control node; wherein, n third idle nodes are initially configured between the third head control node and the third tail control node. The execution logic of the data transmission ring buffer queue is as follows: The notification data parsing ring buffer queue is paused. The communication instructions stored in each node that needs to issue instructions are copied to each of the third idle nodes in the data sending ring buffer queue, so that each of the third idle nodes that have stored communication instructions forms the 3-1 first-in-first-out queue. Each of the third idle nodes that have stored communication instructions is moved sequentially between the third middle control node and the third head control node. At this point, the third idle nodes that have stored communication instructions are called data structure organization nodes. Each data structure organization node forms the 3-2 first-in-first-out queue. The communication instructions stored in each data structure organization node are processed by directly processing the communication instructions stored in the data structure organization node to generate AT instructions. The AT instructions then replace the original communication instructions stored in the data structure organization node, thus obtaining the node that writes the AT instructions. Each node that writes AT commands is moved sequentially between the third tail control node and the third middle control node. The node that writes AT commands at this time is called the AT command node, and each AT command node forms the 3-3 first-in-first-out queue. When AT commands need to be sent down via the hardware interface, the data transmission ring buffer queue is first paused. Then, the AT commands stored in the AT command node are sent down. When the sending is finished, the data transmission ring buffer queue is resumed. In the data transmission ring buffer queue, the contents of the AT command nodes that have finished sending are cleared and moved to the tail of the 3-1 first-in-first-out queue in sequence to form an idle node.

17. The device for implementing a 5G communication module intermediate layer framework in an embedded system according to claim 16, characterized in that, The data receiving ring buffer queue, the data parsing ring buffer queue, and the data sending ring buffer queue adopt a time-division control method to realize node movement and data processing.

18. The device for implementing a 5G communication module intermediate layer framework in an embedded system according to claim 11, characterized in that, The application software interface layer and the various application software in the application layer adopt a Socket multi-channel parallel communication method; the 5G communication module and the various remote communication objects adopt a polling serial communication method; the conversion between parallel communication method and serial communication method is realized by time-division multiplexing the hardware interface driver layer HAL. Specifically: The Hardware Interface Driver Layer (HAL) maintains a mapping table of communication objects from hardware identifiers to software identifiers. The hardware interface driver layer (HAL) continuously determines the event status, which includes three types: the event status of the application software issuing communication instructions; the event status of the remote communication object reporting a communication request; and the idle event status. If an event occurs where the application software issues a communication command, the communication command issued by the application software is converted into an AT command, and a mapping relationship between the software identifier and hardware identifier of the remote communication object is established to realize the binding of the logical channel between the remote communication object and the application software, and the AT command is transmitted through the logical channel. If an event occurs in which a remote communication object reports a communication request, the communication request of the remote communication object is converted into an application software protocol, and a mapping relationship between the software identifier and hardware identifier of the remote communication object is established to realize the binding of the corresponding logical channel between the remote communication object and the application software, and the communication request is transmitted through the corresponding logical channel. If an idle event occurs, the hardware interface driver layer (HAL) polls each remote communication object in the communication object mapping table and processes the data sent and reported by each remote communication object one by one. For data that needs to be sent, the data is transmitted through the corresponding logical channel; for data that needs to be reported, the data is transmitted through the corresponding logical channel.

19. A storage medium, characterized in that, The storage medium stores a computer program. When the processor executes the computer program stored on the storage medium, it implements the embedded system application 5G communication module intermediate layer framework implementation method as described in any one of claims 1 to 9.

20. A computer device, characterized in that, The computer device includes a memory and a processor. The memory is used to store a computer-executable program, and the processor is used to run the computer-executable program to implement the embedded system application 5G communication module intermediate layer framework implementation method according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • Multi-mode communication implementation method and device based on kylin mobile operating system

    CN113207194A