Frame synchronization method and electronic device

By converting serial data into parallel detection data and computed with reference signals, the problem of large delay and high packet error rate in IEEE 802.11b is solved, and fast and accurate frame synchronization and data frames are achieved Get it.

CN118449828BActive Publication Date: 2025-01-14HONOR DEVICE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311452593.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-02
Publication Date
2025-01-14
Estimated Expiration
2043-11-02

AI Technical Summary

Technical Problem

In the existing IEEE 802.11b wireless LAN standard, the receiving device is delayed at the start position of the synchronization code (SYNC), which is prone to false alarms, resulting in high packet error rate of data frame reception.

Method used

By converting the received serial data into parallel detection data and computed with the local reference signal, we can judge whether the signal peak meets the preset conditions, select the path with the largest sum of the signal peaks as the target detection data, and determine that the validity in the physical frame is achieved through the physical frame. The starting position of the load reduces the amount of data and calculations, and improves the accuracy of frame synchronization.

Benefits of technology

It realizes fast and accurate identification of synchronization codes, thereby improving the accuracy of data frame acquisition, reducing packet error rate, and shortening the time of frame synchronization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118449828B_ABST
    Figure CN118449828B_ABST
Patent Text Reader

Abstract

The present application provides a method for frame synchronization and an electronic device, and relates to the field of Wi-Fi technology. The present application provides a method for frame synchronization, including: obtaining serial data of a preset length, converting the serial data into parallel m-channel detection data, obtaining in parallel the signal peak value output by the cross-correlation of each channel of detection data with the local reference data, detecting whether the signal peak value corresponding to each channel of detection data meets the preset first condition, and if it is detected that the number of channels of detection data that meet the preset condition reaches the channel number threshold, then selecting the channel with the largest sum of the n signal peak values ​​from the detection data that meets the condition as the target detection data, and determining the starting position of the payload according to the number of channels of the target detection data. The method in the present application is adopted, so that the receiving end device can quickly and accurately identify the synchronization code in the physical frame, thereby improving the accuracy of acquiring data frames and reducing the packet error rate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of Wi-Fi technology, and in particular to a frame synchronization method and electronic device. Background Art

[0002] IEEE 802.11b is a wireless local area network standard formulated by IEEE and is an extension of 802.11. The standard stipulates that the WLAN operating frequency band is 2.4~2.4835GHz, the data transmission rate reaches 11Mbps, and the transmission distance is controlled at 15~45m. IEEE 802.11b has four data transmission rates: 11Mbps, 55Mbps, 2Mbps, and 1Mbps. The physical layer protocol data unit of the IEEE 802.11b includes three parts: preamble (PLCP Preamble), header (PLCP Header) and physical layer service data unit (Physical Service Data Unit, PSDU). The preamble includes synchronization preamble (Syncronization, SYNC) and start frame delimiter (Start Frame Delimiter, SFD). SYNC is used by the receiving end device to determine whether there is a data frame (i.e. frame synchronization) in the channel. SFD is used as a frame start identifier to determine the position of the subsequent PLCP Header and the starting position of the PSDU.

[0003] The transmitting device of the wireless signal usually performs scrambling, modulation, spread spectrum, frequency modulation and other operations on the transmitted data before transmitting it to the receiving device. The receiving device uses the local reference signal to perform cross-correlation calculation on the received signal to find the starting position of SYNC. According to the starting position of SYNC, the starting position of PSDU can be determined. However, the delay of finding the starting position of SYNC is large, or false alarms may occur, resulting in a high packet error rate of the receiving device receiving data. Summary of the invention

[0004] In order to solve the above technical problems, the present application provides a frame synchronization method and electronic device, so that the receiving device can quickly and accurately identify the synchronization code in the physical frame, thereby improving the accuracy of acquiring data frames and reducing the packet error rate.

[0005] In a first aspect, the present application provides a frame synchronization method, comprising: obtaining first serial data of a preset length from a buffer, the buffer being used to cache a physical frame sent by a transmitting end device in real time, the preamble of the physical frame being data at least after upsampling and Barker code spread spectrum, the preset length being n*m*k bits, n being an integer greater than or equal to 3, m being an upsampling gain, and k being a Barker code length; converting the first serial data into m parallel detection data, wherein each detection data comprises n sequences of length k; obtaining n signal peaks outputted by cross-correlating each detection data with a locally stored reference signal in parallel, and determining whether the signal peak corresponding to each detection data satisfies a preset first condition, the first condition comprising that there are n consecutive signal peaks greater than a peak threshold in the signal peak corresponding to each detection data; if the number of detection data satisfying the preset condition reaches a path number threshold, selecting a path with the largest sum of n signal peaks from the detection data satisfying the condition as target detection data, the path number threshold being an integer greater than 1 and less than m; obtaining the number of target detection data, and determining the starting position of a payload in a physical frame.

[0006] In this way, the physical layer of the electronic device converts the acquired serial data into parallel m-channel detection data, each channel of detection data includes n sequences of length k, m is the same as the upsampling magnification, so that after the target detection data is acquired, the other m-1 channels of detection data can be ignored, reducing the amount of data for determining the starting position of SYNC in the subsequent process; at the same time, each channel of detection data includes n sequences of length k, k is the length of the spread spectrum code, and the length is the same as the length of the reference signal, so that when each sequence is cross-correlated with the reference signal, the amount of calculation is small and the speed is fast, and because the length of the parallel sub-data is fixed and the same as the length of the reference signal, the calculation of each channel of detection data is similar, and the calculation time is similar, which shortens the time for the number of channels of detection data that meet the preset conditions to reach the channel number threshold. At the same time, in this example, the preset number of channels is less than m, and there is no need to wait for the 4 channels to be determined before making a determination, which further shortens the judgment time. And the acquired serial data is converted into m-channel parallel detection data, which improves the speed of finding the starting position of SYNC.

[0007] According to the first aspect, determining whether a signal peak value corresponding to each channel of detection data satisfies a preset first condition includes:

[0008] Detect whether there are n consecutive signal peaks greater than the peak threshold value in the signal peaks corresponding to the i-th detection data; if it is determined that there are, detect whether the n signal peaks of the i-th detection data are the same or similar signal peaks; if it is determined that the n signal peaks of the i-th detection data are the same or similar signal peaks, determine that the signal peaks corresponding to the detection data meet the preset first condition. In this way, after the electronic device detects n consecutive signal peaks greater than the peak threshold value in each detection data, it detects whether the n signal peaks are the same or similar signal peaks, which can avoid the problem of false alarm caused by erroneous judgment due to noise fluctuation.

[0009] According to the first aspect, detecting whether the n signal peaks of the i-th detection data are the same or similar signal peaks includes: obtaining the maximum signal peak and the minimum signal peak from the n signal peaks of the i-th detection data; obtaining the ratio between the maximum signal peak and the minimum signal peak as the first ratio; detecting whether the first ratio is greater than a preset first threshold; if it is determined that the first ratio is greater than the first threshold, determining that the n signal peaks of the i-th detection data are the same or similar signal peaks. In this way, the electronic device can quickly determine whether the n signal peaks in the i-th detection data are similar or the same signal peaks by comparing the maximum signal peak and the minimum signal peak in the i-th detection data.

