Encoding method and decoding method of enhanced physical layer based on loRa chip

By dividing the data in the LoRa chip and using a combination of low-power wide area network coding standards and frequency hopping interrupt functions, the problem of reduced communication rate of LoRa chips as the communication distance increases is solved, thus improving communication efficiency.

CN116743307BActive Publication Date: 2026-08-04TSINGHUA UNIVERSITY
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
TSINGHUA UNIVERSITY
Filing Date
2022-03-03
Publication Date
2026-08-04

AI Technical Summary

Technical Problem

Existing LoRa chips suffer from a decrease in communication speed as the communication distance increases, resulting in a poor user experience.

Method used

By dividing the data to be processed into first data to be encoded and second data to be encoded, the first data to be encoded is encoded using the low-power wide area network encoding standard, and the second data to be encoded is added to the LoRa physical layer. The value of the register is set by the frequency hopping interrupt function to realize the encoding of the second data to be encoded.

Benefits of technology

As the communication distance increases, the rate of decrease in communication speed is reduced, improving the performance of the LoRa chip and enhancing the communication speed.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116743307B_ABST
    Figure CN116743307B_ABST
Patent Text Reader

Abstract

The application provides an encoding method and a decoding method of an enhanced physical layer based on a LoRa chip, and the encoding method comprises the following steps: dividing to-be-processed data into first to-be-encoded data and second to-be-encoded data; encoding the first to-be-encoded data by using a low-power wide-area network encoding standard, adding the second to-be-encoded data to a LoRa physical layer, setting the value of a register of each of the second to-be-encoded data as a first instruction value or a second instruction value by using a frequency hopping interrupt function, encoding the second to-be-encoded data, and obtaining a target signal comprising a LoRa data packet. The application is used to solve the defect that the communication rate is reduced with the increase of the communication distance in the prior art, and the enhanced LoRa data packet is generated by modifying the encoding mode, so that the degree of reduction of the communication rate is reduced when the communication distance is increased.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of wireless communication technology, and in particular to an encoding and decoding method for an enhanced physical layer based on a LoRa chip. Background Technology

[0002] With the booming development of the Internet of Things (IoT), different applications have placed different demands on communication technologies. One important type of demand is wide-area, low-power, low-data-rate communication. Low-power wide-area network (LPWAN) technology is well-suited to this need, and one of its representative technologies is LoRa. LoRa uses chirped spread spectrum as its physical layer communication method, which has extremely strong anti-interference capabilities.

[0003] Existing technologies utilize various LoRa chips to meet the needs of different regions for different frequency bands. These chips configure LoRa parameters, such as the spreading factor (SF). Users determine the corresponding communication distance by modifying the spreading factor; a larger spreading factor supports a longer communication distance. However, as the communication distance increases, the communication rate decreases, resulting in a poor user experience.

[0004] Therefore, how to reduce the decrease in communication rate while increasing communication distance is an important issue that the industry urgently needs to address. Summary of the Invention

[0005] This invention provides an encoding and decoding method for an enhanced physical layer based on a LoRa chip, which addresses the deficiency in existing technologies where the communication rate decreases as the communication distance increases. By modifying the encoding method, enhanced LoRa data packets are generated, thereby reducing the degree of communication rate reduction as the communication distance increases and improving the performance of the LoRa chip.

[0006] This invention provides an enhanced physical layer encoding method based on a LoRa chip, comprising:

[0007] The data to be processed is divided into first data to be encoded and second data to be encoded, wherein the length of the data to be processed corresponds to the number of sweep symbols, and the second data to be encoded is newly added encoded data;

[0008] The first data to be encoded is encoded using the Low Power Wide Area Network (LPWAN) coding standard. The second data to be encoded is added to the LoRa physical layer. The register value of each second data to be encoded is set to a first indicator value or a second indicator value through the frequency hopping interrupt function, thereby realizing the encoding of the second data to be encoded and obtaining a target signal containing LoRa data packets.

[0009] Wherein, the first indication value is used to indicate the upper frequency, the second indication value is used to indicate the lower frequency, and the data segment of the LoRa data packet includes the data to be processed.

[0010] According to the present invention, an encoding method for an enhanced physical layer based on a LoRa chip includes adding the second data to be encoded to the LoRa physical layer, and setting the register value of each of the second data to be encoded to a first indicator value or a second indicator value through a frequency hopping interrupt function to achieve encoding of the second data to be encoded, comprising:

