Embodiment 1
The embodiment of the present invention provides a kind of method for sending information, when solving to carry out information transmission using the prior art,
There is a problem of that information transmitting efficiency is lower.
The executing subject of the method for sending information provided in an embodiment of the present invention can be Bluetooth system, for example can be vehicle
Carry Bluetooth system and parking lot Bluetooth system etc..The executing subject does not constitute a limitation of the invention simultaneously, for the ease of
Description, the embodiment of the present invention are illustrated so that executing subject is on-vehicle Bluetooth system as an example.
Specifically, the specific implementation flow schematic diagram of this method provided in an embodiment of the present invention is as shown in Figure 1, mainly include
Following step:
Step 11, it obtains information and sends instruction, and send and instruct in response to the information, create empty queue;
It should be noted that the information obtained sends instruction, it can be and connect by user by the voice of on-vehicle Bluetooth system
Mouth (e.g., microphone or microphone) is by voice input.
For example, it is assumed that when driving, user A is expected that by on-vehicle Bluetooth system triggering and builds with the on-vehicle Bluetooth system
The mobile phone of vertical connection sends short message to user B, then can input voice by the microphone of on-vehicle Bluetooth system: " send to user B
Short message ", on-vehicle Bluetooth system can be obtained information and send instruction, and sends and instruct in response to the information, and creation one is empty
Queue.
It should also be noted that, the information obtained sends instruction, it is also possible to the finger by user to on-vehicle Bluetooth system
Input interface is enabled to execute specific operation and trigger.
For example, user can click " sending information " button of on-vehicle Bluetooth system, on-vehicle Bluetooth system can be obtained letter
Breath sends instruction.
Step 12, information to be sent and at least two recipients mark are obtained;According to the information to be sent and described
At least two recipients mark, is arranged the queue object in the queue;
Generally, the information to be sent of acquisition can be the text information input interface by on-vehicle Bluetooth system, defeated
Enter the text information to on-vehicle Bluetooth system;It is also possible to the language inputted by the speech interface (such as microphone) of on-vehicle Bluetooth system
Message breath;It can also be the text information as obtained from carrying out speech recognition to the voice messaging.For example, on-vehicle Bluetooth system
The phonetic order of user's input can be obtained;And by the phonetic order carry out speech recognition, obtain accordingly as to
Send the text information of information.
Wherein, for sending short message by on-vehicle Bluetooth system, recipient's mark can be the ground of recipient
Location information or the information with recipient address information with incidence relation.For example, recipient's mark can be with are as follows: join in address list
It is the unique identifications such as cell-phone number or the name of people;Or email address.
For example, on-vehicle Bluetooth system after establishing connection with equipment such as mobile phones, is based on the connection, accessible equipment is led to
News record, and the cell-phone number (or contact name) in address list is shown in the mobile unit for being equipped with the on-vehicle Bluetooth system
On display screen, for user's selection.It is possible to further obtain the cell-phone number (or contact name) that user selectes.
For another example, by taking user sends short message by on-vehicle Bluetooth system as an example, it is assumed that user A is expected that by on-vehicle Bluetooth system
The mobile phone that system triggering establishes connection with the on-vehicle Bluetooth system sends information to user B, user C and user D respectively, then user
A can input voice by the microphone of on-vehicle Bluetooth system: " to name of contact person B, name of contact person C and name of contact person D
Send short message ".Wherein, " name of contact person B ", " name of contact person C " and " connection that user is inputted by on-vehicle Bluetooth system
People name D ", as recipient's mark of user B, user C and user D.
It should be noted that can be identified according to the information to be sent and at least two recipient, for by holding
The queue of row step 11 creation generates queue object.For example, in one embodiment, method packet provided by the embodiments of the present application
It includes: being identified according to the information to be sent and at least two recipient, be provided as the chained list node of the queue object.
Wherein, as shown in Fig. 2, each object in queue includes the information to be sent and single recipient mark.
It should also be noted that, identifying according to the information to be sent and at least two recipient, it is provided as institute
State the chained list node of queue object, comprising: send using the information added in the MAP protocol of bluetooth protocol repertory
Sendmessage function identifies according to the information to be sent and at least two recipient, is provided as the queue pair
The chained list node of elephant.
Wherein, the sendmessage function is a kind of for realizing according to specified structural body transmission in the prior art
The function of information.Wherein, the specified structural body, for example can be the structural body of short message or the structural body of mail.?
In the embodiment of the present application, by the sendmessage function, it may be implemented to seal information according to the specified structural body
Dress, and then sent to the terminal for establishing connection with the on-vehicle Bluetooth system.
It should be noted that sendmessage function mainly includes two parameters: Msg and return value.Wherein, the value of Msg
To be designated the information sent, in the embodiment of the present application, previously described information to be sent and recipient is identified and made
For the value of the Msg of sendmessage function.Return value is the processing result of the specified information sent.
In one embodiment, method provided by the embodiments of the present application includes: that sendmessage function is called to establish such as
Chained list shown in Fig. 3, and according to the value of Msg, each node of chained list is set.For example, sendmessage function is according to specified
Structural body, the information to be sent received using MAP protocol to MAP protocol layer and at least two recipient mark
In single recipient mark be packaged, and will the obtained data packet of encapsulation, be stored in a node in the chained list.
In this manner, sendmessage function can make each node in the chained list include information to be sent
And some single recipient's mark in at least two recipients mark.Each node in the chained list, i.e., as logical
Cross the queue object executed in the queue that step 11 creates.
Step 13, individual queue object is read from the queue being provided with, and is connected to establishing with the on-vehicle Bluetooth system
The terminal connect is sent.
In a kind of embodiment, read individual queue object from the queue being provided with, and to the on-vehicle Bluetooth system
The terminal of the vertical connection of construction in a systematic way is sent, comprising: reads individual queue object from the queue being provided with, and for reading
Individual queue object executes respectively: sending the queue object, and determines the transmission state of the queue object;If the state of transmission is to send
Success, then delete the queue object from the queue being provided with, and generates information and send success report;If the state of transmission
To send failure, then the queue object is deleted from the queue being provided with, and generate information and send failure reporting.
It should be noted that can be according to queue the characteristics of, in the way of first in first out, successively from the team being provided with
Individual queue object is read in column, and is sent to the terminal for establishing connection with on-vehicle Bluetooth system, and be sent completely in information
Afterwards, the queue object comprising the information is deleted from queue front end.
For example, it is assumed that user A is expected that by the mobile phone that connection is established in on-vehicle Bluetooth system triggering with the on-vehicle Bluetooth system
Short message is sent to user B, user C and user D respectively, it is as shown in Figure 2 by executing the queue that step 11 creates, wherein figure
In cell-phone number in " object 1 " comprising user B and short message to be sent;In " object 2 " comprising user C cell-phone number and to
The short message of transmission;Cell-phone number and short message to be sent in " object 3 " comprising user D.Then according to from " object 1 ", " object 2 "
To the sequence of " object 3 ", successively read individual queue object from queue as shown in Figure 2, so first to on-vehicle Bluetooth system
The cell-phone number for the user B that the mobile phone transmission " object 1 " of the vertical connection of construction in a systematic way is included and short message to be sent, and sent in information
After, " object 1 " is deleted from queue, according still further to similar transmission and mode is deleted, is sequentially completed for " object 2 ",
The transmission and deletion for the information that " object 3 " is included.
It should be noted that in order to allow user to obtain the transmission progress of information to be sent, in a kind of embodiment
In, method provided by the embodiments of the present application includes: the recipient's mark and information to be sent that transmit queue object is included, and
It determines that information sends state, state is sent according to determining information and generates corresponding information transmission report.
Specifically include following two situation:
Situation 1: if it is determined that it is when sending successfully, then to delete the team from the queue being provided with that information, which sends state,
Column object, and generate information and send success report;
For example, it is assumed that user A expectation is sent out using the mobile phone that on-vehicle Bluetooth system triggering establishes connection with the system to user B
Breath of delivering letters successfully is had sent to the mobile phone for establishing connection with the system by executing step 11, step 12 and step 13
The identification information of user B and information to be sent, then can generate one at this time: the letter of " information for being successfully transmitted user B "
Breath sends report, and the information can be sent to report display in the visual interface of on-vehicle Bluetooth system, so that user can be with
View the transmission result of this information.
Situation 2: if it is to send failure that information, which sends state, the queue can be deleted from the queue being provided with
Object, and generate information and send failure reporting.
For example, it is assumed that user A expectation using on-vehicle Bluetooth system triggering and the system establish the mobile phone of connection to user B with
And user C sends information, by executing step 11, step 12 and step 13, successfully to the hand for establishing connection with the system
Machine has sent the recipient's mark and information to be sent of user B, but what is failed establishes connection to the system
Mobile phone sends the recipient's mark and information to be sent of user C, then can be generated respectively at this time: " be successfully transmitted user B
The information of information " and " the failed message for sending user C " sends report, and above-mentioned two information is sent report display and is existed
The visual interface of on-vehicle Bluetooth system, so that user can view the transmission result of this information.
If being also possible that information sends state is to send failure, can be from the front end of the queue after described set up
The queue object is deleted, and adds the queue object in the tail of the queue of the queue, and generates information and sends failure reporting.
It should be noted that when being sent to the queue object in the queue, in fact it could happen that not sent for a long time
Success, but the queue object (" overtime object " hereinafter) of also not sent failure, according to the rule that queue is sent, " overtime object "
Occur that the transmission progress of other information in queue will will be will affect, in one in embodiment, side provided by the embodiments of the present application
Method includes: that a transmission time-out time is arranged for the individual queue object in queue, when some queue object in queue fails
When sending successfully in the time-out time, then it can will be somebody's turn to do " overtime object " and be deleted from the front end of the queue, and in the team
The tail of the queue of column adds " the overtime object ".Generally, when certain queue object fails to be sent completely in time-out time twice in succession, then
It can be determined that send the transmission state of the queue object to the terminal for establishing connection with the on-vehicle Bluetooth system fails to send,
And " overtime object " is somebody's turn to do by the processing of method described in above situation 2.
It should also be noted that, passing through sendmessage function to make mobile terminal can receive on-vehicle Bluetooth system
The information of transmission needs the agreement in the system framework to mobile terminal to be modified accordingly, the agreement for needing to modify
As shown in Figure 4, comprising: operating system frame (Framework) agreement, service (Service/Java Native Interface
Layout, Service/JNI Layout) agreement and message accesses (Message Acess Profile, MAP) agreement.
Wherein, specifically modification mode is as follows:
In Framework agreement, increase sendmessage function;Also increase in Service/JNI Layout agreement
Add corresponding sendmessage function;Increase sendmessage function in MAP protocol, it is increased in MAP protocol should
Sendmessage function has and is provided as the queue pair according to the information to be sent and at least two recipients mark
The function of the chained list node of elephant.
Generally, Framework agreement is to be write by java language, and MAP protocol is write by C language.Thus
In Framework agreement after increased sendmessage function, it is also desirable to increase in Service/JNI Layout agreement
Corresponding sendmessage function.It wherein, is the parameter setting head of increased sendmessage function in Framework agreement
File, the header file to lower-layer protocols (Service/JNI Layout agreement) for showing in the sendmessage function
Meaning represented by the structure and parameter of parameter, so that Service/JNI Layout agreement can receive and handle above-mentioned
Parameter in sendmessage function.And the sendmessage function to be increase accordingly in Service/JNI Layout agreement
Parameter setting header file, the header file to lower-layer protocols (MAP protocol) for showing in Service/JNI Layout agreement
Sendmessage function in parameter structure and parameter represented by meaning so that MAP protocol can receive and locate
Manage the parameter in the sendmessage function that upper-layer protocol (Service/JNI Layout agreement) is sent.
It should be noted that being to this by on-vehicle Bluetooth system by executing step 11, step 12 and step 13
The mobile terminal device of the vertical connection of construction in a systematic way sends the idiographic flow schematic diagram of information as shown in figure 5, mainly including the following steps:
Step 21: obtaining information and send instruction;
It should be noted that the information obtained sends instruction, it can be and connect by user by the voice of on-vehicle Bluetooth system
Mouth (e.g., microphone or microphone) is by voice input.
Step 22: sending and instruct in response to the information, create empty message queue;
Step 23: addition short message object to queue tail of the queue;
Obtain information to be sent and at least two recipients mark;According to the information to be sent and described at least two
Recipient's mark, is arranged the queue object in the queue.The process being specifically arranged is detailed in above-mentioned steps 12 and the queue is arranged
The associated description of object, repeats no more at this time.
Step 24: judging whether queue is empty;
When the judgment result is no, step 25 is executed;
When the judgment result is yes, terminate process.
Step 25: reading individual queue object from the queue being provided with, and connect to being established with the on-vehicle Bluetooth system
The terminal connect is sent;
Specific information transmission process, is detailed in the associated description of above-mentioned steps 13, details are not described herein again.
Step 26: generating information and send report;
The queue object is sent, and determines the transmission state of the queue object;
If the state of transmission is to send successfully, the queue object is deleted from the queue being provided with, and generate letter
Breath sends success report;
If the state of transmission is to send failure, the queue object is deleted from the queue being provided with, and generate letter
Breath sends failure reporting.
The specific information that generates sends reporting process, is detailed in the associated description of above-mentioned steps 13, details are not described herein again.
Method provided in an embodiment of the present invention, since on-vehicle Bluetooth system can be after obtaining information and sending instruction, creation
Empty queue, and this data structure of queue, may include at least two queue objects, single queue object may include by one
The data packet that a recipient's mark and information to be sent form, so that on-vehicle Bluetooth system receives information every time sends instruction
Afterwards, at least two data packets comprising recipient a mark and information to be sent can be sent, therefore compared to existing skill
For the information sender formula that art provides, information transmitting efficiency is higher.
Embodiment 2
The embodiment of the present invention provides a kind of information transmitting apparatus, when solving to carry out information transmission using the prior art,
There is a problem of that information transmitting efficiency is lower.The concrete structure schematic diagram of the device is as shown in fig. 6, include following function unit:
Instruction receiving unit 31 sends instruction for obtaining information, and sends and instruct in response to the information, creates sky
Queue;
Information obtainment unit 32, for obtaining information to be sent and at least two recipients mark;
Queue object setting unit 33, for being identified according to the information to be sent and at least two recipient, if
Set the queue object in the queue;Wherein, single queue object includes that the information to be sent and single recipient identify;
Transmission unit 34, for from the queue being provided with read individual queue object, and to the on-vehicle Bluetooth system
The terminal of the vertical connection of construction in a systematic way is sent.
In one embodiment, instruction receiving unit 31 are used for: obtaining the phonetic order of user's input;By to institute
It states phonetic order and carries out speech recognition, obtain the text information as information to be sent accordingly.
In one embodiment, queue object setting unit 33, is used for: according to the information to be sent and it is described at least
Two recipient's marks, are provided as the chained list node of the queue object.
In one embodiment, queue object setting unit 33, is used for: accessing association using the message in bluetooth protocol repertory
The information added in view MAP sends sendmessage function, is marked according to the information to be sent and at least two recipient
Know, is provided as the chained list node of the queue object.
In one embodiment, transmission unit 34 are used for: individual queue object is read from the queue being provided with, and
It is executed respectively for the individual queue object read: sending the queue object, and determine the transmission state of the queue object;If letter
Breath transmission state be sends successfully, then delete the queue object from the queue being provided with, and generate information transmission at
Function report;If it is to send failure that information, which sends state, the queue object is deleted from the queue being provided with, and generate
Information sends failure reporting.
Above-mentioned related function can be realized in the embodiment of the present invention by hardware processor (hardware processor)
It can module.
Device provided in an embodiment of the present invention, since on-vehicle Bluetooth system can be after obtaining information and sending instruction, creation
Empty queue, and this data structure of queue, may include at least two queue objects, single queue object may include by one
The data packet that a recipient's mark and information to be sent form, so that on-vehicle Bluetooth system receives information every time sends instruction
Afterwards, at least two data packets comprising recipient a mark and information to be sent can be sent, therefore compared to existing skill
For the information sender formula that art provides, information transmitting efficiency is higher.
The apparatus embodiments described above are merely exemplary, wherein described, unit can as illustrated by the separation member
It is physically separated with being or may not be, component shown as a unit may or may not be physics list
Member, it can it is in one place, or may be distributed over multiple network units.It can be selected according to the actual needs
In some or all of the modules achieve the purpose of the solution of this embodiment.Those of ordinary skill in the art are not paying creativeness
Labour in the case where, it can understand and implement.
Through the above description of the embodiments, those skilled in the art can be understood that each embodiment can
It realizes by means of software and necessary general hardware platform, naturally it is also possible to pass through hardware.Based on this understanding, on
Stating technical solution, substantially the part that contributes to existing technology can be embodied in the form of software products in other words, should
Computer software product may be stored in a computer readable storage medium, such as ROM/RAM, magnetic disk, CD, including several fingers
It enables and using so that a computer equipment (can be personal computer, server or the network equipment etc.) executes each implementation
Method described in certain parts of example or embodiment.
Finally, it should be noted that the above embodiments are merely illustrative of the technical solutions of the present invention, rather than its limitations;Although
Present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that: it still may be used
To modify the technical solutions described in the foregoing embodiments or equivalent replacement of some of the technical features;
And these are modified or replaceed, technical solution of various embodiments of the present invention that it does not separate the essence of the corresponding technical solution spirit and
Range.