[0010] According to the first aspect, detecting whether the n signal peaks of the i-th detection data are the same or similar signal peaks includes: detecting whether the difference between any two signal peaks in the n signal peaks of the i-th detection data is less than a preset difference threshold; if it is determined that the difference between any two signal peaks in the n signal peaks is less than the difference threshold, then determining that the n signal peaks of the i-th detection data are the same or similar signal peaks. In this way, the electronic device can accurately determine whether the n signal peaks are similar or the same signal peaks by comparing the difference between any two signal peaks in the i-th detection data with the difference threshold.

[0011] According to the first aspect, before selecting the path with the largest sum of corresponding signal peaks from the detection data that meets the conditions as the target detection data, the method also includes: judging whether the signal peaks corresponding to the detection data of each path that meets the conditions are the same or similar signal peaks; if the signal peaks corresponding to the detection data of each path that meets the conditions are the same or similar signal peaks, determining to execute the step of selecting the path with the largest sum of corresponding peaks from the detection data that meets the conditions as the target detection data. In this way, after the electronic device detects that the number of detection data that meets the first condition reaches the path number threshold, it detects whether the signal peaks of the detection data of each path are the same or similar, which can reduce the problem of false alarm caused by erroneous judgment due to noise fluctuations and improve the accuracy of frame synchronization.

[0012] According to the first aspect, judging whether the signal peaks corresponding to the detection data of each channel that meets the conditions are the same or similar signal peaks includes: obtaining the sum of the n signal peaks corresponding to each detection data as the peak sum of the detection data; obtaining the ratio between the maximum peak sum and the minimum peak sum as the second ratio; judging whether the second ratio is greater than the preset second threshold; if it is determined that the second ratio is greater than the second threshold, determining that the signal peaks corresponding to the detection data of each channel that meets the conditions are the same or similar signal peaks. In this way, the receiving end device obtains the sum of the signal peaks of each detection data, and through the ratio between the maximum peak sum and the minimum peak sum, the larger the ratio, the closer the peak sum is. This method can quickly and accurately judge whether the signal peaks corresponding to the detection data of each channel that meets the conditions are the same or similar signal peaks.

[0013] According to the first aspect, before detecting whether the first ratio is greater than a preset first threshold, the method further includes: setting at least two different first candidate thresholds; obtaining the packet error rate of the receiving end device receiving the data frame under different first candidate thresholds; and selecting the first candidate threshold corresponding to the minimum packet error rate as the first threshold. In this way, the electronic device can reduce the packet error rate of the receiving end device by selecting the first threshold according to the packet error rate.

[0014] According to the first aspect, before determining whether the signal peaks corresponding to the detection data of each path that meets the conditions are the same or similar signal peaks, the method further includes: setting at least two different second candidate thresholds; obtaining the packet error rate of the frame data received by the receiving device under different second candidate thresholds; and selecting the second candidate threshold corresponding to the minimum packet error rate as the second threshold. In this way, the electronic device can reduce the packet error rate of the receiving device by selecting the second threshold according to the packet error rate.

[0015] According to the first aspect, the first serial data is converted into m parallel detection data, including: starting from the starting position of the first serial data, each received m-bit data is used as a group of data to be converted; each group of data to be converted is subjected to the following serial-to-parallel conversion processing: each data in the i-th group of data to be converted is used as the data of the i-th column position in each parallel data, i is an integer greater than 0; when each group of conversion data has completed the serial-to-parallel conversion processing, the parallel m-path detection data is obtained. In this way, the electronic device converts the serial data in this way, so that the length of each detection data is the same, and each detection data contains n sequences of length k, which can reduce the execution speed of the subsequent step of determining whether the first condition is met. In addition, each received m data is sequentially added to each detection data, which is the same as the sampling multiple, so that one of the m paths has valid data, and the remaining m-1 paths are data obtained by interpolation during upsampling, so that the detection data of the m-1 paths can be discarded later, reducing the cache.

[0016] According to the first aspect, the signal peak values ​​output by cross-correlating each channel of detection data with a locally stored reference signal are obtained in parallel, including: performing cross-correlation calculations on n sequences of length k in each channel of detection data with the reference signal, and outputting n signal peak values. In this way, after the electronic device cross-correlates each channel of detection data with the reference signal, at most n signal peak values ​​greater than the peak threshold are generated, which can reduce the amount of calculation for each channel of detection data and improve the calculation speed.

[0017] According to the first aspect, after determining the starting position of the payload in the physical frame, the method further includes: when it is detected that the timer reaches the first duration, shifting to obtain second serial data of a preset length from the buffer. In this way, after the electronic device performs frame synchronization on the data obtained from the buffer each time, it performs clock synchronization, so that after converting the serial data into parallel data each time, the processing time of each detection data is similar, thereby reducing the time for processing data.

[0018] According to the first aspect, the number of paths of target detection data is obtained to determine the starting position of the payload in the physical frame, including: obtaining the number of paths of the target detection data as a first index position; cutting a data stream from a buffer according to the first index position to obtain third serial data; downsampling the third serial data according to the second index position to obtain fourth serial data; identifying the position of a start frame delimiter in the fourth serial data;

[0019] The starting position of the payload is determined according to the position of the start delimiter. In this way, the electronic device can identify the position of the start frame delimiter used for fine synchronization according to the first index position and the second index position, and then determine the starting position of the payload.

[0020] According to the first aspect, when the method is applied to WLAN standards of 802.11b and 802.11n, n is 3, m is 4 and k is 11.

[0021] In a second aspect, the present application provides an electronic device comprising: one or more processors; a memory; and one or more computer programs, wherein the one or more computer programs are stored in the memory, and when the computer programs are executed by the one or more processors, the electronic device executes the frame synchronization method corresponding to the first aspect and any one of the implementation methods of the first aspect.

[0022] The second aspect and any implementation of the second aspect correspond to the first aspect and any implementation of the first aspect respectively. The technical effects corresponding to the second aspect and any implementation of the second aspect can refer to the technical effects corresponding to the above-mentioned first aspect and any implementation of the first aspect, which will not be repeated here.

[0023] In a third aspect, the present application provides a computer-readable medium for storing a computer program. When the computer program runs on an electronic device, the electronic device executes the frame synchronization method corresponding to the above-mentioned first aspect and any one of the implementation methods of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments of the present application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0025] Figure 1 is a schematic diagram of an architecture of a communication system exemplarily shown;

[0026] Figure 2 is a schematic diagram showing the structure of an electronic device;

[0027] Figure 3 is a software structure block diagram of an electronic device exemplarily shown;

[0028] Figure 4 is a schematic diagram showing an exemplary PPDU format under the 802.11b standard;

[0029] Figure 5 is a schematic diagram exemplarily illustrating a frame synchronization;

[0030] Figure 6 is a flowchart of another frame synchronization shown as an example;

[0031] Figure 7 is a flowchart showing an exemplary frame synchronization;

[0032] Figure 8 is a schematic diagram showing an exemplary serial-to-parallel conversion;

[0033] Fig. 9 is a flowchart of another frame synchronization shown as an example;

[0034] Fig.10 is a diagram showing the correspondence between peak values ​​and the number of peak values;

[0035] Fig.11 FIG. 4 is a schematic diagram showing exemplary data used for fine synchronization. DETAILED DESCRIPTION

[0036] 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 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.

[0037] The term "and / or" in this article is merely a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone.

[0038] The terms "first" and "second" in the description and claims of the embodiments of the present application are used to distinguish different objects rather than to describe a specific order of objects. For example, a first target object and a second target object are used to distinguish different target objects rather than to describe a specific order of target objects.

[0039] In the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.