[0011] The second data to be encoded is added to the LoRa physical layer. Starting from the third sweep symbol of the data segment, the register value of each second data to be encoded is set to a first indicator value or a second indicator value through the frequency hopping interrupt function, thereby realizing the encoding of the second data to be encoded.

[0012] According to the encoding method of the enhanced physical layer based on LoRa chip provided by the present invention, the step of dividing the data to be processed into first data to be encoded and second data to be encoded includes:

[0013] Determine the number of sweep symbols required for the data to be processed;

[0014] Based on the number of sweep symbols, the data to be processed is divided into the first data to be encoded and the second data to be encoded.

[0015] This invention also provides a decoding method for an enhanced physical layer based on a LoRa chip, comprising:

[0016] Determine the starting position of the sweep symbol of the LoRa data packet in the target signal;

[0017] Perform a despreading operation on the frequency sweep symbols to obtain the frequency corresponding to any one of the frequency sweep symbols;

[0018] The sweep symbol corresponding to the upper frequency is input into the LoRa decoder for decoding. The sweep symbol corresponding to the lower frequency is flipped, and the flipped sweep symbol is input into the LoRa decoder for decoding to obtain the data to be processed in the LoRa data packet.

[0019] According to a decoding method for an enhanced physical layer based on a LoRa chip provided by the present invention, the step of performing a despreading operation on the swept symbols to determine the frequency corresponding to any one of the swept symbols includes:

[0020] Despreading is performed on all the sweep symbols following the third sweep symbol corresponding to the data segment to determine the frequency corresponding to any one of the sweep symbols.

[0021] According to a decoding method for an enhanced physical layer based on a LoRa chip provided by the present invention, the step of performing a despreading operation on the swept symbols to determine the frequency corresponding to any one of the swept symbols includes:

[0022] Perform a despreading operation on the frequency sweep symbols to determine the frequency corresponding to any one of the frequency sweep symbols;

[0023] Based on the frequency, determine whether the frequency sweep symbol is an upper frequency sweep symbol or a lower frequency sweep symbol;

[0024] When the frequency sweep symbol is the upper frequency sweep symbol, the frequency is determined to be the upper frequency;

[0025] When the frequency sweep symbol is the lower frequency sweep symbol, the frequency is determined to be the lower frequency.

[0026] The present invention also provides an encoding device for an enhanced physical layer based on a LoRa chip, comprising:

[0027] A partitioning module is used to partition the data to be processed into a first data to be encoded and a second data to be encoded, wherein the length of the data to be processed corresponds to the number of sweep symbols;

[0028] The encoding module is used to encode the first data to be encoded using the Low Power Wide Area Network (LPWAN) encoding standard, add the second data to be encoded to the LoRa physical layer, and set the register value of each second data to be encoded to a first indicator value or a second indicator value through a frequency hopping interrupt function, thereby encoding the second data to be encoded to obtain a target signal including LoRa data packets; wherein, the first indicator value is used to indicate the upper frequency, the second indicator value is used to indicate the lower frequency, and the data segment of the LoRa data packet includes the data to be processed.

[0029] The present invention also provides a decoding device with an enhanced physical layer based on a LoRa chip, comprising:

[0030] The determination module is used to determine the starting position of the sweep symbol of the LoRa data packet in the target signal;

[0031] The despreading module is used to perform a despreading operation on the sweeping symbols to obtain the frequency corresponding to any one of the sweeping symbols;

[0032] The decoding module is used to input the sweep symbol corresponding to the upper frequency into the LoRa decoder for decoding, to flip the sweep symbol corresponding to the lower frequency, and to input the flipped sweep symbol into the LoRa decoder for decoding to obtain the data to be processed in the LoRa data packet.

[0033] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it implements either the encoding method of the enhanced physical layer based on the LoRa chip described above, or the decoding method of the enhanced physical layer based on the LoRa chip described above.

[0034] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the encoding method of the enhanced physical layer based on the LoRa chip as described above, or the decoding method of the enhanced physical layer based on the LoRa chip as described above.

