Adaptive anti-interference infrared meter reading method and device
Patent Information
- Application Number
- CN202611220158.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-12
- Publication Date
- 2026-11-03
AI Technical Summary
Existing infrared meter reading methods frequently experience communication failures when faced with strong light interference and equipment alignment deviations, resulting in time-consuming manual intervention and reduced efficiency of batch meter reading.
An adaptive anti-interference infrared meter reading method is adopted. By acquiring three evaluation indicators—response signal strength, CRC check result, and communication delay—real-time scores are calculated, and retransmission strategies, including the number of retransmissions, intervals, and encoding methods, are dynamically adjusted to overcome communication interference.
It automatically adjusts parameters in complex environments, reduces the frequency of manual intervention, shortens the single meter reading time, and improves meter reading efficiency, making it suitable for outdoor scenarios with strong sunlight.
Smart Images

Figure CN123035388A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of power, and particularly relates to an adaptive anti-interference infrared meter reading method and device. Background Technology
[0002] Currently, the communication process of infrared meter reading peripherals in the power industry is usually as follows: the peripheral sends a request frame, waits for the meter to respond, and after receiving the response frame, the peripheral checks the CRC. If successful, the data is recorded; if it fails, the user retryes manually.
[0003] In related technologies, infrared communication uses a half-duplex mode. After a single communication failure, there is a lack of automatic evaluation mechanism. It either relies on manual re-alignment of the device for retrying or adopts a fixed retransmission strategy (such as fixed number of times, fixed interval, fixed encoding). Especially when applying the DL / T 698.45 protocol, due to the long protocol frame, strong light interference in the field, equipment alignment deviation and other factors, communication failure is very likely to occur. Manual intervention is time-consuming and seriously reduces the efficiency of batch meter reading. Summary of the Invention
[0004] In view of this, the present invention discloses an adaptive anti-interference infrared meter reading method and device, which can solve the shortcomings of related technologies.
[0005] To achieve the above objectives, the present invention discloses the following technical solution: According to a first aspect of the present invention, an adaptive anti-interference infrared meter reading method is proposed, comprising: Send a request frame to the target meter and receive a response frame returned by the target meter; Obtain three evaluation metrics for this communication and calculate a real-time score for this communication based on the three evaluation metrics; wherein the three evaluation metrics are response signal strength, CRC check result, and communication delay; The retransmission strategy for the next communication is adjusted based on the real-time score, and retransmission is performed based on the adjusted retransmission strategy until communication is successful or the maximum number of retries is reached. The retransmission strategy includes the number of retransmissions, the retransmission interval, and the encoding method.
[0006] Preferably, the three evaluation metrics for obtaining this communication include: Before sending the downlink request frame, the infrared emitter is turned off, and the ambient light is sampled multiple times by the MCU's ADC and the average value is taken to obtain the ambient baseline value. During the high-level period of each pulse of the response frame, the output signal of the photodiode of the infrared receiver is sampled by the ADC of the MCU, and the peak value is taken. The response signal strength is calculated based on the environmental baseline value and the sampling peak value, using the following formula: R_rssi=[(sampling peak value)] environmental baseline value) / 4095]×100; where R_rssi is the response signal strength.
[0007] Preferably, the obtaining of the three evaluation indicators for the current communication includes: performing check on the received response frame by using the CRC-16 / CCITT inverted polynomial 0x8408; if the CRC values are completely matched, determining that the CRC check result R_crc is 100 points; if the CRC check fails and the frame header routing information is credible, determining that the CRC check result R_crc is 50 points; if the CRC check fails and the frame header routing information is not credible, determining that the CRC check result R_crc is 0 points.
[0008] Preferably, the obtaining of the three evaluation indicators for the current communication includes: recording, by using an MCU timer, the time interval T from the end moment of the last pulse of sending a request frame to the end moment of receiving the last pulse of the response frame; setting the protocol standard response time as T_std; if T≤T_std, determining that the communication delay R_delay is 100 points; if T_std<T≤1.5T_std, determining that the communication delay R_delay is 60 points; if T>1.5T_std, determining that the communication delay R_delay is 30 points.
[0009] Preferably, the formula for calculating the real-time score S(k) of the current communication according to the three evaluation indicators is: S(k)=α×R_rssi / 100+β×R_delay / 100+γ×R_crc / 100; where α, β, and γ are respectively the signal strength weight, the delay weight, and the CRC check result weight, and satisfy α+β+γ=1.00.
[0010] Further, the method further includes: under a conventional environment, setting α=0.55, β=0.30, γ=0.15 by default; if the response signal strength R_rssi<30 is detected for 3 consecutive times, adjusting the weights to α=0.65, β=0.20, γ=0.15; if the CRC check result R_crc<50 is detected for 3 consecutive times, adjusting the weights to α=0.45, β=0.25, γ=0.30; If communication delay R_delay>80 is detected three times consecutively and R_rssi and R_crc are normal, then the weights are adjusted to α=0.60, β=0.15, and γ=0.25.
[0011] Preferably, adjusting the retransmission strategy for the next communication based on the real-time score includes: If the real-time score S(k) ≥ 0.8, keep the current communication parameters unchanged; If 0.6≤S(k)<0.8, set the maximum number of retransmissions to 2, switch the encoding method, and add scrambling code 0x33 to the data; If S(k) < 0.6, set the maximum number of retransmissions to 3, adjust the infrared transmission power to the maximum value, switch to anti-interference coding mode, and add scrambling code 0x33; The infrared communication uses 900nm~1000nm infrared light modulated by a 38kHz carrier, and the application layer protocol adopts the DL / T698.45 protocol.
[0012] According to a second aspect of the present invention, an adaptive anti-interference infrared meter reading device is provided, applied to an infrared meter reading peripheral, comprising: The sending unit is used to send a request frame to the target meter and receive a response frame returned by the target meter. The acquisition unit is used to acquire three evaluation indicators for this communication and calculate the real-time score of this communication based on the three evaluation indicators; wherein the three evaluation indicators are the response signal strength, CRC check result, and communication delay. The retransmission unit is used to adjust the retransmission strategy for the next communication based on the real-time score, and to execute retransmission based on the adjusted retransmission strategy until the communication is successful or the maximum number of retries is reached. The retransmission strategy includes the number of retransmissions, the retransmission interval, and the encoding method.
[0013] Preferably, the acquisition unit is specifically used for: Before sending the downlink request frame, the infrared emitter is turned off, and the ambient light is sampled multiple times by the MCU's ADC and the average value is taken to obtain the ambient baseline value. During the high-level period of each pulse of the response frame, the output signal of the photodiode of the infrared receiver is sampled by the ADC of the MCU, and the peak value is taken. The response signal strength is calculated based on the environmental baseline value and the sampling peak value, using the following formula: R_rssi=[(sampling peak value)] [Environmental baseline value) / 4095]×100; Where R_rssi is the response signal strength.
[0014] Preferably, the acquisition unit is specifically used for: Perform verification on the received response frame using the CRC-16 / CCITT reversed polynomial 0x8408; If the CRC values are completely matched, the CRC check result R_crc is determined to be 100 points; If the CRC check fails and the frame header routing information is credible, the CRC check result R_crc is determined to be 50 points; If the CRC check fails and the frame header routing information is not credible, the CRC check result R_crc is determined to be 0 points.
[0015] Preferably, the acquiring unit is specifically configured to: Record the time interval T from the end moment of the last pulse of the transmitted request frame to the end moment of the last pulse of the received response frame using an MCU timer; Set the protocol standard response time as T_std; If T≤T_std, the communication delay R_delay is determined to be 100 points; If T_std<T≤1.5T_std, the communication delay R_delay is determined to be 60 points; If T>1.5T_std, the communication delay R_delay is determined to be 30 points.
[0016] Preferably, the acquiring unit is specifically configured to: S(k)=α×R_rssi / 100+β×R_delay / 100+γ×R_crc / 100; where α, β, and γ are respectively the signal strength weight, the delay weight, and the CRC check result weight, and satisfy α+β+γ=1.00.
[0017] Further, the apparatus further comprises: a setting unit, configured to set α=0.55, β=0.30, γ=0.15 by default in a conventional environment; a first adjusting unit, configured to adjust the weights to α=0.65, β=0.20, γ=0.15 if the response signal strength R_rssi<30 is detected for 3 consecutive times; a second adjusting unit, configured to adjust the weights to α=0.45, β=0.25, γ=0.30 if the CRC check result R_crc<50 is detected for 3 consecutive times; a third adjusting unit, configured to adjust the weights to α=0.60, β=0.15, γ=0.25 if the communication delay R_delay>80 is detected for 3 consecutive times while R_rssi and R_crc are normal.
[0018] Preferably, the retransmission unit is specifically configured to: If the real-time score S(k) ≥ 0.8, keep the current communication parameters unchanged; If 0.6≤S(k)<0.8, set the maximum number of retransmissions to 2, switch the encoding method, and add scrambling code 0x33 to the data; If S(k) < 0.6, set the maximum number of retransmissions to 3, adjust the infrared transmission power to the maximum value, switch to anti-interference coding mode, and add scrambling code 0x33; The infrared communication uses 900nm~1000nm infrared light modulated by a 38kHz carrier, and the application layer protocol adopts the DL / T698.45 protocol.
[0019] According to a third aspect of the present invention, an electronic device is provided, comprising: processor; Memory used to store processor-executable instructions; The processor implements the steps of the method as described in the first aspect by running the executable instructions.
[0020] According to a fourth aspect of the invention, a computer-readable storage medium is provided having computer instructions stored thereon that, when executed by a processor, implement the steps of the method as described in the first aspect.
[0021] As can be seen from the above technical solutions, the beneficial effects of the adaptive anti-interference infrared meter reading method and device disclosed in this invention are as follows: On the one hand, this invention breaks the traditional one-way communication mode of infrared meter reading ("one send, one receive") and establishes a closed-loop mechanism of sending, evaluating, optimizing, and retransmitting. By quantitatively scoring the results of each communication, the system can automatically sense the current channel status and dynamically adjust parameters without manual intervention.
[0022] On the other hand, instead of focusing solely on the CRC check result as a single criterion, this invention introduces signal strength and communication latency as auxiliary evaluation indicators. This multi-dimensional evaluation system can distinguish the causes of failure (such as weak signal due to strong light interference, large latency due to busy meters, or bit errors due to line noise), thereby implementing more targeted error correction strategies.
[0023] Furthermore, by dynamically adjusting the number of retransmissions, power, and encoding method, this invention can overcome interference from complex on-site environments when facing long frame protocols such as DL / T 698.45, reduce the frequency of manual intervention due to communication failures, shorten the reading time of a single meter, and is suitable for outdoor scenes with complex lighting conditions and strong sunlight. Attached Figure Description
[0024] Figure 1 This is a flowchart of an adaptive anti-interference infrared meter reading method provided in an exemplary embodiment; Figure 2 This is a schematic diagram illustrating a communication delay time interval provided in an exemplary embodiment; Figure 3 This is a schematic diagram of an infrared communication circuit provided in an exemplary embodiment; Figure 4 This is a schematic diagram illustrating an infrared communication data transmission and processing process provided in an exemplary embodiment; Figure 5 This is a schematic structural diagram of a device provided in an exemplary embodiment; Figure 6 This is a block diagram of an adaptive anti-interference infrared meter reading device provided in an exemplary embodiment. Detailed Implementation
[0025] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with one or more embodiments of the present invention. Rather, they are merely examples of apparatuses and methods consistent with some aspects of one or more embodiments of the present invention as detailed in the appended claims.
[0026] It should be noted that the steps of the corresponding methods in other embodiments are not necessarily performed in the order shown and described in this invention. In some other embodiments, the methods may include more or fewer steps than those described in this invention. Furthermore, a single step described in this invention may be broken down into multiple steps in other embodiments; and multiple steps described in this invention may be combined into a single step in other embodiments.
[0027] To address the shortcomings of related technologies, this invention proposes an adaptive anti-interference infrared meter reading method and device.
[0028] Figure 1 This is a flowchart illustrating an adaptive anti-interference infrared meter reading method provided in an exemplary embodiment. For example... Figure 1 As shown, the method may include the following steps: Step 101: Send a request frame to the target meter and receive a response frame returned by the target meter.
[0029] Step 102: Obtain the three evaluation indicators for this communication and calculate the real-time score of this communication based on the three evaluation indicators; wherein the three evaluation indicators are the response signal strength, CRC check result, and communication delay.
[0030] The specific manner of obtaining the response signal strength is: before sending the downlink request frame, turn off the infrared emitting tube, use the ADC of the MCU to sample the ambient light multiple times and take the average value to obtain the ambient baseline value; during each pulse high level period of the response frame, use the ADC of the MCU to sample the output signal of the photodiode at the infrared receiving end, and take the sampling peak value; calculate the response signal strength according to the ambient baseline value and the sampling peak value, and the calculation formula is: R_rssi=[(sampling peak value ambient baseline value) / 4095]×100; where R_rssi is the response signal strength.
[0031] The analog signal output by the transimpedance amplifier from the photodiode at the infrared receiving end is obtained by sampling with the ADC of the MCU; sampling is performed during each pulse high level period of the response frame, and the peak value is taken; before each downlink frame transmission, the ambient baseline value needs to be collected, specifically by turning off the infrared emission, performing 128 ADC samplings and taking the average value to obtain the ambient baseline value.
[0032] The specific manner of obtaining the CRC check result is: The received response frame is checked using the CRC-16 / CCITT reversed polynomial 0x8408; If the CRC values match completely, the CRC check result R_crc is determined to be 100 points; If the CRC check fails and the frame header routing information is credible, the CRC check result R_crc is determined to be 50 points; If the CRC check fails and the frame header routing information is not credible, the CRC check result R_crc is determined to be 0 points.
[0033] A failed CRC check is also a cause of infrared communication failure, which directly affects the infrared communication quality. The integrity of the received frame can be judged through the CRC check, so the CRC check result can be used as one of the indicators for evaluating communication quality.
[0034] The specific manner of obtaining the communication delay is: As Figure 2 shown, the MCU timer is used to record the time interval T from the end moment of the last pulse of the sent request frame to the end moment of the last pulse of the received response frame; Set the specified standard response time as T_std; If T≤T_std, the communication delay R_delay is determined to be 100 points; If T_std<T≤1.5T_std, the communication delay R_delay is determined to be 60 points; If T>1.5T_std, the communication delay R_delay is determined to be 30 points.
[0035] Step 103: Adjust the retransmission strategy for the next communication based on the real-time score, and execute the retransmission based on the adjusted retransmission strategy until the communication is successful or the maximum number of retries is reached. The retransmission strategy includes the number of retransmissions, the retransmission interval, and the encoding method.
[0036] Specifically, the formula for calculating the real-time score S(k) of this communication based on the three evaluation indicators is as follows: S(k)=α×R_rssi / 100+β×R_delay / 100+γ×R_crc / 100; Where α, β, and γ are the signal strength weight, time delay weight, and CRC check result weight, respectively, and satisfy α+β+γ=1.00.
[0037] On one hand, this invention breaks away from the traditional one-way communication mode of infrared meter reading ("one send, one receive") and establishes a closed-loop mechanism of sending, evaluating, optimizing, and retransmitting. By quantitatively scoring each communication result, the system can automatically sense the current channel status and dynamically adjust parameters without manual intervention. On the other hand, instead of focusing solely on the CRC check result, this invention introduces signal strength and communication latency as auxiliary evaluation indicators. This multi-dimensional evaluation system can distinguish the causes of failure (such as weak signal due to strong light interference, large latency due to busy meters, or bit errors due to line noise), thereby implementing more targeted error correction strategies. Furthermore, by dynamically adjusting the number of retransmissions, power, and encoding method, this invention can overcome interference from complex on-site environments when facing long-frame protocols such as DL / T 698.45, reducing the frequency of manual intervention due to communication failures, shortening the single-meter reading time, and making it suitable for outdoor scenarios with complex lighting conditions and strong sunlight.
[0038] Furthermore, the method also includes: As shown in Table 1, under normal conditions, the default settings are α=0.55, β=0.30, and γ=0.15; If the response signal strength R_rssi < 30 is detected three times consecutively, the weights are adjusted to α = 0.65, β = 0.20, and γ = 0.15. If the CRC check result R_crc < 50 is detected three times consecutively, the weights are adjusted to α = 0.45, β = 0.25, and γ = 0.30. If communication delay R_delay>80 is detected three times consecutively and R_rssi and R_crc are normal, then the weights are adjusted to α=0.60, β=0.15, and γ=0.25.
[0039] Table 1
[0040] Specifically, adjusting the retransmission strategy for the next communication based on the real-time score includes: If the real-time score S(k) ≥ 0.8, keep the current communication parameters unchanged; If 0.6≤S(k)<0.8, set the maximum number of retransmissions to 2, switch the encoding method, and add scrambling code 0x33 to the data; If S(k) < 0.6, set the maximum number of retransmissions to 3, adjust the infrared transmission power to the maximum value, switch to anti-interference coding mode, and add scrambling code 0x33; wherein, the infrared communication uses 900nm~1000nm infrared light modulated by a 38kHz carrier, and the application layer protocol adopts DL / T698.45 protocol.
[0041] like Figure 3 As shown, the infrared communication uses 900nm~1000nm infrared serial half-duplex communication with a 38kHz carrier. The so-called 38kHz carrier modulation means that after modulation, each bit of data is in the following states: OFF state = binary "1" = the light source is off, ON state = binary "0" = the light source is on. The light source is a 38kHz square wave.
[0042] The application layer protocol adopts DL / T 645 or DL / T 698.45. Since the mainstream protocol for smart meters is currently DL / T 698.45, the 645 protocol has shorter frames, making it less prone to failure. In contrast, the 698 protocol has longer frames, and most infrared communication failures encountered in the field are due to 698 protocol failures. Therefore, this invention primarily focuses on infrared communication using the DL / T 698.45 protocol.
[0043] Figure 4 This is a schematic diagram illustrating an infrared communication data transmission and processing process as provided in an exemplary embodiment. Figure 4As shown, the infrared transmission utilizes the physical light-emitting capability of an infrared diode to transmit infrared signals; 38K carrier modulation controls the switching of the 38kHz signal transmission bit rate, outputting a processed signal; protocol frame to bit stream conversion: the MCU's UART hardware converts DL / T 645 or DL / T 698 protocol frames into serial transmission bit rates and processes them according to the UART standard; transmission power adjustment: the MCU controls the transmission circuit to set the transmission power, i.e., control the current passing through the infrared emitting diode; infrared intensity detection: a PIN photodiode is used as a sampling device to convert infrared light intensity into an electrical signal; signal conditioning: the sampled electrical signal is amplified; AD conversion: the analog signal is converted into a digital signal for subsequent processing and analysis in the MCU; infrared reception and decoding: a standard 38K infrared receiver head performs infrared reception and decoding; serial data sampling and reception: the MCU's UART hardware processes the bit data stream according to the UART definition, converting it into byte data; protocol analysis and processing: within the MCU, the byte stream is converted into protocol frames, and CRC checks and normal protocol frame processing are performed, etc.
[0044] Figure 5 This is a schematic structural diagram of a device provided in an exemplary embodiment. Please refer to... Figure 5 At the hardware level, the device includes a processor 502, an internal bus 504, a network interface 506, memory 508, and non-volatile memory 510, and may also include other hardware required for its functions. One or more embodiments of the present invention can be implemented in software, for example, the processor 502 reads the corresponding computer program from the non-volatile memory 510 into memory 508 and then runs it. Of course, in addition to software implementation, one or more embodiments of the present invention do not exclude other implementation methods, such as logic devices or a combination of hardware and software, etc. That is to say, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.
[0045] Please refer to Figure 6 An adaptive anti-interference infrared meter reading device can be applied to, for example... Figure 6 The device shown, in order to implement the technical solution of the present invention, includes: The sending unit 601 is used to send a request frame to the target meter and receive a response frame returned by the target meter. The acquisition unit 602 is used to acquire three evaluation indicators for this communication and calculate the real-time score of this communication based on the three evaluation indicators; wherein the three evaluation indicators are the response signal strength, CRC check result, and communication delay. The retransmission unit 603 is configured to adjust the retransmission strategy for the next communication according to the real-time score, and perform retransmission based on the adjusted retransmission strategy until the communication succeeds or the maximum number of retries is reached, wherein the retransmission strategy includes the number of retransmissions, retransmission interval and coding mode.
[0046] Preferably, the acquiring unit 602 is specifically configured to: Before sending a downlink request frame, turn off the infrared transmitting tube, perform multiple samplings on the ambient light through the ADC of the MCU and take an average value to obtain an ambient baseline value; During each pulse high level period of the response frame, sample the output signal of the photodiode at the infrared receiving end through the ADC of the MCU, and take the sampling peak value; Calculate the response signal strength according to the ambient baseline value and the sampling peak value, with the calculation formula being: R_rssi=[(Sampling peak value Ambient baseline value) / 4095]×100; Wherein, R_rssi is the response signal strength.
[0047] Preferably, the acquiring unit 602 is specifically configured to: Check the received response frame by using the CRC-16 / CCITT reversed polynomial 0x8408; If the CRC values are completely matched, determine that the CRC check result R_crc is 100 points; If the CRC check fails and the frame header routing information is credible, determine that the CRC check result R_crc is 50 points; If the CRC check fails and the frame header routing information is not credible, determine that the CRC check result R_crc is 0 points.
[0048] Preferably, the acquiring unit 602 is specifically configured to: Use the MCU timer to record the time interval T from the end time of the last pulse of the sent request frame to the end time of the last pulse of the received response frame; Set the standard protocol response time as T_std; If T≤T_std, determine that the communication delay R_delay is 100 points; If T_std<T≤1.5T_std, determine that the communication delay R_delay is 60 points; If T>1.5T_std, determine that the communication delay R_delay is 30 points.
[0049] Preferably, the acquiring unit 602 is specifically configured to: S(k)=α×R_rssi / 100+β×R_delay / 100+γ×R_crc / 100; Where α, β, and γ are the signal strength weight, time delay weight, and CRC check result weight, respectively, and satisfy α+β+γ=1.00.
[0050] Furthermore, the device also includes: Setting unit 604 is used to set α=0.55, β=0.30, and γ=0.15 by default under normal conditions; The first adjustment unit 605 is used to adjust the weights as α=0.65, β=0.20, and γ=0.15 if the response signal strength R_rssi is detected less than 30 for three consecutive times. The second adjustment unit 606 is used to adjust the weights to α=0.45, β=0.25, and γ=0.30 if the CRC check result R_crc<50 is detected three times consecutively. The third adjustment unit 607 is used to adjust the weights as α=0.60, β=0.15, and γ=0.25 if communication delay R_delay>80 is detected three times in a row and R_rssi and R_crc are normal.
[0051] Preferably, the retransmission unit 603 is specifically used for: If the real-time score S(k) ≥ 0.8, keep the current communication parameters unchanged; If 0.6≤S(k)<0.8, set the maximum number of retransmissions to 2, switch the encoding method, and add scrambling code 0x33 to the data; If S(k) < 0.6, set the maximum number of retransmissions to 3, adjust the infrared transmission power to the maximum value, switch to anti-interference coding mode, and add scrambling code 0x33; The infrared communication uses 900nm~1000nm infrared light modulated by a 38kHz carrier, and the application layer protocol adopts the DL / T698.45 protocol.
[0052] The systems, devices, modules, or units described in the above embodiments can be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer, which can take the form of a personal computer, laptop computer, cellular phone, camera phone, smartphone, personal digital assistant, media player, navigation device, email sending and receiving device, game console, tablet computer, wearable device, or any combination of these devices.
[0053] In a typical configuration, a computer includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0054] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0055] Computer-readable media, including both permanent and non-permanent, removable and non-removable media, can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, disk storage, quantum memory, graphene-based storage media or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0056] For any other form of computer-readable medium (or computer-readable storage medium) as described above, computer instructions may be stored thereon, which, when executed by a processor, implement one or more of the above embodiments, thereby realizing the technical solution of the present invention.
[0057] The present invention also proposes a computer program that, when executed by a processor, implements one or more of the embodiments described above, thereby realizing the technical solution of the present invention. This computer program may be specifically recorded on the above-described or other computer-readable media, and the present invention does not impose any limitations on this.
[0058] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0059] The foregoing has described specific embodiments of the invention. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps described in the claims may be performed in a different order than that shown in the embodiments and still achieve the desired results. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are possible or may be advantageous.
[0060] The terminology used in one or more embodiments of the invention is for the purpose of describing particular embodiments only and is not intended to limit the invention. The singular forms “a,” “the,” and “the” used in one or more embodiments of the invention and in the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any or all possible combinations of one or more associated listed items.
[0061] It should be understood that although the terms first, second, third, etc., may be used to describe various information in one or more embodiments of the present invention, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, first information may also be referred to as second information without departing from the scope of one or more embodiments of the present invention, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to a determination."
[0062] The above description is merely a preferred embodiment of one or more embodiments of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of one or more embodiments of the present invention should be included within the protection scope of one or more embodiments of the present invention.
Claims
1. An adaptive anti-interference infrared meter reading method, characterized in that, A method applied to an infrared meter reading peripheral, the method comprising: Sending a request frame to a target electricity meter, and receiving a response frame returned by the target electricity meter; Acquiring three evaluation indicators of the current communication, and calculating a real-time score of the current communication according to the three evaluation indicators, wherein the three evaluation indicators are respectively response signal strength, CRC check result, and communication delay; Adjusting the retransmission strategy for the next communication according to the real-time score, and performing retransmission based on the adjusted retransmission strategy until the communication succeeds or the maximum number of retries is reached, wherein the retransmission strategy includes the number of retransmissions, retransmission interval, and coding mode.
2. The adaptive anti-interference infrared meter reading method according to claim 1, characterized in that, The acquiring three evaluation indicators of the current communication comprises: Before sending a downlink request frame, turning off the infrared transmitting tube, performing multiple samplings on ambient light through the ADC of the MCU, and taking the average value to obtain an ambient baseline value; During each pulse high-level period of the response frame, sampling the output signal of the photodiode at the infrared receiving end through the ADC of the MCU, and taking the sampling peak value; Calculating the response signal strength according to the ambient baseline value and the sampling peak value, wherein the calculation formula is: R_rssi=[(sampling peak value)] [Environmental baseline value) / 4095]×100; where R_rssi is the response signal strength.
3. The adaptive anti-interference infrared meter reading method according to claim 1, characterized in that, The acquiring three evaluation indicators of the current communication comprises: Performing check on the received response frame by using the CRC-16 / CCITT reversed polynomial 0x8408; If the CRC values are completely matched, determining that the CRC check result R_crc is 100 points; If the CRC check fails and the frame header routing information is credible, determining that the CRC check result R_crc is 50 points; If the CRC check fails and the frame header routing information is not credible, determining that the CRC check result R_crc is 0 points.
4. The adaptive anti-interference infrared meter reading method according to claim 1, characterized in that, The acquiring three evaluation indicators of the current communication comprises: Recording, by using an MCU timer, the time interval T from the end moment of the last pulse of the sent request frame to the end moment of the last pulse of the completely received response frame; Setting the protocol standard response time as T_std; If T≤T_std, determining that the communication delay R_delay is 100 points; If T_std<T≤1.5T_std, determining that the communication delay R_delay is 60 points; If T>1.5T_std, determining that the communication delay R_delay is 30 points.
5. The adaptive anti-interference infrared meter reading method according to claim 1, characterized in that, The formula for calculating the real-time score S(k) of the current communication according to the three evaluation indicators is: S(k)=α×R_rssi / 100+β×R_delay / 100+γ×R_crc / 100; where α, β, and γ are respectively the signal strength weight, the delay weight, and the CRC check result weight, and satisfy α+β+γ=1.
00.
6. The adaptive anti-interference infrared meter reading method according to claim 5, characterized in that, The method further comprises: In a conventional environment, α=0.55, β=0.30, and γ=0.15 are set by default; If the response signal strength R_rssi<30 is detected for 3 consecutive times, the weights are adjusted to α=0.65, β=0.20, and γ=0.15; If the CRC check result R_crc<50 is detected for 3 consecutive times, the weights are adjusted to α=0.45, β=0.25, and γ=0.30; If communication delay R_delay>80 is detected three times consecutively and R_rssi and R_crc are normal, then the weights are adjusted to α=0.60, β=0.15, and γ=0.
25.
7. The adaptive anti-interference infrared meter reading method according to claim 1, characterized in that, The step of adjusting the retransmission strategy for the next communication based on the real-time score includes: If the real-time score S(k) ≥ 0.8, keep the current communication parameters unchanged; If 0.6≤S(k)<0.8, set the maximum number of retransmissions to 2, switch the encoding method, and add scrambling code 0x33 to the data; If S(k) < 0.6, set the maximum number of retransmissions to 3, adjust the infrared transmission power to the maximum value, switch to anti-interference coding mode, and add scrambling code 0x33; The infrared communication uses 900nm~1000nm infrared light modulated by a 38kHz carrier, and the application layer protocol adopts the DL / T698.45 protocol.
8. An adaptive anti-interference infrared meter reading device, characterized in that, Applications to infrared meter reading peripherals include: Sending unit: sends a request frame to the target meter and receives a response frame returned by the target meter; Acquisition Unit: Acquires three evaluation indicators for this communication and calculates a real-time score for this communication based on the three evaluation indicators; wherein the three evaluation indicators are the response signal strength, CRC check result, and communication delay; Retransmission unit: Adjusts the retransmission strategy for the next communication based on the real-time score, and performs retransmission based on the adjusted retransmission strategy until communication is successful or the maximum number of retries is reached. The retransmission strategy includes the number of retransmissions, the retransmission interval, and the encoding method.
9. An electronic device, characterized in that, include: processor; Memory used to store processor-executable instructions; The processor implements the steps of the method as described in any one of claims 1-7 by running the executable instructions.
10. A computer-readable storage medium storing computer instructions thereon, characterized in that, When executed by the processor, this instruction implements the steps of the method as described in any one of claims 1-7.
