Time division multiplexing method and system of antenna, electronic equipment and medium
By dynamically adjusting the time proportion of the antenna used by the first communication module, the time-sharing multiplexing method of the antenna is optimized, the problem of low transmission efficiency in the prior art is solved, and the efficiency and user experience of communication data transmission are improved.
Patent Information
- Application Number
- CN202310939970.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-28
- Publication Date
- 2025-02-14
AI Technical Summary
In the prior art, when transmitting and receiving communication data through time-sharing multiplexing antennas, the transmission efficiency is low, especially when the amount of communication data in the WiFi protocol is large, the data transmission speed will decrease.
By acquiring the first data flow within the preset time period, the time proportion of the first communication module using the antenna is determined, and the time period of the first communication module and the second communication module using the antenna is determined according to the time proportion, so as to optimize the antenna time-sharing multiplexing method.
Dynamically adjust the time proportion of the first communication module using antennas, avoiding the problem of reducing transmission efficiency caused by large communication data flow but insufficient time to use antennas, and improving the user's experience when using time-sharing multiplexing antennas.
Smart Images

Figure CN119449075A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communication technology, and in particular to a time-division multiplexing method, system, electronic equipment and medium for antennas. Background Art
[0002] At present, some smart products have the needs of both networking and local control. Usually, a dual-mode chip (such as Combo chip) that uses a WiFi protocol (wireless network protocol) and a private 2.4G protocol (a wireless communication protocol) is used to achieve networking and local control to reduce costs. The chip integrates the above two communication methods into one chip by time-division multiplexing antennas. Usually, the communication modules that use the above two communication methods are in the receiving state. When data needs to be sent, the antenna is used to send it within the time slice corresponding to the two communication methods, and then it switches back to the receiving state after sending. When the amount of communication data using the WiFi protocol is large, problems such as decreased data transmission speed will occur. Summary of the invention
[0003] The technical problem to be solved by the present invention is to overcome the defect of low transmission efficiency when sending and receiving communication data through time-division multiplexing antennas in the prior art, and to provide a time-division multiplexing method, system, electronic device and medium for antennas.
[0004] The present invention solves the above technical problems through the following technical solutions:
[0005] The present invention provides a time-division multiplexing method for an antenna, wherein the antenna is shared by a first communication module and a second communication module, and the time-division multiplexing method for the antenna comprises:
[0006] Obtaining a first data flow within a preset time period;
[0007] The first data flow includes the data flow when the first communication module communicates using the antenna and / or the data flow when the second communication module communicates using the antenna;
[0008] Determine a time proportion of using the antenna by the first communication module according to the first data flow;
[0009] A first time period in which the first communication module uses the antenna and a second time period in which the second communication module uses the antenna are determined according to the time proportion, so that the first communication module occupies the antenna to transmit data during the first time period and the second communication module occupies the antenna to transmit data during the second time period.
[0010] Preferably, when the first occupying object occupies the antenna according to the time proportion, the time division multiplexing method of the antenna further includes:
[0011] In response to an antenna occupation request, determining a priority between the first occupied object and a second occupied object that sends the antenna occupation request; wherein the first occupied object is one of the following objects: a first sending unit included in the first communication module, a first receiving unit included in the first communication module, a second sending unit included in the second communication module, and a second receiving unit included in the second communication module; the second occupied object is one of the following objects: a first sending unit included in the first communication module, a first receiving unit included in the first communication module, a second sending unit included in the second communication module, and a second receiving unit included in the second communication module;
[0012] If the priority of the second occupied object is higher than the priority of the first occupied object, the second occupied object is switched to occupy the antenna to transmit data, and the priority of the second occupied object is reset according to a preset initial priority.
[0013] Preferably, if the priority of the second occupied object is lower than that of the first occupied object, the priority level of the second occupied object is increased according to a preset rule, and the step of determining the priority of the first occupied object and the second occupied object that sends the antenna occupation request in response to the antenna occupation request is returned. Preferably, the step of determining the proportion of time the first communication module uses the antenna according to the first data flow includes:
[0014] Determine an average flow rate of the first data flow rate, where the average flow rate is a ratio of the first data flow rate to the preset time period;
[0015] When the first data flow is the data flow when the first communication module uses the antenna for communication, and both the first communication module and the second communication module are in an activated state, the size of the average flow is positively correlated with the proportion of time the first communication module uses the antenna.
[0016] Preferably, the step of determining the time proportion of the first communication module using the antenna according to the first data flow rate further includes:
[0017] When the first communication module is in the enabled state and the second communication module is in the disabled state, it is determined that the time proportion of the first communication module using the antenna is 1.
[0018] Preferably, the step of determining the time proportion of the first communication module using the antenna according to the first data flow rate further includes:
[0019] When the first communication module is in a disabled state and the second communication module is in an enabled state, it is determined that the time proportion of the first communication module using the antenna is zero.
[0020] Preferably, the step of obtaining the first data flow within a preset time period includes:
[0021] The first data flow within a preset time period is obtained according to a preset period.
[0022] Preferably, the first communication module is a WiFi module, and the second communication module is a 2.4G protocol module;
[0023] The WiFi module is used to transmit communication data using the WiFi protocol through the antenna;
[0024] The 2.4G protocol module is used to transmit communication data through the antenna using the 2.4G protocol.
[0025] The present invention further provides a time-division multiplexing system of an antenna, wherein the antenna is shared by a first communication module and a second communication module, and the time-division multiplexing system of the antenna comprises:
[0026] An acquisition module, used for acquiring a first data flow within a preset time period;
[0027] The first data flow includes the data flow when the first communication module communicates using the antenna and / or the data flow when the second communication module communicates using the antenna;
[0028] A first determining module, configured to determine a time proportion of using the antenna by the first communication module according to the first data flow;
[0029] The second determination module is used to determine a first time period in which the first communication module uses the antenna and a second time period in which the second communication module uses the antenna according to the time proportion, so that the first communication module occupies the antenna in the first time period to communicate and transmit data, and the second communication module occupies the antenna in the second time period to transmit data.
[0030] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and used to run on the processor, wherein the processor implements the aforementioned antenna time-division multiplexing method when executing the computer program.
[0031] The present invention also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the aforementioned antenna time-division multiplexing method is implemented.
[0032] On the basis of being in accordance with the common sense in the art, the above-mentioned preferred conditions can be arbitrarily combined to obtain the preferred embodiments of the present invention.
[0033] The positive and progressive effects of the present invention are:
[0034] The present invention dynamically adjusts the proportion of time the first communication module uses the antenna according to the first data flow, thereby avoiding the problem of reduced communication data transmission efficiency caused by the first communication module having a large communication data flow but insufficient time using the antenna in practice, and improving the user experience when using the time-division multiplexing antenna. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Figure 1 A first flow chart of a time division multiplexing method for antennas according to Embodiment 1 of the present invention;
[0036] Figure 2 A second flow chart of the time division multiplexing method of the antenna according to Embodiment 1 of the present invention;
[0037] Figure 3 A structural diagram of a time-division multiplexing system of an antenna according to Embodiment 2 of the present invention;
[0038] Figure 4 This is a schematic diagram of the structure of an electronic device according to Embodiment 3 of the present invention. DETAILED DESCRIPTION
[0039] The present invention is further described below by way of examples, but the present invention is not limited to the scope of the examples.
[0040] Example 1
[0041] This embodiment provides a time-division multiplexing method for an antenna, where the antenna is shared by a first communication module and a second communication module.
[0042] In an optional embodiment, the first communication module is a WiFi module, and the WiFi module is used to transmit communication data through an antenna using a WiFi protocol, that is, the communication data transmitted by the WiFi module is the communication data sent or received using the WiFi protocol; the second communication module is a 2.4G protocol module, and the 2.4G protocol module is used to transmit communication data through an antenna using a 2.4G protocol, that is, the communication data transmitted by the 2.4G protocol module is the communication data sent or received using the 2.4G protocol. Among them, the 2.4G protocol includes a common 2.4G wireless communication protocol and a Bluetooth communication protocol.
[0043] See also Figure 1 , the time-division multiplexing methods of antennas include:
[0044] S1. Obtain a first data flow within a preset time period.
[0045] Among them, the preset time period is the time period from a certain moment in the past to the current moment, and the first data traffic includes the data traffic when the first communication module uses the antenna to communicate, or the data traffic when the second communication module uses the antenna to communicate, or the data traffic when the first communication module uses the antenna to communicate and the data traffic when the second communication module uses the antenna to communicate.
[0046] The preset time period can be set according to the actual situation. For example, 10 seconds can be set as the preset time period.
[0047] The use state includes the start state and the disable state. That is, the use state of the first communication module includes the start state of the first communication module and the disable state of the first communication module; the use state of the second communication module includes the start state of the second communication module and the disable state of the second communication module.
[0048] When the first communication module is in the enabled state, the first communication module receives or sends communication data through the antenna; when the first communication module is in the disabled state, the first communication module cannot receive or send communication data through the antenna.
[0049] When the second communication module is in the enabled state, the second communication module receives or sends communication data through the antenna; when the second communication module is in the disabled state, the second communication module cannot receive or send communication data through the antenna.
[0050] S2. Determine a time proportion of the first communication module using the antenna according to the first data flow.
[0051] S3. Determine a first time period in which the first communication module uses the antenna and a second time period in which the second communication module uses the antenna according to the time proportion, so that the first communication module occupies the antenna to transmit data in the first time period, and the second communication module occupies the antenna to transmit data in the second time period.
[0052] It should be noted that in a time slice, the total time that the first communication module and the second communication module use the antenna is T, the time that the first communication module uses the antenna is t1, and the time that the second communication module uses the antenna is t2, T=t1+t2, and the proportion of time that the first communication module uses the antenna is the first ratio of t1 to T; and the proportion of time that the second communication module uses the antenna is the second ratio of t2 to T, which is also the difference between 1 and the first ratio.
[0053] When the first data flow is the data flow when the first communication module uses the antenna for communication, the size of the first data flow is proportional to the size of the time proportion of the first communication module using the antenna.
[0054] In this embodiment, the proportion of time the first communication module uses the antenna is dynamically adjusted according to the first data flow, thereby avoiding the problem of reduced communication data transmission efficiency caused by the first communication module having a large communication data flow but insufficient time using the antenna in practice, thereby improving the user experience when using the time-division multiplexing antenna.
[0055] In an alternative embodiment, see Figure 2 , the time division multiplexing method of the antenna also includes:
[0056] When the first occupying object occupies the antenna according to the time proportion, step S4 is executed.
[0057] S4. In response to the antenna occupation request, determine the priority of the first occupation object and the second occupation object that sends the antenna occupation request.
[0058] The antenna occupation request is an occupation request for the first communication module to use the antenna or an occupation request for the second communication module to use the antenna.
[0059] The first occupied object is an object currently occupying the antenna, and the second occupied object is an object that wants to occupy the antenna and sends an antenna occupation request.
[0060] The first occupied object is one of the following objects: the first sending unit included in the first communication module, the first receiving unit included in the first communication module, the second sending unit included in the second communication module, and the second receiving unit included in the second communication module; the second occupied object is one of the following objects: the first sending unit included in the first communication module, the first receiving unit included in the first communication module, the second sending unit included in the second communication module, and the second receiving unit included in the second communication module. The state in which the first sending unit and the first receiving unit use the antenna both belongs to the state in which the first communication module occupies the antenna to transmit data in the first time period; similarly, the state in which the second sending unit and the second receiving unit use the antenna both belongs to the state in which the second communication module occupies the antenna to transmit data in the second time period.
[0061] S5. Determine whether the priority of the second occupied object is higher than that of the first occupied object. If so, execute step S6; if not, execute step S7.
[0062] S6. Switch the antenna occupied by the second occupied object to transmit data, and reset the priority of the second occupied object according to a preset initial priority.
[0063] The preset initial priority is the default initial priority of the second occupied object. After the second occupied object occupies the antenna and completes data transmission, the right to use the antenna needs to be returned to the first occupied object.
[0064] S7. Raise the priority level of the second occupied object according to a preset rule, and return to step S4.
[0065] Among them, the preset rules are set according to actual needs.
[0066] For example: a priority number is assigned to the first receiving unit, the first sending unit, the second receiving unit, and the second sending unit respectively, and the priority number is assigned from 0 to 15, and the larger the number, the higher the priority. The priority number of the first receiving unit is 2, the priority number of the first sending unit is 0, the priority number of the second receiving unit is 9, and the priority number of the second sending unit is 7. Among them, the first receiving unit and the first sending unit are two units of the WiFi module in this example; the second receiving unit and the second sending unit are two units of the 2.4G protocol module in this example.
[0067] When the antenna is working, generally, the first communication module and the second communication module use the antenna to transmit data according to the first time period when the first communication module uses the antenna and the second time period when the second communication module uses the antenna, respectively. In order to improve real-time performance, the first communication module and the second communication module will temporarily seize the current right to use the antenna. The specific situation is as follows:
[0068] In the first case of the first method, if the current antenna usage period is in the first time period, and the second occupied object is the first sending unit (or the first receiving unit) in the first communication module, the first sending unit (or the first receiving unit) directly seizes the current right to use the antenna without comparing the priority with the first occupied object. Similarly, if the current antenna usage period is in the second time period, and the second occupied object is the second sending unit (or the second receiving unit) in the second communication module, the second sending unit (or the second receiving unit) directly seizes the current right to use the antenna without comparing the priority with the first occupied object. In this method, different communication modules seize the antenna based on priority, and the sending unit and receiving unit contained in each communication module can directly seize the antenna without referring to the priority of the sending unit and the receiving unit.
[0069] In the second case of the first method, if the current antenna usage period is in the first time period, and the second occupied object is the second sending unit (or second receiving unit) in the second communication module, it is necessary to compare the priority with the first occupied object. That is, if the second occupied object is the second receiving unit, the first occupied object of the antenna is the first receiving unit, and the priority of the second occupied object is greater than the priority of the first occupied object, then the second receiving unit seizes the antenna usage right of the first receiving unit. At this time, the priority number of the first receiving unit does not change, and the priority number of the second receiving unit needs to be reset to its preset initial priority number, that is, 9. And when the second receiving unit completes data transmission, the right to use the antenna is returned to the first receiving unit. However, if the second occupied object is the first sending unit and the first occupied object is the second sending unit, that is, the priority of the second occupied object is less than the priority of the first occupied object, the right to use the antenna still belongs to the second sending unit, and the priority number of the first sending unit is added with a preset threshold (the preset threshold is determined according to actual needs, for example, the preset threshold can be 1), and the first occupied object of the antenna is re-compared with the new priority number of the first communication module sending state at the next request time.
[0070] It should be noted that when the second occupying object preempts the antenna, it will be changed to the new first occupying object, and then it is determined whether the new second occupying object can preempt the antenna use right of the new first occupying object according to the first situation of the first mode or the second situation of the first mode.
[0071] For example, if the current antenna usage period is in the first time period, and the second occupied object is the first sending unit (or the first receiving unit) in the first communication module, the steps of preempting the antenna are the same as the first case of the first method, and the new first occupied object that preempts the right to use the antenna should be the first sending unit (or the first receiving unit). If the current antenna usage period is still in the first time period, and the new second occupied object is the second sending unit (or the second receiving unit), the steps of preempting the antenna are the same as the second case of the first method; when the new second occupied object is still the first sending unit (or the first receiving unit), the steps of preempting the antenna are the same as the first case of the first method.
[0072] For another example, if the current antenna usage period is in the first time period, and the second occupied object is the second receiving unit, the steps of preempting the antenna are the same as the second case of the first method, and the new first occupied object that preempts the right to use the antenna should be the second receiving unit. If the current antenna usage period is still in the first time period, when the new second occupied object is the second sending unit (or the second receiving unit), the steps of preempting the antenna are the same as the second case of the first method; when the new second occupied object is the first sending unit (or the first receiving unit), the steps of preempting the antenna are the same as the first case of the first method.
[0073] In the second mode, regardless of whether the current antenna usage period belongs to the first time period or the second time period, the priorities of the second occupied object and the first occupied object are directly compared. If the priority number of the first occupied object is less than the priority number of the second occupied object, the second occupied object seizes the antenna usage right of the first occupied object. At this time, the priority number of the first occupied object remains unchanged, and the priority number of the second occupied object needs to be reset to its preset initial priority number; if the priority number of the first occupied object is greater than or equal to the priority number of the second occupied object, the antenna usage right still belongs to the first occupied object, and the priority number of the second occupied object is added with a preset threshold (the preset threshold is determined according to actual needs, for example, the preset threshold can be 1), and the new priority numbers of the first occupied object and the second occupied object of the antenna are re-compared at the next request time. In this embodiment, according to the priority comparison result and the usage time period of the antenna, or based on the priority comparison result alone, it is determined whether the current usage right of the antenna is the first occupied object or the second occupied object. When it is necessary to compare the priorities of the first occupied object and the second occupied object, if the priority of the second occupied object is greater than that of the first occupied object, the second occupied object seizes the right to use the antenna. At this time, the priority of the first occupied object remains unchanged, and the priority of the second occupied object needs to be reset to its preset initial priority number; when the priority of the second occupied object is less than that of the first occupied object, the priority of the second occupied object is dynamically adjusted to arrange the second occupied object to use the antenna in a reasonable time period as much as possible.
[0074] In practice, because the antenna can only be used in a fixed time slot when sending communication data using the 2.4G protocol, it is very likely to cause communication delays and fail to meet the high real-time requirements of 2.4G protocol communication. However, this implementation is based on the high real-time requirements of 2.4G protocol communication, and the priority of the 2.4 protocol module sending unit and receiving unit is generally greater than the priority of the WiFi module sending unit and receiving unit. Therefore, this implementation can ensure the high real-time performance of 2.4G protocol communication while taking into account WiFi protocol communication, making the time ratio of the two communication modes more reasonable and flexible.
[0075] In an optional embodiment, when the first data traffic is the data traffic when the first communication module uses the antenna to communicate, and both the first communication module and the second communication module are in a startup state, the size of the average traffic is positively correlated with the proportion of time the first communication module uses the antenna.
[0076] Specifically, step S2 includes:
[0077] S21. Determine an average flow rate of the first data flow rate, where the average flow rate is a ratio of the first data flow rate to a preset time period.
[0078] S22: When both the first communication module and the second communication module are in the startup state, when the average flow is less than the first flow threshold, determine the first ratio as the time proportion of the first communication module using the antenna.
[0079] S23: When both the first communication module and the second communication module are in the startup state, when the average flow is greater than or equal to the second flow threshold, the second ratio is determined as the time proportion of the first communication module using the antenna.
[0080] S24: When both the first communication module and the second communication module are in the startup state, when the average flow is greater than the first flow threshold and less than the second flow threshold, the sum of the third ratio and the fourth ratio is determined as the time proportion of the first communication module using the antenna.
[0081] The fourth ratio is the ratio of the average flow rate to the preset value. The first flow rate threshold is less than the second flow rate threshold. The first flow rate threshold, the second flow rate threshold, the first ratio, the second ratio, the third ratio, and the preset value are set according to actual conditions.
[0082] In this embodiment, when the first data traffic is the data traffic when the first communication module uses the antenna to communicate, and the first communication module and the second communication module are both in the startup state, the time proportion of the first communication module using the antenna is determined by comparing the average traffic with the traffic threshold, so that the time proportion is more reasonable and in line with reality.
[0083] In an optional implementation, step S2 further includes:
[0084] S25: When the first communication module is in the enabled state and the second communication module is in the disabled state, determine that the time proportion of the first communication module using the antenna is 1.
[0085] In this embodiment, when the first communication module is in the startup state and the second communication module is in the disabled state, regardless of whether the first communication module has data traffic, the right to use the antenna belongs to the first communication module, that is, the proportion of time the first communication module uses the antenna is 1, thereby improving the communication transmission efficiency of the first communication module within a reasonable time period.
[0086] In an optional implementation, step S2 further includes:
[0087] S26: When the first communication module is in a disabled state and the second communication module is in an enabled state, determine that the time proportion of the first communication module using the antenna is 0.
[0088] In this embodiment, when the first communication module is in a disabled state and the second communication module is in an enabled state, regardless of whether the second communication module has data traffic, the right to use the antenna belongs to the second communication module, that is, the time proportion of the first communication module using the antenna is 0, thereby improving the communication transmission efficiency of the second communication module within a reasonable time period.
[0089] The following is a formula for determining the time proportion of the first communication module using the antenna when the first data flow is the data flow when the first communication module (WiFi module) uses the antenna for communication:
[0090]
[0091] Where a is used to represent the first time period, s is used to represent the average flow rate in MB / s (megabytes per second), X is used to represent any data flow value, and f _2.4G =0 is used to indicate that the second communication module is in a disabled state, f _2.4G =1 is used to indicate that the second communication module is in the startup state, f _WiFi =0 is used to indicate that the first communication module is in a disabled state, f _WiFi =1 is used to indicate that the first communication module is in the startup state.
[0092] In an optional embodiment, step S1 includes:
[0093] S11. Obtain a first data flow within a preset time period according to a preset cycle.
[0094] Among them, the preset cycle is set according to actual needs.
[0095] In this embodiment, the first data flow is obtained periodically, so that the time proportion of the first communication module using the antenna can be updated in time, and the time for the first communication module and the second communication module to use the antenna to communicate and transmit data can be arranged more flexibly and reasonably.
[0096] Example 2
[0097] This embodiment provides a time-division multiplexing system for an antenna, where the antenna is shared by a first communication module and a second communication module.
[0098] In an optional embodiment, the first communication module is a WiFi module, and the WiFi module is used to transmit communication data through an antenna using a WiFi protocol, that is, the communication data transmitted by the WiFi module is the communication data sent or received using the WiFi protocol; the second communication module is a 2.4G protocol module, and the 2.4G protocol module is used to transmit communication data through an antenna using a 2.4G protocol, that is, the communication data transmitted by the 2.4G protocol module is the communication data sent or received using the 2.4G protocol. Among them, the 2.4G protocol includes a common 2.4G wireless communication protocol and a Bluetooth communication protocol.
[0099] See also Figure 3 , the antenna time-division multiplexing system includes:
[0100] The acquisition module 1 is used to acquire the first data flow within a preset time period.
[0101] Among them, the preset time period is the time period from a certain moment in the past to the current moment, and the first data traffic includes the data traffic when the first communication module uses the antenna to communicate, or the data traffic when the second communication module uses the antenna to communicate, or the data traffic when the first communication module uses the antenna to communicate and the data traffic when the second communication module uses the antenna to communicate.
[0102] The preset time period can be set according to the actual situation. For example, 10 seconds can be set as the preset time period.
[0103] The use state includes the start state and the disable state. That is, the use state of the first communication module includes the start state of the first communication module and the disable state of the first communication module; the use state of the second communication module includes the start state of the second communication module and the disable state of the second communication module.
[0104] The first determination module 2 is used to determine the time proportion of the first communication module using the antenna according to the first data flow.
[0105] The second determination module 3 is used to determine a first time period in which the first communication module uses the antenna and a second time period in which the second communication module uses the antenna according to the time proportion, so that the first communication module occupies the antenna to transmit data in the first time period, and the second communication module occupies the antenna to transmit data in the second time period.
[0106] In an alternative embodiment, see Figure 3 In the case where the first occupying object occupies the antenna according to the time proportion, the time division multiplexing system of the antenna further includes:
[0107] The acquisition module 1 is further used to determine, in response to the antenna occupation request, a priority between the first occupation object and the second occupation object that sends the antenna occupation request.
[0108] Among them, the first occupied object is one of the following objects: the first sending unit included in the first communication module, the first receiving unit included in the first communication module, the second sending unit included in the second communication module, and the second receiving unit included in the second communication module; the second occupied object is one of the following objects: the first sending unit included in the first communication module, the first receiving unit included in the first communication module, the second sending unit included in the second communication module, and the second receiving unit included in the second communication module.
[0109] The adjustment module 4 is used to switch the antenna occupied by the second occupied object to transmit data when the priority of the second occupied object is higher than the priority of the first occupied object.
[0110] In an optional embodiment, the adjustment module 4 is also used to increase the priority level of the second occupied object according to preset rules when the priority of the second occupied object is lower than that of the first occupied object, and return to the step of determining the priority level of the first occupied object and the second occupied object that sends the antenna occupancy request in response to the antenna occupancy request.
[0111] In an optional implementation, the first determination module 2 is further configured to determine an average flow rate of the first data flow rate, where the average flow rate is a ratio of the first data flow rate to a preset time period.
[0112] When the first data flow is the data flow when the first communication module uses the antenna for communication, and both the first communication module and the second communication module are in the startup state, the size of the average flow is positively correlated with the proportion of time the first communication module uses the antenna.
[0113] Specifically, the first determination module 2 is further configured to determine the first ratio as the time proportion of the first communication module using the antenna when the average flow rate is less than the first flow rate threshold when both the first communication module and the second communication module are in the startup state;
[0114] The first determination module 2 is further configured to determine the second ratio as the time proportion of the first communication module using the antenna when the average flow is greater than or equal to the second flow threshold when both the first communication module and the second communication module are in the startup state.
[0115] The first determination module 2 is also used to, when both the first communication module and the second communication module are in the startup state, when the average flow is greater than the first flow threshold and less than the second flow threshold, determine the sum of the third ratio and the fourth ratio as the proportion of time the first communication module uses the antenna, so that the first communication module communicates and transmits data during the time period when the first communication module uses the antenna, and the second communication module communicates and transmits data during the time period when the second communication module uses the antenna.
[0116] The fourth ratio is a ratio of an average flow rate to a preset value; and the first flow rate threshold is smaller than the second flow rate threshold.
[0117] In an optional implementation, the first determination module 2 is further configured to determine that a time proportion of the first communication module using the antenna is 1 when the first communication module is in an enabled state and the second communication module is in a disabled state.
[0118] In an optional implementation, the first determination module 2 is further configured to determine that the time proportion of the first communication module using the antenna is 0 when the first communication module is in a disabled state and the second communication module is in an enabled state.
[0119] In an optional implementation, the acquisition module 1 is further configured to acquire the first data flow within a preset time period according to a preset cycle.
[0120] It should be noted that the implementation principles and technical effects of each module of this embodiment can refer to the corresponding parts of Example 1 and will not be repeated here.
[0121] Example 3
[0122] This embodiment provides an electronic device, Figure 4 The electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, the time-division multiplexing method of the antenna of the first embodiment is implemented. Figure 4 The electronic device 30 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0123] like Figure 4 As shown, the electronic device 30 may be in the form of a general-purpose computing device, for example, it may be a server device. The components of the electronic device 30 may include, but are not limited to: at least one processor 31, at least one memory 32, and a bus 33 connecting different system components (including the memory 32 and the processor 31).
[0124] The bus 33 includes a data bus, an address bus, and a control bus.
[0125] The memory 32 may include a volatile memory, such as a random access memory (RAM) 321 and / or a cache memory 322 , and may further include a read-only memory (ROM) 323 .
[0126] The memory 32 may also include a program / utility 325 having a set (at least one) of program modules 324, such program modules 324 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0127] The processor 31 executes various functional applications and data processing by running the computer programs stored in the memory 32, such as the time-division multiplexing method of the antenna in the first embodiment of the present invention.
[0128] The electronic device 30 may also communicate with one or more external devices 34 (e.g., keyboards, pointing devices, etc.). Such communication may be performed via an input / output (I / O) interface 35. Furthermore, the model generating device 30 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 36. Figure 4 As shown, the network adapter 36 communicates with other modules of the model-generated device 30 via the bus 33. It should be understood that, although not shown in the figure, other hardware and / or software modules can be used in conjunction with the model-generated device 30, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID (disk array) systems, tape drives, and data backup storage systems, etc.
[0129] It should be noted that although several units / modules or sub-units / modules of the electronic device are mentioned in the above detailed description, this division is merely exemplary and not mandatory. In fact, according to an embodiment of the present invention, the features and functions of two or more units / modules described above can be embodied in one unit / module. Conversely, the features and functions of one unit / module described above can be further divided into multiple units / modules to be embodied.
[0130] Example 4
[0131] This embodiment provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the time-division multiplexing method of the antenna in Embodiment 1 is implemented.
[0132] The readable storage medium may include but is not limited to: a portable disk, a hard disk, a random access memory, a read-only memory, an erasable programmable read-only memory, an optical storage device, a magnetic storage device or any suitable combination of the above.
[0133] In a possible implementation manner, the present invention may also be implemented in the form of a program product, which includes program code. When the program product is run on a terminal device, the program code is used to enable the terminal device to execute the antenna time-division multiplexing method of embodiment 1.
[0134] Among them, the program code for executing the present invention can be written in any combination of one or more programming languages, and the program code can be executed completely on the user device, partially on the user device, as an independent software package, partially on the user device and partially on a remote device, or completely on the remote device.
[0135] Although the specific embodiments of the present invention are described above, it should be understood by those skilled in the art that this is only for illustration and the protection scope of the present invention is defined by the appended claims. Those skilled in the art may make various changes or modifications to these embodiments without departing from the principles and essence of the present invention, but these changes and modifications all fall within the protection scope of the present invention.
Claims
1. A time division multiplexing method for antennas, characterized in that: The antenna is shared by the first communication module and the second communication module, and the time-division multiplexing method of the antenna includes: Obtaining a first data flow within a preset time period; The first data flow includes the data flow when the first communication module communicates using the antenna and / or the data flow when the second communication module communicates using the antenna; Determine a time proportion of using the antenna by the first communication module according to the first data flow; A first time period in which the first communication module uses the antenna and a second time period in which the second communication module uses the antenna are determined according to the time proportion, so that the first communication module occupies the antenna to transmit data during the first time period and the second communication module occupies the antenna to transmit data during the second time period.
2. The antenna time division multiplexing method according to claim 1, characterized in that: In the case where the first occupying object occupies the antenna according to the time proportion, the time division multiplexing method of the antenna further includes: In response to an antenna occupation request, determining a priority between the first occupied object and a second occupied object that sends the antenna occupation request; wherein the first occupied object is one of the following objects: a first sending unit included in the first communication module, a first receiving unit included in the first communication module, a second sending unit included in the second communication module, and a second receiving unit included in the second communication module; the second occupied object is one of the following objects: a first sending unit included in the first communication module, a first receiving unit included in the first communication module, a second sending unit included in the second communication module, and a second receiving unit included in the second communication module; If the priority of the second occupied object is higher than the priority of the first occupied object, the second occupied object is switched to occupy the antenna to transmit data, and the priority of the second occupied object is reset according to a preset initial priority.
3. The antenna time division multiplexing method according to claim 2, characterized in that: If the priority of the second occupied object is lower than that of the first occupied object, the priority level of the second occupied object is increased according to a preset rule, and the step of responding to the antenna occupation request and determining the priority of the first occupied object and the second occupied object that sends the antenna occupation request is returned.
4. The antenna time division multiplexing method according to claim 1, characterized in that: The step of determining the time proportion of the first communication module using the antenna according to the first data flow includes: Determine an average flow rate of the first data flow rate, where the average flow rate is a ratio of the first data flow rate to the preset time period; When the first data flow is the data flow when the first communication module uses the antenna for communication, and both the first communication module and the second communication module are in an activated state, the size of the average flow is positively correlated with the proportion of time the first communication module uses the antenna.
5. The antenna time division multiplexing method according to claim 1, characterized in that: The step of determining the time proportion of the first communication module using the antenna according to the first data flow rate also includes: When the first communication module is in the enabled state and the second communication module is in the disabled state, it is determined that the time proportion of the first communication module using the antenna is 1.
6. The antenna time division multiplexing method according to claim 1, characterized in that: The step of determining the time proportion of the first communication module using the antenna according to the first data flow rate also includes: When the first communication module is in a disabled state and the second communication module is in an enabled state, it is determined that the time proportion of the first communication module using the antenna is 0.
7. The antenna time division multiplexing method according to claim 1, characterized in that: The step of obtaining the first data flow within a preset time period includes: The first data flow within a preset time period is obtained according to a preset period.
8. The antenna time division multiplexing method according to claim 1, characterized in that: The first communication module is a WiFi module, and the second communication module is a 2.4G protocol module; The WiFi module is used to transmit communication data using the WiFi protocol through the antenna; The 2.4G protocol module is used to transmit communication data through the antenna using the 2.4G protocol.
9. An antenna time division multiplexing system, characterized in that: The antenna is shared by the first communication module and the second communication module, and the time-division multiplexing system of the antenna includes: An acquisition module, used for acquiring a first data flow within a preset time period; The first data flow includes the data flow when the first communication module communicates using the antenna and / or the data flow when the second communication module communicates using the antenna; A first determining module, configured to determine a time proportion of using the antenna by the first communication module according to the first data flow; The second determination module is used to determine a first time period in which the first communication module uses the antenna and a second time period in which the second communication module uses the antenna according to the time proportion, so that the first communication module occupies the antenna to transmit data during the first time period, and the second communication module occupies the antenna to transmit data during the second time period.
10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and used to run on the processor, characterized in that: When the processor executes the computer program, the time-division multiplexing method for the antenna according to any one of claims 1 to 8 is implemented.
11. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the time-division multiplexing method for antennas according to any one of claims 1 to 8 is implemented.