[0035] This invention provides an enhanced physical layer encoding and decoding method based on a LoRa chip. The encoding method divides the data to be processed into first data to be encoded and second data to be encoded, wherein the length of the data to be processed corresponds to the number of frequency sweep symbols, and the second data to be encoded is newly added encoded data. The first data to be encoded is encoded using a low-power wide area network encoding standard, and the second data to be encoded is added to the LoRa physical layer. Through a frequency hopping interrupt function, the register value of each second data to be encoded is set to a first indicator value or a second indicator value, thereby realizing the encoding of the second data to be encoded to obtain a target signal including LoRa data packets. The first indicator value is used to indicate the upper frequency, and the second indicator value is used to indicate the lower frequency. The data segment of the LoRa data packet includes the data to be processed. It can be seen that this invention solves the problem of communication rate reduction with increasing communication distance in the prior art by adding new encoded data and using a new encoding method for the new encoded data, thereby improving the transmission rate of the target signal, reducing the degree of communication rate reduction when the communication distance increases, and improving the performance of the LoRa chip. Attached Figure Description

[0036] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0037] Figure 1 This is a schematic diagram illustrating the formation process of the original LoRa data packet provided by the present invention;

[0038] Figure 2 This is a schematic diagram of the original LoRa encoding method provided by the present invention;

[0039] Figure 3 This is a schematic diagram of the new encoding method provided by the present invention;

[0040] Figure 4 This is a flowchart illustrating the encoding method for the enhanced physical layer based on the LoRa chip provided by the present invention.

[0041] Figure 5 This is a flowchart illustrating the decoding method for the enhanced physical layer based on the LoRa chip provided by the present invention.

[0042] Figure 6 This is a schematic diagram of the structure of the encoding device for the enhanced physical layer based on the LoRa chip provided by the present invention;

[0043] Figure 7 This is a schematic diagram of the structure of the decoding device based on the LoRa chip-enhanced physical layer provided by the present invention;

[0044] Figure 8 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation

[0045] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.

[0046] The following is combined Figures 4-5 The present invention describes the encoding and decoding methods of the enhanced physical layer based on the LoRa chip.

[0047] Before introducing the encoding method of the present invention, the encoding methods of the prior art are described below:

[0048] The original LoRa used chirped spread spectrum for communication. A LoRa data packet consists of three parts: a preamble, a start frame indicator, and a data segment. Each part consists of several up-chirp symbols. A standard up-chirp symbol is defined as a frequency up-chirp from the baseband. linear change to A signal, where B is the bandwidth, can be defined as an up-chirp symbol. Other up-chirp symbols used in LoRa can be obtained by cyclically shifting a standard up-chirp symbol in the time-frequency domain, such as... Figure 1 As shown. Similarly, a standard down-chirp symbol is defined as a frequency from the fundamental frequency. linear change to A signal can be defined as a down-chirp symbol. Cyclic shifting of this symbol in the time-frequency domain yields other down-chirp symbols that encode the data. See [link to documentation] for details. Figure 1 .

[0049] in, Figure 1 In the diagram, (a) represents the standard up-chirp symbol, (b) represents the standard down-chirp symbol, (c) represents the LoRa up-chirp symbol after cyclic translation, and (d) represents the LoRa down-chirp symbol after cyclic translation.

[0050] The original LoRa data packet format is as follows: Figure 2 As shown, a data packet is constructed using either a uniform up-chirp symbol or a down-chirp symbol. Different symbols have different starting frequencies. arrive Between these, a single symbol can encode a spreading factor of bits.

[0051] Based on this, the present invention utilizes the characteristic that up-chirp and down-chirp symbols can simultaneously encode data, adding one bit of information to each symbol to improve network throughput. The LoRa data format of the present invention is as follows: Figure 3 As shown.

[0052] This invention can directly generate enhanced LoRa data packets on LoRa terminals, and the specific implementation can be based on the SX127x chip. The following explanation uses the SX127x chip as an example. The SX127x chip is a type of LoRa terminal chip that provides a frequency hopping interface to meet radio transmission restrictions in certain areas. This interface is provided in the form of a frequency hopping interrupt function, and the frequency hopping time granularity can reach the level of a single chirp.

[0053] This invention provides an enhanced physical layer encoding method based on a LoRa chip. This method belongs to the field of low-power wide-area network (LPWAN) device communication and is applied to the signal transmitting end. Specifically, as follows... Figure 4 As shown, the method includes:

[0054] Step 401: Divide the data to be processed into the first data to be encoded and the second data to be encoded.

[0055] The length of the data to be processed corresponds to the number of frequency sweep symbols, and the second data to be encoded is the newly added encoded data.

[0056] The data to be processed includes original data and new data. The first data to be encoded corresponds to the original data, and the new data corresponds to the second data to be encoded. The new encoded data is a further restriction on the original data based on the first data to be encoded.