[0040] In the description of the embodiments of the present application, unless otherwise specified, the meaning of "multiple" refers to two or more than two. For example, multiple processing units refer to two or more processing units; multiple systems refer to two or more systems.

[0041] Before explaining the embodiments of the present application in detail, the application scenarios in the present application are first described. Figure 1 Schematic diagram of the architecture of a communication system provided in an embodiment of the present application. The communication system includes an access point device and a site device. The communication system may include one or more access points (APs), Figure 1 Only one is shown in FIG. The communication system also includes one or more stations (STA), such as Figure 1 STA1~STA3 shown in the figure.

[0042] Figure 1The architecture shown can also be extended to the application scenarios of base stations (BS) and user equipment (UE). Among them, AP can be the access point for mobile users to enter the wired network. It is mainly deployed in homes, buildings and parks. The typical coverage radius is tens of meters to hundreds of meters. Of course, it can also be deployed outdoors.

[0043] AP is equivalent to a bridge connecting wired network and wireless network. Its main function is to connect various wireless network clients together and then connect the wireless network to Ethernet. Specifically, AP can be a terminal device or network device with a WiFi chip. AP can be a device that supports 802.11b and its 802.11n format. STA can be a wireless communication chip, a wireless sensor or a wireless communication terminal. For example, a mobile phone that supports WiFi communication function, a tablet computer that supports WiFi communication function, a set-top box that supports WiFi communication function, a smart TV that supports WiFi communication function, a smart wearable device that supports WiFi communication function, a vehicle-mounted communication device that supports WiFi communication function, and a computer that supports WiFi communication function. Optionally, STA can support devices of 802.11b and its 802.11n format.

[0044] The embodiments of the present application are mainly described by taking a network deploying IEEE 802.11b and 802.11n as an example. Those skilled in the art will readily appreciate that various aspects of the present application may be extended to other networks adopting various standards or protocols.

[0045] Figure 2 This is a schematic diagram of the structure of an electronic device 100 shown in an embodiment of the present application. It should be understood that: Figure 2 The electronic device 100 shown is only one example of an electronic device, and the electronic device 100 may have more or fewer components than shown in the drawings, may combine two or more components, or may have a different configuration of components. Figure 2 The various components shown in the figure can be implemented in hardware, software, or a combination of hardware and software including one or more signal processing and / or application specific integrated circuits. In this example, the electronic device 100 is taken as an example of a mobile phone.

[0046] The electronic device 100 may include: a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor, a gyroscope sensor, an air pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, etc.

[0047] Figure 3 is a software structure diagram of an electronic device in an embodiment of the present application. The layered architecture of the electronic device divides the software into several layers, each layer has a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into three layers, from top to bottom, namely, the application layer, the application framework layer, and the kernel layer. It can be understood that Figure 3 The layers in the software structure and the components contained in each layer do not constitute a specific limitation on the wearable device 200. In other embodiments of the present application, the wearable device 200 may include more or fewer layers than shown in the figure, and each layer may include more or fewer components, which is not limited in the present application.

[0048] like Figure 3 As shown, the application layer can include a series of application packages. The application packages can include WLAN, Bluetooth, camera, gallery, calendar, short message and other applications. The application framework layer provides an application programming interface (API) and programming framework for the applications in the application layer. The application framework layer includes some predefined functions.

[0049] like Figure 3 As shown, the application framework layer may include a window manager, a resource manager, a content provider, a view system, a phone manager, a notification manager, and the like.

[0050] The window manager is used to manage window programs. The window manager can obtain the display screen size, determine whether there is a status bar, lock the screen, capture the screen, etc.

[0051] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.

[0052] Content providers are used to store and retrieve data and make it accessible to applications. The data may include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.

[0053] The view system includes visual controls, such as controls for displaying text, controls for displaying images, etc. The view system can be used to build applications.

[0054] The phone manager is used to provide communication functions of the electronic device 200, such as management of call status (including connecting, hanging up, etc.).

[0055] The notification manager enables applications to display notification information in the status bar. It can be used to convey notification-type messages and can disappear automatically after a short stay without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc.

[0056] The kernel layer is the layer between hardware and software. The kernel layer contains at least Wi-Fi driver, Bluetooth driver, display driver, camera driver, audio driver, sensor driver, etc.

[0057] Before describing the frame synchronization method in the present application, the WLAN standard of 802.11b involved in the present application is described first.

[0058] 802.11b uses high-speed direct sequence spread spectrum (HR / DSSS) transmission technology and 2.4GHz frequency band. According to the modulation technology used, there are four transmission rates: 1Mb / s, using differential binary phase keying (DBPSK) modulation technology; 2Mb / s, using differential quadrature phase shift keying (DQPSK) modulation technology; 5.5Mb / s and 11Mb / s. Both 5.5Mb / s and 11Mb / s high-speed transmission modes use complementary code keying (CCK) modulation technology.

[0059] The physical layer of Wi-Fi includes two sublayers, namely the Physical Layer Convergence Protocol (PLCP) layer and the Physical Media Dependent (PMD) layer. The data layer above the physical layer includes: the Logical Link Control (LLC) and the Media Access Control (MAC) layer. The LLC receives data from layers 3 to 7 (i.e. above the network layer), called MAC Service Data Unit (MSDU), and transmits the MSDU to the MAC layer. The MAC layer encapsulates the MSDU into a MAC Payload Unit (MPDU) and transmits it to the physical layer. The PLCP layer in the physical layer encapsulates the MPDU into a Physical Layer Protocol Data Unit (PPDU). The PPDU includes a PLCP Preamble, a PLCP Header, and a Physical Service Data Unit (PSDU), wherein the PSDU in the PPDU is equal to the MPDU. The PMD layer encodes and modulates the encapsulated data (PPDU) and transmits it to the receiving device. The PLCP preamble in the PPDU is used to synchronize the transmitting device and the receiving device to ensure the time relationship between the two, so that the receiving device can synchronize according to the PLCP preamble and receive the actual data (i.e., receive the PSDU). The PLCP preamble includes: long preamble and short preamble.

[0060] Figure 4 This is a schematic diagram of the PPDU format under the 802.11b standard.

[0061] Figure 44a in FIG. 4 is a schematic diagram of the long preamble frame format. As shown in 4a, the long preamble frame includes a PLCP long preamble (length is 144 bits), a PLCP header (length is 48 bits) and a PSDU. The transmission rate of the PSDU can be 1Mb / s, 2Mb / s, 5.5Mb / s and 11Mb / s as shown in 4a. The PLCP long preamble includes a 128-bit synchronization code (SYNC) and a 16-bit start frame delimiter (SFD). The PLCP header includes an 8-bit signaling (SIGNAL), an 8-bit service (SERVICE), a 16-bit length (LENGTH) and a 16-bit check code (CRC). The signaling is used to indicate the transmission rate of the payload (payload) (such as 1Mb / s, 2Mb / s, 5.5Mb / s or 11Mb / s). The length is the time for the payload to be transmitted, in microseconds (us). The check bit is used to determine whether there is an error in the header. The service bit is an additional High Rate (HR) configuration bit.

[0062] Figure 4 4b in FIG. 4 is a schematic diagram of the short preamble frame format. As shown in 4b, the short preamble frame includes a PLCP long preamble code (length is 72 bits), a PLCP header (length is 48 bits) and a PSDU. The transmission rate of the PSDU is shown in 4a, which can be 2Mb / s, 5.5Mb / s and 11Mb / s. The PLCP short preamble code includes a 56-bit synchronization code (Synchronized, SYNC) and a 16-bit start frame delimiter (SFD). The PLCP header includes an 8-bit signaling (SIGNAL), an 8-bit service (SERVICE), a 16-bit length (LENGTH) and a 16-bit check code (CRC). The structure and function of the header of the short preamble frame are the same as those of the header of the long preamble frame, and will not be repeated here.

