Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the invention, the technical scheme in the embodiment of the invention is clearly and completely described, obviously, described embodiment only is the present invention's part embodiment, rather than whole embodiment.Based on the embodiment among the present invention, those of ordinary skills belong to the scope of protection of the invention not making the every other embodiment that is obtained under the creative work prerequisite.
Embodiments of the invention provide a kind of method and apparatus of data processing.
For the advantage that makes technical solution of the present invention is clearer, the present invention is elaborated below in conjunction with drawings and Examples.
Embodiments of the invention provide a kind of method of data processing, the communication quality in the time of can improving data transmit-receive.
Embodiment one
As shown in Figure 1, the method for described data processing comprises:
S101, consult selected different transmission code decode algorithm and receive code decode algorithm with the opposite end;
S102, handle the data that send to the opposite end according to described transmission code decode algorithm;
S103, handle the data that receive from the opposite end according to described reception code decode algorithm.
The method of the data processing that the embodiment of the invention provides, the communication two ends are consulted selected different transmission code decode algorithm and are received code decode algorithm, handle the data that send to the opposite end according to described transmission code decode algorithm, handle the data that receive from the opposite end according to described reception code decode algorithm.Compared with prior art, network environment was different when the present invention can send with Data Receiving according to data, select the different code decode algorithm of the most suitable current network environment that data are handled respectively, and then can make full use of the network bandwidth, improve communication quality.
Embodiment two
In the present embodiment, calling and called are held consultation, and by called selected different transmission code decode algorithm and reception code decode algorithm, respectively the data of transmission and the data of reception are handled.
As shown in Figure 2, the method for described data processing comprises:
S201, caller be to called transmission query messages, inquires about the called ability that the different code decode algorithm of The data of the data that send and reception is handled that whether has.
In IP network communication, communicating pair adopts Session Initiation Protocol to communicate, in described Session Initiation Protocol, usually adopt SDP Session Initiation Protocol to be described as message body, communicating pair uses SDP to hold consultation, and negotiates the code decode algorithm that both sides support, communicates.In order to inquire about the whether negotiation functionality of tenaculum direction of the other side, SDP is expanded, make communicating pair when data transmit-receive, select different code decode algorithms according to the description of this expansion.Call initiator is before making a call, send an OPTIONS message to the other side, described OPTIONS message is carried the supported header field of " direction-indicator " indication, whether inquiry the other side supports this negotiation and communication mode, wherein, described direction-indicator is designated as an expansion of supported header field, and described expansion title is not limited to direction-indicator, also the arbitrary name that can appoint for communicating pair.The mode that SDP is expanded has following two kinds.
Mode one:
An attribute field a is arranged among the SDP, can define an extended attribute:
A=forward, the expression data receiver to;
A=backward, expression Data Receiving direction;
Certainly, the title of described extended attribute is not limited to forward and backward, also the arbitrary name that can appoint for communicating pair.
In described SDP, increased the description of expression direction:
m=audio?6000?RTP/AVP?18?80
a=rtpmap?18?G729/8000
a=rtpmap?8 PCMA/8000
a=rtpmap?0 PCMU/8000
a=forward
m=audio?6000?RTP/AVP?8?0?18
a=rtpmap?8?PCMA/8000
a=rtpmap?0?PCMU/8000
a=rtpmap?18?G729/8000
a=backward
Mode two:
In described SDP, the m line parameter is expanded:
m=audio?6000?RTP/AVP?forward?18?80
a=rtpmap?18?G729/8000
a=rtpmap?8?PCMA/8000
a=rtpmap?0?PCMU/8000
m=audio?6000?RTP/AVP?backward?8?0?18
a=rtpmap?8?PCMA/8000
a=rtpmap?0?PCMU/8000
a=rtpmap?18?G729/8000
Calledly can resolve the capable spreading parameter of m, confirm that according to these parameters the different code decode algorithms that data transmit-receive directions adopt handle data.
Certainly, in order to express the data transmit-receive direction, the extended method of described SDP can have a variety of, includes but not limited to two kinds listed above.In addition, MGCP, H.248 wait the agreement of using SDP to describe can hold consultation with top method equally.
In addition, as message body Session Initiation Protocol is described, also can be described, for example: use XML to describe sip message, from XML, parse negotiation information by other proprietary protocols except adopting SDP commonly used; Perhaps define certain data structure, describe negotiation information, comprising the information of sending direction and the information of receive direction, and convert thereof into binary system, as the message body of sip message.
S202, called receive described query messages after, reply a 200OK response message to caller, represent the called ability that the different code decode algorithm of The data of the data of transmission and reception is handled that has.Carry the supported header field of " direction-indicator " indication in the described response message equally, and have the direction attribute of expansion, be illustrated in the code decode algorithm that both direction is supported respectively.Caller like this, is subsequently just known and can have been communicated with this kind negotiation and communication mode.
S203, caller are carried tabulation of transmission code decode algorithm and the tabulation of reception code decode algorithm that caller is supported to called transmission " Invite " negotiation message in the described negotiation message, comprise at least one code decode algorithm in each tabulation.
S204, called terminal ringing send the message of " 180ring " to caller, and the prompting caller has calledly been received described negotiation message.
S205, called in the tabulation of described transmission code decode algorithm with receive the code decode algorithm of each selected own support in the encoding and decoding tabulation, two selected code decode algorithm differences.
S206, called party to calling party send consults success message " 200 OK ", and expression has been selected two different transmission code decode algorithm A and received code decode algorithm B.
S207, caller be to called sending " ACK " acknowledge message, confirms caller and calledly consulted success, can adopt different transmission code decode algorithm A and receive code decode algorithm B and respectively the data that send and the data of reception be handled.
S208, when caller sends data, caller is compressed the data that send according to the transmission code decode algorithm A that both consult to select, send to the data after the compression called, after the called data that receive after the described compression, will adopt the transmission code decode algorithm A (also can think called reception code decode algorithm) of described caller that the described data that receive are decompressed.
S209, when caller receives data, the called reception code decode algorithm B that consults to select according to both (also can think called transmission code decode algorithm) compresses data, data after the compression are sent to caller, and caller adopts described reception code decode algorithm B that the described data that receive are decompressed.
In the present embodiment, when called when not having the ability that the different code decode algorithm of The data of the data that send and reception is handled, to reply one 420 Bad Extension response message to caller, represent the called described ability that do not have, can only adopt between the calling and called with a kind of code decode algorithm the data of transmission and the data of reception are handled.At this moment, calling and called will be consulted selected same code decode algorithm according to negotiation mode of the prior art, adopt this code decode algorithm that the data of transmission and the data of reception are handled, concrete negotiations process and data handling procedure are same as the prior art, do not repeat them here.
Embodiment three
In the present embodiment, calling and called are held consultation, and by selected different transmission code decode algorithm of caller and reception code decode algorithm, respectively the data of transmission and the data of reception are handled.
S301-S304, identical with S301-S304 does not repeat them here.
S305, called transmission code decode algorithm and the reception code decode algorithm of oneself supporting of in described transmission code decode algorithm tabulation and reception encoding and decoding tabulation, selecting.
S306, called party to calling party send negotiate response message, carry the transmission code decode algorithm of the called called support of selecting in the described response message and receive code decode algorithm from described transmission code decode algorithm tabulation and the tabulation of reception code decode algorithm.
S307, caller are selected two different transmission code decode algorithm A and are received code decode algorithm B from the transmission code decode algorithm and reception code decode algorithm of the described called called support of selecting.
S308, caller are consulted success message to called transmission, carry described selected different transmission code decode algorithm A in the described negotiation success message and receive code decode algorithm B, confirm caller and calledly consulted success, can adopt different transmission code decode algorithm A and receive code decode algorithm B and respectively the data that send and the data of reception be handled.
S309-S310, identical with S208-S209 does not repeat them here.
In the present embodiment, when called when not having the ability that the different code decode algorithm of The data of the data that send and reception is handled, to reply one 420 Bad Extens ion response message to caller, represent the called described ability that do not have, can only adopt between the calling and called with a kind of code decode algorithm the data of transmission and the data of reception are handled.At this moment, calling and called will be consulted selected same code decode algorithm according to negotiation mode of the prior art, adopt this code decode algorithm that the data of transmission and the data of reception are handled, concrete negotiations process and data handling procedure are same as the prior art, do not repeat them here.
Embodiment four
In the present embodiment, a network environment checkout equipment is set in a communication carrier net, knows the current environment of network, as the variation of the network bandwidth, whether upstream and downstream bandwidth is consistent, if inconsistent, how many bandwidth constraints is, and network delay etc.
As shown in Figure 4, the method for described data processing comprises:
S401, caller are subscribed to or the requester network environmental information to the network environment checkout equipment.
Wherein, described network environment information comprises that whether what, information such as network delay unanimity and bandwidth constraints thereof be for network bandwidth information, bandwidth change information, upstream and downstream bandwidth.
The network environment information that S402, network environment checkout equipment detect between the calling and called is: up-downgoing flow restriction difference, and differ bigger, described network environment information is sent to caller, perhaps, send indication to caller, the indication caller need adopt different code decode algorithms that the data of transmission and the data of reception are handled.
The network environment information that S403, caller send according to the network environment checkout equipment, making a strategic decision out needs to adopt different code decode algorithms that the data of transmission and the data of reception are handled between the calling and called, perhaps, caller receive that the network environment checkout equipment sends with called between need to adopt different code decode algorithms that the data of the data that send and reception are handled indication.
S404-S405, similar with step S201-S202 does not repeat them here.
Wherein, the order of described S401-S403 and S404-S405 can be exchanged.
S406, caller send carry SDP the Invite negotiation message to called, wherein, describe when sending data and adopt different code decode algorithms to tabulate when receiving data with the SDP of expansion.
S407, the described SDP of called parsing, parse caller and carry extended attribute forward and backward, from described different code decode algorithm tabulation, respectively select one calledly self to support the code decode algorithm that both direction requires, and the algorithm parameter that codec chip DSP or code decode algorithm software module are carried out forward and backward both direction is set.
S408, called SDP with expansion describe sending code decode algorithm and receiving code decode algorithm, and the 200 OK message that send band SDP are carried called selected transmission code decode algorithm and received code decode algorithm to the other side in the described message.
Described SDP is resolved in S409, caller, parsing the code decode algorithm that carries extended attribute forward and backward description is respectively to consult successful transmission code decode algorithm and receive code decode algorithm, and codec chip DSP or code decode algorithm software module are carried out the algorithm parameter setting.
S410, caller are consulted success message to called transmission ACK.
S411-S412, identical with S208-S209 does not repeat them here.
When caller sends data, caller is compressed the data that send according to the transmission code decode algorithm A that both consult to select, send to the data after the compression called, after the called data that receive after the described compression, will adopt the transmission code decode algorithm A (also can think called reception code decode algorithm) of described caller that described data are decompressed.
S412, when caller receives data, the reception code decode algorithm B (also can think called transmission code decode algorithm) of the called caller of consulting to select according to both compresses data, data after the compression are sent to caller, and caller adopts described reception code decode algorithm B that the described data that receive are decompressed.
S413, network environment checkout equipment detect network environment and change.
The network condition that S414, network environment checkout equipment detect between the calling and called is: the up-downgoing flow becomes unanimity, and this network condition is sent to caller.
S415, caller are according to current network condition, and decision is heavily consulted with called.
Certainly, know that as if called variation has taken place current network condition, also can initiate heavily to consult to caller.
S416, caller send the heavy negotiation message of the re-Invite that carries SDP to called, wherein, describe transmission with SDP and adopt identical code decode algorithm tabulation with receiving.
S417, the described SDP of called parsing, discovery is a common SDP who does not expand with direction, shows that the both direction use communicates with a kind of code decode algorithm.Calledly from the tabulation of described code decode algorithm, select a code decode algorithm, and again code decode algorithm chip DSP or code decode algorithm software module are carried out parameter setting.
The 200 OK message of S418, called transmission band SDP are carried called selected code decode algorithm to the other side in the described message.
The code decode algorithm that S419, caller describe according to the SDP of called transmission carries out algorithm parameter to codec chip DSP or code decode algorithm software module again and sets.
S420, caller are consulted success message to called transmission ACK.
S421, calling and called are handled the data of transmission and the data of reception according to the code decode algorithm A that both consult to select.
Wherein, caller is when sending data, and caller is compressed data according to the transmission code decode algorithm A that both consult to select, and sends to the data after the compression called, called receive described data after, adopt described transmission code decode algorithm A that data are decompressed; Caller is when receiving data, and the called reception code decode algorithm A that consults to select according to both compresses data, and the data after the compression are sent to caller, after caller receives described data, adopts described transmission code decode algorithm A that data are decompressed.
Wherein, if caller sends the failure of OPTIONS inquiry the other side ability, then subsequent voice calls will be held consultation and communicate by letter according to call flow of the prior art.
If in the network that a network environment can not change, and under the different environment of up-downgoing flow restriction, also can not need the network environment diagnostic device, directly adopt different code decode algorithms that the data of transmission and the data of reception are handled by system configuration.
Thereby, utilize the method for the data processing that the embodiment of the invention provides, the communication quality in the time of can improving data transmit-receive.
Embodiments of the invention provide a kind of communication entity, the communication quality in the time of can improving data transmit-receive.
Embodiment five
As shown in Figure 5, described communication entity comprises:
Negotiation element 501 is used for consulting selected different transmission code decode algorithm and receiving code decode algorithm with the opposite end;
First processing unit 502 is used for handling the data that send to the opposite end according to described transmission code decode algorithm;
Second processing unit 503 is used for handling the data that receive from the opposite end according to described reception code decode algorithm.
The communication entity that the embodiment of the invention provides, consult selected different transmission code decode algorithm and receive code decode algorithm with the opposite end, handle the data that send to the opposite end according to described transmission code decode algorithm, handle the data that receive from the opposite end according to described reception code decode algorithm.Compared with prior art, network environment was different when the present invention can send with Data Receiving according to data, select the different code decode algorithm of the most suitable current network environment that data are handled respectively, and then can make full use of the network bandwidth, improve communication quality.
Embodiment six
In the present embodiment, hold consultation in the communication two ends, by called selected different transmission code decode algorithm and reception code decode algorithm, respectively the data of transmission and the data of reception handled.
As shown in Figure 6, described communication entity comprises:
Negotiation element 601 is used for consulting selected different transmission code decode algorithm and receiving code decode algorithm with the opposite end;
First processing unit 602 is used for handling the data that send to the opposite end according to described transmission code decode algorithm;
Second processing unit 603 is used for handling the data that receive from the opposite end according to described reception code decode algorithm.
Wherein, described communication entity can be used as caller or called, and when described communication entity during as caller, described opposite end is called, when described communication entity when called, described opposite end is caller.
When described communication entity during as caller, described negotiation element 601 comprises:
Negotiation message transmitting element 6011 is used for sending negotiation message to the opposite end, carries in the described negotiation message to send the code decode algorithm tabulation and receive the code decode algorithm tabulation;
First consults success message receiving element 6012, is used to receive the negotiation success message that returns the opposite end, carries the selected different transmission code decode algorithm in opposite end in the described negotiation success message and receives code decode algorithm.
Then described first consults success message receiving element 6012 will notify first processing unit 602 to handle the data that send to the opposite end according to described transmission code decode algorithm, notify second processing unit 603 to handle the data that receive from the opposite end according to described reception code decode algorithm.
Wherein, when described communication entity during as caller, in order to inquire about the called ability that the different code decode algorithm of The data of the data that send and reception is handled that whether has, described communication entity also comprises:
Query messages transmitting element 604 is used for sending query messages to the opposite end, and whether the inquiry opposite end has the ability that the different code decode algorithm of The data of data that send and reception is handled;
Acknowledge message receiving element 605 is used to receive the affirmation message of returning the opposite end, carries the affirmation information that the opposite end has described ability in the described acknowledge message.
Whether wherein, when described communication entity during as caller, need to adopt different code decode algorithms that the data that send and the data of reception are handled in order to judge the communication two ends, described communication entity also comprises:
Identifying unit 606, be used to receive the network environment information that the network environment checkout equipment sends, according to described network environment information make a strategic decision out with the opposite end between needs adopt different code decode algorithms that the data that send and the data of reception are handled, perhaps, receive that the network environment checkout equipment sends with the opposite end between need to adopt different code decode algorithms that the data of the data that send and reception are handled indication.
When described communication entity when called, described negotiation element 601 comprises:
Negotiation message receiving element 6013 is used to receive the negotiation message that the opposite end sends, and carries in the described negotiation message to send the code decode algorithm tabulation and receive the code decode algorithm tabulation;
The second selected unit 6014 is used for tabulating and selected different transmission code decode algorithm of reception code decode algorithm tabulation and reception code decode algorithm from described transmission code decode algorithm;
Second consults success message transmitting element 6015, is used for sending the negotiation success message to the opposite end, carries the transmission code decode algorithm of selecting the described second selected unit 6014 in the described negotiation success message and receives code decode algorithm.
The then described second selected unit 6014 will notify first processing unit 602 to handle the data that send to the opposite end according to described reception code decode algorithm, notify second processing unit 603 to handle the data that receive from the opposite end according to described transmission code decode algorithm.
Wherein, when described communication entity when called, self whether have the ability that the different code decode algorithm of The data of the data that send and reception is handled in order to inquire about, described communication entity also comprises:
Query messages receiving element 607 is used to receive the query messages that the opposite end sends, and described query messages is used to inquire about self whether to have the ability that the different code decode algorithm of The data of the data that send and reception is handled;
Acknowledge message transmitting element 608 is used for sending acknowledge message to the opposite end, carries the affirmation information that self has described ability in the described acknowledge message.
Embodiment seven
In the present embodiment, hold consultation in the communication two ends, by selected different transmission code decode algorithm of caller and reception code decode algorithm, respectively the data of transmission and the data of reception handled.
As shown in Figure 7, described communication entity comprises:
Negotiation element 701 is used for consulting selected different transmission code decode algorithm and receiving code decode algorithm with the opposite end;
First processing unit 702 is used for handling the data that send to the opposite end according to described transmission code decode algorithm;
Second processing unit 703 is used for handling the data that receive from the opposite end according to described reception code decode algorithm.
Wherein, described communication entity can be used as caller or called, and when described communication entity during as caller, described opposite end is called, when described communication entity when called, described opposite end is caller.
When described communication entity during as caller, described negotiation element 701 comprises:
Negotiation message transmitting element 7011 is used for sending negotiation message to the opposite end, carries in the described negotiation message to send the code decode algorithm tabulation and receive the code decode algorithm tabulation;
Response message receiving element 7012, be used to receive the response message that the opposite end is returned, carry the transmission code decode algorithm of the opposite end support of from described transmission code decode algorithm tabulation and the tabulation of reception code decode algorithm, selecting the opposite end in the described response message and receive code decode algorithm;
The first selected unit 7013, transmission code decode algorithm that the opposite end that is used for selecting from described opposite end is supported and reception code decode algorithm are selected different transmission code decode algorithms and are received code decode algorithm;
First consults success message transmitting element 7014, is used for sending the negotiation success message to the opposite end, carries the different transmission code decode algorithm of selecting the described first selected unit 7013 in the described negotiation success message and receives code decode algorithm.
The then described first selected unit 7013 will notify first processing unit 702 to handle the data that send to the opposite end according to described transmission code decode algorithm, notify second processing unit 703 to handle the data that receive from the opposite end according to described reception code decode algorithm.
Wherein, when described communication entity during as caller, in order to inquire about the called ability that the different code decode algorithm of The data of the data that send and reception is handled that whether has, described communication entity also comprises:
Query messages transmitting element 704 is used for sending query messages to the opposite end, and whether the inquiry opposite end has the ability that the different code decode algorithm of The data of data that send and reception is handled;
Acknowledge message receiving element 705 is used to receive the affirmation message of returning the opposite end, carries the affirmation information that the opposite end has described ability in the described acknowledge message.
Whether wherein, when described communication entity during as caller, need to adopt different code decode algorithms that the data that send and the data of reception are handled in order to judge the communication two ends, described communication entity also comprises:
Identifying unit 706, be used to receive the network environment information that the network environment checkout equipment sends, according to described network environment information make a strategic decision out with the opposite end between needs adopt different code decode algorithms that the data that send and the data of reception are handled, perhaps, receive that the network environment checkout equipment sends with the opposite end between need to adopt different code decode algorithms that the data of the data that send and reception are handled indication.
When described communication entity when called, described negotiation element 701 comprises:
Negotiation message receiving element 7015 is used to receive the negotiation message that the opposite end sends, and carries in the described negotiation message to send the code decode algorithm tabulation and receive the code decode algorithm tabulation;
Selected cell 7016 is used for from described transmission code decode algorithm tabulation and receives the code decode algorithm tabulation selecting the transmission code decode algorithm of self supporting and receiving code decode algorithm;
Response message transmitting element 7017 is used for sending response message to the opposite end, carries transmission code decode algorithm of self supporting and reception code decode algorithm that described selected cell 7016 is selected in the described response message;
Second consults success message receiving element 7018, is used to receive the negotiation success message that the opposite end sends, and carries the selected different transmission code decode algorithm in opposite end in the described negotiation success message and receives code decode algorithm.
Then described second consults success message receiving element 7018 will notify first processing unit 702 to handle the data that send to the opposite end according to described reception code decode algorithm, notify second processing unit 703 to handle the data that receive from the opposite end according to described transmission code decode algorithm.
Wherein, when described communication entity when called, self whether have the ability that the different code decode algorithm of The data of the data that send and reception is handled in order to inquire about, described communication entity also comprises:
Query messages receiving element 707 is used to receive the query messages that the opposite end sends, and described query messages is used to inquire about self whether to have the ability that the different code decode algorithm of The data of the data that send and reception is handled;
Acknowledge message transmitting element 708 is used for sending acknowledge message to the opposite end, carries the affirmation information that self has described ability in the described acknowledge message.
Thereby, the communication entity that utilizes the embodiment of the invention to provide, the communication quality in the time of can improving data transmit-receive.
The embodiment of the invention is applicable to that voice, video etc. need carry out in the communication of data processing, and need adopt different code decode algorithms that data are handled when data transmit-receive.In the embodiment of the invention, the transmission code decode algorithm of calling terminal can be thought the reception code decode algorithm of called end, and the reception code decode algorithm of calling terminal also can be thought the transmission code decode algorithm of called end.
One of ordinary skill in the art will appreciate that all or part of flow process that realizes in the foregoing description method, be to instruct relevant hardware to finish by computer program, described program can be stored in the computer read/write memory medium, this program can comprise the flow process as the embodiment of above-mentioned each side method when carrying out.Wherein, described storage medium can be magnetic disc, CD, read-only storage memory body (Read-Only Memory, ROM) or at random store memory body (Random Access Memory, RAM) etc.
The above; it only is the embodiment of the embodiment of the invention; but the protection range of the embodiment of the invention is not limited thereto; anyly be familiar with those skilled in the art in the technical scope that the present invention discloses; the variation that can expect easily or replacement all should be encompassed within protection scope of the present invention.Therefore, the protection range of the embodiment of the invention should be as the criterion with the protection range of claim.