[0057] This invention is illustrated using the example of a frequency sweep symbol corresponding to a piece of data to be processed.

[0058] In one specific embodiment, the specific implementation of dividing the data to be processed into first data to be encoded and second data to be encoded is as follows: determining the number of sweep symbols required for the data to be processed; and dividing the data to be processed into first data to be encoded and second data to be encoded based on the number of sweep symbols.

[0059] According to the LoRa encoding rules, we can obtain a function F1(N1), where N1 is the number of bits encoded using the LoRa method, and F1(N1) represents the minimum number of sweep symbols required for N1 (obviously, redundancy can be used; adding a few unnecessary sweep symbols does not affect the result). Based on this invention, we can also obtain a function F2(N2), where N2 is the number of bits encoded using the up-down method of this invention, and F2(N2) represents the minimum number of sweep symbols required for N2. If we fill N1 bits using the LoRa method and N2 bits using the up-down method, then the number of sweep symbols we need is the larger of F1(N1) and F2(N2). To reduce power consumption, we should obviously send fewer sweep symbols to reduce the signal length. If I want to send N bits, then I need to solve an optimization problem: divide the N bits into N1 and N2 bits such that max(F1(N1), F2(N2)) is minimized; this is a reasonable division.

[0060] Where N1 represents the number of sweep symbols required for the first data to be encoded, N2 represents the number of sweep symbols required for the second data to be encoded, and N represents the number of sweep symbols required for the data to be processed.

[0061] Step 402: Encode the first data to be encoded using the Low Power Wide Area Network (LPWAN) coding standard, add the second data to be encoded to the LoRa physical layer, and set the register value of each second data to be encoded to the first or second indicator value through the frequency hopping interrupt function to achieve the encoding of the second data to be encoded, so as to obtain the target signal including LoRa data packets.

[0062] The first indication value is used to indicate the upper frequency, the second indication value is used to indicate the lower frequency, and the data segment of the LoRa data packet includes the data to be processed.

[0063] The first and second indicator values ​​are set alternately.

[0064] Specifically, after generating the target signal, the target signal is sent.

[0065] In one specific embodiment, the second data to be encoded is added to the LoRa physical layer. Starting from the third sweep symbol of the data segment, the register value of each second data to be encoded is set to a first indicator value or a second indicator value through the frequency hopping interrupt function, thereby realizing the encoding of the second data to be encoded.

[0066] The first indicator value can be represented by up-chirp, and the second indicator value can be represented by down-chirp. Of course, they can be interchanged.

[0067] Specifically, within each interrupt function body, by modifying the value of the inversion register (RegInvertIQ), a single chirp symbol can be inverted, i.e., an up-chirp becomes a down-chirp or vice versa. Therefore, this invention adds extra bits to the LoRa physical layer protocol with fine-grained precision. The inversion register is used to toggle specified bits.

[0068] Since the frequency hopping interface of the SX127x chip can only achieve the frequency hopping time granularity of a single chirp symbol starting from the third chirp in the data segment, the bits added in this invention also start from the third chirp symbol in the data segment.

[0069] The following example illustrates how one chirp symbol corresponds to one bit of data:

[0070] For example, when the data to be transmitted is N bits, it is divided into two parts, N1 and N2. The N1 bits of data use the original LoRa encoding, and the N2 bits are filled into the original LoRa physical layer, indicated sequentially by up-chirp and down-chirp. To set the chirp symbol to up-chirp or down-chirp form, starting from the up-chirp of the third data segment, the corresponding register value needs to be set in the frequency hopping interrupt function. The value of this register indicates whether the current chirp symbol is up-chirp or down-chirp. Because this function is called when each chirp symbol is transmitted, the form of each chirp symbol can be controlled.

[0071] Where up-chirp represents 0 and down-chirp represents 1.

[0072] The modifications in this invention are limited to the data segment.

[0073] Furthermore, this invention does not affect the sensitivity of the receiver because the anti-interference capability is the same for both up-chirp and down-chirp symbols. The extra bits added by this invention do not affect the single-link communication performance. Moreover, the encoding method of this invention only requires software modification at the signal transmitting end, without requiring hardware upgrades, making it highly applicable and cost-effective for deployment.

