Frequency band detection model construction method and device, detection method and device, receiver
By constructing a frequency band detection model based on convolutional neural networks, the problem of low frequency band detection efficiency in power line communication is solved, accurate frequency band detection is achieved in high-noise environments, and hardware costs and power consumption are reduced.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHANGHAI EASTSOFT MICROELECTRONICS
- Filing Date
- 2022-12-13
- Publication Date
- 2026-06-30
AI Technical Summary
Existing frequency band detection methods in power line communication are inefficient in high-noise environments, making it difficult to achieve fast and accurate automatic frequency band switching, which limits network access efficiency and adaptive frequency hopping applications.
A frequency band detection model based on convolutional neural networks is constructed. By generating preamble data of the power line communication protocol, a training sample set is generated to simulate the channel environment, and the convolutional neural network is trained to achieve frequency band detection, which is suitable for low signal-to-noise ratio conditions.
It achieves accurate detection of power line communication frequency bands under low signal-to-noise ratio conditions, saves hardware costs and system power consumption, and is suitable for complex power line communication environments.
Smart Images

Figure CN116016208B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of power line communication technology, specifically to a method and apparatus for constructing a frequency band detection model, and also to a frequency band detection method and apparatus, and a receiver. Background Technology
[0002] Power line communication (PLC), also known as power line carrier communication, is a communication technology that transmits data over power lines. Unlike other wired communication methods, PLC operates in a more complex environment. Due to the diverse types of connected electrical devices, these devices generate significant noise interference on the power lines during operation, and the timing and frequency of this interference are highly variable. To address the high-noise channel environment, PLC protocols typically define multiple configurable communication frequency bands to avoid highly interfering frequencies. Furthermore, in many smart electronic product applications, proprietary communication frequency bands may be configured based on the specific channel environment.
[0003] In existing power line communication, both the transmitting and receiving ends must be configured to the same frequency band for normal data transmission. In most current power line applications, the transmitting and receiving frequency bands are generally pre-configured. While this operation is relatively simple, it reduces the flexibility of frequency band switching, which requires complex upper-layer protocols or even software intervention. This approach reduces network access efficiency and limits applications that require automatic frequency band switching, such as adaptive frequency hopping and simultaneous access to multiple networks by a single node.
[0004] Fast and accurate frequency band detection technology is the foundation of automatic frequency band switching. If the receiver can automatically determine the operating frequency band of the transmitted signal, it can greatly improve the efficiency of network access and also provide the possibility for a series of application extensions such as adaptive frequency hopping.
[0005] For power line communication applications in low signal-to-noise ratio environments, how to perform effective frequency band detection is an important problem that the industry needs to solve. Summary of the Invention
[0006] One aspect of this invention provides a method and apparatus for constructing a frequency band detection model, which constructs a classification model for detecting power line communication frequency bands based on a neural network, thereby improving the classification performance of the frequency band detection model.
[0007] Another aspect of this invention provides a method and apparatus for detecting power line communication frequency bands, and a receiver. By utilizing a classification model based on neural networks, it achieves accurate detection of power line communication frequency bands under low signal-to-noise ratio conditions, and saves hardware costs and system power consumption.
[0008] Therefore, the embodiments of the present invention provide the following technical solutions:
[0009] On one hand, embodiments of the present invention provide a method for constructing a frequency band detection model, the method comprising:
[0010] Based on the power line communication protocol, generate preamble data corresponding to each frequency band of the protocol;
[0011] Based on the aforementioned preamble data, a training sample set is generated by simulating a power line communication channel.
[0012] Construct a convolutional neural network;
[0013] The parameters of the convolutional neural network are trained using the training sample set;
[0014] A frequency band detection model is generated based on the trained convolutional neural network.
[0015] Optionally, generating preamble data corresponding to each frequency band of the protocol includes: generating preamble data corresponding to each frequency band of the protocol using a programming tool.
[0016] Optionally, the step of simulating a power line communication channel based on the preamble data and generating a large amount of sample data includes:
[0017] The preceding data is looped from its starting point to generate multiple preceding data with different starting points;
[0018] To simulate a power line communication channel, Gaussian white noise and sampling frequency offset are added to the preamble data to obtain sample data;
[0019] The sample data is encoded to generate labels corresponding to the sample data;
[0020] The training sample set is generated based on the sample data and the corresponding labels.
[0021] Optionally, adding Gaussian white noise and sampling frequency offset to the preamble data to obtain sample data includes adding different Gaussian white noise and sampling frequency offset to different preamble data.
[0022] Optionally, adding different Gaussian white noise and sampling frequency offset to different preamble data includes: adding Gaussian white noise and sampling frequency offset sequentially to each preamble data by increasing or decreasing Gaussian white noise according to the first step length and increasing or decreasing sampling frequency offset according to the second step length.
[0023] Optionally, the convolutional neural network includes an input layer, a convolutional layer, a pooling layer, a fully connected layer, and an output layer, wherein the output layer serves as the second fully connected layer in the two fully connected layers; the number of nodes in the input layer is the same as the number of sampling points of a single preamble data in the frequency band to be detected; and the number of nodes in the output layer is the same as the number of frequency bands to be detected.
[0024] Optionally, the convolutional layer includes two one-dimensional convolutional layers, each followed by a ReLU activation function.
[0025] Optionally, the pooling layer includes two one-dimensional pooling layers, both of which use max pooling. After the second pooling layer, the Flatten function is used to convert the max-pooled two-dimensional data into one-dimensional data and send it into the fully connected layer.
[0026] Optionally, the fully connected layer comprises two layers. The neurons in the first fully connected layer use the ReLU activation function. The number of neurons in the second fully connected layer is the same as the number of frequency bands to be detected, and the softmax activation function is used. The output layer is the second fully connected layer.
[0027] Optionally, training the parameters of the convolutional neural network using the training sample set includes: using the cross-entropy loss function to avoid gradient diffusion during the parameter training process, and using the Adam optimization algorithm to adaptively adjust the learning rate.
[0028] On the other hand, embodiments of the present invention also provide a frequency band detection model construction apparatus, the apparatus comprising:
[0029] The preamble data generation module is used to generate preamble data corresponding to each frequency band of the power line communication protocol according to the protocol.
[0030] The training sample set generation module is used to generate a training sample set based on the preceding data through a simulated power line communication channel.
[0031] The network building block is used to build convolutional neural networks;
[0032] A parameter training module is used to train the parameters of the convolutional neural network using the training sample set;
[0033] The model generation module is used to generate frequency band detection models based on the trained convolutional neural network.
[0034] On the other hand, embodiments of the present invention also provide a frequency band detection method for detecting power line communication frequency bands, the method comprising:
[0035] Real-time reception of power line communication data;
[0036] The communication data is subjected to preamble signal detection to obtain a preamble data sequence;
[0037] The preceding data sequence is classified using a pre-established frequency band detection model based on a convolutional neural network, and the current communication frequency band is determined based on the classification results.
[0038] On the other hand, embodiments of the present invention also provide a frequency band detection device for detecting power line communication frequency bands, the device comprising:
[0039] The data receiving module is used to receive power line communication data in real time.
[0040] The preamble detection module is used to detect the preamble signal in the communication data to obtain a preamble data sequence;
[0041] The frequency band detection module is used to classify the preamble data sequence using a pre-established frequency band detection model based on a convolutional neural network, and determine the current communication frequency band based on the classification results.
[0042] On the other hand, embodiments of the present invention also provide a power line communication receiver, including: a receiving module and a frequency band detection device as described above;
[0043] The receiving module is used to receive power line communication data in real time;
[0044] The frequency band detection device is used to determine the current communication frequency band based on the power line communication data received in real time by the receiving module.
[0045] On the other hand, embodiments of the present invention also provide a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when run by a computer, executes some or all of the steps of the frequency band detection model construction method described above, or executes some or all of the steps of the frequency band detection method described above.
[0046] The frequency band detection model construction method and apparatus provided in this invention generate preamble data corresponding to each frequency band of the power line communication protocol; simulate a power line communication channel using the preamble data to generate a training sample set; and train a classification model based on a convolutional neural network, i.e., a frequency band detection model, using the training sample set. Since convolutional neural networks have excellent classification capabilities, this frequency band detection model exhibits good classification performance and can accurately classify power line communication frequency bands.
[0047] Accordingly, the frequency band detection method, apparatus, and receiver provided in this embodiment of the invention utilize the aforementioned frequency band detection model based on convolutional neural networks to achieve accurate detection of power line communication frequency bands under low signal-to-noise ratio conditions. It can achieve excellent frequency band resolution even in high-noise environments, making it suitable for power line communication environments. Furthermore, when using this invention for power line communication frequency band detection, a large number of parallel correlators are not required, thus significantly reducing hardware costs and system power consumption. Attached Figure Description
[0048] Figure 1 This is a schematic diagram of the preamble structure of the IEEE P1901.1 protocol;
[0049] Figure 2 This is a flowchart of a frequency band detection model construction method provided in an embodiment of the present invention;
[0050] Figure 3 This is a flowchart of generating a training sample set in an embodiment of the present invention;
[0051] Figure 4 This is a schematic diagram of a frequency band detection model construction device provided in an embodiment of the present invention;
[0052] Figure 5 This is a flowchart of a frequency band detection method provided in an embodiment of the present invention;
[0053] Figure 6 This is a schematic diagram of a frequency band detection device provided in an embodiment of the present invention;
[0054] Figure 7 This is a schematic diagram of a power line communication receiver provided in an embodiment of the present invention. Detailed Implementation
[0055] To make the above-mentioned objectives, features and beneficial effects of the present invention more apparent and understandable, specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
[0056] In communication systems, there are two common methods for frequency band detection:
[0057] 1) Using the maximum likelihood estimation method, the frame structure defined by general communication standards includes a preamble or training sequence. The time-domain values of the preamble or training sequence will inevitably differ for different frequency bands. At the receiving end, known preamble or training sequences of different frequency bands can be used to perform correlation operations with the received data, and the signal frequency band can be determined by the magnitude of the correlation value. This method generally has good performance, but the computational load is large, and the computational load is proportional to the number of frequency bands. For broadband power line applications, due to the high transmission rate, the preamble correlation operation can only be performed in hardware. If there are many frequency bands, a large number of parallel preamble correlators will consume a huge amount of circuit area and power consumption.
[0058] 2) The received signal is converted to the frequency domain using FFT (Fast Fourier Transform), and the communication frequency band of the transmitted signal is determined by detecting the energy of different frequency bands. This method has relatively controllable computational complexity; the computational load does not increase significantly with the increase in frequency bands. However, this method is generally more suitable for communication methods with good channel environments and high signal-to-noise ratios. Power line communication operates in complex channel environments with high channel noise. The most robust communication modes defined by various power line communication protocols operate in environments where noise energy is greater than signal energy. In such environments, the spectral energy of the signal is mainly dominated by various noise energies, making it very difficult to assess the effective energy range of the signal. Therefore, this frequency band detection method is generally not applicable to power line communication.
[0059] A neural network is a mathematical model that mimics the human brain's nervous system. It consists of many artificial neurons and can model complex relationships between data, achieving excellent results in various classification tasks. A convolutional neural network (CNN) is a type of feedforward neural network and is currently a very mainstream type of neural network. It typically consists of an input layer, convolutional layers, pooling layers, and fully connected layers. It can adaptively learn classification features from training data and ultimately output the classification result.
[0060] In major power line communication protocols, a continuously repeating preamble sequence is typically defined at the beginning of a data frame. This preamble sequence is used for receiver synchronization, for example... Figure 1 As shown, the preamble sequence of the Institute of Electrical and Electronics Engineers (IEEE) P1901.1 (hereinafter referred to as P1901.1) protocol consists of 10 repeated SYNCP symbols and 2 SYNCM symbols that are the opposite of the SYNCP symbols (i.e., the SYNCM symbols have a 180° phase difference with the SYNCP symbols). The values of the preamble sequence differ for different frequency bands, but the length and repetition period of the preamble sequence are the same.
[0061] Based on this characteristic, embodiments of the present invention provide a method and apparatus for constructing a frequency band detection model. According to the power line communication protocol, preamble data corresponding to each frequency band of the protocol is generated; and based on the preamble data, a training sample set is generated by simulating a power line communication channel. The training sample set is used to train a classification model based on a convolutional neural network, i.e., a frequency band detection model, for classifying and detecting power line communication frequency bands.
[0062] Reference Figure 2 , Figure 2 This is a flowchart of a frequency band detection model construction method provided in an embodiment of the present invention. The method includes the following steps:
[0063] In step 201, preamble data corresponding to each frequency band of the power line communication protocol is generated according to the power line communication protocol.
[0064] Specifically, programming tools can be used, employing languages such as M-language or C / C++, to generate preamble data corresponding to each frequency band of the protocol. The preamble data refers to the data corresponding to one symbol in the preamble sequence.
[0065] For example, the P1901.1 protocol has two frequency bands. The preamble sequence for each frequency band consists of 10 repeated SYNCP symbols and 2 SYNCM symbols that are the reverse of the SYNCP symbols. Each symbol has 1024 sampling points. Accordingly, the preamble data refers to the 1024 sample data corresponding to the symbol.
[0066] Considering that the number of frequency bands, the number of symbols in the preamble sequence within each band, and the number of sampling points per symbol may vary depending on the corresponding power line communication protocol, the number of frequency bands, the number of symbols in the preamble sequence, and the number of sampling points per symbol can be set as adjustable variables in the programming to increase the versatility of the solution and adapt it to various protocols. In practical applications, these variables are assigned values according to the actual power line communication protocol used, and the corresponding preamble data is generated based on the actual values of these variables.
[0067] In step 202, a training sample set is generated based on the preceding data by simulating a power line communication channel.
[0068] In this embodiment of the invention, multiple preamble data with different starting points can be obtained by looping the preamble data with starting points, and then noise and frequency offset can be added to simulate preamble data under various environments, thereby obtaining multiple sample data. Each sample data is then encoded to obtain the label corresponding to the sample data.
[0069] Reference Figure 3 This is a flowchart of generating a training sample set in an embodiment of the present invention, including the following steps:
[0070] Step 301: Perform a starting point loop on the preamble data to generate preamble data with multiple different starting points.
[0071] By looping through the starting points of the preceding data, each preceding data has a different starting point, and subsequent processing does not require synchronization of these different preceding data, which can effectively save hardware resources.
[0072] As mentioned earlier, a continuous, repeating preamble sequence is typically defined at the beginning of a data frame. If the sequence is not synchronized, the starting point of the preamble data will be random, but the total number of points in the preamble data remains unchanged. Therefore, by generating multiple different preamble data by iterating through the starting points of the preamble data, multiple sample data can be obtained. The frequency band detection model trained based on these sample data can also achieve good classification results.
[0073] Step 302: Simulate the power line communication channel by adding Gaussian white noise and sampling frequency offset to the preamble data to obtain sample data.
[0074] It should be noted that different Gaussian white noise and sampling frequency offsets can be added for different preamble data. Furthermore, the ranges for Gaussian white noise and sampling frequency offsets can be set; for example, the range of Gaussian white noise is -20dB to +20dB, and the range of sampling frequency offset is -500ppm to 500ppm. The specific method of addition is not limited in this embodiment of the invention; it can be added randomly or sequentially. For example, Gaussian white noise can be added to each preamble data in increments of 2dB, resulting in 21 signal-to-noise ratios. This can be done sequentially for each preamble data or sequentially for multiple preamble data until all preamble data have been added with white noise. Similarly, for example, sampling frequency offsets can be added to each preamble data in increments of 100ppm, resulting in 11 sampling frequency offsets.
[0075] For example, in step 301, the leading data is randomly selected from the starting point and looped to generate leading data with 200 different starting points.
[0076] For the P1901.1 protocol, since there are two frequency bands, the preamble data with 200 different starting points is expanded to 200×2=400 (data).
[0077] Then, 21 different signal-to-noise ratios and 11 different frequency offsets were randomly added to the preamble data from these 400 different starting points, resulting in a sample data quantity of 11 × 21 × 400 = 92,400.
[0078] To further enhance the richness of the samples, other interferences such as multipath interference can be added to the preceding data, but this embodiment of the invention does not limit this.
[0079] Step 303: Encode the sample data to generate labels corresponding to the sample data.
[0080] Specifically, one-hot encoding can be used to encode the sample data, and the encoded data can be used as the label corresponding to the sample data.
[0081] One-hot encoding is a single-bit encoding method that uses an N-bit register to encode N states, with each state having its own independent register bit. Only one bit is active at any given time. One-hot encoding enables neural networks to process attribute data and can also expand features. Two frequency bands correspond to two different codes 01 and 10. The number of encoding bits changes as the number of frequency bands changes. For example, the State Grid broadband power line protocol requires four frequency bands, so the encoding would be 0001, 0010, 0100, and 1000.
[0082] For example, if a total of 92,400 sample data are obtained in step 302, these sample data are then encoded to generate 92,400 codes.
[0083] Of course, other encoding methods can also be used, and this embodiment of the invention does not limit the specific encoding methods used.
[0084] Step 304: Generate the training sample set based on the sample data and the corresponding labels.
[0085] It should be noted that in practical applications, to validate and test the trained model, the sample data and corresponding labels obtained above can be combined (i.e., each sample data and its corresponding label are considered as one sample). All samples are randomly shuffled and divided into a training sample set and a test sample set according to a certain ratio. The model is trained using samples from the training sample set and tested using samples from the test sample set.
[0086] Furthermore, a portion of the samples can be set as a validation sample set. During model training, after each iteration, the current model is validated using samples from the validation sample set. The iteration process stops when the error rate on the validation set no longer decreases.
[0087] Continue to refer to Figure 2 In step 203, a convolutional neural network is constructed.
[0088] The convolutional neural network includes an input layer, a convolutional layer, a pooling layer, a fully connected layer, and an output layer. The output layer serves as the second fully connected layer in the two fully connected layers. The number of nodes in the input layer is the same as the number of sampling points for a single preamble symbol in the frequency band to be detected. The number of nodes in the output layer is the same as the number of frequency bands to be detected.
[0089] In practical applications, the number of intermediate layers can be set as needed, and this embodiment of the invention does not limit this.
[0090] For example, in a non-limiting embodiment of frequency band detection for the P1901.1 protocol, the convolutional layer may include two one-dimensional convolutional layers, each followed by a ReLU (Rectified Linear Unit) activation function. The number of kernels in each convolutional layer is, for example, 50, and the kernel size is, for example, 8. The pooling layer may include two one-dimensional pooling layers, both using max pooling. After the second pooling layer (i.e., before entering the fully connected layer), a Flatten function is used to convert the max-pooled two-dimensional data into one-dimensional data before feeding it into the fully connected layer. The fully connected layer may include two layers: the first fully connected layer has, for example, 70 neurons and uses the ReLU activation function; the second fully connected layer has the same number of neurons as the number of frequency bands to be detected and uses the Softmax activation function; the output layer is the second fully connected layer.
[0091] For other power line communication protocols, the structure of the convolutional neural network can be adaptively adjusted according to the number of corresponding frequency bands, the number of preamble symbols in the preamble sequence, the number of sampling points for each preamble symbol, etc., and this embodiment of the invention does not limit this.
[0092] In step 204, the parameters of the convolutional neural network are trained using the training sample set.
[0093] During parameter training, the cross-entropy loss function can be used to avoid gradient diffusion, and the Adam (Adaptive Moment Estimation) optimization algorithm can be used to adaptively adjust the learning rate.
[0094] The training process for convolutional neural network parameters is similar to that of existing neural networks, and will not be described in detail here.
[0095] Step 205: Generate a frequency band detection model based on the trained convolutional neural network.
[0096] Accordingly, embodiments of the present invention also provide a frequency band detection model construction device, such as... Figure 4 The diagram shown is a schematic of a device for constructing a detection model for this frequency band.
[0097] The frequency band detection model construction device 400 includes the following modules:
[0098] The preamble data generation module 401 is used to generate preamble data corresponding to each frequency band of the power line communication protocol according to the protocol.
[0099] The training sample set generation module 402 is used to generate a training sample set based on the preceding data through a simulated power line communication channel.
[0100] Network building module 403 is used to build convolutional neural networks;
[0101] The parameter training module 404 is used to train the parameters of the convolutional neural network using the training sample set;
[0102] The model generation module 405 is used to generate a frequency band detection model based on the trained convolutional neural network.
[0103] Specifically, the preamble data generation module 401 can utilize programming tools, such as M language or C / C++ language, to generate preamble data corresponding to each frequency band of the protocol.
[0104] Specifically, the training sample set generation module 402 can iterate through the preceding data to obtain preceding data with multiple different starting points. Then, Gaussian noise and sampling frequency offset are added to these preceding data to simulate preceding data under various environments, resulting in sample data. Each sample data is then encoded to obtain its corresponding label. Each sample data and its corresponding label can be considered as a sample, thus obtaining the training sample set.
[0105] The structure of the convolutional neural network can be referred to the description in the previous embodiments of the present invention, and will not be repeated here.
[0106] The training process of the convolutional neural network parameters by the parameter training module 404 is similar to that of existing neural networks and will not be described in detail here. It should be noted that during parameter training, the cross-entropy loss function can be used to avoid gradient diffusion, and the Adam optimization algorithm can be used to adaptively adjust the learning rate.
[0107] The frequency band detection model construction method and apparatus provided in this invention generate preamble data corresponding to each frequency band of the power line communication protocol according to the protocol; based on the preamble data, a training sample set is generated by simulating a power line communication channel; and the training sample set is used to train a classification model based on a convolutional neural network, i.e., a frequency band detection model. Since convolutional neural networks have excellent classification capabilities, this frequency band detection model has good classification performance and can achieve accurate classification of power line communication frequency bands.
[0108] It should be noted that in practical applications, the structure of the convolutional neural network can be adaptively adjusted according to the number and characteristics of the frequency bands used in the power line communication protocol applied in this solution, so that it can be adapted to the communication protocol. When the number of communication frequency bands is increased or decreased according to the actual application needs, only the number of output nodes of the output layer of the convolutional neural network needs to be simply modified, which has little impact on the overall computational scale of the convolutional neural network, and is very beneficial for use in multi-frequency communication protocols or applications.
[0109] For example, for the detection of the two operating frequency bands defined by the P1901.1 protocol: band0 (1.953MHz~11.96MHz) and band1 (2.441MHz~5.615MHz), the input nodes of the convolutional neural network can be set to 1024 and the output nodes to 2.
[0110] For example, for the detection of the three operating frequency bands specified in the International Telecommunication Union (ITU) standard G9903 protocol: CELENCE-A (39.938kHz~90.625kHz), CELENCE-B (98.4375kHz~121.875kHz), and FCC (159.375kHz~478.125kHz), the input nodes of the convolutional neural network can be set to 256 and the output nodes to 3.
[0111] For example, in addition to the three frequency bands mentioned above, the G3-PLC protocol also specifies a series of frequency bands such as CENELEC-C / BC / D / BCD / BD. For this, the input nodes of the convolutional neural network can be set to 256 and the output nodes to 8.
[0112] As can be seen, the frequency band detection model construction method and apparatus provided in this embodiment of the invention can be conveniently and flexibly applied to the classification and detection of communication frequency bands of various power line communication protocols.
[0113] Accordingly, embodiments of the present invention also provide a frequency band detection method and apparatus, which utilize the above-mentioned frequency band detection model based on convolutional neural networks to detect power line communication frequency bands.
[0114] like Figure 5 The diagram shown is a flowchart of a frequency band detection method provided in an embodiment of the present invention, which includes the following steps:
[0115] Step 501: Receive power line communication data in real time.
[0116] Step 502: Perform preamble signal detection on the communication data to obtain a preamble data sequence.
[0117] It should be noted that preamble detection refers to detecting whether there is preamble data in the currently received communication data, that is, whether preamble data has arrived.
[0118] In practical applications, there are multiple methods to determine whether preceding data has arrived. For example:
[0119] 1. Autocorrelation Method: This method involves delaying the received communication data by one or more sequence repetition periods and performing correlation calculations with the original data. When a preamble data sequence is received, the correlator will show a large correlation value, while the correlation value will be very small when other data is received. This indicates that the received communication data is a preamble data sequence. Therefore, the magnitude of the correlation value obtained from the autocorrelation calculation can determine whether a preamble signal has been detected. For example, a corresponding threshold can be preset. If the correlation value is greater than the preset threshold, it is determined that a preamble signal has been detected; otherwise, it is determined that a preamble signal has not been detected.
[0120] 2. Cross-correlation method: This method involves performing correlation calculations between the received communication data and a known reference sequence. When a preamble data sequence is received, the correlator will show a large correlation value, while the correlation value will be small when other data is received. This indicates that the received communication data is a preamble data sequence. Therefore, the magnitude of the correlation value obtained from the cross-correlation calculation can determine whether a preamble signal has been detected. For example, a corresponding threshold can be preset. If the correlation value is greater than the preset threshold, it is determined that a preamble signal has been detected; otherwise, it is determined that a preamble signal has not been detected.
[0121] 3. Energy detection method: This involves calculating the energy of the received communication data. Based on the magnitude of the energy of the received communication data, it is possible to detect whether a data frame has arrived. The data preceding the data frame is the preamble data sequence.
[0122] Of course, there are other ways to detect the preamble signal, and this embodiment of the invention does not limit these methods.
[0123] Step 503: Classify the preceding data sequence using a pre-established frequency band detection model based on a convolutional neural network, and determine the current communication frequency band based on the classification results.
[0124] Given the long length of the preamble data sequence, inputting the entire preamble data sequence into the frequency band detection model would result in a very large model size, increasing the computational load and impacting computational efficiency.
[0125] Therefore, in another non-limiting embodiment of the present invention, the preamble data sequence can be preprocessed to obtain the data to be detected; then the data to be detected can be input into a pre-established classification model, and the current communication frequency band can be determined according to the output of the classification model.
[0126] Taking the P1901.1 protocol as an example, the first sampling point of the first to 12 symbols is accumulated to obtain the first accumulated value. Then the second sampling point of the first to 12 symbols is accumulated to obtain the second accumulated value, and so on, until a total of 1024 accumulated values are obtained. These 1024 accumulated values are used as the data to be detected.
[0127] Since the preceding data is repeated, the above preprocessing and accumulation operations can effectively improve the signal-to-noise ratio of the data, thereby improving the classification success rate of the convolutional neural network.
[0128] Accordingly, embodiments of the present invention also provide a frequency band detection device, such as... Figure 6 The diagram shown is a structural schematic of the device.
[0129] The frequency band detection device 600 includes: a data receiving module 601, a preamble detection module 602, and a frequency band detection module 603. Wherein:
[0130] The data receiving module 601 is used to receive power line communication data in real time;
[0131] The preamble detection module 602 is used to detect the preamble signal in the communication data to obtain a preamble data sequence;
[0132] The frequency band detection module 603 is used to classify the preamble data sequence using a pre-established frequency band detection model based on a convolutional neural network, and determine the current communication frequency band based on the classification results.
[0133] In this embodiment of the invention, the leader detection module 602 can detect whether leader data has arrived in a variety of ways, such as the autocorrelation method, cross-correlation method, energy detection method, etc., as described above, and then obtain the leader data sequence.
[0134] After the preamble detection module 602 obtains the preamble data sequence, the frequency band detection module 603 inputs the preamble data sequence into the frequency band detection model and determines the current communication frequency band based on the output of the frequency band detection model.
[0135] In another non-limiting embodiment, the frequency band detection module 603 may first preprocess the preamble data sequence, for example, by accumulating the preamble data sequence according to a set repetition period to obtain the data to be detected, and then inputting the data to be detected into the frequency band detection model, and determining the current communication frequency band based on the output of the frequency band detection model.
[0136] The frequency band detection method and apparatus provided in this invention utilize the aforementioned frequency band detection model based on a convolutional neural network to achieve accurate detection of power line communication frequency bands under low signal-to-noise ratio conditions. It can achieve excellent frequency band resolution even in high-noise environments, making it suitable for power line communication environments. Furthermore, when using this invention for frequency band detection, a large number of parallel preamble correlators are not required, thus significantly reducing hardware costs and system power consumption.
[0137] Simulation tests were conducted on the scheme of the present invention under different signal-to-noise ratios, and some simulation results are shown in Table 1 below:
[0138] Table 1
[0139] SNR / dB -20 -10 0 +10 +20 Detection accuracy 98.31% 100% 100% 100% 100%
[0140] Table 1 above shows the simulation results of the frequency band detection model established using the present invention under different signal-to-noise ratios (SNR). It can be seen that when the SNR is greater than -20dB, a detection accuracy of over 98% can be achieved. This frequency band detection model can achieve high detection accuracy under low SNR conditions, meeting the application requirements of power line communication.
[0141] Accordingly, this embodiment of the invention also provides a power line communication receiver 700, which includes: a receiving module 701 and the aforementioned frequency band detection device 600. Wherein:
[0142] The receiving module 701 is used to receive power line communication data in real time;
[0143] The frequency band detection device 600 is used to determine the current communication frequency band based on the power line communication data received in real time by the receiving module 701.
[0144] Accordingly, embodiments of the present invention also provide a computer-readable storage medium having a computer program stored thereon, the computer program being executed by a computer during runtime. Figure 2 , Figure 3 , Figure 5 Some or all of the steps of the method described.
[0145] Regarding the modules / units included in the various devices and products described in the above embodiments, they can be software modules / units, hardware modules / units, or a combination of both. For example, for devices and products applied to or integrated into a chip, all modules / units can be implemented using hardware methods such as circuits, or at least some modules / units can be implemented using software programs running on a processor integrated within the chip, while the remaining (if any) modules / units can be implemented using hardware methods such as circuits. For devices and products applied to or integrated into a chip module, all modules / units can be implemented using hardware methods such as circuits. Different modules / units can be located in the same component (e.g., chip, circuit module, etc.) or different components of the chip module, or at least some modules / units can be implemented using hardware methods such as circuits. The implementation is achieved through a software program that runs on a processor integrated within the chip module. The remaining modules / units (if any) can be implemented using hardware methods such as circuits. For various devices and products applied to or integrated into terminal equipment, each of their modules / units can be implemented using hardware methods such as circuits. Different modules / units can be located in the same component (e.g., chip, circuit module, etc.) or different components within the terminal equipment. Alternatively, at least some modules / units can be implemented using a software program that runs on a processor integrated within the terminal equipment, while the remaining modules / units (if any) can be implemented using hardware methods such as circuits.
[0146] It should be noted that "multiple" in the embodiments of this application refers to two or more.
[0147] The descriptions of "first," "second," etc., appearing in the embodiments of this application are for illustrative purposes and to distinguish the objects being described. They have no order and do not indicate any special limitation on the number of devices in the embodiments of this application, nor do they constitute any limitation on the embodiments of this application.
[0148] The above embodiments can be implemented, in whole or in part, by software, hardware, firmware, or any other combination thereof. When implemented using software, the above embodiments can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer program are loaded or executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired or wireless means.
[0149] It should be understood that in the various embodiments of this application, the order of the above-mentioned processes does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0150] In the several embodiments provided in this application, it should be understood that the disclosed methods, apparatuses, and systems can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for example, the division of units is merely a logical functional division, and other division methods may exist in actual implementation; for example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
[0151] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0152] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can be physically included separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or in the form of hardware plus software functional units.
[0153] The integrated unit implemented as a software functional unit described above can be stored in a computer-readable storage medium. This software functional unit, stored in a storage medium, includes several instructions to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to execute some steps of the methods described in the various embodiments of this application.
[0154] While this application discloses the above information, it is not limited thereto. Any person skilled in the art can make various modifications and alterations without departing from the spirit and scope of this application; therefore, the scope of protection of this application shall be determined by the scope defined in the claims.
Claims
1. A method for constructing a frequency band detection model, characterized in that, The method includes: According to the power line communication protocol, preamble data corresponding to each frequency band of the protocol is generated. The preamble data refers to the sampled data of a single preamble symbol in the corresponding preamble sequence. The number of sampled points of a single preamble symbol corresponding to different power line communication protocols is an adjustable variable. Based on the aforementioned preamble data, a training sample set is generated by simulating a power line communication channel. A convolutional neural network is constructed; the convolutional neural network includes an input layer, a convolutional layer, a pooling layer, a fully connected layer, and an output layer; the number of nodes in the input layer is the same as the number of sampling points of a single preamble data of the frequency band to be detected; the number of nodes in the output layer is the same as the number of frequency bands to be detected; The parameters of the convolutional neural network are trained using the training sample set; A frequency band detection model is generated based on the trained convolutional neural network, and the frequency band detection model is used to classify and detect power line communication frequency bands; The step of generating a training sample set based on the preamble data by simulating a power line communication channel includes: The preceding data is looped from its starting point to generate multiple preceding data with different starting points; To simulate a power line communication channel, Gaussian white noise and sampling frequency offset are added to the preamble data to obtain sample data; The sample data is encoded to generate labels corresponding to the sample data; The training sample set is generated based on the sample data and the corresponding labels.
2. The method according to claim 1, characterized in that, The generation of preamble data corresponding to each frequency band of the protocol includes: The preamble data corresponding to each frequency band of the protocol is generated using programming tools.
3. The method according to claim 1 or 2, characterized in that, The addition of Gaussian white noise and sampling frequency offset to the preamble data to obtain the sample data includes: Different Gaussian white noise and sampling frequency offset are added to different leading data.
4. The method according to claim 3, characterized in that, The addition of different Gaussian white noise and sampling frequency offset to different preamble data includes: Gaussian white noise and sampling frequency offset are added to each preamble data in sequence, following the method of increasing or decreasing Gaussian white noise in the first step and increasing or decreasing sampling frequency offset in the second step.
5. The method according to claim 1, characterized in that, The convolutional layer consists of two one-dimensional convolutional layers, each followed by a ReLU activation function.
6. The method according to claim 1, characterized in that, The pooling layer includes two one-dimensional pooling layers, both of which use max pooling. After the second pooling layer, the Flatten function is used to convert the max-pooled two-dimensional data into one-dimensional data and send it into the fully connected layer.
7. The method according to claim 1, characterized in that, The fully connected layer consists of two layers. The neurons in the first fully connected layer use the ReLU activation function. The number of neurons in the second fully connected layer is the same as the number of frequency bands to be detected, and the softmax activation function is used. The output layer is the second fully connected layer.
8. The method according to claim 1, characterized in that, The parameters used to train the convolutional neural network using the training sample set include: The parameter training process uses the cross-entropy loss function to avoid gradient diffusion and the Adam optimization algorithm to adaptively adjust the learning rate.
9. A frequency band detection model construction device, characterized in that, The device includes: The preamble data generation module is used to generate preamble data corresponding to each frequency band of the power line communication protocol. The preamble data refers to the sampling data of a single preamble symbol in the corresponding preamble sequence. The number of sampling points of a single preamble symbol corresponding to different power line communication protocols is an adjustable variable. The training sample set generation module is used to generate a training sample set based on the preceding data through a simulated power line communication channel. A network construction module is used to construct a convolutional neural network; the convolutional neural network includes an input layer, a convolutional layer, a pooling layer, a fully connected layer, and an output layer; the number of nodes in the input layer is the same as the number of sampling points of a single preamble data of the frequency band to be detected; the number of nodes in the output layer is the same as the number of frequency bands to be detected; A parameter training module is used to train the parameters of the convolutional neural network using the training sample set; The model generation module is used to generate a frequency band detection model based on the trained convolutional neural network. The frequency band detection model is used to classify and detect power line communication frequency bands. The training sample set generation module is specifically used for: The preceding data is looped from its starting point to generate multiple preceding data with different starting points; To simulate a power line communication channel, Gaussian white noise and sampling frequency offset are added to the preamble data to obtain sample data; The sample data is encoded to generate labels corresponding to the sample data; The training sample set is generated based on the sample data and the corresponding labels.
10. A frequency band detection method for detecting power line communication frequency bands, characterized in that, The method includes: Real-time reception of power line communication data; The communication data is subjected to preamble signal detection to obtain a preamble data sequence; The preamble data sequence is classified using a frequency band detection model based on a convolutional neural network, which is pre-established based on the frequency band detection model construction method described in any one of claims 1 to 8. The current communication frequency band is determined based on the classification results. The convolutional neural network includes an input layer, a convolutional layer, a pooling layer, a fully connected layer, and an output layer. The number of nodes in the input layer is the same as the number of sampling points of a single preamble data of the frequency band to be detected. The number of nodes in the output layer is the same as the number of frequency bands to be detected.
11. A frequency band detection device for detecting power line communication frequency bands, characterized in that, The device includes: The data receiving module is used to receive power line communication data in real time. The preamble detection module is used to detect the preamble signal in the communication data to obtain a preamble data sequence; A frequency band detection module is used to classify the preamble data sequence using a frequency band detection model based on a convolutional neural network, which is pre-established based on the frequency band detection model construction method of any one of claims 1 to 8, and to determine the current communication frequency band based on the classification result; the convolutional neural network includes an input layer, a convolutional layer, a pooling layer, a fully connected layer, and an output layer; the number of nodes in the input layer is the same as the number of sampling points of a single preamble data of the frequency band to be detected; the number of nodes in the output layer is the same as the number of frequency bands to be detected.
12. A power line communication receiver, characterized in that, include: The receiving module, and the frequency band detection device as described in claim 11; The receiving module is used to receive power line communication data in real time; The frequency band detection device is used to determine the current communication frequency band based on the power line communication data received in real time by the receiving module.
13. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is run by a computer, it executes some or all of the steps of the frequency band detection model construction method according to any one of claims 1 to 8, or executes some or all of the steps of the frequency band detection method according to claim 10.