Method for saving and outputting direct output short message
Technical Field
The invention relates to an information storage and output method, in particular to a method for directly outputting short messages for storage and output.
Background
Short messages are point-to-point information transmission techniques. The short message received by the modem is stored, transmitted and notified to the AP, and the AP can be configured through a series of AT commands.
The short message received by the Modem can be stored in the Modem side, and then the AP is informed to fetch the short message. The short message may also be directly output to the AP. The data interface between the Modem and the AP is generally an AT interface, and the state of the AT interface is divided into a data state and a command state. In the command state, the received short message can be directly output to the AP. In the data state, data is generally buffered at the modem side, and the buffered message is output to the AP when the data state is restored.
The short message content or the indication message output to the AP is also notified to the AP through an AT command on the serial port. The state of the AT port includes a data state and a command state. If the port state is a data state, the short message data directly outputs the short message content to the AP according to the setting instead of being stored in the modem, and outputs a storage instruction to the AP. How the data is buffered in this case is not explicitly indicated by the 3GPP standard protocol 27005.
The storage media of the short message on the modem are mainly 2 kinds, NV and USIM. Aiming AT the configuration that the short message content is directly output in the AT port data state, the short message content is also stored on the 2 media, and a simpler, faster and quicker mode does not exist,
the advantage of short message save on the NV and USIM is that it can be saved for long periods of time without loss of data even if the system is powered off. The disadvantage is the slow data storage read speed.
Disclosure of Invention
In order to solve the technical problem, the invention provides a method for storing and outputting the short message by directly outputting the short message aiming AT the problem of storing the short message under the configuration of directly outputting the short message content under the data state of the AT port, comprising a storage medium and a caching and outputting method.
In order to achieve the purpose, the invention provides the following technical scheme:
a method for saving and outputting short message directly includes applying RAM memory space when short message is needed to be cached in data state of AT port, and pressing address and length parameter of applied memory into said memory management queue; when the memory address needs to be output, the address and the length information are sequentially read out from the queue, the data of the memory address is output to the AP, and meanwhile the memory space is released.
The invention is further improved, and the steps of directly outputting the short message content to the RAM for storage when the AT port is in a data state are specifically as follows:
s1, establishing a memory management queue for managing a memory for storing the short message;
s2, firstly analyzing the header information of the received short message to obtain the grade of the short message, judging whether the content of the short message needs to be directly output to the AP or not based on the grade and output configuration, if not, processing according to the description of 3GPP 27007, and if so, entering S3;
s3, the AT port state directly outputs the short message content to the AP if the AT port state is the command state; if the data state is the data state, the step goes to S4;
s4, applying for the memory space of the short message content length in the RAM, copying the short message content to the applied memory, and simultaneously pressing the applied memory address and length information into a memory management queue.
The invention is further improved, when the AT port is restored to the command state, the data is taken out from the RAM and output to the AP specifically comprises the following steps:
s1, sequentially taking out elements in a queue from a management memory queue;
and S2, outputting the short message content on the address to the AP, and releasing the corresponding memory space.
The invention has the beneficial effects that: the short message content storage problem under the configuration that the short message content is directly output in the AT port data state comprises a storage medium, a cache and an output method, since the configuration that the short message content is directly output to an AP, the AP analyzes and decodes the short message content, the AP enables the data to be output to the AP better as soon as possible, and under the condition that the data has to be cached in the port data state, the NV and USIM storage and reading speeds are slow, which is not beneficial to outputting the short message content to the AP quickly when the port is restored to the command state, therefore, the short message is cached in a RAM, and the RAM has the advantages that the data reading speed is fast, and the cache and the output of the short message under the condition are just matched.
Drawings
FIG. 1 is a schematic view of a preservation process of the present invention;
FIG. 2 is a schematic diagram of an output process according to the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Example (b): as shown in fig. 1 and fig. 2, the method for saving and outputting a short message includes applying for a RAM memory space when a short message needs to be cached in a data state AT an AT port, and pushing an address and a length parameter of the applied RAM memory into the memory management queue; when the memory address needs to be output, the address and the length information are sequentially read out from the queue, the data of the memory address is output to the AP, and meanwhile the memory space is released.
In this embodiment, when the AT port is in the data state, the step of directly outputting the short message content to the RAM includes the following steps:
s1, establishing a memory management queue for managing a memory for storing the short message;
s2, firstly analyzing the header information of the received short message to obtain the grade of the short message, judging whether the content of the short message needs to be directly output to the AP or not based on the grade and output configuration, if not, processing according to the description of 3GPP 27007, and if so, entering S3;
s3, the AT port state directly outputs the short message content to the AP if the AT port state is the command state; if the data state is the data state, the step goes to S4;
s4, applying for the memory space of the short message content length in the RAM, copying the short message content to the applied memory, and simultaneously pressing the applied memory address and length information into a memory management queue.
In this embodiment, when the AT port is restored to the command state, the step of retrieving data from the RAM and outputting the data to the AP specifically includes:
s1, sequentially taking out elements in a queue from a management memory queue;
and S2, outputting the short message content on the address to the AP, and releasing the corresponding memory space.
The foregoing is merely an example of the present invention and common general knowledge of known specific structures and features of the embodiments is not described herein in any greater detail. It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential attributes thereof. The present embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference sign in a claim should not be construed as limiting the claim concerned.