[0074] The encoding method for the enhanced physical layer based on LoRa chips provided by this invention divides the data to be processed into first data to be encoded and second data to be encoded. The length of the data to be processed corresponds to the number of sweep symbols, and the second data to be encoded is newly added encoded data. The first data to be encoded is encoded using the Low Power Wide Area Network (LPWAN) encoding standard, and the second data to be encoded is added to the LoRa physical layer. Through a frequency hopping interrupt function, the register value of each second data to be encoded is set to a first indicator value or a second indicator value, thereby achieving the encoding of the second data to be encoded to obtain a target signal including LoRa data packets. The first indicator value is used to indicate the upper frequency, and the second indicator value is used to indicate the lower frequency. The data segment of the LoRa data packet includes the data to be processed. It can be seen that this invention solves the problem of communication rate reduction with increasing communication distance in the prior art by adding new encoded data and adopting a new encoding method for the new encoded data, thereby improving the transmission rate of the target signal, reducing the degree of communication rate reduction when the communication distance increases, and improving the performance of the LoRa chip.

[0075] This invention also provides an enhanced physical layer decoding method based on a LoRa chip. This method belongs to the field of low-power wide-area network device communication and is applied to the signal receiving end. Specifically, as shown in the example... Figure 5 As shown, the method includes:

[0076] Step 501: Determine the starting position of the sweep symbol of the LoRa data packet in the target signal.

[0077] Specifically, the target signal sent by the receiving signal transmitter is received, and routine LoRa preamble detection and synchronization operations are performed to determine the existence of LoRa data and obtain the starting position of the data segment chirp.

[0078] Step 502: Perform a despreading operation on the sweep symbols to obtain the frequency corresponding to any sweep symbol.

[0079] In one specific embodiment, after obtaining the starting position of the data segment, a despreading operation is performed on all sweep symbols after the third sweep symbol corresponding to the data segment to determine the frequency corresponding to any sweep symbol.

[0080] In one specific embodiment, based on the frequency, it is determined whether the frequency sweep symbol is an upper frequency sweep symbol or a lower frequency sweep symbol; when the frequency sweep symbol is an upper frequency sweep symbol, the frequency is determined to be the upper frequency; when the frequency sweep symbol is a lower frequency sweep symbol, the frequency is determined to be the lower frequency.

[0081] Specifically, the despreading operation is implemented as follows:

[0082] First, the target signal is multiplied by the corresponding standard up-chirp or standard down-chirp. Then, a Fast Fourier Transform (FFT) is performed to determine the frequency with the highest energy in the frequency domain, which is defined as the first peak frequency. This frequency position indicates the coded data. Next, the signal is multiplied by the standard up-chirp, and the result of the FFT is multiplied by the standard down-chirp and then the result of the FFT is defined as the second peak frequency. The first peak frequency and the second peak frequency are compared. If the first peak frequency is greater than the second peak frequency, the chirp symbol to be transmitted is determined to be a down-chirp symbol; otherwise, the chirp symbol to be transmitted is determined to be an up-chirp symbol.

[0083] Based on the above operations, the bit information of the target signal is obtained.

[0084] Step 503: Input the sweep symbol corresponding to the upper frequency into the LoRa decoder for decoding, flip the sweep symbol corresponding to the lower frequency, and input the flipped sweep symbol into the LoRa decoder for decoding to obtain the data to be processed in the LoRa data packet.

[0085] Specifically, after step 502, a series of frequencies that can be converted into bits are obtained. For up-chirp symbols, they are directly input into the LoRa decoder for decoding. For down-chirp symbols, due to the symmetry of the chirp symbols, they need to be converted into the frequencies corresponding to the original unflipped values. If the peak frequency corresponding to the down-chirp symbol is f0, then the bit string corresponding to -f0 is taken and input into the LoRa decoder. The LoRa decoder synthesizes the decoding results to obtain the data to be processed.

[0086] The decoding method based on the enhanced physical layer of LoRa chips provided by this invention determines the starting position of the sweep symbol of the LoRa data packet in the target signal; performs a despreading operation on the sweep symbol to obtain the frequency corresponding to any sweep symbol; inputs the sweep symbol corresponding to the upper frequency into the LoRa decoder for decoding, and performs a toggling operation on the sweep symbol corresponding to the lower frequency, and inputs the toggled sweep symbol into the LoRa decoder for decoding to obtain the data to be processed in the LoRa data packet. It can be seen that the decoding method of this invention obtains the data to be processed based on the above encoding method, realizing the reception of long-distance target signals and improving the user experience.