[0063] In this example, Figure 4 As shown, before the synchronization codes in the long preamble frame and the short preamble frame are transmitted by the transmitting device, the PMD can use DBPSK to modulate the PLCP preamble code and use the Barker code to spread the PLCP preamble code. The lengths of the Barker code include: 2, 3, 4, 5, 7, 11, 13. Among them, under the 802.11b standard, an 11-bit Barker code is used. The transmitting device scrambles, modulates, spreads and upsamples the PLCP preamble code. In addition, the transmitting device also scrambles, modulates, spreads and upsamples the PCLP header and PSDU. The transmitting device transmits the processed PLCP preamble code (PLCPPreamble) together with the processed PLCP header (PLCP header) and PSDU. The scrambling code and the spreading code can be different or the same.

[0064] After the receiving device receives the signal, the physical layer performs matched filtering on the received signal and performs frame synchronization processing on the filtered signal to obtain the PSDU in the signal. Frame synchronization processing includes coarse synchronization and fine synchronization. The coarse synchronization operation is specifically as follows: the receiving device detects whether there is SYNC through a coarse synchronization algorithm. If so, it determines that the received signal includes a data frame. After the receiving device determines that there is a data frame in the signal, it performs a fine synchronization operation, specifically as follows: the receiving device downsamples according to the position of SYNC to obtain finely synchronized data, the receiving device identifies the SFD in the finely synchronized data, and determines the starting position of the data frame according to the SFD. The physical layer can split and process subsequent data packets of the data frame according to the starting position of the data frame. If the position of the SYNC determined by the receiving device is inaccurate, it may result in the inability to correctly identify the position of the data frame, resulting in packet loss.

[0065] Figure 5 5a in FIG. 5 is a schematic diagram of frame synchronization, as shown in 5a. The receiving end device receives a data stream, and the transmission rate of the data stream is shown in 5a as "44M data stream". The "44M data stream" indicates that the transmission rate of the data stream is 1 / 44M (second) to transmit one bit of signal, and M is 10 6 ,Right now (seconds) transmits one bit of signal. The receiving device uses the local reference signal to perform cross-correlation calculation with the received signal and outputs multiple signal peaks. If the receiving device determines that a signal peak greater than the peak threshold has appeared, it detects whether three signal peaks greater than the peak threshold have appeared continuously. If it is determined that three signal peaks greater than the peak threshold have appeared continuously, the receiving device determines that a data frame has arrived, and the signal position corresponding to the last peak can be used as the starting position of SYNC (as shown in 5a, where the arrow is located at the C position), wherein the data stream moves in the direction shown by the wide arrow in 5a, and the data that first flows into the physical layer of the receiving device is processed first, that is, the position of the first signal peak exceeding the peak threshold calculated by the physical layer is the A position, and the third peak is the C position. The local reference signal usually uses a long sequence (such as a 128-bit reference signal) to ensure the accuracy of the detection, but this method consumes a long time for cross-correlation calculation due to the long length of the reference signal, increases the duration of coarse synchronization, and results in a long time for data frame acquisition.

[0066] In other embodiments, since the length of the local reference signal is too long, resulting in a large amount of calculation for the cross-correlation between the local reference signal and the received signal, the local reference signal may use a shorter reference signal, such as an 11-bit Barker code. The receiving device uses the 11-bit Barker code to perform cross-correlation calculations with the received signal and outputs multiple signal peaks. If the receiving device detects a signal peak greater than the peak threshold, it detects whether three signal peaks greater than the peak threshold appear consecutively. If it is determined that three signal peaks greater than the peak threshold appear consecutively and the signal index interval corresponding to each peak is 11 bits, the receiving device determines that a data frame has arrived. In this example. The electronic device uses a shorter local reference signal to reduce the amount of cross-correlation calculations between the local reference and the received signal and speed up the determination of the SYNC position.

[0067] Although this method can increase the speed at which the receiving device calculates the cross-correlation between the local reference signal and the received signal, the way in which the receiving device serially processes the data stream still affects the speed of determining SYNC.

[0068] Figure 5 5b in FIG. 5 is a schematic diagram of another frame synchronization, as shown in 5b. The physical layer of the receiving device receives a data stream with a transmission rate of 44M, which indicates that one bit of signal is transmitted every 1 / 44M (second), and M is 10 6 The physical layer divides the received data stream into 4 parallel data streams. This method converts serial data into parallel data by directly dividing the serial data into 4 parts. For example, the serial data obtained by the physical layer is shown in 5c. Position A is the index position of the data that the physical layer starts to receive. The physical layer can divide every 33 data from the index position A into one detection data. As shown in 5c, the division method generates 4 parallel detection data. Since it is divided into 4 channels, the transmission time of each channel is 1 / 11M (seconds), and M is 10 6 . Figure 5 The 11M data stream shown in 5b means that one bit of signal is transmitted every 1 / 11M (second). The first data stream detects three consecutive signal peaks greater than the peak threshold at position D, and the signal index corresponding to each peak is separated by 11 bits. The second data stream detects three consecutive signal peaks greater than the peak threshold at position C, and the signal index corresponding to each peak is separated by 11 bits. The third data stream detects three consecutive signal peaks greater than the peak threshold at position B, and the signal index corresponding to each peak is separated by 11 bits. The fourth data stream detects three consecutive signal peaks greater than the peak threshold at position A, and the signal index corresponding to each peak is separated by 11 bits. The data stream moves in the direction indicated by the wide arrow in 5b, and the data that first flows into the physical layer of the receiving device is processed first.

[0069] like Figure 5 As shown in 5b, when the fourth channel determines that there are 3 signal peaks greater than the peak threshold at position A, the third channel, the second channel, and the first channel have not detected 3 signal peaks greater than the peak threshold. That is, the fourth channel first detects 3 consecutive signal peaks greater than the peak threshold, and the first channel detects 3 consecutive signal peaks greater than the peak threshold at the end. Although the fourth channel first detects 3 consecutive signal peaks greater than the peak threshold, it needs to wait for the first channel to detect 3 consecutive signal peaks greater than the peak threshold. The physical layer can obtain the last searched position as the starting position of SYNC, that is, the physical layer needs to detect all 4 channels of data before stopping the search and determining that one of the 4 channels contains SYNC, which results in a long time to determine the starting position of SYNC. It can be seen that the physical layer has different detection speeds for each channel, and there is a large detection difference, which leads to a slow speed for the electronic device to determine the starting position of SYNC.

[0070] Optionally, the physical layer divides the received data stream (such as 256 bits) into 4 parallel data streams of different lengths. For example, the physical layer starts from the A index position and uses the received 33 bits of data as the first detection data. Similarly, the data is extracted to generate the second detection data, the third detection data and the fourth detection data. The second detection data is 44 bits, the third detection data is 88 bits, and the fourth detection data is 44 bits. In this method, since the length of each detection data is different, the detection speed of each detection data is different, which affects the speed of determining the starting position of SYNC.

