Wireless communication device and wireless communication method
By setting the data generation cycle of the slave device consistent with the polling cycle, the problem of data retention in wireless communication is solved, timely transmission and efficient transmission of data are realized, and communication efficiency and anti-interference performance are improved.
Patent Information
- Application Number
- CN202310675095.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-07
- Publication Date
- 2024-12-10
AI Technical Summary
During wireless communication, because the data production cycle of the slave device is inconsistent with the polling time, the data produced by the slave device cannot be sent to the master device in time, resulting in long-term data being stuck.
Setting the data generation period of the slave device to its end time is the same as the polling time of the polling period, allowing the master device to poll when the data generation is completed, thereby ensuring that the data is sent in time.
It reduces data retention time, improves the real-time and efficiency of wireless communications, and enhances the anti-interference ability of data transmission.
Smart Images

Figure CN119110341A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of wireless communication technology, and in particular to a wireless communication device and a wireless communication method. Background Art
[0002] In the wireless communication process between the slave device and the master device, the master device usually adopts a polling mechanism to poll the slave device to receive the data from the slave device. However, since the data production cycle of the slave device is inconsistent with the polling time, the data produced by the slave device is easily misaligned with the corresponding polling time during the polling process, resulting in the data produced by the slave device not being sent to the master device in the first time, resulting in the data being retained for a long time. Summary of the invention
[0003] The embodiments of the present application provide a wireless communication device and a wireless communication method, which can reduce data retention time, ensure the real-time performance of data transmission, and improve the working efficiency of the wireless communication device.
[0004] In a first aspect, an embodiment of the present application provides a wireless communication device, the device comprising:
[0005] From the device, used to form working data within the data generation cycle;
[0006] A master device is communicatively connected to the slave device, and the master device is used to send a polling data packet to the slave device in each polling cycle; each polling cycle has a polling time corresponding to the slave device, and the master device sends a polling data packet to the slave device at the polling time;
[0007] The data generation cycle is set to have its end time the same as the polling time of a polling cycle; the slave device is used to send a response data packet containing the working data to the master device when receiving a polling data packet after generating the working data.
[0008] In a second aspect, an embodiment of the present application provides a wireless communication device, the device comprising:
[0009] The microphone transmitter is used to generate working data during the data generation cycle;
[0010] A microphone receiving end is communicatively connected to the microphone transmitting end, and the microphone receiving end sends a polling data packet to the microphone transmitting end in each polling cycle; each polling cycle has a polling time corresponding to the microphone transmitting end, and the microphone receiving end sends a polling data packet to the microphone transmitting end at the polling time;
[0011] The data generation cycle is set to have its end time the same as the polling time of a polling cycle; the microphone transmitter is used to send a response data packet containing working data to the microphone receiver when receiving a polling data packet after generating working data.
[0012] In a third aspect, an embodiment of the present application provides a wireless communication method, the method comprising:
[0013] Receive a polling data packet sent by the master device at the polling time of the current polling cycle;
[0014] The data generation cycle starting at the polling time forms the working data; wherein the data generation cycle is set so that its end time is the same as the polling time of a polling cycle;
[0015] When a polling data packet is received after generating working data, a response data packet containing the working data is sent to the master device.
[0016] The beneficial effect of the present application is: different from the prior art, the present application sets the end time of the data generation cycle of the working data of the slave device to be the same as the polling time of a polling cycle, so as to ensure that after the slave device forms the working data according to the data generation cycle, the master device can just poll the slave device, so that the slave device can send the working data to the master device in time, thereby reducing the retention time of the working data, ensuring the real-time nature of data transmission, and improving the working efficiency of the wireless communication device. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 is a structural diagram of an embodiment of a wireless communication device of the present application;
[0018] Figure 2 It is a schematic diagram of a step flow of an embodiment of the wireless communication method of the present application;
[0019] Figure 3 is a timing diagram of a process of an embodiment of a wireless communication device of the present application;
[0020] Figure 4 is another flowchart of an embodiment of a wireless communication device of the present application;
[0021] Figure 5 It is another structural diagram of an embodiment of a wireless communication device of the present application. DETAILED DESCRIPTION
[0022] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0023] In the wireless communication process between the slave device and the master device, the master device usually adopts a polling mechanism to poll the slave device to receive data from the slave device. However, since the production cycle of the slave device is inconsistent with the polling time, the data produced by the slave device will be misaligned with the polling time during the polling process, resulting in the data produced by the slave device not being sent to the master device in the first time, resulting in the situation where the data is retained for a long time. In order to solve the above problems, the present application proposes the following embodiments.
[0024] The following is an exemplary description of a wireless communication device according to an embodiment of the wireless communication device of the present application.
[0025] like Figure 1 As shown, the wireless communication device 10 includes a slave device 11 and a master device 12. The slave device 11 can be used to generate working data in a data generation cycle. The master device 12 can be communicatively connected to the slave device 11 and is used to send polling data packets to the slave device 11 in turn in each polling cycle.
[0026] Specifically, in a polling cycle, the master device 12 sends a polling data packet to the slave device 11, and the slave device 11 is used to receive and respond to the polling data packet and send a reply data packet to the master device 12. After the master device 12 receives the reply data packet, the polling cycle ends.
[0027] Each polling cycle has a polling time corresponding to the slave device 11, and the master device 12 sends a polling data packet to the slave device 11 at the polling time. Specifically, the polling time may be the start time of the polling cycle, that is, the time when the master device 12 starts to poll the slave device 11 and sends a polling data packet to the slave device 11.
[0028] The data generation cycle is set to end at the same time as the polling time of a polling cycle. The slave device 11 is used to send a response data packet containing the working data to the master device 12 when receiving a polling data packet after generating working data.
[0029] In this way, the end time of the data generation cycle is set to be the same as the polling time of a polling cycle of the slave device 11, so that the slave device 11 can send the generated working data to the master device 12 in time, thereby reducing the retention time of the working data, ensuring the real-time nature of the working data, and improving the working efficiency of the wireless communication device.
[0030] In some implementations, the data generation cycle can be set so that its start time is the same as the polling time of a non-first polling cycle, and the data generation cycle is an integer multiple of the polling cycle, for example, the data generation cycle can be a multiple of 2, 3, 4, etc. of the polling cycle. Such a setting can ensure that the end time of the data generation cycle can be the same as the polling time of a polling cycle of the slave device 11, so that the slave device 11 can send the generated working data to the master device 12 in a timely manner.
[0031] Of course, in other implementations, other methods may be used for calculation and processing so that the end time of the data generation cycle is the same as the polling time of a polling cycle of the slave device 11 .
[0032] In some embodiments, the data generation cycle may include a data generation duration and a delay duration, wherein the delay duration is set such that the data generation cycle is an integer multiple of the polling cycle.
[0033] Optionally, the data generation duration may include the data sampling duration and the data encoding duration. The data generation period may be the data sampling duration plus the data encoding duration and the delay duration. The value of the delay duration must be as small as possible, and the data generation period must be an integer multiple of the polling period. For example, if the duration of a polling period can be 4000us, the data sampling duration can be set to 2.5ms, and the data encoding duration can be set to 1.2ms, then the delay duration can be set to 300us, so that the data generation period is 4ms, so that the data generation period is an integer multiple of the polling period 4000us.
[0034] By setting the delay time in this way, it is possible to reduce the duration of the data generation cycle while ensuring the real-time performance of data transmission, thereby improving the polling efficiency of the wireless communication device 10 .
[0035] In some implementations, the number of slave devices 11 may be at least two, and the master device 12 sends a polling data packet to each slave device 11 in turn in each polling cycle.
[0036] Optionally, the polling time corresponding to each slave device 11 is different. The start time of the data generation cycle of different slave devices 11 is different. And the end time of the data generation cycle of each slave device 11 is the same as the polling time corresponding to the slave device 11. With such a setting, in the scenario where the master device 12 and multiple slave devices 11 are polled and interacted, each slave device 12 can still send the generated working data to the master device 12 in a timely manner, so as to reduce the retention time of the working data and ensure the real-time nature of the working data.
[0037] Optionally, each slave device 11 is used to determine whether the latest working data has been formed when receiving the polling data packet sent by the master device 12, and if not, send a response data packet of missing working data to the master device 12. If the slave device 11 determines that the latest working data has been formed when receiving the polling data packet sent by the master device 12, it sends a response data packet containing the working data to the master device 12.
[0038] In some implementations, each slave device 11 may determine the start time of the data generation cycle of the slave device 11 according to the polling data packet sent by the master device 12 in the first polling cycle.
[0039] Specifically, the master device 12 may be configured to send a polling data packet to the corresponding slave device 11 for the first time at the first polling moment of each polling cycle.
[0040] The polling data packet may carry a corresponding polling time. Each slave device 11 may be used to obtain the receiving time and the corresponding polling time of the received polling data packet when receiving the polling data packet sent by the master device 12 in the first polling cycle, and determine the starting time of the first data generation cycle according to the polling cycle, the receiving time and the corresponding polling time, so that the starting time of the first data generation cycle is the same as the corresponding polling time of the next polling cycle.
[0041] Specifically, each slave device 11 can calculate the transmission time of the polling data packet according to the reception time of the polling data packet and the corresponding polling time, and then can obtain the remaining time of the polling cycle by subtracting the transmission time from the polling cycle. Therefore, after each slave device 11 receives the polling data packet at the reception time of the first polling cycle, it can start to produce working data after the remaining time obtained by subtracting the transmission time from the polling cycle, so that the start time of the first data generation cycle is the same as the corresponding polling time of the next polling cycle.
[0042] For example, the polling cycle of a slave device 11 can be set to Tr. The master device 12 sends a polling data packet to the slave device 11 at the polling time T2 of the first polling cycle. The slave device 11 receives the polling data packet at the receiving time T3. The slave device 11 can calculate the transmission time of the polling data packet Ta=T3-T2. At this time, the remaining time of the polling cycle Ts=Tr-Ta, so the starting time of the first data generation cycle T6=Ts+T3 can be obtained.
[0043] Of course, in other implementations, other algorithms may be used to make the polling time of each slave device 11 corresponding to a non-first polling cycle the same as the start time of the data generation cycle of the slave device 11. For example, a deep learning model may be used to calculate the start time of the data generation cycle of each slave device 11 in advance based on samples, so that each slave device 11 can make the start time of the data generation cycle the same as the polling time of the non-first polling cycle corresponding to it in actual applications. This embodiment does not specifically limit the specific algorithm for the start time of the data generation cycle of the slave device 11.
[0044] In some embodiments, the master device 12 may be configured to send polling data packets to the slave device 11 at least twice in succession when polling each slave device 11 in each polling cycle, and poll the next slave device 11 after polling one slave device 11. Therefore, each polling cycle has at least two polling moments corresponding to each slave device 11. Such a setting can allow each slave device 11 to have two opportunities to transmit data to the master device 12 continuously, thereby reducing the situation where the working data is retained for a long time after a transmission failure, and can also improve the network transmission anti-interference performance of the wireless communication device 10 while ensuring the periodicity of the timing of the wireless communication device 10.
[0045] Among them, the data generation cycle is set so that its start time is the same as one of the polling times corresponding to the non-first polling cycle, so that the slave device 11 can use the first polling cycle to calculate the start time of the data generation cycle, and after the slave device 11 produces the working data according to the data generation cycle, the production completion time of its working data is the same as one of the polling times corresponding to the non-first polling cycle, so that the working data of the slave device 11 can be sent to the master device 12 in time at one of the polling times corresponding to the non-first polling cycle.
[0046] In some embodiments, the data generation cycle can be set to have an end time that is the same as the first polling time in a non-first polling cycle. This setting allows the slave device 11 to produce data at the corresponding first polling time in a non-first polling cycle, and complete the production of working data before the first polling time in a non-first polling cycle, so that the working data can be sent from the slave device 11 to the master device 12 at the corresponding first polling time of the next polling cycle after the production is completed, and the working data can have a chance to be retransmitted to the master device 12 once, so as to reduce the situation where the working data is retained after the first transmission failure, thereby increasing the anti-interference ability of data transmission.
[0047] In some implementations, the master device 12 and at least two slave devices 11 can be used to perform timing synchronization in a handshake phase before the first polling cycle, so that the master device 12 and each slave device 11 can ensure timing accuracy during polling and reduce time errors in data packet transmission.
[0048] Optionally, the master device 12 and each slave device 11 can each perform time counting after the program is started, and the master device 12 and each slave device 11 can obtain their own time counting. The time counting rules of the master device 12 and each slave device 11 can be consistent, for example, the master device 12 and each slave device 11 can both count once every 1us, or once every 2us. Of course, the master device 12 and each slave device 11 can also set other time counting rules, which are not specifically limited in this embodiment.
[0049] Further, the master device 12 may be used to record the first time count value during the handshake phase, and send the first time count value to each slave device 11. Each slave device 11 may be used to receive the first time count value, and record the second time count value at the time of receiving. Further, the slave device 11 may be used to calculate the time compensation value according to the second time count value and the first time count value, and calibrate the time count by the time compensation value, so that the timing between the slave device 11 and the master device 12 is synchronized.
[0050] For example, the master device 12 can send the first count value T11 at the moment T1 in the handshake phase to each slave device 11, and each slave device 11 receives the first time count value T11 and records the second time count value T21 of the slave device at the moment of receiving. Further, the slave device 11 can calculate the time compensation value Tb=T21-T11 according to the first time count value T11 and the second time count value T21. And each slave device 11 can know in advance the transmission time Tc of the master device 12 transmitting the count value to each slave device 11, so each slave device 11 can calibrate the time count by the time compensation value and the transmission time Tc of the count value, and calculate the time difference between the master device 12 and the slave device 11 as Td=Tb+Tc. Then, the slave device 11 can know the count value of the master device 12 according to the time difference Ts, and perform timing synchronized with the master device 12.
[0051] Optionally, the master device 12 and each slave device 11 may test the transmission time between the master device 12 and each slave device 11 in advance during the test phase. Alternatively, in other implementations, the master device 12 may carry a test data packet when sending the first time count value to the slave device 11, and the slave device 11 may calculate the transmission time of the test data packet according to the length of the test data packet.
[0052] Of course, in other embodiments, the master device 12 and each slave device 11 can be synchronized according to other methods. For example, a reference time can be set. After the master device 12 and each slave device 11 start the program and when the reference time is reached, the master device 12 and the slave device 11 reset their respective time counts and restart the count to achieve the effect of timing synchronization between the slave device 11 and the master device 12. This embodiment does not limit the timing synchronization method between the master device 12 and each slave device 11. In other embodiments, in the process of information interaction between the master device 12 and multiple slave devices 11, the start time of the data generation cycle of each slave device 11 can be set to be the same.
[0053] Specifically, there are at least two slave devices 11, and the master device 12 sends a polling data packet to each slave device 11 in turn in each polling cycle. Different slave devices 11 correspond to different polling times, and the start time of the data generation cycle of different slave devices 11 can be the same.
[0054] In some embodiments, the polling data packet carries a corresponding polling time. The slave device 11 that first receives the polling data packet among at least two slave devices 11 determines the start time of the first data generation cycle, and the start time of the first data generation cycle of the other slave devices 11 is the same as that of the first slave device 11 that first receives the polling data packet.
[0055] Specifically, the master device can send the polling time of the slave device 11 that first receives the polling data packet to other slave devices 11 in the first polling cycle, so that other slave devices 11 can calculate the starting time of the first data generation cycle of the slave device 11 that first receives the polling data packet, so that the starting time of the first data generation cycle of all slave devices 11 is the same. Or, the slave device 11 that first receives the polling data packet transmits the calculated starting time of the first data generation cycle to the master device 12 at the second polling time in the first polling cycle, and the master device 12 transmits the starting time to other slave devices 11 when polling with other slave devices 12, so that the starting time of the first data generation cycle of all slave devices 11 is the same. Of course, in other ways, there can also be other ways to make the starting time of the first data generation cycle of all slave devices 11 the same, and this application does not limit it here.
[0056] Such a configuration can simplify the processing flow of the wireless communication device while reducing data latency.
[0057] Optionally, the data generation cycles of all slave devices 11 may be consistent and may be integer multiples of the polling cycle. Therefore, the end time of the data generation cycle of the slave device 11 that first receives the polling data packet is the same as the polling time corresponding to the slave device 11, so that the slave device 11 that first receives the polling data packet can send the working data to the master device 12 in time after the working data is produced. The start time of the first data generation cycle of the other slave devices 11 is the same as that of the slave device 11 that first receives the polling data packet, so the end time of the first data generation cycle of the other slave devices 11 is also the same as that of the slave device 11 that first receives the polling data packet. After the production of the working data of the other slave devices 11 is completed, it is still necessary to wait for a period of time until the corresponding polling time before the working data can be transmitted to the master device 12, and the waiting time of the working data of the slave device 11 is equal to the sum of the polling times of the slave devices 11 arranged in front of the slave device 11 in the polling cycle.
[0058] Such a setting can reduce the delay time of working data while simplifying the processing flow of the wireless communication device 10, reduce the difficulty of the wireless communication device 10, make the whole process easy to implement, and enable the working data of other slave devices 11 that are not the first to be polled to be transmitted with a certain time delay, thereby improving the orderliness and feasibility of the wireless communication device 10.
[0059] Optionally, the slave device 11 is used to obtain the receiving time and the corresponding polling time of the received polling data packet when the slave device 11 first receives the polling data packet sent by the master device 12 in the first polling cycle, and determine the starting time of the first data generation cycle according to the polling cycle, the receiving time and the corresponding polling time, so that the starting time of the first data generation cycle is the same as the corresponding polling time of the next polling cycle. The calculation process of the starting time of the data generation cycle can refer to the specific description above, which will not be repeated here.
[0060] Based on the contents of the wireless communication device 10 described above, a wireless communication method of the wireless communication device is exemplarily described below.
[0061] S100: After the program is started, time counting is performed and timing synchronization is performed with the master device during the handshake phase.
[0062] The counting synchronization process of the slave device 11 and the master device 12 can be found in the relevant description of the wireless communication device 10 of the present application mentioned above, and will not be repeated here.
[0063] S200: receiving a polling data packet sent by the master device in the first polling cycle, and acquiring a receiving time of the polling data packet and a corresponding polling time.
[0064] After timing synchronization, the master device 12 and the slave device 11 enter the first polling cycle. In the first polling cycle, the master device 12 sends a polling data packet to the slave device 11.
[0065] The polling data packet sent by the master device 12 in the first polling cycle carries the polling time corresponding to the polling cycle and the slave device 11, so that the slave device 11 can receive the corresponding polling time and obtain the receiving time of the polling data packet. Moreover, after the polling data packet sent in the first polling cycle, the slave device 11 responds to the polling data packet and sends a response data packet with no working data to the master device 12.
[0066] Optionally, the master device 12 sends a polling data packet to the slave device 11 at least twice in each polling cycle.
[0067] S300: Determine the start time of the first data generation cycle according to the polling cycle, the receiving time and the corresponding polling time, so that the start time of the first data generation cycle is the same as the polling time of the next polling cycle.
[0068] Specifically, the slave device 11 calculates the transmission time of the polling data packet according to the receiving time and the corresponding polling time, and the slave device 11 can calculate the corresponding polling time of the next polling cycle according to the transmission time and the corresponding polling cycle, that is, the end time of the first polling cycle. The calculation process of the start time of the first data generation cycle of the slave device 11 can refer to the relevant description of the wireless communication device 10 of the present application above, which will not be repeated here.
[0069] S400: receiving a polling data packet sent by the master device at the polling time of the current polling cycle.
[0070] Furthermore, the master device 12 may continue to send polling data packets to each slave device 11 in turn in subsequent polling cycles.
[0071] Optionally, the slave device 11 receives polling data packets sent at least twice in the current polling cycle by the master device 12. The master device 12 sends polling data packets at least twice in each polling cycle, and each polling cycle has at least two polling moments corresponding to each wireless communication device. After receiving the polling data packet, each slave device 11 responds to the polling data packet and sends a response data packet to the master device 12.
[0072] S500: forming working data in a data generation cycle starting at a polling time; wherein the data generation cycle is set such that its end time is the same as the polling time of a polling cycle.
[0073] In some embodiments, the data generation cycle can be set to have a start time that is the same as a polling time of a non-first polling cycle, and the data generation cycle is an integer multiple of the polling cycle. Specifically, the slave device 11 generates working data according to the calculated start time of the data generation cycle and the data generation cycle, so that the end time of the data generation cycle is the same as one of the polling times corresponding to a polling cycle.
[0074] In some embodiments, the master device 12 may be configured to send a polling data packet to the slave device 11 for the first time at the first polling time of each polling cycle, so that the slave device 11 may calculate the start time of the data generation cycle according to the first polling time of each polling cycle. The data generation cycle is configured such that its start time is the same as the first polling time corresponding to the non-first polling cycle.
[0075] Such a setting can make the slave device 11 produce data at the first polling time corresponding to the non-first polling cycle, and complete the production of working data before the first polling time corresponding to the non-first polling cycle. The working data can be sent from the slave device 11 to the master device 12 at the first polling time corresponding to the next polling cycle after the production is completed, so that the working data can have a chance to be retransmitted to the master device 12, so as to reduce the situation where the working data is retained after the first transmission failure, thereby increasing the anti-interference ability of data transmission.
[0076] S600: When a polling data packet is received after the working data is generated, a response data packet containing the working data is sent to the master device.
[0077] Since the data generation cycle can be set to have its start time the same as one of the polling times corresponding to the non-first polling cycle, and the data generation cycle is an integer multiple of the polling cycle, the moment when the work data is produced is the polling time of the corresponding polling cycle of the slave device 11. Therefore, the slave device 11 can receive the polling data packet in time and respond to the polling data packet, and send the response data packet containing the work data to the master device 12. Such a setting can reduce the retention time of the work data, and ensure the real-time transmission of the work data while ensuring the stability of the timing cycle.
[0078] Based on the above wireless communication device 10 and the contents of the wireless communication method, taking the case where at least one slave device 11 includes a first slave device 111 and a second slave device 112, and within one polling cycle, the master device 12 sends a polling data packet to the same slave device 11 twice, and the start times of the data generation cycles of the first slave device 111 and the second slave device 112 are different as an example, the communication process of the wireless communication device 10 is exemplarily described below.
[0079] In some embodiments, the number of at least one slave device 11 may be two, and the at least one slave device 11 includes a first slave device 111 and a second slave device 112, and the first slave device 111 and the second slave device 112 are coupled to the master device 12 respectively. Figure 3 as well as Figure 4 In the example, it can be represented as TX1, and the second slave device 112 is Figure 3 as well as Figure 4 It can be represented as TX2 in the master device 12. Figure 3 as well as Figure 4 It can be expressed as RX.
[0080] Specifically, Figure 3 as well as Figure 4 As shown, the first slave device 111, the second slave device 112 and the master device 12 each count the time after the program is started, so that each device can obtain its own time count. The time count value of the master device 12 can be expressed as T01, the time count value of the first slave device 111 can be expressed as T02, and the time count value of the second slave device 112 can be expressed as T03.
[0081] Then, each device enters the handshake phase, and the master device 12 can record the first time count value at a certain time T1, and send the first time count value to the first slave device 111 and the second slave device 112. The first slave device 111 and the second slave device 112 are used to receive the first time count value at the moment of successful handshake, and use the first time count value and their own count values to synchronize the count with the master device 12. The count synchronization process can refer to the relevant description of the wireless communication device 10 of the present application above, which will not be repeated here.
[0082] After the handshake phase, the master device 12 polls the first slave device 111 and the second slave device 112 in turn. In each polling cycle, the master device 12 sends a polling data packet to the same slave device 11 twice, and the polling duration of the master device 12 and the first slave device 111 and the second slave device 112 can be consistent. Optionally, after polling the first slave device 111, the second slave device 112 is polled. Exemplarily, the time for the master device 12 to complete a polling with a slave device 11 can be set to 500us, so in this embodiment, the duration of a polling cycle is 500us*4=4000us.
[0083] Specifically, in the first polling cycle, the master device 12 sends a polling data packet to the first slave device 111 at the polling time T2 of the first polling cycle, wherein the polling data packet carries the corresponding polling time T2. The time when the first slave device 111 receives the polling data packet is T3, and the first slave device 111 responds to the polling data packet and sends a response data packet with no working data to the master device 12. Further, the master device 12 repeatedly retransmits to the first slave device 111, and sends the polling data packet to the first slave device 111 again, and the first slave device 111 also responds to the polling data packet and sends a response data packet with no working data to the master device 12.
[0084] The first slave device 111 calculates the transmission duration Tc=T3-T2 of the polling data packet according to the polling time T2 and the receiving time T3. The first slave device 111 can calculate the start time of the data generation cycle of the first slave device 111 as T6=T3+(Tr-Tc) according to the length of the polling cycle Tr known in advance. Moreover, after obtaining the start time T6 of the data generation cycle, the first slave device 111 starts to continuously produce working data according to the data generation cycle at time T6.
[0085] After polling the first slave device 111, the master device 12 sends a polling data packet to the second slave device 112 at the polling time T4 corresponding to the second slave device 112, wherein the polling data packet also carries the polling time T4. The second slave device 112 receives the polling data packet at time T5, and the second slave device 112 sends a response data packet with no working data to the master device 12 in response to the polling data packet. Then the master device 12 repeatedly sends the polling data packet to the second slave device 112, and the second slave device 112 sends a response data packet with no working data to the master device 12 in response to the polling data packet.
[0086] The first polling cycle ends after the master device 12 receives the response data packet from the second slave device 112. Further, referring to the above process, the master device 12 continuously polls the first slave device 111 and the second slave device 112 according to the polling cycle.
[0087] Similarly, the second slave device 112 calculates the start time T7 of the data generation cycle of the second slave device 112 according to its corresponding polling time T2, receiving time T5 and polling cycle Tr, and starts to continuously produce working data according to the data generation cycle at time T7.
[0088] The data generation period of the first slave device 111 and the second slave device 112 can be set to be consistent and be an integer multiple of the polling period. Figure 3 as well as Figure 4As shown, the data generation cycle of the first slave device 111 and the second slave device 112 can be twice the polling cycle. Therefore, after reaching two polling cycles, the first slave device 111 can form working data. And in the next polling cycle corresponding to the start time T8 of the first slave device 111, the master device 12 sends a polling data packet to the first slave device 111, and after the first slave device 111 receives the polling data packet, the first slave device 111 can send a response data packet with working data to the master device 12.
[0089] Similarly, in the same polling cycle corresponding to the start time T9 of the second slave device 112, the second slave device 112 can also complete the production of work data. At this time, the master device 12 sends a polling data packet to the second slave device 112, and after the first slave device 111 receives the polling data packet, the first slave device 111 can send a response data packet with work data to the master device 12.
[0090] With such a configuration, the data generation cycles of the first slave device 111 and the second slave device 112 can be staggered, and the start time of the data generation cycle of the first slave device 111 and the second slave device 112 can correspond to the polling time of their respective polling cycles, thereby ensuring the real-time performance of data transmission of the wireless communication device 10 while maintaining the stability of the timing cycle of the wireless communication device 10.
[0091] In some embodiments, Figure 5 As shown, a wireless communication device 10 includes a microphone transmitting end 13 and a microphone receiving end 14 .
[0092] The microphone transmitting end 13 is used to generate working data in a data generation cycle. The microphone receiving end 14 is communicatively connected to the microphone transmitting end, and the microphone receiving end 14 sends a polling data packet to the microphone transmitting end 13 in each polling cycle. Each polling cycle has a polling time corresponding to the microphone transmitting end, and the microphone receiving end 14 sends a polling data packet to the microphone transmitting end at the polling time.
[0093] The data generation cycle is set to end at the same time as the polling time of a polling cycle in the data generation process. The microphone transmitter 13 is used to send a response data packet containing the working data to the microphone receiver 14 when receiving a polling data packet after generating working data.
[0094] Specifically, the slave device 11 may be the microphone receiving terminal 14, and the master device 12 may be the microphone receiving terminal 14. The specific description of the microphone receiving terminal 14 and the microphone receiving terminal 14 may refer to the above slave device 11 and master device 12, which will not be repeated in this embodiment.
[0095] In summary, the present application sets the data generation cycle of the working data of the slave device 11 to the same end time as the polling time of a polling cycle, so that it can be ensured that after the slave device 11 forms the working data according to the data generation cycle, the master device 12 can just poll the slave device at this time, so that the slave device 11 can send the working data to the master device 12 in time, thereby reducing the retention time of the working data, ensuring the real-time nature of data transmission, and improving the efficiency of the wireless communication device 10. In addition, the present application also sets that when the master device 12 polls each slave device 12 in each polling cycle, it sends a polling data packet to the slave device 11 at least twice in succession, so that each slave device 11 has two opportunities to respond to the master device 12 in each polling cycle, thereby reducing the situation where data is retained due to transmission errors of the response data packet, and improving the transmission anti-interference performance of the wireless communication device 10.
[0096] The above descriptions are merely embodiments of the present application and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A wireless communication device, characterized in that: include: From the device, used to form working data within the data generation cycle; A master device, communicatively connected to the slave device, wherein the master device sends a polling data packet to the slave device in each polling cycle; Each of the polling cycles has a polling time corresponding to the slave device, and the master device sends the polling data packet to the slave device at the polling time; Wherein, the data generation cycle is set so that its end time is the same as the polling time of one of the polling cycles; the slave device is used to send a response data packet containing the working data to the master device when receiving the polling data packet after generating the working data.
2. The wireless communication device according to claim 1, wherein: The data generation cycle is set so that its start time is the same as the polling time of the polling cycle other than the first one, and the data generation cycle is an integer multiple of the polling cycle.
3. The wireless communication device according to claim 2, wherein: The number of the slave devices is at least two, and the master device sends a polling data packet to each of the slave devices in turn in each polling cycle; the polling time corresponding to each of the slave devices is different; and the start time of the data generation cycle of different slave devices is different.
4. The wireless communication device according to claim 3, characterized in that The polling data packet carries the corresponding polling time; each slave device is used to obtain the reception time and the corresponding polling time of the polling data packet when receiving the polling data packet sent by the master device in the first polling cycle, and determine the start time of the first data generation cycle according to the polling cycle, the reception time and the corresponding polling time, so that the start time of the first data generation cycle is the same as the corresponding polling time of the next polling cycle.
5. The wireless communication device according to any one of claims 2 to 4, characterized in that: The master device is used to send the polling data packet to the slave device at least twice in succession when polling each slave device in each polling cycle, and poll the next slave device after polling one slave device; each polling cycle has at least two polling times corresponding to each slave device; wherein the data generation cycle is set so that its start time is the same as one of the polling times corresponding to a non-first polling cycle.
6. The wireless communication device according to claim 4, characterized in that: The master device is used to send the polling data packet to the corresponding slave device for the first time at the first polling moment of each polling cycle; wherein the data generation cycle is set so that its end time is the same as the first polling moment in a non-first polling cycle.
7. The wireless communication device according to any one of claims 2 to 4, characterized in that: Each of the slave devices is used to determine whether the latest working data has been formed when receiving the polling data packet sent by the master device, and if not, send a response data packet missing the working data to the master device.
8. The wireless communication device according to claim 2, wherein: The master device and the at least one slave device are used to perform timing synchronization during a handshake phase before the first of the polling cycles.
9. The wireless communication device according to claim 8, characterized in that: The master device and each of the slave devices respectively count the time after the program is started; The master device is used to record a first time count value in the handshake phase, and send the first time count value to each of the slave devices; each of the slave devices is used to receive the first time count value, and record a second time count value at the moment of receiving; Each of the slave devices is used to calculate a time compensation value according to the second time count value and the first time count value, and calibrate the time count by the time compensation value, so that the timing between the slave device and the master device is synchronized.
10. The wireless communication device according to claim 2, wherein: The data generation cycle includes a data generation duration and a delay duration; the delay duration is set so that the data generation cycle is an integer multiple of the polling cycle.
11. The wireless communication device according to claim 2, characterized in that: The number of the slave devices is at least two, and the master device sends polling data packets to the slave devices in turn in each polling cycle; the polling times corresponding to different slave devices are different, and the start times of the data generation cycles of different slave devices are the same.
12. The wireless communication device according to claim 11, characterized in that: The polling data packet carries the corresponding polling time; the slave device that first receives the polling data packet among at least two slave devices determines the starting time of the first data generation cycle, and the starting time of the first data generation cycle of the other slave devices is the same as that of the slave device that first receives the polling data packet.
13. The wireless communication device according to claim 12, characterized in that: The slave device is used to obtain the reception time and the corresponding polling time of the polling data packet when it first receives the polling data packet sent by the master device in the first polling cycle, and determine the start time of the first data generation cycle according to the polling cycle, the reception time and the corresponding polling time, so that the start time of the first data generation cycle is the same as the corresponding polling time of the next polling cycle.
14. A wireless communication device, characterized in that: include: The microphone transmitter is used to generate working data during the data generation cycle; A microphone receiving end, communicatively connected to the microphone transmitting end, the microphone receiving end sending a polling data packet to the microphone transmitting end in each polling cycle; Each of the polling cycles has a polling time corresponding to the microphone transmitting end, and the microphone receiving end sends the polling data packet to the microphone transmitting end at the polling time; Among them, the data generation cycle is set so that its end time is the same as the polling time of one of the polling cycles; the microphone transmitting end is used to send a response data packet containing the working data to the microphone receiving end when receiving the polling data packet after generating the working data.
15. A wireless communication method for a wireless communication device, characterized in that: include: Receive a polling data packet sent by the master device at the polling time of the current polling cycle; The data generation cycle starting at the polling time forms working data; wherein the data generation cycle is set to have its end time the same as the polling time of one of the polling cycles; When the polling data packet is received after the working data is generated, a response data packet containing the working data is sent to the master device.
16. The wireless communication method according to claim 15, characterized in that: The data generation cycle is set so that its start time is the same as the polling time of the polling cycle other than the first one, and the data generation cycle is an integer multiple of the polling cycle.
17. The method according to claim 16, characterized in that Before the receiving of the polling data packet sent by the master device at the polling time of the current polling cycle, the method includes: receiving the polling data packet sent by the master device in the first polling cycle, and acquiring the receiving time of the polling data packet and the corresponding polling time; The starting time of the first data generation cycle is determined according to the polling cycle, the receiving time and the corresponding polling time, so that the starting time of the first data generation cycle is the same as the polling time of the next polling cycle.
18. The method according to claim 16, characterized in that The receiving master device sends a polling data packet at the polling time of the current polling cycle, including: Receive the polling data packet sent by the master device at least twice in the current polling cycle; wherein the master device sends the polling data packet at least twice in each polling cycle, and each polling cycle has at least two polling times corresponding to the slave device; wherein the data generation cycle is set so that its start time is the same as one of the polling times corresponding to a non-first polling cycle.
19. The method according to claim 18, characterized in that The master device is used to send the polling data packet to the corresponding slave device for the first time at the first polling time of each polling cycle; wherein the data generation cycle is set to have its start time the same as the first polling time corresponding to the non-first polling cycle.