[0087] The following describes the encoding device for the enhanced physical layer based on a LoRa chip provided by this invention. The encoding device for the enhanced physical layer based on a LoRa chip described below can be referred to in correspondence with the encoding method for the enhanced physical layer based on a LoRa chip described above; repeated details will not be repeated. Specifically, as follows... Figure 6 As shown, the encoding device includes:

[0088] The partitioning module 601 is used to partition the data to be processed into first data to be encoded and second data to be encoded, wherein the length of the data to be processed corresponds to the number of sweep symbols, and the second data to be encoded is newly added encoded data.

[0089] The encoding module 602 is used to encode the first data to be encoded using the Low Power Wide Area Network (LPWAN) encoding standard, add the second data to be encoded to the LoRa physical layer, and set the register value of each second data to be encoded to a first indicator value or a second indicator value through a frequency hopping interrupt function, thereby encoding the second data to be encoded to obtain a target signal including LoRa data packets; wherein, the first indicator value is used to indicate the upper frequency, the second indicator value is used to indicate the lower frequency, and the data segment of the LoRa data packet includes the data to be processed.

[0090] In one specific embodiment, the encoding module 602 is specifically used to add the second data to be encoded to the LoRa physical layer. Starting from the third sweep symbol of the data segment, the value of the register for each second data to be encoded is set to a first indicator value or a second indicator value through a frequency hopping interrupt function, thereby realizing the encoding of the second data to be encoded.

[0091] In one specific embodiment, the partitioning module 601 is specifically used to partition the data to be processed into first data to be encoded and second data to be encoded based on the number of sweep symbols.

[0092] The following describes the LoRa chip-based enhanced physical layer decoding device provided by this invention. The LoRa chip-based enhanced physical layer decoding device described below and the LoRa chip-based enhanced physical layer decoding method described above can be referred to and corresponded to each other; repeated details will not be repeated. Specifically, as follows... Figure 7 As shown, the decoding device includes:

[0093] The determination module 701 is used to determine the starting position of the sweep symbol of the LoRa data packet in the target signal;

[0094] The despreading module 702 is used to perform despreading operation on the sweeping symbols to obtain the frequency corresponding to any sweeping symbol.

[0095] The decoding module 703 is used to input the sweep frequency symbol corresponding to the upper frequency into the LoRa decoder for decoding, to flip the sweep frequency symbol corresponding to the lower frequency, and to input the flipped sweep frequency symbol into the LoRa decoder for decoding to obtain the data to be processed in the LoRa data packet.

[0096] In one specific embodiment, the despreading module 702 is specifically used to perform despreading operation on all sweep symbols after the third sweep symbol corresponding to the data segment to determine the frequency corresponding to any sweep symbol.

[0097] In one specific embodiment, the despreading module 702 is specifically used to perform despreading operation on the sweep symbols, determine the frequency corresponding to any sweep symbol; based on the frequency, determine whether the sweep symbol is an upper sweep symbol or a lower sweep symbol; when the sweep symbol is an upper sweep symbol, determine the frequency as the upper frequency; when the sweep symbol is a lower sweep symbol, determine the frequency as the lower frequency.

[0098] Figure 8 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 8As shown, the electronic device may include: a processor 801, a communication interface 802, a memory 803, and a communication bus 804. The processor 801, communication interface 802, and memory 803 communicate with each other via the communication bus 804. The processor 801 can call logic instructions in the memory 803 to execute an enhanced physical layer encoding method based on a LoRa chip. This method includes: dividing the data to be processed into first data to be encoded and second data to be encoded, wherein the length of the data to be processed corresponds to the number of frequency sweep symbols, and the second data to be encoded is newly added encoded data; encoding the first data to be encoded using a low-power wide-area network encoding standard; adding the second data to be encoded to the LoRa physical layer; and setting the register value of each second data to be encoded to a first indicator value or a second indicator value through a frequency hopping interrupt function to achieve encoding of the second data to be encoded, thereby obtaining a target signal containing LoRa data packets. In the LoRa data packet, the first indication value is used to indicate the upper frequency, and the second indication value is used to indicate the lower frequency. The data segment of the LoRa data packet includes the data to be processed. Alternatively, a decoding method based on the enhanced physical layer of the LoRa chip is executed. This method includes: determining the starting position of the sweep symbol of the LoRa data packet in the target signal; performing a despreading operation on the sweep symbol to obtain the frequency corresponding to any sweep symbol; inputting the sweep symbol corresponding to the upper frequency into the LoRa decoder for decoding; performing a toggle operation on the sweep symbol corresponding to the lower frequency; and inputting the toggle-operated sweep symbol into the LoRa decoder for decoding to obtain the data to be processed in the LoRa data packet.