[0071] In order to solve the problem that the physical layer performs coarse synchronization slowly and inaccurately, this example provides a frame synchronization method, which is executed by an electronic device, wherein the physical layer of the electronic device obtains first serial data of a preset length from a buffer, and the buffer is used to cache the physical frame sent by the transmitting device in real time, and the leading code of the physical frame is data after at least upsampling and Barker code spread spectrum, and the preset length is n*m*k bits, where n is an integer greater than or equal to 3, m is the upsampling magnification, and k is the length of the Barker code; the first serial data is converted into m parallel detection data, wherein each detection data includes n sequences of length k ; In parallel, n signal peaks are obtained from the cross-correlation outputs of each detection data with the locally stored reference signal, and it is determined whether the signal peak corresponding to each detection data satisfies a preset first condition, wherein the first condition includes that there are n consecutive signal peaks greater than a peak threshold in the signal peaks corresponding to each detection data; if the number of detection data paths that meet the preset condition reaches a path number threshold, then a path with the largest sum of n signal peaks is selected from the detection data that meet the condition as the target detection data, and the path number threshold is an integer greater than 1 and less than m; the number of target detection data paths is obtained to determine the starting position of the payload in the physical frame.

[0072] Figure 6 A flowchart of a frame synchronization method provided in an embodiment of the present application includes the following steps:

[0073] Step 601: The receiving end device obtains first serial data of a preset length from a buffer. The buffer is used to cache in real time a physical frame sent by the transmitting end device, the preamble of the physical frame is data at least after upsampling and Barker code spread spectrum, the preset length is n*m*k bits, n is an integer greater than or equal to 3, m is the upsampling magnification, and k is the Barker length.

[0074] Specifically, an electronic device can be used as a transmitting device or as a receiving device, and an access point device can be used as a transmitting device or a receiving device. The physical layer of the transmitting device encapsulates the PPDU, and transmits it to the receiving device after scrambling, modulation, spread spectrum, and upsampling. The physical layer of the receiving device receives the signal sent by the transmitting device. In this example, the received signal is a physical frame. In this example, the WLAN standard takes the 802.11b standard as an example, and the spread spectrum sequence of the preamble (PLCP Preamble) in the 802.11b standard signal is an 11-bit Barker code. The upsampling gain is m, such as 4 times.

[0075] After the physical layer of the receiving device receives the signal, it can first perform matched filtering on the received signal to reduce the influence of the noise signal. The physical layer caches the matched filtered signal in a buffer. The physical layer obtains serial data from the buffer as the first serial data according to the preset length, and identifies the first serial data to find SYNC. In this example, the preset length is n*m*k bits, and n is an integer greater than or equal to 3. For example, n is 3, m is 4, and k is 11, and the preset length is 3*4*11=132 bits. For another example, n is 4, m is 4, and k is 11, and the preset length is 4*4*11=176 bits. In this example, the preset length is 3*4*11=132 bits. After the physical layer completes the coarse synchronization processing of the current first serial data (i.e., determining the starting position of SYNC), it moves 1 bit and continues to extract serial data of the preset length from the buffer as the serial data for the next coarse synchronization processing.

[0076] Step 602: The physical layer converts the first serial data into m parallel detection data, where each detection data includes n sequences of length k.

[0077] In this example, the process of the physical layer converting the first serial data into the parallel m-path detection data includes: the physical layer starts from the starting position of the first serial data, and takes each received m-bit data as a group of data to be converted; and performs the following serial-to-parallel conversion processing on each group of data to be converted: each data in the i-th group of data to be converted is sequentially used as the data at the i-th column position in each path of parallel data, where i is an integer greater than 0. When each group of conversion data has completed the serial-to-parallel conversion processing, the parallel m-path detection data is obtained.

[0078] Specifically, the physical layer starts from the starting position of the first serial data (i.e., the first bit of data), and regards each m received data as a group of data to be converted. For example, the first serial data is n*m*k bits, and each m bits of data is regarded as a group of data to be converted, then the physical layer can obtain n*k groups of data to be converted. The physical layer sequentially regards the m data in each group of data to be converted as the i-th column data in each detection data in the order from the first detection data to the m-th detection data. That is to say, the physical layer adds 1 bit of data to each parallel data each time until m parallel data are formed, and the length of each parallel data is n*k. The following is combined with Figure 8 The process of converting the first serial data into 4-channel (ie, m=4) parallel data is specifically described.

[0079] In this example, m=4, n=3, and k=11 are taken as an example. Figure 8 132 bits of first serial data acquired by the physical layer are shown in FIG. 132. In the first serial data, the position of the first bit is the starting position of the first serial data, and the starting position is the starting position of the first serial data received by the physical layer. Figure 8As shown, the physical layer first obtains 4 bits of data as the first group of data to be converted, that is, the data from the 1st bit to the 4th bit (that is, "0001") is used as the first group of data to be converted, the data at the 1st bit is used as the data at the 1st column of the first detection data, the data at the 2nd bit is used as the data at the 1st column of the second detection data, the data at the 3rd bit is used as the data at the 1st column of the third detection data, and the data at the 4th bit is added to the data at the 1st column of the fourth detection data. The physical layer obtains 4 bits of data for the second time, that is, the data from the 5th bit to the 8th bit (that is, "1101") is used as the second group of data to be converted, the data at the 5th bit is used as the data at the 2nd column of the first detection data, the data at the 6th bit is used as the data at the 2nd column of the second detection data, the data at the 7th bit is used as the data at the 2nd column of the third detection data, and the data at the 8th bit is used as the data at the 2nd column of the fourth detection data. According to the above operation, the physical layer uses the last 4 bits of data as the 33rd group of data to be converted, that is, the data at the positions of bit 129 to bit 132 (that is, "0010") as the 33rd group of data to be converted, uses the data at bit 129 as the data at the 33rd column position of the first detection data, uses the data at bit 130 as the data at the 33rd column position of the second detection data, uses the data at bit 131 as the data at the 33rd column position of the third detection data, and uses the data at bit 132 as the data at the 33rd column position of the fourth detection data. When the physical layer has completed the conversion of all 33 groups of data to be converted, the following is formed. Figure 8 The 4-way parallel detection data shown (i.e. Figure 8 Parallel data marked).

[0080] Step 603: The receiving end device obtains in parallel the signal peak value output by cross-correlating each channel of detection data with a locally stored reference signal, and determines whether the signal peak value corresponding to each channel of detection data satisfies a preset first condition.

[0081] Specifically, after the physical layer of the receiving end device obtains m parallel detection data, the m parallel detection units in the physical layer can respectively detect the m detection data to detect whether each detection data satisfies the preset first condition. Figure 7 and Figure 8 Specifically describe the process of testing each channel of test data. Figure 7 As shown, the first serial sub-data is 132 bits of data, and the data transmission rate is one bit of signal per 1 / 44M (second), where M is 10 6The first serial sub-data is converted into 4 parallel detection data in step 602, and the transmission rate of each detection data is 11M, that is, one signal is transmitted every 1 / 11M (second), and M is 10 6 Each channel of detection data includes three 11-bit data to be detected, such as Figure 8 As shown, the first parallel sub-data of the first portion, the first parallel sub-data of the second portion, and the first parallel sub-data of the third portion are three data to be detected. The first parallel detection unit of the physical layer performs cross-correlation calculation on the three data to be detected in the first detection data (i.e., the first 11-bit sequence) and the local reference signal to obtain three signal peaks, wherein the reference signal adopts a k-bit Barker code, and in this example, k is 11 as an example. Since the length of the reference signal is consistent with the length of the sequence used for spectrum spread, and the length of the 11 bits is small, the calculation amount of the cross-correlation is small and the calculation speed is fast. The first parallel detection unit detects whether there is a signal peak greater than the peak threshold among the three obtained signal peaks. If so, it detects whether there are three consecutive signal peaks greater than the peak threshold. If so, it is determined that the detection data of this path meets the first preset condition; otherwise, it is determined that the detection data of this path does not meet the first preset condition.

