[summary of the invention]
In view of this, the embodiment of the invention provides a kind of method and apparatus of electricity control, for solving the prior art
The problem of middle Wi-Fi works by fixed messaging parameter always, power resources is caused to waste.
In a first aspect, the embodiment of the invention provides a kind of method of electricity control, method includes:
When the terminal is in business state, terminal present type of service and current battery charge are obtained;
According to the current battery charge, battery saving mode corresponding with current battery charge is determined;
According to the present type of service, business corresponding with the present type of service under the battery saving mode is determined
State messaging parameter;
It is communicated according to the messaging parameter.
The aspect and any possible implementation manners as described above, it is further provided a kind of implementation, in the acquisition
Before present type of service and current battery charge, further includes:
Obtain all types of service of the terminal configuration;
It is required according to the delay requirement of each type of service, throughput demand and lowest power consumption, is each type of service
Corresponding business state optimal communication parameter is respectively configured;
It is different according to the communication parameter ranges that business state optimal communication parameter and business state maximum communication parameter limit
Corresponding business state messaging parameter is respectively configured in battery saving mode.
The aspect and any possible implementation manners as described above, it is further provided a kind of implementation, according to business state
Phase is respectively configured for different battery saving modes in the communication parameter ranges that optimal communication parameter and business state maximum communication parameter limit
The business state messaging parameter answered, comprising:
According to each messaging parameter in communication power consumption sequence from big to small, respectively to all logical in communication parameter ranges
Letter parameter is arranged, and messaging parameter sequence is obtained;Wherein, each messaging parameter sequence respectively corresponds a kind of messaging parameter class
Type;
The n-th mark is distributed for n-th of messaging parameter in each messaging parameter sequence;Wherein, n is less than or equal to communication
Element summation in argument sequence;
According to the sequence of power saving degree from small to large, each battery saving mode is arranged, obtains battery saving mode sequence;
M mark is distributed for m-th of battery saving mode in battery saving mode sequence;Wherein, m is less than or equal to battery saving mode sequence
Element summation in column;
It distributes in all messaging parameter types to be identified as the battery saving mode of x and is identified as the messaging parameter of x, the x is less than
Or equal to the smaller in m and n.
Aspect as described above and any possible implementation, it is further provided a kind of implementation, according to business
The communication parameter ranges that state optimal communication parameter and business state maximum communication parameter limit, are respectively configured for different battery saving modes
Before the messaging parameter of business, first corresponding battery saving mode is respectively configured according to electricity power saving degree.
The aspect and any possible implementation manners as described above, it is further provided a kind of realization, the acquisition terminal are worked as
Preceding type of service includes:
Obtain the port that the terminal currently receives data;
According to the port, type of service corresponding with the port is determined.
Second aspect, the embodiment of the invention provides a kind of device of electricity control, described device includes:
First acquisition unit, for when the terminal is in business state, obtaining terminal present type of service and current electricity
Pond electricity;
First determination unit, for determining power saving mould corresponding with current battery charge according to the current battery charge
Formula;
Second determination unit, for according to the present type of service, determine under the battery saving mode with it is described current
The corresponding business state messaging parameter of type of service;
First communication unit, for being communicated according to the messaging parameter.
The aspect and any possible implementation manners as described above, it is further provided a kind of implementation, the electricity control
Device processed further include:
Second acquisition unit, for obtaining all types of service of the terminal configuration;
First configuration unit, for being wanted according to the delay requirement of each type of service, throughput demand and lowest power consumption
It asks, corresponding business state optimal communication parameter is respectively configured for each type of service;
Second configuration unit, for the communication according to business state optimal communication parameter and the restriction of business state maximum communication parameter
Corresponding business state messaging parameter is respectively configured for different battery saving modes in parameter area.
The aspect and any possible implementation manners as described above, it is further provided a kind of implementation, described second matches
Setting unit includes:
First order module, for according to each messaging parameter in communication power consumption sequence from big to small, respectively to communication
All messaging parameters in parameter area are arranged, and messaging parameter sequence is obtained;Wherein, each messaging parameter sequence is right respectively
Answer a kind of messaging parameter type;
First distribution module, for distributing the n-th mark for n-th of messaging parameter in each messaging parameter sequence;Its
In, n is less than or equal to the element summation in messaging parameter sequence;
Second order module arranges each battery saving mode, obtains for the sequence according to power saving degree from small to large
To battery saving mode sequence;
Second distribution module, for distributing m mark for m-th of battery saving mode in battery saving mode sequence;Wherein, m is small
In or equal to element summation in battery saving mode sequence;
Third distribution module distributes in all messaging parameter types for the battery saving mode to be identified as x and is identified as the logical of x
Believe parameter, the x is less than or equal to the smaller in m and n.
The aspect and any possible implementation manners as described above, it is further provided a kind of implementation, the electricity control
Device processed further include:
Allocation unit, for corresponding battery saving mode to be respectively configured according to electricity power saving degree.
The aspect and any possible implementation manners as described above, it is further provided a kind of implementation, described first obtains
The unit is taken to include:
Module is obtained, the port of data is currently received for obtaining the terminal;
Determining module, for determining type of service corresponding with the port according to the port.
The method and apparatus of a kind of electricity control provided in an embodiment of the present invention, by electricity size, battery saving mode, business
The mapping relations of state messaging parameter three, by obtaining current business state type and electricity, determination is corresponding with the electricity
Battery saving mode distributes the messaging parameter of the business state under the battery saving mode, is communicated, made according to the parameter distributed
Time delay and benefit amount of handling up when obtaining service communication can change.It is carried out always using fixed communication parameter in compared with the prior art
For the method for communication, method provided in an embodiment of the present invention by according under the different corresponding battery saving modes of charge level,
It is different to the setting of the messaging parameter of business state, thus change the time delay and handling capacity when communication according to electricity and communication performance,
And then realize the resource for rationally applying electricity, realize the purpose of power saving.
[specific embodiment]
For a better understanding of the technical solution of the present invention, being retouched in detail to the embodiment of the present invention with reference to the accompanying drawing
It states.
It will be appreciated that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.Base
Embodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts it is all its
Its embodiment, shall fall within the protection scope of the present invention.
The term used in embodiments of the present invention is only to be not intended to be limiting merely for for the purpose of describing particular embodiments
The present invention.In the embodiment of the present invention and the "an" of singular used in the attached claims, " described " and "the"
It is also intended to including most forms, unless the context clearly indicates other meaning.
It should be appreciated that term "and/or" used herein is only a kind of incidence relation for describing affiliated partner, indicate
There may be three kinds of relationships, for example, A and/or B, can indicate: individualism A, exist simultaneously A and B, individualism B these three
Situation.In addition, character "/" herein, typicallys represent the relationship that forward-backward correlation object is a kind of "or".
The embodiment of the present invention provides example a kind of method of electricity control, and the process of method provided by the embodiment of the present invention is shown
Be intended to as shown in Figure 1, this method specific step is as follows:
101, when the terminal is in business state, terminal present type of service and current battery charge are obtained.
102, according to the current battery charge, battery saving mode corresponding with current battery charge is determined.
103, according to the present type of service, determination is corresponding with the present type of service under the battery saving mode
Business state messaging parameter.
Messaging parameter includes beacon interval, listening intervals, business instruction broadcast interval, submits business instruction period etc..
104, it is communicated according to the messaging parameter.
A kind of electric quantity controlling method provided in an embodiment of the present invention, by electricity size, battery saving mode, business state communication ginseng
The mapping relations of number three determine battery saving mode corresponding with the electricity by acquisition current business state type and electricity,
The messaging parameter for distributing the business state under the battery saving mode, is communicated according to the parameter distributed, so that business is logical
Time delay and benefit amount of handling up when letter can change.The side communicated always using fixed communication parameter in compared with the prior art
For method, method provided in an embodiment of the present invention is by according under the different corresponding battery saving modes of charge level, to business state
Messaging parameter setting it is different, to change the time delay and handling capacity when communication according to electricity and communication performance, and then realize
The resource for rationally applying electricity, realizes the purpose of power saving.
It further illustrates, in order to realize aforesaid operations step, needs to electricity size, battery saving mode and business state communication
Certain mapping relations is arranged in parameter three, and three is connected, be based on this relationship, one kind provided in an embodiment of the present invention can
In the implementation of energy, related procedure need to be before executing abovementioned steps 101, as shown in Fig. 2, specific as follows:
105, all types of service of the terminal configuration are obtained.
106, it is required according to the delay requirement of each type of service, throughput demand and lowest power consumption, is each business
Corresponding business state optimal communication parameter is respectively configured in type.
Optimal communication parameter refers to the requirement of required time delay and handling capacity when guaranteeing to meet service communication quality, makes
The smallest messaging parameter of power of consumption must be communicated.
Handling capacity refers to the rate that data packet is sent in network, can be indicated with Mean Speed and peak rate.
Time delay is often referred to one group of data at the time of getting out data transmission on transmitting terminal, receives this group of data to receiving end
At the time of between difference.It includes encoding and decoding time delay, grouping packing time delay, terminal Key dithering time delay, access delay, core net
Upper propagation delay time, buffer queue time delay and processing delay etc..
The size of time delay and handling capacity is influenced by messaging parameter, between beacon interval, listening intervals, business instruction broadcast
Every, submit that the business instruction messaging parameters such as period are smaller, and time delay is smaller, and handling capacity is bigger.
107, the communication parameter ranges limited according to business state optimal communication parameter and business state maximum communication parameter, for not
Corresponding business state messaging parameter is respectively configured in same battery saving mode.
Further, it in order to realize aforesaid operations step, needs to electricity size, battery saving mode and business state messaging parameter
Certain mapping relations is arranged in three, and three is connected, and is based on this relationship, possible in one kind provided in an embodiment of the present invention
In implementation, related procedure need to be before executing abovementioned steps 107, as shown in figure 3, specific as follows:
108, according to each messaging parameter in communication power consumption sequence from big to small, respectively to the institute in communication parameter ranges
There is messaging parameter to be arranged, obtains messaging parameter sequence;Wherein, each messaging parameter sequence respectively corresponds a kind of messaging parameter
Type.
Arrangement to the messaging parameter only arranges each messaging parameter for being related to influencing communication power consumption, is led to
Believe that argument sequence, the messaging parameter that other are not influenced with power consumption can not sort, uses the messaging parameter of original fixation.
109, the n-th mark is distributed for n-th of messaging parameter in each messaging parameter sequence;Wherein, n is less than or waits
In the element summation in messaging parameter sequence.
110, the sequence according to power saving degree from small to large arranges each battery saving mode, obtains battery saving mode sequence
Column.
111, m mark is distributed for m-th of battery saving mode in battery saving mode sequence;Wherein, m is less than or equal to power saving mould
Element summation in formula sequence.
112, it distributes in all messaging parameter types to be identified as the battery saving mode of x and is identified as the messaging parameter of x, the x
Less than or equal to the smaller in m and n.
The division methods of business state messaging parameter are specific as follows:
Beacon interval refers to that the time quantum number between two beacons, unit are time quantum.Original from small to large
Then be in turn divided into the 1st beacon-interval parameter, the 2nd beacon-interval parameter ..., nth beacon spacing parameter, the 1st beacon interval ginseng
Number is minimum, and nth beacon spacing parameter is maximum.It is best beacon interval-that beacon interval, which divides range, in embodiments of the present invention
65535, so the 1st beacon-interval parameter is best beacon-interval parameter.
Listening intervals refer to that Wi-Fi equipment is not necessarily intended to monitor each beacon, can each suspend mode certain amount beacon
1 beacon management frame is monitored after several time, is in turn divided into the 1st listening intervals parameter, the 2nd listening intervals ginseng from small to large
Number ..., the n-th listening intervals parameter, the 1st listening intervals parameter is minimum, and the n-th listening intervals parameter is maximum.In the embodiment of the present invention
The range that middle listening intervals divide is best listening intervals -65535, so the 1st listening intervals are best listening intervals.
Business instruction broadcast spacing parameter refers to the beacon number between continuous two business instruction beacon frame, from small to large
Be in turn divided into the 1st business instruction broadcast spacing parameter, the 2nd business instruction broadcast spacing parameter ..., the n-th business instruction broadcast
Spacing parameter, the 1st business instruction broadcast spacing parameter is minimum, and the n-th business instruction broadcast spacing parameter is maximum.The present invention is implemented
Business instruction broadcast spacing parameter range is best service instruction broadcast interval -255 in example, so between the instruction broadcast of the 1st business
It is divided into best service instruction broadcast interval.
It submits business and indicates that the period refers to the continuous two business instruction beacon frames submitted between business instruction beacon frame
Number, be in turn divided into from small to large the 1st submit business instruction cycle parameter, the 2nd submit business instruction cycle parameter ..., n-th pass
Friendship business indicates cycle parameter, and the 1st submits business instruction cycle parameter minimum, and n-th submits business instruction cycle parameter maximum.This
It is most preferably to submit the business instruction period -255 that business instruction cycle parameter range is submitted in inventive embodiments, so the 1st submits industry
The business instruction period is most preferably to submit business to indicate the period.
There are one-to-one relationships for battery saving mode and messaging parameter, for example, the 1st battery saving mode corresponds to minimal communications ginseng
Number, i.e. the 1st battery saving mode respectively correspond the 1st beacon interval, the 1st listening intervals, the 1st submit business instruction broadcast interval etc.;
Business instruction broadcast interval etc. is submitted in the 2nd beacon interval of 2nd battery saving mode correspondence, the 2nd listening intervals, the 2nd, and so on,
Corresponding business state messaging parameter is respectively configured for different battery saving modes.
It further illustrates, in order to realize aforesaid operations step, needs to electricity size, battery saving mode and business state communication
Certain mapping relations is arranged in parameter three, and three is connected, be based on this relationship, one kind provided in an embodiment of the present invention can
In the implementation of energy, related procedure need to be before executing abovementioned steps 105, as shown in figure 4, specific as follows:
113, according to electricity power saving degree, corresponding battery saving mode is respectively configured.
Power saving degree is to determine that time delay is small, and handling capacity is big according to the time delay and handling capacity of business, and power consumption is high, power saving journey
It spends small.Battery saving mode by power saving degree be in turn divided into from small to large the 1st battery saving mode, the 2nd battery saving mode ..., the n-th power saving mould
Formula, the 1st battery saving mode are that least battery saving mode (such as general mode), the n-th battery saving mode are most battery saving mode.
It further, is the realization acquisition terminal present type of service, a kind of possible reality provided in an embodiment of the present invention
In existing mode, as shown in figure 5, specific as follows:
114, the port that the terminal currently receives data is obtained.
115, according to the port, type of service corresponding with the port is determined.
Determine that type of service is IP (Internet Protocol, the network interconnection of the message received according to the port
Agreement) address and port numbers or the feature of message identify type of service.Have between port and business one-to-one or a pair of
More incidence relation, for example, FTP (File Transfer Protocol File Transfer Protocol) TCP (Transmission
Control Protocol transmission control protocol) port 20 and 21;Electric donkey downloads TCP (Transmission Control
Protocol transmission control protocol)/UDP (User Datagram Protocol User Datagram Protocol) port is 4661-
4666 etc., it is possible to which difference is distinguished by (the Internet Protocol Internet protocol) address IP and port numbers
Business.In addition, the changeless hexadecimal data in the certain positions of message or character string can be used as the feature of business.Example
Such as, message 10- when storm video uses TCP (Transmission Control Protocol transmission control protocol) agreement
13 bytes are " 52000000 ", 18-21 byte is " 85000000 ";Sina weibo message characteristic is " weibo.com " etc.,
So different business can be distinguished by message characteristic.
The embodiment of the invention also provides a kind of device of electricity control, it can be achieved that aforementioned approaches method process, composition is such as
Shown in Fig. 6, described device includes:
First acquisition unit 21 obtains terminal present type of service and currently for when the terminal be in business state
Battery capacity.
First determination unit 22, for determining power saving corresponding with current battery charge according to the current battery charge
Mode.
Second determination unit 23, for according to the present type of service, determination to be worked as under the battery saving mode with described
The corresponding business state messaging parameter of preceding type of service.
First communication unit 24, for being communicated according to the messaging parameter.
Optionally, such as Fig. 7, the device further include:
Second acquisition unit 25, for obtaining all types of service of the terminal configuration.
First configuration unit 26, for according to the delay requirement of each type of service, throughput demand and lowest power consumption
It is required that corresponding business state optimal communication parameter is respectively configured for each type of service.
Second configuration unit 27, it is logical for being limited according to business state optimal communication parameter and business state maximum communication parameter
Believe parameter area, corresponding business state messaging parameter is respectively configured for different battery saving modes.
Optionally, such as Fig. 8, the device further include:
First sorting module 271, for according to each messaging parameter in communication power consumption sequence from big to small, respectively to logical
All messaging parameters in letter parameter area are arranged, and messaging parameter sequence is obtained;Wherein, each messaging parameter sequence difference
A kind of corresponding messaging parameter type.
First distribution module 272, for distributing the n-th mark for n-th of messaging parameter in each messaging parameter sequence;
Wherein, n is less than or equal to the element summation in messaging parameter sequence.
Second sorting module 273 arranges each battery saving mode for the sequence according to power saving degree from small to large
Column, obtain battery saving mode sequence.
Second distribution module 274, for distributing m mark for m-th of battery saving mode in battery saving mode sequence;Wherein,
M is less than or equal to the element summation in battery saving mode sequence.
Third distribution module 275 distributes in all messaging parameter types for the battery saving mode to be identified as x and is identified as x
Messaging parameter, the x be less than or equal to m and n in smaller.
Optionally, such as Fig. 9, the device further include:
Allocation unit 28, for corresponding battery saving mode to be respectively configured according to electricity power saving degree.
Optionally, such as Figure 10, the first acquisition unit 21 includes:
Module 211 is obtained, the port of data is currently received for obtaining the terminal.
Determining module 212, for determining type of service corresponding with the port according to the port.
A kind of electric quantity control unit provided in an embodiment of the present invention, by electricity size, battery saving mode, business state communication ginseng
The mapping relations of number three determine battery saving mode corresponding with the electricity by acquisition current business state type and electricity,
The messaging parameter for distributing the business state under the battery saving mode, is communicated according to the parameter distributed, so that business is logical
Time delay and benefit amount of handling up when letter can change.The side communicated always using fixed communication parameter in compared with the prior art
For method, method provided in an embodiment of the present invention is by according under the different corresponding battery saving modes of charge level, to business state
Messaging parameter setting it is different, to change the time delay and handling capacity when communication according to electricity and communication performance, and then realize
The resource for rationally applying electricity, realizes the purpose of power saving.
It is apparent to those skilled in the art that for convenience and simplicity of description, the system of foregoing description,
The specific work process of device and unit, can refer to corresponding processes in the foregoing method embodiment, and details are not described herein.
In several embodiments provided by the present invention, it should be understood that disclosed system, device and method can be with
It realizes by another way.For example, the apparatus embodiments described above are merely exemplary, for example, the unit
It divides, only a kind of logical function partition, there may be another division manner in actual implementation, for example, multiple units or group
Part can be combined or can be integrated into another system, or some features can be ignored or not executed.Another point, it is shown
Or the mutual coupling, direct-coupling or communication connection discussed can be through some interfaces, device or unit it is indirect
Coupling or communication connection can be electrical property, mechanical or other forms.
The unit as illustrated by the separation member may or may not be physically separated, aobvious as unit
The component shown may or may not be physical unit, it can and it is in one place, or may be distributed over multiple
In network unit.It can select some or all of unit therein according to the actual needs to realize the mesh of this embodiment scheme
's.
It, can also be in addition, the functional units in various embodiments of the present invention may be integrated into one processing unit
It is that each unit physically exists alone, can also be integrated in one unit with two or more units.Above-mentioned integrated list
Member both can take the form of hardware realization, can also realize in the form of hardware adds SFU software functional unit.
The above-mentioned integrated unit being realized in the form of SFU software functional unit can store and computer-readable deposit at one
In storage media.Above-mentioned SFU software functional unit is stored in a storage medium, including some instructions are used so that a computer
It is each that device (can be personal computer, server or network equipment etc.) or processor (Processor) execute the present invention
The part steps of a embodiment the method.And storage medium above-mentioned includes: USB flash disk, mobile hard disk, read-only memory (Read-
Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic or disk etc. it is various
It can store the medium of program code.
The foregoing is merely illustrative of the preferred embodiments of the present invention, is not intended to limit the invention, all in essence of the invention
Within mind and principle, any modification, equivalent substitution, improvement and etc. done be should be included within the scope of the present invention.