[0099] Furthermore, the logical instructions in the aforementioned memory 803 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0100] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the encoding method based on the enhanced physical layer of the LoRa chip provided by the above methods. The method includes: dividing the data to be processed into first data to be encoded and second data to be encoded, wherein the length of the data to be processed corresponds to the number of frequency sweep symbols, and the second data to be encoded is newly added encoded data; encoding the first data to be encoded using a low-power wide area network encoding standard; adding the second data to be encoded to the LoRa physical layer; and setting the register value of each second data to be encoded to a first indicator value or a second indicator value through a frequency hopping interrupt function, thereby realizing the encoding of the second data. Encoding the data to be encoded to obtain a target signal including LoRa data packets; wherein, a first indication value is used to indicate an upper frequency, a second indication value is used to indicate a lower frequency, and the data segment of the LoRa data packet includes the data to be processed; or, performing the decoding method based on the enhanced physical layer of the LoRa chip provided by the above methods, the method includes: determining the starting position of the sweep symbol of the LoRa data packet in the target signal; performing a despreading operation on the sweep symbol to obtain the frequency corresponding to any sweep symbol; inputting the sweep symbol corresponding to the upper frequency into the LoRa decoder for decoding operation, performing a flipping operation on the sweep symbol corresponding to the lower frequency, and inputting the flipped sweep symbol into the LoRa decoder for decoding operation to obtain the data to be processed in the LoRa data packet.

[0101] In another aspect, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon. When executed by a processor, the computer program implements the encoding method for the enhanced physical layer based on a LoRa chip provided by the methods described above. This method includes: dividing data to be processed into first data to be encoded and second data to be encoded, wherein the length of the data to be processed corresponds to the number of frequency sweep symbols, and the second data to be encoded is newly added encoded data; encoding the first data to be encoded using a low-power wide-area network encoding standard; adding the second data to be encoded to the LoRa physical layer; and setting the register value of each second data to be encoded to a first indicator value or a second indicator value through a frequency hopping interrupt function, thereby achieving the encoding of the second data to be encoded to obtain a result including... A target signal containing LoRa data packets; wherein a first indication value is used to indicate an upper frequency, a second indication value is used to indicate a lower frequency, and the data segment of the LoRa data packet includes data to be processed; or, the decoding method based on the enhanced physical layer of the LoRa chip provided by the above methods is executed, the method comprising: determining the starting position of the sweep symbol of the LoRa data packet in the target signal; performing a despreading operation on the sweep symbol to obtain the frequency corresponding to any sweep symbol; inputting the sweep symbol corresponding to the upper frequency into the LoRa decoder for decoding operation, performing a toggling operation on the sweep symbol corresponding to the lower frequency, and inputting the toggled sweep symbol into the LoRa decoder for decoding operation to obtain the data to be processed in the LoRa data packet.

[0102] The device embodiments described above are merely illustrative. 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 modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0103] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0104] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A coding method based on the enhanced physical layer of the LoRa chip, characterized in that, include: A function F1(N1) is determined according to the LoRa encoding rules, where N1 represents the number of bits encoded according to the LoRa encoding rules, and F1(N1) represents the minimum number of sweep symbols required for N1. A function F2(N2) is determined according to the up-down method, where N2 represents the number of bits encoded according to the up-down method, and F2(N2) represents the minimum number of sweep symbols required for N2. The number of sweep symbols required for the data to be processed is determined based on the larger value of F1(N1) and F2(N2). Based on the number of sweep symbols required for the data to be processed, the data to be processed is divided into first data to be encoded and second data to be encoded. The first data to be encoded is encoded using the Low Power Wide Area Network (LPWAN) coding standard. The second data to be encoded is added to the LoRa physical layer. The register value of each second data to be encoded is set to a first indicator value or a second indicator value through the frequency hopping interrupt function, thereby realizing the encoding of the second data to be encoded and obtaining a target signal containing LoRa data packets. Wherein, the first indication value is used to indicate the upper frequency, the second indication value is used to indicate the lower frequency, and the data segment of the LoRa data packet includes the data to be processed.