[0082] The second parallel detection unit of the physical layer performs cross-correlation calculation on the three sequences to be detected in the second channel of detection data and the locally pre-stored reference signal to obtain the signal peak value output after cross-correlation. The second parallel detection unit of the physical layer detects whether there is a signal peak value greater than the peak threshold in the output signal peak value. If so, it detects whether there are three consecutive signal peak values ​​greater than the peak threshold. If so, it is determined that the detection data of this channel meets the first preset condition; otherwise, it is determined that the second channel of detection data does not meet the first preset condition. Similarly, the physical layer can obtain the detection result of the third channel of detection data (i.e., whether the result of the first preset condition is met) and the detection result of the fourth channel of detection data.

[0083] In this example, the peak value threshold can be preset by the engineer, such as 0.7, 0.8, etc. Optionally, the electronic device can simulate the calculated signal peak value, calculate the packet error rate of the receiving device according to the set peak value threshold, and select the signal peak value corresponding to the minimum packet error rate. For example, Fig.10 The following is a schematic diagram of the corresponding relationship between the peak value and the number of peaks obtained by simulation. Fig.10As shown, the horizontal axis is the number of signal peaks, the vertical axis is the peak threshold, and the vertical axis is the normalized peak value; multiple candidate peak thresholds can be selected, such as 0.5, 0.65, 0.7, 0.75, 0.8, etc. The electronic device calculates the starting position of SYNC at different candidate peak thresholds and obtains the data frame based on the starting position of SYNC. The electronic device calculates the packet error rate based on the received data frame. If the electronic device determines that the packet error rate is the smallest when 0.75, the peak threshold is determined to be 0.75.

[0084] Step 604: If the receiving device detects that the number of detection data paths that meet the preset conditions reaches the path number threshold, then a path with the largest sum of n signal peaks is selected from the detection data that meet the conditions as the target detection data. The path number threshold is an integer greater than 1 and less than m.

[0085] Specifically, the physical layer of the receiving end device can obtain the detection result of each channel of detection data, detect whether the number of channels of detection data that meet the first preset condition reaches the channel number threshold, and if it is determined that the channel number threshold is reached, select a channel with the largest sum of n signal peaks from the detection data that meets the condition as the target detection data. The electronic device can pre-set the channel number threshold, and the channel number threshold is an integer greater than 1 and less than m. For example, when m is 4, the channel number threshold can be 2 or 3.

[0086] For example, the path number threshold is 2, and the physical layer of the receiving end device detects that the number of paths that meet the first preset condition reaches 2 (such as the first and second detection data meet the first preset condition), and determines that a data frame has arrived. The physical layer can sort the sum of the three signal peaks corresponding to each detection data, assuming that the sum of the three signal peaks of the first detection data is SUM1, and the sum of the three signal peaks of the second detection data is SUM2, and SUM1 is greater than SUM2; select the detection data corresponding to the largest sum value from the two sum values ​​(i.e., SUM1 and SUM2) as the target detection data, that is, the physical layer uses the first detection data as the target detection data.

[0087] For another example, the physical layer obtains the detection result of the first channel detection data at time t1, obtains the detection result of the second channel detection data at time t2, obtains the detection result of the third channel detection data at time t3, and obtains the result of the fourth channel detection data at time t4; wherein, t1 is earlier than t2, t2 is earlier than t4, and t4 is earlier than t3. The detection result of the third channel detection data is that it does not meet the first preset condition, and the first channel, the second channel, and the fourth channel all meet the first preset condition. If the physical layer detects that the first signal peak or the second signal peak in the third channel detection data does not exceed the peak threshold, it can directly determine that the third channel detection data does not meet the first preset condition, and there is no need to detect the third signal peak, which can shorten the detection time. In this example, time t3 is the time when the physical layer detects that the second signal peak in the third channel detection data is less than the peak threshold. The physical layer can determine at time t3 that the number of channels that meet the first preset condition is 3, which is greater than the channel number threshold, and determines that a data frame has arrived. The physical layer can detect the sum of the three signal peaks corresponding to each channel of detection data and sort them. Assume that the sum of the three signal peaks of the first channel of detection data is SUM1, the sum of the three signal peaks of the second channel of detection data is SUM2, and the sum of the three signal peaks of the fourth channel of detection data is SUM4; and SUM1 is greater than SUM2, and SUM4 is greater than SUM1; select the detection data corresponding to the maximum sum value from the three sum values ​​as the target detection data, that is, the physical layer takes the fourth channel of detection data as the target detection data.

[0088] For example Figure 7 As shown, the path number threshold is 2, and the physical layer of the receiving end device detects 4 paths of detection data in parallel, and the detection results of the 4 paths of detection data all meet the first preset condition; the physical layer can start to detect whether the number of paths that meet the first preset condition reaches 2 after the last path of detection data (such as the time to detect the third path of detection data is the longest) is detected, that is, the moment when the physical layer determines whether a data frame has arrived is the same moment. After the physical layer finishes determining whether a data frame has arrived, the first serial data of the preset length is obtained from the buffer again. This method uses clock synchronization in the determination of 4 parallel data to ensure the real-time nature of each determination.

[0089] Step 605: The receiving end device determines the starting position of the payload in the physical frame according to the number of paths of the target detection data.

[0090] Specifically, the physical layer of the receiving device selects the target detection data, and can determine the first index position (denoted as Location) of the cut data stream, and determine the second index position (denoted as Ind) of the downsampling according to the position of the switched data stream. Optionally, the physical layer can use the number of target detection data as Location information, and the starting index position of the downsampling is the index of the starting data of the target detection data, that is, 1.

[0091] For example, if Fig.11 In the "11010101001 0111" shown, "11010101001" is data that has not been processed by frame synchronization. Fig.11 The serial data in the thick dashed box is converted into parallel data as indicated by the dashed arrows. If the physical layer determines that the target detection data is the second path detection data, the path number 2 of the target detection data is obtained as the first index position, and Ind is set to 1. Since the data stream first flows into the physical layer and is first subjected to coarse synchronization processing, the final processed data is "0111". The physical layer determines to start cutting the data stream in the cache from the first index position based on the first index position, and determines to start downsampling from the first position of the cut data stream (i.e., the second index position), as shown in FIG. Fig.11 The first signal obtained by downsampling is "0" indicated by the dotted box, and the second sampled signal is "1". The physical layer uses the downsampled data for fine synchronization, that is, identifies SFD from the downsampled data, and then determines the position of the data frame based on the identified SFD.

[0092] In some embodiments, the signal may be affected by noise fluctuations in the environment during transmission. When the physical layer of the receiving device is performing coarse synchronization, when the noise signal and the reference signal are cross-correlated, a signal peak greater than the peak threshold may appear n times in succession, resulting in a false alarm and inability to accurately receive data frames.

[0093] In some embodiments, the first preset condition includes: if n signal peaks greater than a peak threshold are detected continuously and it is detected that the n signal peaks in the detection data of this path are the same or similar signal peaks. Optionally, after the physical layer detects that the number of detection data paths that meet the preset conditions reaches the path number threshold, it can also detect whether the signal peaks corresponding to the detection data paths that meet the conditions are the same or similar signal peaks; if the signal peaks corresponding to the detection data paths that meet the conditions are the same or similar signal peaks, determine to execute the step of selecting the path with the largest sum of corresponding peaks from the detection data that meet the conditions as the target detection data. The following is combined with Fig. 9 The frame synchronization process is specifically described, taking n=3, m=4, and k=11 as an example. The peak value threshold is 0.8 and the path number threshold is 2 as an example.

[0094] Step 901: The receiving end device obtains first serial data of a preset length from a buffer. The buffer is used to cache in real time a physical frame sent by the transmitting end device, the preamble of the physical frame is data at least after upsampling and Barker code spread spectrum, the preset length is n*m*k bits, n is an integer greater than or equal to 3, m is the upsampling magnification, and k is the Barker length.

[0095] This step may refer to the relevant description in step 601 and will not be described again here.

[0096] Step 902: The receiving end device converts the first serial data into 4 parallel detection data, and the length of each detection data is 3*11 bits.

[0097] Specifically, the step of converting the first serial data into 4-way parallel detection data by the physical layer of the receiving end device includes:

[0098] 9021: The receiving end device divides the first serial data into three serial sub-data.

[0099] This step can refer to the relevant description in step 6021 and will not be repeated here.

[0100] 9022: The receiving end device converts each serial sub-data into four parallel sub-data in sequence to form four detection data, wherein each parallel sub-data is an 11-bit sequence, the i-th detection data is composed of four i-th parallel sub-data, and i is an integer greater than 0 and less than or equal to m.

[0101] This step can refer to the relevant description in step 6022 and will not be repeated here.

[0102] Step 903: The receiving end device obtains in parallel the peak values ​​of the signals output by cross-correlating each channel of detection data with the locally stored reference signal.

[0103] Specifically, each channel of detection data includes three parallel sub-data, such as Figure 8 In the example, the first detection data includes: the first parallel sub-data of the first copy, the first parallel sub-data of the second copy and the first parallel sub-data of the third copy, and the length of each parallel sub-data is 11 bits. Fig. 9 As shown, each parallel sub-data in the first channel of detection data is cross-correlated with the 11-bit Barker code to generate three signal peaks.

[0104] Step 904: The receiving end device determines whether the signal peak value corresponding to each channel of detection data meets the preset first condition. If so, step 905 is executed, otherwise, the first serial data is acquired again.

[0105] Specifically, the receiving device obtains three signal peaks corresponding to each detection data, and determines whether the three signal peaks meet a first preset condition, which includes: three signal peaks greater than a peak threshold are continuously detected and the three signal peaks are the same or similar signal peaks.

[0106] like Fig.11 As shown, the physical layer detects the three peak values ​​corresponding to each detection signal to determine whether they are all greater than the peak value threshold. If they are all greater than, then the three signal peak values ​​are detected to be the same or similar signal peak values. If the three signal peak values ​​are detected to be the same or similar signal peak values, then it is determined that the detection data of this path meets the preset first condition. In this example, the steps of the physical layer detecting whether the three signal peak values ​​are the same or similar signal peak values ​​may include: the physical layer sorts the three signal peak values, obtains the largest signal peak value and the smallest signal peak value from the three signal peak values, obtains the ratio between the smallest signal peak value and the largest signal peak value, and if the ratio is greater than the first ratio threshold value (i.e., ratio_th1), the physical layer determines that the three signal peak values ​​corresponding to the detection data of this path are the same or similar signal peak values.

[0107] The first ratio threshold can be preset, and the electronic device can set the size of multiple first candidate thresholds by fixing other parameters, obtain different first candidate thresholds, and select the first candidate threshold corresponding to the minimum packet error rate of the receiving end device as the first ratio threshold. Other parameters include peak threshold, path number threshold, second ratio threshold, etc.

[0108] Optionally, the way in which the physical layer detects whether the three signal peaks are the same or similar signal peaks may also include: the physical layer may obtain the difference between every two signal peaks, and if each difference is within the first threshold range, it is determined that the three signal peaks corresponding to the detection data of this path are the same or similar signal peaks.

[0109] like Fig.11 As shown, if the physical layer detects that all four detection data satisfy the first condition, step 905 can be executed; if the physical layer detects that one detection data does not satisfy the first condition, the detection result is output and step 905 is not executed.

[0110] Step 905: After the receiving end device determines whether the signal peak value corresponding to each channel of detection data meets the preset first condition, it determines whether the second condition is met. If so, step 906 is executed; otherwise, the first serial data is reacquired.

[0111] Specifically, the physical layer of the receiving end device can detect whether the number of paths that meet the first condition reaches 2, and if so, detect whether the signal peaks corresponding to the detection data that meet the first condition are the same or similar signal peaks. If the physical layer determines that the signal peaks corresponding to the detection data that meet the first condition are the same or similar signal peaks, step 906 is executed; if it is determined that the signal peaks corresponding to the detection data that meet the first condition are not the same or similar signal peaks, step 906 is not executed, and the first serial data is waited for to be re-acquired next time.

[0112] In this example, the physical layer detects whether the signal peaks corresponding to the detection data that meets the first condition are the same or similar signal peaks, which can include: the physical layer obtains the sum of n signal peaks corresponding to each channel of detection data as the peak sum of the detection data; obtains the quotient between the maximum peak sum and the minimum peak sum as the second quotient value; determines whether the second quotient value is greater than a preset second threshold; if it is determined that the second quotient value is greater than the second threshold, determines whether the signal peaks corresponding to the detection data of each channel that meets the condition are the same or similar signal peaks.

[0113] The second ratio threshold can be preset, and the electronic device can set the size of multiple second candidate thresholds by fixing other parameters, and obtain different second candidate thresholds. Under the condition of the second candidate threshold, the second candidate threshold corresponding to the minimum packet error rate of the receiving end device is selected as the second ratio threshold. In this example, other parameters include peak threshold, path number threshold, first ratio threshold, etc.

[0114] Step 906: The receiving end device outputs the frame synchronization data index and the downsampling selected path index.

[0115] This step is substantially the same as step 606, and reference may be made to the relevant description in step 606. In this step, the frame synchronization index is the first index position, and the downsampling selected path index is the second index position.

[0116] In some embodiments, the first condition may include: n signal peaks greater than a peak threshold are detected continuously and the n signal peaks in the detection data of the path are detected to be the same or similar signal peaks. The second condition includes: the number of detection paths that meet the first condition reaches the path number threshold. Optionally, the first condition may also include: n signal peaks greater than a peak threshold are detected continuously, where n is an integer greater than 3; the second condition includes: the number of detection paths that meet the first condition reaches the path number threshold and the signal peaks corresponding to the detection paths that meet the first condition are the same or similar signal peaks.

[0117] In this example, when the physical layer detects that the n signal peaks in each channel of detection data are greater than the peak threshold, it detects whether the n signal peaks in each channel of detection data are the same or similar signal peaks, thereby effectively avoiding false alarm problems caused by noise fluctuations and improving the accuracy of frame synchronization; similarly, when it is detected that the number of detection data that meets the first condition reaches the channel number threshold, it detects whether the signal peaks corresponding to each channel of detection data that meets the condition are the same or similar signal peaks, which can further eliminate false alarm problems caused by noise fluctuations, improve the accuracy of frame synchronization, and improve the accuracy of received data frames.

[0118] It is understandable that, in order to realize the above functions, the electronic device includes hardware and / or software modules corresponding to the execution of each function. In combination with the algorithm steps of each example described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application in combination with the embodiments, but such implementation should not be considered to be beyond the scope of the present application.