2. The encoding method of the LoRa chip-based enhanced physical layer according to claim 1, wherein, The step of adding the second data to be encoded to the LoRa physical layer, and setting the register value for each of the second data to be encoded to a first indicator value or a second indicator value through a frequency hopping interrupt function, thereby achieving the encoding of the second data to be encoded, includes: The second data to be encoded is added to the LoRa physical layer. Starting from the third sweep symbol of the data segment, the register value of each second data to be encoded is set to a first indicator value or a second indicator value through the frequency hopping interrupt function, thereby realizing the encoding of the second data to be encoded.

3. A decoding method of an enhanced physical layer based on a LoRa chip, characterized in that, The method includes: Determine the starting position of the sweep symbol of the LoRa data packet in the target signal; Perform a despreading operation on the frequency sweep symbols to obtain the frequency corresponding to any of the frequency sweep symbols; The sweep symbol corresponding to the upper frequency is input into the LoRa decoder for decoding, the sweep symbol corresponding to the lower frequency is flipped, and the flipped sweep symbol is input into the LoRa decoder for decoding to obtain the data to be processed in the LoRa data packet. The step of performing a despreading operation on the swept frequency symbols to determine the frequency corresponding to any one of the swept frequency symbols includes: Despreading is performed on all the sweep symbols following the third sweep symbol corresponding to the data segment to determine the frequency corresponding to any one of the sweep symbols.

4. The decoding method of the LoRa chip-based enhanced physical layer according to claim 3, characterized in that, The step of performing a despreading operation on the swept frequency symbols to determine the frequency corresponding to any one of the swept frequency symbols includes: Perform a despreading operation on the frequency sweep symbols to determine the frequency corresponding to any one of the frequency sweep symbols; Based on the frequency, determine whether the frequency sweep symbol is an upper frequency sweep symbol or a lower frequency sweep symbol; When the frequency sweep symbol is the upper frequency sweep symbol, the frequency is determined to be the upper frequency; When the frequency sweep symbol is the lower frequency sweep symbol, the frequency is determined to be the lower frequency.

5. An encoding device based on an enhanced physical layer of a LoRa chip, characterized in that, include: A partitioning module is used to determine function F1(N1) according to LoRa encoding rules; where N1 represents the number of bits encoded according to LoRa encoding rules, and F1(N1) represents the minimum number of sweep symbols required for N1; determine function F2(N2) according to the up-down method; where N2 represents the number of bits encoded according to the up-down method, and F2(N2) represents the minimum number of sweep symbols required for N2; determine the number of sweep symbols required for the data to be processed based on the larger value of F1(N1) and F2(N2); and partition the data to be processed into first data to be encoded and second data to be encoded based on the number of sweep symbols required for the data to be processed. The encoding module is used to encode the first data to be encoded using the Low Power Wide Area Network (LPWAN) encoding standard, add the second data to be encoded to the LoRa physical layer, and set the register value of each second data to be encoded to a first indicator value or a second indicator value through a frequency hopping interrupt function, thereby encoding the second data to be encoded to obtain a target signal including LoRa data packets; wherein, the first indicator value is used to indicate the upper frequency, the second indicator value is used to indicate the lower frequency, and the data segment of the LoRa data packet includes the data to be processed.

6. A decoding device based on an enhanced physical layer of a LoRa chip, characterized in that, include: The determination module is used to determine the starting position of the sweep symbol of the LoRa data packet in the target signal; The despreading module is used to perform a despreading operation on the sweeping symbols to obtain the frequency corresponding to any one of the sweeping symbols; The decoding module is used to input the sweep symbol corresponding to the upper frequency into the LoRa decoder for decoding, to flip the sweep symbol corresponding to the lower frequency, and to input the flipped sweep symbol into the LoRa decoder for decoding to obtain the data to be processed in the LoRa data packet. The despreading module is specifically used for: Despreading is performed on all the sweep symbols following the third sweep symbol corresponding to the data segment to determine the frequency corresponding to any one of the sweep symbols.

7. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the encoding method of the enhanced physical layer based on the LoRa chip as described in any one of claims 1 to 2, or the decoding method of the enhanced physical layer based on the LoRa chip as described in any one of claims 4 to 5.

8. A non-transitory computer-readable storage medium having stored thereon a computer program, characterized in that, When the computer program is executed by the processor, it implements the encoding method of the enhanced physical layer based on the LoRa chip as described in any one of claims 1 to 2, or the decoding method of the enhanced physical layer based on the LoRa chip as described in any one of claims 4 to 5.