[0119] This embodiment also provides a computer storage medium, in which computer instructions are stored. When the computer instructions are executed on an electronic device, the electronic device executes the above-mentioned related method steps to implement the frame synchronization method in the above-mentioned embodiment. The storage medium includes: a U disk, a mobile hard disk, a read only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes.

[0120] This embodiment further provides a computer program product. When the computer program product is run on a computer, the computer is enabled to execute the above-mentioned related steps to implement the frame synchronization method in the above-mentioned embodiment.

[0121] Among them, the electronic device, computer storage medium, computer program product or chip provided in this embodiment is used to execute the corresponding method provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method provided above and will not be repeated here.

[0122] Any content of each embodiment of the present application, as well as any content of the same embodiment, can be freely combined. Any combination of the above content is within the scope of the present application.

[0123] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.

Claims

1. A frame synchronization method, characterized in that: include: Acquire first serial data of a preset length from a buffer, the buffer being used to cache in real time a physical frame sent by a transmitting end device, the preamble of the physical frame being data at least subjected to upsampling and Barker code spreading, the preset length being n*m*k bits, n being an integer greater than or equal to 3, m being a magnification of the upsampling, and k being the length of the Barker code; Converting the first serial data into m parallel detection data, wherein each detection data includes n sequences of length k; Parallel acquisition of n signal peaks output by cross-correlating each channel of detection data with a locally stored reference signal, and determination of whether the signal peak corresponding to each channel of detection data satisfies a preset first condition, wherein the first condition includes the presence of n consecutive signal peaks greater than a peak threshold value among the signal peaks corresponding to each channel of detection data; If it is detected that the number of detection data satisfying the preset condition reaches a path number threshold, then a path with the largest sum of the n signal peaks is selected from the detection data satisfying the condition as the target detection data, and the path number threshold is an integer greater than 1 and less than m; The starting position of the payload in the physical frame is determined according to the number of paths of the target detection data.

2. The method according to claim 1, characterized in that The determining whether the signal peak value corresponding to each channel of detection data satisfies a preset first condition includes: Detect whether there are n consecutive signal peaks greater than the peak threshold value among the signal peaks corresponding to the i-th channel of detection data; If it is determined to exist, detect whether the n signal peaks of the i-th channel detection data are the same or similar signal peaks; If it is determined that the n signal peak values ​​of the i-th channel of detection data are the same or similar signal peak values, it is determined that the signal peak value corresponding to the detection data satisfies a preset first condition.

3. The method according to claim 2, characterized in that The detecting whether the n signal peak values ​​of the i-th channel of detection data are the same or similar signal peak values ​​comprises: Obtaining the maximum signal peak value and the minimum signal peak value from the n signal peak values ​​of the i-th channel of detection data; Acquire a ratio between the maximum signal peak value and the minimum signal peak value as a first ratio; Detecting whether the first ratio is greater than a preset first threshold; If it is determined that the first ratio is greater than the first threshold, it is determined that the n signal peaks of the i-th channel of detection data are the same or similar signal peaks.

4. The method according to claim 2, characterized in that: The detecting whether the n signal peak values ​​of the i-th channel of detection data are the same or similar signal peak values ​​comprises: Detect whether the difference between any two signal peak values ​​among the n signal peak values ​​of the i-th channel detection data is less than a preset difference threshold; If it is determined that the difference between any two signal peak values ​​among the n signal peak values ​​is less than the difference threshold, then the n signal peak values ​​of the i-th channel of detection data are determined to be the same or similar signal peak values.

5. The method according to any one of claims 1 to 4, characterized in that Before selecting a path with the largest sum of corresponding signal peak values ​​from the detection data satisfying the conditions as target detection data, the method further includes: Determine whether the signal peaks corresponding to the detection data of each channel that meets the conditions are the same or similar signal peaks; If the signal peaks corresponding to the detection data satisfying the conditions are the same or similar signal peaks, a step of selecting a path with the largest sum of corresponding peaks from the detection data satisfying the conditions as target detection data is determined.

6. The method according to claim 5, characterized in that Determining whether the signal peaks corresponding to the detection data of each channel that meets the conditions are the same or similar signal peaks includes: Obtaining the sum of n signal peak values ​​corresponding to each channel of detection data as the peak sum of the detection data; Obtaining a ratio between the maximum peak sum and the minimum peak sum as a second ratio; Determining whether the second ratio is greater than a preset second threshold; If it is determined that the second ratio is greater than the second threshold, it is determined that the signal peaks corresponding to the detection data of each channel that meets the condition are the same or similar signal peaks.

7. The method according to claim 3, characterized in that Before detecting whether the first ratio is greater than a preset first threshold, the method further includes: Set at least 2 different first candidate thresholds; Obtaining a packet error rate of a data frame received by a receiving device under different first candidate thresholds; A first candidate threshold corresponding to the minimum packet error rate is selected as the first threshold.

8. The method according to claim 6, characterized in that Before determining whether the signal peaks corresponding to the detection data of each channel that meets the conditions are the same or similar signal peaks, the method further includes: Setting at least 2 different second candidate thresholds; Obtaining a packet error rate of a number of frames of data received by a receiving device under different second candidate thresholds; A second candidate threshold corresponding to the minimum packet error rate is selected as the second threshold.

9. The method according to any one of claims 1-4, 6-8, characterized in that: The step of converting the first serial data into m parallel detection data comprises: Starting from the start position of the first serial data, each received m-bit data is used as a group of data to be converted; Perform the following serial-to-parallel conversion processing on each group of data to be converted: use each data in the i-th group of data to be converted as the data at the i-th column position in each parallel data path, where i is an integer greater than 0; When each group of conversion data has completed the serial-to-parallel conversion process, m parallel detection data are obtained.

10. The method according to claim 1, characterized in that The step of parallelly acquiring the peak value of a signal output by cross-correlating each channel of detection data with a locally stored reference signal comprises: Cross-correlation calculations are performed on n sequences of length k in each channel of detection data and the reference signal, and n signal peaks are output.

11. The method according to claim 1, characterized in that: After determining the starting position of the payload in the physical frame, the method further comprises: When it is detected that the timer reaches the first time length, the second serial data of the preset length is obtained from the buffer by shifting.

12. The method according to claim 1, characterized in that The number of paths for obtaining target detection data and determining the starting position of the payload in the physical frame include: Obtain the number of paths of target detection data as the first index position; According to the first index position, cutting the data stream from the buffer to obtain third serial data; down-sampling the third serial data according to the second index position to obtain fourth serial data; identifying a position of a start frame delimiter in the fourth serial data; The starting position of the payload is determined according to the position of the start frame delimiter.

13. The method according to claim 1, characterized in that When the method is applied to WLAN standards of 802.11b and 802.11n, n is 3, m is 4 and k is 11.

14. An electronic device, characterized in that: include: a memory and a processor, the memory being coupled to the processor; The memory stores program instructions, and when the program instructions are executed by the processor, the electronic device executes the frame synchronization method described in any one of claims 1 to 13.

15. A computer-readable storage medium comprising a computer program, characterized in that: When the computer program is executed on an electronic device, the electronic device is enabled to execute the frame synchronization method according to any one of claims 1 to 13.

Citation Information

Patent Citations

  • Synchronizer, synchronization method and high-speed receiver by using synchronizer

    CN107425953A

  • Self-adaptive synchronization method used in direct sequence spread spectrum system

    CN116192188A