Digital signal validity detection method, device, equipment, medium and product
By sampling the digital signal multiple times and dividing it into sub-signals, combining the duration and number of sampled values of the sub-signal, the problem of low accuracy in digital signal detection in the prior art is solved, and more efficient digital signal effectiveness detection is achieved .
Patent Information
- Application Number
- CN202211725466.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-30
- Publication Date
- 2025-02-11
- Estimated Expiration
- 2042-12-30
AI Technical Summary
The prior art has low detection accuracy in digital signal validity detection, and it is impossible to effectively determine whether the digital signal is disturbed during transmission.
By sampling the digital signal to be detected, multiple signal sample values are obtained, and the digital signal is divided into a first sub-digital signal and a second sub-digital signal according to the effective signal value range. The validity of the digital signal is comprehensively judged based on the duration of the sub-digital signal or the number of signal sampled values contained.
The accuracy of digital signal validity detection is improved, and it can more effectively determine whether the digital signal is disturbed during transmission, thereby ensuring the accuracy of subsequent processing.
Smart Images

Figure CN115987463B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of digital signal technology, and in particular to a method, device, equipment, medium and product for detecting the validity of a digital signal. Background Art
[0002] Digital signals refer to signals whose independent variables are discrete and whose dependent variables are also discrete. They are widely used in various industries because of their strong anti-interference ability, compatibility, and ease of storage. In order to ensure the accuracy of the information carried by digital signals, during the digital signal transmission process, the signal receiving device needs to perform validity detection on the received digital signal to determine whether the digital signal is interfered with during the transmission process, thereby ensuring the accuracy of subsequent processing based on the digital signal.
[0003] At present, the validity detection of digital signals mainly involves the signal receiving device sampling three times in a signal cycle of the digital signal after receiving the digital signal to obtain three signal values. If more than or equal to two signal values are within the valid signal value range, it means that the digital signal is valid; otherwise, it means that the digital signal is invalid.
[0004] However, the existing technology has the problem of low detection accuracy. Summary of the invention
[0005] The present application provides a method, device, equipment, medium and product for detecting the validity of a digital signal to solve the problem of low detection accuracy in the prior art.
[0006] In a first aspect, an embodiment of the present application provides a method for detecting validity of a digital signal, comprising:
[0007] Sampling the digital signal to be detected to obtain multiple signal sampling values;
[0008] Determine at least one first sub-digital signal and / or at least one second sub-digital signal from the digital signal to be detected according to the sampling order of each signal sampling value and the valid signal value range; wherein the valid signal value range is the signal value range of the digital signal to be detected when it is not interfered with, the signal sampling values included in each first sub-digital signal are continuous and are all outside the valid signal value range, and the signal sampling values included in each second sub-digital signal are continuous and are all within the valid signal value range;
[0009] A validity detection result of the digital signal to be detected is determined according to the at least one first sub-digital signal and / or the at least one second sub-digital signal, wherein the validity detection result is used to indicate whether the digital signal to be detected is valid.
[0010] In a possible design of the first aspect, determining a validity detection result of the digital signal to be detected according to the at least one first sub-digital signal and / or the at least one second sub-digital signal includes:
[0011] Determining a target first sub-digital signal from the at least one first sub-digital signal according to a duration of the at least one first sub-digital signal;
[0012] If the duration of the target first sub-digital signal is less than the target duration, the validity detection result of the digital signal to be detected is determined according to the duration of each second sub-digital signal, the target duration is the maximum duration of the invalid signal value in the valid signal, and the invalid signal value is the signal value outside the valid signal value range.
[0013] Optionally, if the duration of the target first sub-digital signal is less than the target duration, determining the validity detection result of the digital signal to be detected according to the duration of each second sub-digital signal includes:
[0014] If the duration of the target first sub-digital signal is less than the target duration, then the durations of all second sub-digital signals are accumulated, and the accumulated sum is determined as the effective duration of the digital signal to be detected;
[0015] Calculate the ratio of the effective duration of the digital signal to be detected to the total duration;
[0016] The validity test result is determined according to the ratio.
[0017] Optionally, determining the validity test result according to the ratio includes:
[0018] If the ratio is greater than or equal to the target ratio, a second validity detection result is output, the target ratio is the minimum ratio of the cumulative value of the duration of the valid signal value in the valid signal to the total duration of the valid signal, the valid signal value is a signal value within the valid signal value range, and the second validity detection result is used to indicate that the digital signal to be detected is valid;
[0019] If the ratio is less than the target ratio, a third validity detection result is output, where the third validity detection result is used to indicate that the digital signal to be detected is invalid.
[0020] Optionally, the method further includes:
[0021] If the duration of the target first sub-digital signal is greater than or equal to the target duration, a fourth validity detection result is output, where the fourth validity detection result is used to indicate that the digital signal to be detected is invalid.
[0022] In another possible design of the first aspect, sampling the digital signal to be detected to obtain a plurality of signal sampling values includes:
[0023] During the sampling process, the difference between the signal sampling value obtained by sampling at the current sampling time and the signal sampling value obtained by sampling at the previous sampling time is calculated;
[0024] According to the difference, adjusting the sampling frequency;
[0025] The digital signal to be detected continues to be sampled according to the adjusted sampling frequency to obtain the multiple signal sampling values.
[0026] In a second aspect, an embodiment of the present application provides a digital signal validity detection device, comprising:
[0027] An acquisition module is used to sample the digital signal to be detected and obtain multiple signal sampling values;
[0028] A determination module, configured to determine at least one first sub-digital signal and / or at least one second sub-digital signal from the digital signal to be detected according to a sampling order of each signal sampling value and a valid signal value range; wherein the valid signal value range is a signal value range of the digital signal to be detected when it is not interfered with, the signal sampling values included in each first sub-digital signal are continuous and are all outside the valid signal value range, and the signal sampling values included in each second sub-digital signal are continuous and are all within the valid signal value range;
[0029] The determination module is further used to determine a validity detection result of the digital signal to be detected according to the at least one first sub-digital signal and / or the at least one second sub-digital signal, wherein the validity detection result is used to indicate whether the digital signal to be detected is valid.
[0030] In a possible design of the second aspect, the determining module is specifically configured to:
[0031] Determining a target first sub-digital signal from the at least one first sub-digital signal according to a duration of the at least one first sub-digital signal;
[0032] If the duration of the target first sub-digital signal is less than the target duration, the validity detection result of the digital signal to be detected is determined according to the duration of each second sub-digital signal, the target duration is the maximum duration of the invalid signal value in the valid signal, and the invalid signal value is the signal value outside the valid signal value range.
[0033] Optionally, the determining module is specifically used to:
[0034] If the duration of the target first sub-digital signal is less than the target duration, then the durations of all second sub-digital signals are accumulated, and the accumulated sum is determined as the effective duration of the digital signal to be detected;
[0035] Calculate the ratio of the effective duration of the digital signal to be detected to the total duration;
[0036] The validity test result is determined according to the ratio.
[0037] Optionally, the determining module is specifically used to:
[0038] If the ratio is greater than or equal to the target ratio, a second validity detection result is output, the target ratio is the minimum ratio of the cumulative value of the duration of the valid signal value in the valid signal to the total duration of the valid signal, the valid signal value is a signal value within the valid signal value range, and the second validity detection result is used to indicate that the digital signal to be detected is valid;
[0039] If the ratio is less than the target ratio, a third validity detection result is output, where the third validity detection result is used to indicate that the digital signal to be detected is invalid.
[0040] Optionally, the device further comprises:
[0041] The output module is used to output a fourth validity detection result if the duration of the target first sub-digital signal is greater than or equal to the target duration, and the fourth validity detection result is used to indicate that the digital signal to be detected is invalid.
[0042] In another possible design of the second aspect, the acquisition module is specifically configured to:
[0043] During the sampling process, the difference between the signal sampling value obtained by sampling at the current sampling time and the signal sampling value obtained by sampling at the previous sampling time is calculated;
[0044] According to the difference, adjusting the sampling frequency;
[0045] The digital signal to be detected continues to be sampled according to the adjusted sampling frequency to obtain the multiple signal sampling values.
[0046] In a third aspect, an embodiment of the present application provides a signal receiving device, comprising: a processor, a memory, and computer program instructions stored in the memory and executable on the processor, wherein the processor is used to implement the first aspect and the methods provided by various possible designs when executing the computer program instructions.
[0047] In a fourth aspect, an embodiment of the present application may provide a measuring instrument for implementing the methods provided in the first aspect and various possible designs.
[0048] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, is used to implement the first aspect and the methods provided by various possible designs.
[0049] The validity detection method, device, equipment, medium and product of digital signals provided by the embodiments of the present application, in which: the signal receiving device samples the digital signal to be detected, obtains multiple signal sampling values, determines at least one first sub-digital signal and / or at least one second sub-digital signal from the digital signal to be detected according to the valid signal value range, the acquisition time and sampling frequency of the multiple signal sampling values, and determines the validity detection result of the digital signal to be detected according to the at least one first sub-digital signal and / or at least one second sub-digital signal. Among them, the signal sampling values contained in each first sub-digital signal are continuous and are all outside the valid signal value range, and the signal sampling values contained in each second sub-digital signal are continuous and are all within the valid signal value range. In this technical solution, it is possible to comprehensively judge whether the digital signal is valid based on the duration of each sub-digital signal or the number of signal sampling values contained, thereby improving the detection accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0051] Figure 1 A flowchart of a first embodiment of a method for detecting the validity of a digital signal provided in an embodiment of the present application;
[0052] Figure 2 A schematic diagram of the sampling time and signal sampling value provided in the embodiment of the present application;
[0053] Figure 3 A flowchart of a first embodiment of a method for detecting the validity of a digital signal provided in an embodiment of the present application;
[0054] Figure 4 A flowchart of a first embodiment of a method for detecting the validity of a digital signal provided in an embodiment of the present application;
[0055] Figure 5 A schematic diagram of the structure of a digital signal validity detection device provided in an embodiment of the present application.
[0056] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0057] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0058] Before introducing the embodiments of the present application, the application background of the embodiments of the present application is first explained:
[0059] Digital signals are often interfered with during transmission, resulting in loss or change of information carried by the digital signals. If the signal receiving device directly processes the interfered digital signal after receiving it, there will be problems with inaccurate processing. For example, in practical applications, the signal sending device may be a flow meter in a gas meter, and the signal receiving device may be a processing device in the gas meter. When a user uses natural gas, the flow meter can collect the natural gas flow value used by the user in real time, generate a metering pulse signal based on the natural gas flow value, and send it to the processing device. If the metering pulse signal is interfered with during the transmission of the metering pulse signal, the natural gas flow value carried by the metering pulse signal will change or be lost. For example, if the natural gas flow value carried by the metering pulse signal is A, the natural gas flow value will become B after being interfered with. At this time, if the processing device directly processes the interfered metering pulse signal, such as calculating the total natural gas flow used by the user based on the metering pulse signal, it will lead to over-calculation or under-calculation.
[0060] In order to solve the above problems, after the signal receiving device obtains the digital signal, it is also necessary to judge the validity of the digital signal to determine whether the information it carries is accurate. At present, the main way to judge whether the digital signal is valid is to add a software filtering algorithm to the signal receiving device. When the signal receiving device receives the digital signal, the digital signal is continuously sampled three times within a signal cycle through the software filtering algorithm. If more than or equal to two of the three signal values sampled are within the valid signal value range, it means that the digital signal is valid; otherwise, it means that the digital signal is invalid.
[0061] However, in practical applications, if the duration of an invalid signal value in a digital signal is too long, it means that the digital signal has been interfered with and is an invalid signal. However, since the existing technology determines whether a digital signal is valid only by the number of valid signal values obtained by sampling, without considering the impact of the duration of the invalid signal value on the validity, there is a problem of low detection accuracy.
[0062] Based on this, the present application proposes a method, device, equipment, medium and product for detecting the validity of a digital signal. After receiving the digital signal, the signal receiving device can sample it, obtain multiple signal sampling values, and divide the digital signal into multiple first sub-digital signals and multiple second sub-digital signals according to a preset valid signal value range, wherein the signal sampling values contained in each first sub-digital signal are continuous and are all outside the valid signal value range, and the signal sampling values contained in each second sub-digital signal are continuous and are all within the valid signal value range. In this way, it is possible to comprehensively judge whether the digital signal is valid based on the duration of each sub-digital signal or the number of signal sampling values contained, which can improve the accuracy of the judgment.
[0063] The technical solution of the present application is described in detail below through specific embodiments.
[0064] It should be noted that the following specific embodiments may be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.
[0065] Figure 1 The figure is a flow chart of the first embodiment of the method for detecting the validity of a digital signal provided in the embodiment of the present application. Figure 1 As shown, the validity detection method of the digital signal may include the following steps:
[0066] S101 , sampling a digital signal to be detected to obtain a plurality of signal sampling values.
[0067] In the present application, after receiving the digital signal to be detected sent by the signal sending device, the signal receiving device needs to perform validity detection on it to determine whether the digital signal is interfered during the signal transmission process. It should be understood that the signal receiving device and the signal sending device can be two independent devices in hardware, and the device can be a gas meter, a server, a terminal device, etc. The signal receiving device and the signal sending device can also be deployed on the same hardware. For example, the signal receiving device can be a processing device (such as a processing chip) in the gas meter, and the signal sending device can be a flow meter in the gas meter.
[0068] In this step, after the signal receiving device receives the digital signal to be detected sent by the signal sending device, this scheme needs to determine whether the digital signal to be detected is valid based on the signal value in the digital signal to be detected. Therefore, it is necessary to sample the digital signal to be detected first to obtain multiple signal sampling values.
[0069] In a possible implementation, the signal receiving device may sample the digital signal to be detected at a preset sampling frequency, thereby obtaining a plurality of signal sampling values.
[0070] Exemplarily, the preset sampling frequency may be once every 5 milliseconds, once every 10 milliseconds, once every 15 milliseconds, etc., which may be determined based on actual conditions, and the embodiments of the present application do not impose specific restrictions on this.
[0071] In another possible implementation, the signal receiving device may sample the digital signal to be detected by dynamically adjusting the sampling frequency, thereby obtaining multiple signal sampling values.
[0072] When the signal change of the digital signal to be detected is small, only a small number of signal sampling values need to be collected at a small sampling frequency to feedback the signal characteristics of the digital signal to be detected; when the signal change in the digital signal to be detected is large, more signal sampling values need to be collected at a large sampling frequency in order to better track the signal change of the digital signal to be detected, and the signal change can be reflected by the difference between adjacent signal sampling values. In other words, when sampling the digital signal to be detected, the signal receiving device can calculate the difference between the signal sampling value obtained by sampling at the current sampling moment and the signal sampling value obtained by sampling at the previous sampling moment, and dynamically adjust the sampling frequency according to the difference to determine the next acquisition moment.
[0073] It should be understood that the specific implementation process and principles of this implementation method can refer to Figure 3 The embodiments shown will not be described in detail here.
[0074] S102: Determine at least one first sub-digital signal and / or at least one second sub-digital signal from the digital signal to be detected according to the valid signal value range, the acquisition time and sampling frequency of multiple signal sampling values.
[0075] In this step, since the valid signal value and the invalid signal value jointly determine whether the digital signal to be detected is valid, after obtaining multiple signal sampling values, it is also necessary to divide the digital signal to be detected into at least one first sub-digital signal and / or at least one second sub-digital signal according to the multiple signal sampling values. The signal sampling values contained in each first sub-digital signal are continuous and are all outside the valid signal value range, and the signal sampling values contained in each second sub-digital signal are continuous and are all within the valid signal value range. In this way, at least one first sub-digital signal and / or at least one second sub-digital signal can be processed to determine whether the digital signal is valid from two aspects of the valid signal value and the invalid signal value.
[0076] The effective signal value range is the signal value range of the digital signal to be detected when it is not interfered with.
[0077] Optionally, the digital signal to be detected can be segmented according to the sampling order of each signal sampling value and the valid signal value range to obtain at least one first sub-digital signal and / or at least one second sub-digital signal. Specifically, it can be determined whether the current signal sampling value and the previous signal sampling value are both within the valid signal value range, or both are outside the valid signal value range. If so, no segmentation is performed; if not, the current signal sampling value is segmented from the signal sampling value collected at the previous acquisition moment.
[0078] Optionally, a line diagram of the collection time and the signal sampling value may be generated according to the collection time of multiple signal sampling values to depict the signal characteristics. Figure 2 This is a schematic diagram of the sampling time and signal sampling value provided in the embodiment of the present application. Figure 2 As shown, when the signal receiving device collects multiple signal collection values, it can represent the multiple signal collection values and the corresponding collection time in the form of a line graph. Figure 2 In the figure, the black dots are signal sampling values, and the valid signal value range is the range from the valid signal threshold to the high level. The digital signal to be detected can be segmented according to the sampling order of each signal sampling value and the valid signal value range, thereby obtaining 3 first sub-digital signals and 2 second sub-digital signals.
[0079] S103: Determine a validity detection result of the digital signal to be detected according to at least one first sub-digital signal and / or at least one second sub-digital signal.
[0080] In this step, after obtaining at least one first sub-digital signal and / or at least one second sub-digital signal, the validity detection result of the digital signal to be detected can be judged according to the duration of the sub-digital signal or the number of signal sampling values contained therein, wherein the validity detection result is used to indicate whether the digital signal to be detected is valid.
[0081] Among them, it is first necessary to preliminarily determine whether the digital signal to be detected is invalid based on at least one first sub-digital signal. When the digital signal to be detected is preliminarily determined to be valid, the validity detection result of the digital signal to be detected is further determined based on the second sub-digital signal.
[0082] Among them, according to at least one first sub-digital signal, preliminarily judging whether the digital signal to be detected is invalid can be achieved in the following two ways:
[0083] Method a: When a fixed sampling frequency is used to collect signal acquisition values, the number of invalid signal sampling values contained in the first sub-digital signal with the longest duration can be calculated. When the number of invalid signal sampling values is greater than or equal to a first preset number, the digital signal to be detected is considered invalid; otherwise, it is preliminarily determined that the digital signal to be detected is valid.
[0084] Method b: when using a fixed sampling frequency or a dynamic sampling frequency to collect signal acquisition values, determine whether there is any first sub-digital signal whose duration is greater than or equal to the target duration. If so, it is determined that the digital signal to be detected is invalid; if not, it is preliminarily determined that the digital signal to be detected is valid.
[0085] Optionally, determining the validity detection result of the digital signal to be detected according to the second sub-digital signal can be achieved in the following two ways:
[0086] Method 1: When a fixed sampling frequency is used to collect signal acquisition values, the total number of signal sampling values contained in all second sub-digital signals can be calculated. When the total number of signal sampling values exceeds a second preset number, a validity detection result indicating that the digital signal to be detected is valid is determined. Otherwise, a validity detection result indicating that the digital signal to be detected is invalid is determined.
[0087] Method 2: When a fixed sampling frequency or a dynamic sampling frequency is used to collect signal acquisition values, the total duration of all second sub-digital signals can be calculated, and the ratio of the total duration to the total duration of the digital signal to be detected can be calculated, and the validity detection result can be determined based on the ratio.
[0088] It should be understood that the specific implementation method and principle of method 2 can refer to Figure 4 The embodiments shown will not be described in detail here.
[0089] In actual application scenarios, in order to improve detection efficiency, the validity check is usually not performed after the entire digital signal to be detected is sampled, but the detection is performed while sampling. For example, the digital signal to be detected is sampled at the first sampling time, and the sampled signal sampling value is processed with the previously collected signal sampling value. If the validity test result of the digital signal to be detected can be directly obtained, the digital signal to be detected is no longer sampled. If not, the digital signal to be detected is continuously sampled at the second sampling time, and the above steps are repeated until the validity test result of the digital signal to be detected is obtained.
[0090] In this application scenario, when the multiple signal sampling values obtained by sampling are all outside the valid signal value range or all within the valid signal value range, and the validity detection result can be determined based on the multiple signal sampling values, the sampling of the digital signal to be detected is stopped. At this time, only the first sub-digital signal or the second sub-digital signal can be determined from the digital signal to be detected based on the multiple signal sampling values obtained by sampling.
[0091] The validity detection method of the digital signal provided in the embodiment of the present application is that the signal receiving device samples the digital signal to be detected, obtains multiple signal sampling values, determines at least one first sub-digital signal and / or at least one second sub-digital signal from the digital signal to be detected according to the valid signal value range, the acquisition time and sampling frequency of the multiple signal sampling values, and determines the validity detection result of the digital signal to be detected according to the at least one first sub-digital signal and / or at least one second sub-digital signal. Among them, the signal sampling values contained in each first sub-digital signal are continuous and are all outside the valid signal value range, and the signal sampling values contained in each second sub-digital signal are continuous and are all within the valid signal value range. In this technical solution, it is possible to comprehensively judge whether the digital signal is effective based on the duration of each sub-digital signal or the number of signal sampling values contained, thereby improving the detection accuracy and anti-interference ability.
[0092] Based on the above embodiments, Figure 3 The figure is a flow chart of the first embodiment of the method for detecting the validity of a digital signal provided in the embodiment of the present application. Figure 3 As shown, when the signal receiving device samples the digital signal to be detected by dynamically adjusting the sampling frequency, S101 may include the following steps:
[0093] S301. During the sampling process, calculate the difference between the signal sampling value obtained at the current sampling time and the signal sampling value obtained at the previous sampling time.
[0094] In this step, if the difference between the signal values in the digital signal to be detected is small, it means that the change of the signal values in the digital signal to be detected is small, and the signal sampling values collected by the smaller sampling frequency can feed back the signal characteristics of the digital signal to be detected. On the contrary, if the difference between the signal values in the digital signal to be detected is large, it means that the change of the signal values in the digital signal to be detected is large, and it is necessary to frequently sample the digital signal to be detected by a larger sampling frequency to obtain multiple signal collection values that can accurately feed back the signal characteristics of the digital signal to be detected. Therefore, it is necessary to calculate the difference between the signal sampling value obtained by sampling at the current sampling moment and the signal sampling value obtained by sampling at the previous sampling moment, so as to determine whether it is necessary to adjust the sampling frequency of the next collection according to the difference.
[0095] S302: Adjust the sampling frequency according to the difference.
[0096] In this step, the sampling frequency can be recalculated based on the difference between the signal sampling value obtained at the current sampling moment and the signal sampling value obtained at the previous sampling moment, so as to achieve the purpose of dynamically adjusting the sampling frequency according to the signal changes of the digital signal to be detected.
[0097] In a possible implementation, the linear relationship between the signal value and the sampling frequency may be acquired in advance, and the sampling frequency may be re-determined according to the difference calculated in S301 and the linear relationship, thereby adjusting the sampling frequency.
[0098] In another possible implementation, the difference can be compared with a preset signal value. If the difference is greater than or equal to the preset signal value, the sampling frequency is adjusted to the first sampling frequency. On the contrary, if the difference is less than the preset signal value, the sampling frequency is determined to be the second sampling frequency.
[0099] Exemplarily, the first sampling frequency may be once per millisecond, and the second sampling frequency may be once per ten milliseconds. It should be understood that the first sampling frequency and the second sampling frequency may also be pre-set to other values, which may be determined based on the work experience or experimental data of relevant staff, and the embodiments of the present application do not specifically limit this.
[0100] In the above two implementations, the difference value and the adjusted sampling frequency may be positively correlated, that is, when the difference value is larger, the adjusted sampling frequency is larger, and when the difference value is larger, the adjusted sampling frequency is smaller.
[0101] S303 : Continue to sample the digital signal to be detected according to the adjusted sampling frequency to obtain multiple signal sampling values.
[0102] In this step, after adjusting the sampling frequency, the digital signal to be detected can be sampled again according to the adjusted sampling frequency, and S301-S303 can be repeatedly executed after sampling until the sampling is completed, thereby achieving the purpose of dynamically adjusting the sampling frequency and obtaining multiple signal sampling values.
[0103] It should be understood that the conditions for determining the end of sampling may include the following two:
[0104] Condition 1: The last collectible signal value of the digital signal to be detected is collected through a fixed or dynamically adjusted sampling frequency.
[0105] Condition 2: The collected signal sampling values can be used to perform validity detection on the digital signal to be detected to obtain validity detection results.
[0106] In the above embodiment, the sampling frequency is dynamically adjusted by the difference between the signal sampling value obtained by sampling at the current sampling moment and the signal sampling value obtained by sampling at the previous sampling moment, so that when the digital signal to be detected changes greatly, the sampling frequency is increased to better track the signal changes, and when the signal changes slightly, the sampling frequency is reduced to save the processing resources of the signal receiving device.
[0107] Based on the above embodiments, Figure 4The figure is a flow chart of the first embodiment of the method for detecting the validity of a digital signal provided in the embodiment of the present application. Figure 4 As shown, S103 may include the following steps:
[0108] S401. Determine a target first sub-digital signal from at least one first sub-digital signal according to a duration of at least one first sub-digital signal.
[0109] In this step, when the invalid signal value lasts for too long, it means that the digital signal to be detected is disturbed for a long time, and the information carried has been destroyed, becoming an invalid signal. In other words, it is critical to determine whether the duration of the invalid signal value is too long. Therefore, this step needs to determine the target first sub-digital signal with the longest duration from at least one first digital signal, so that the duration of the target first sub-digital signal can be directly compared with the duration threshold to determine whether the detection digital signal is invalid.
[0110] That is to say, the target first sub-digital signal is the first sub-digital signal with the longest duration among the at least one first sub-digital signal.
[0111] S402: If the duration of the target first digital sub-signal is less than the target duration, determine the validity detection result of the digital signal to be detected according to the duration of each second digital sub-signal.
[0112] In this step, it is necessary to determine whether the duration of the target first sub-digital signal exceeds the target duration. When the duration of the target first sub-digital signal is greater than or equal to the target duration, it means that the digital signal to be detected has been interfered with and is an invalid signal. When the duration of the target first sub-digital signal is less than the target duration, it is necessary to further determine the validity of the digital signal to be detected based on the second sub-digital signal.
[0113] The target duration is the maximum duration of an invalid signal value in a valid signal, and the invalid signal value is a signal value outside the range of valid signal values.
[0114] In a possible implementation, S402 may be implemented by the following steps (1) to (3):
[0115] Step (1): if the duration of the target first digital sub-signal is less than the target duration, the durations of all second digital sub-signals are accumulated, and the accumulated sum is determined as the effective duration of the digital signal to be detected.
[0116] Step (2), calculating the ratio of the effective duration of the digital signal to be detected to the total duration.
[0117] Step (3), determining the validity test result according to the ratio.
[0118] In step (3), in a possible implementation, if the ratio is greater than or equal to the target ratio, a second validity detection result is output, and if the ratio is less than the target ratio, a third validity detection result is output. The target ratio is the minimum ratio of the cumulative value of the duration of the valid signal value in the valid signal to the total duration of the valid signal, the valid signal value is a signal value within the valid signal value range, the second validity detection result is used to indicate that the digital signal to be detected is valid, and the third validity detection result is used to indicate that the digital signal to be detected is invalid.
[0119] Exemplarily, the target ratio may be 80%, 85%, or 90%. It should be understood that the target ratio may also be other values, which may be determined based on actual conditions, and the embodiments of the present application do not limit this.
[0120] S403: If the duration of the target first digital sub-signal is greater than or equal to the target duration, output a fourth validity detection result.
[0121] In this step, when the duration of the target first sub-digital signal is greater than or equal to the target duration, it means that the digital signal to be detected has been interfered with and is an invalid signal. Then a fourth validity detection result can be output, which is used to indicate that the digital signal to be detected is invalid.
[0122] In the above embodiment, the validity of the digital signal to be detected is comprehensively judged by the invalid signal value and the valid signal value, and the influence of the duration of the invalid signal on the validity of the digital signal to be detected is taken into consideration, thereby accurately improving the accuracy of validity detection.
[0123] Optionally, in some embodiments, when the validity detection result is determined to indicate that the digital signal to be detected is invalid, the signal receiving device may send a signal resending instruction to the signal sending device, wherein the signal resending instruction is used to instruct the signal sending device to resend the digital signal to be detected to the signal receiving device.
[0124] It should be understood that in practical applications, different judgment combination strategies and sampling strategies can be selected according to different interference environments and application scenarios, so as to improve the anti-interference ability of the digital signal validity detection scheme and enhance the signal transmission efficiency.
[0125] In the prior art, when the number of samplings is small and the sampling frequency is low, the following two problems may occur:
[0126] Problem 1: Since the interference signal (invalid signal) also contains valid signal values, if the valid signal value in the interference signal happens to be collected during the acquisition process, there is a problem of misidentifying the interference signal as a valid signal.
[0127] Problem 2: When a valid signal is interfered by a regular interference source, regular invalid signal values will be generated. When the interference frequency is similar to the sampling frequency, the collected signal sampling values may mostly be invalid signal values, resulting in the problem of misidentifying the valid signal as an interference signal.
[0128] In the embodiment of the present application, the pre-configured minimum value of the dynamic sampling frequency and the fixed sampling frequency can be a relatively large value to ensure that sufficient signal sampling values can be sampled and the accuracy of the detection can be ensured. At the same time, based on the signal change, when the signal changes greatly, the sampling frequency is dynamically adjusted to effectively ensure that the signal sampling values obtained by sampling can accurately feedback the signal characteristics of the digital signal to be detected.
[0129] Compared with improving anti-interference ability and filtering interference signals through hardware modification, under specific interference, although the hardware modification method can filter interference signals, it will cause distortion of normal signals and there is a problem of losing part of the signal. In addition, the hardware modification method increases the complexity of the hardware, the product cost and the overall power consumption of the product. The validity detection scheme of digital signals provided by the present application can detect the validity of digital signals from the software level without changing the hardware, thereby reducing the complexity of the hardware, the product cost and the overall power consumption of the product. At the same time, the validity detection scheme of digital signals provided by the present application judges the validity of digital signals by signal sampling values, which will not cause distortion of normal signals and ensure the integrity of the digital signals to be detected.
[0130] Based on the validity detection solution of the digital signal provided in the above embodiment, two specific examples are given below to illustrate it in detail.
[0131] Example 1: The digital signal to be detected is sampled at a fixed sampling period of 10 milliseconds, with a maximum sampling period of 100 times.
[0132] 1.1) When there are more than or equal to 80 valid signal values among the sampled signal values, the sampling is stopped and the digital signal to be detected is considered valid.
[0133] 1.2) When there are greater than or equal to 20 invalid signal values among the sampled signal values, sampling is stopped and the signal is considered invalid.
[0134] 1.3) When there are greater than or equal to 80 valid signal values among the sampled signal values, and there are 3 consecutive invalid signal values, the signal is considered invalid.
[0135] Example 2: The digital signal to be detected is sampled at a dynamic sampling frequency. When the signal changes slightly, the sampling period is 10 milliseconds per second; when the signal changes significantly, the sampling period is 1 millisecond per second.
[0136] 2.1) When the ratio of the effective duration of the digital signal to be detected obtained by sampling to the total duration exceeds 80%, sampling is stopped and the signal is considered to be valid.
[0137] 2.2) When the maximum duration of the invalid signal value obtained by sampling exceeds 10 milliseconds, sampling is stopped and the signal is considered invalid.
[0138] 2.3) When the number of invalid signal values obtained by sampling exceeds 20, sampling is stopped and the signal is considered invalid.
[0139] The following is an embodiment of the device of the present application, which can be used to execute the embodiment of the method of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the method of the present application.
[0140] Figure 5 A schematic diagram of the structure of a digital signal validity detection device provided in an embodiment of the present application.
[0141] like Figure 5 As shown, the validity detection device 500 of the digital signal includes:
[0142] The acquisition module 501 is used to sample the digital signal to be detected and acquire a plurality of signal sampling values.
[0143] The determination module 502 is used to determine at least one first sub-digital signal and / or at least one second sub-digital signal from the digital signal to be detected according to the sampling order of each signal sampling value and the valid signal value range. The valid signal value range is the signal value range of the digital signal to be detected when it is not interfered with, the signal sampling values contained in each first sub-digital signal are continuous and are all outside the valid signal value range, and the signal sampling values contained in each second sub-digital signal are continuous and are all within the valid signal value range.
[0144] The determination module 502 is further configured to determine a validity detection result of the digital signal to be detected according to at least one first sub-digital signal and / or at least one second sub-digital signal, wherein the validity detection result is used to indicate whether the digital signal to be detected is valid.
[0145] In a possible design of the embodiment of the present application, the determination module 502 is specifically configured to:
[0146] A target first sub-digital signal is determined from the at least one first sub-digital signal according to the duration of the at least one first sub-digital signal.
[0147] If the duration of the target first sub-digital signal is less than the target duration, the validity detection result of the digital signal to be detected is determined according to the duration of each second sub-digital signal. The target duration is the maximum duration of the invalid signal value in the valid signal, and the invalid signal value is a signal value outside the valid signal value range.
[0148] Optionally, the determination module 502 is specifically configured to:
[0149] If the duration of the target first digital sub-signal is less than the target duration, the durations of all second digital sub-signals are accumulated, and the accumulated sum is determined as the effective duration of the digital signal to be detected.
[0150] Calculate the ratio of the effective duration of the digital signal to be detected to the total duration.
[0151] Based on the ratio, the effectiveness test result is determined.
[0152] Optionally, the determination module 502 is specifically configured to:
[0153] If the ratio is greater than or equal to the target ratio, a second validity detection result is output. The target ratio is the minimum ratio of the accumulated time length of the valid signal value in the valid signal to the total time length of the valid signal. The valid signal value is a signal value within the valid signal value range. The second validity detection result is used to indicate that the digital signal to be detected is valid.
[0154] If the ratio is less than the target ratio, a third validity detection result is output, and the third validity detection result is used to indicate that the digital signal to be detected is invalid.
[0155] Optionally, the digital signal validity detection device 500 further includes:
[0156] The output module is used to output a fourth validity detection result if the duration of the target first sub-digital signal is greater than or equal to the target duration, and the fourth validity detection result is used to indicate that the digital signal to be detected is invalid.
[0157] In another possible design of the embodiment of the present application, the acquisition module 501 is specifically used to:
[0158] During the sampling process, the difference between the signal sampling value obtained by sampling at the current sampling time and the signal sampling value obtained by sampling at the previous sampling time is calculated.
[0159] According to the difference, adjust the sampling frequency.
[0160] The digital signal to be detected continues to be sampled according to the adjusted sampling frequency to obtain multiple signal sampling values.
[0161] The digital signal validity detection device provided in the embodiment of the present application can be used to execute the digital signal validity detection method in any of the above embodiments. Its implementation principle and technical effect are similar and will not be repeated here.
[0162] It should be noted that it should be understood that the division of the various modules of the above device is only a division of logical functions. In actual implementation, they can be fully or partially integrated into one physical entity, or they can be physically separated. And these modules can all be implemented in the form of software calling through processing elements; they can also be all implemented in the form of hardware; some modules can also be implemented in the form of software calling through processing elements, and some modules can be implemented in the form of hardware. In addition, all or part of these modules can be integrated together, or they can be implemented independently. The processing element described here can be an integrated circuit with signal processing capabilities. In the implementation process, each step of the above method or each module above can be completed by an integrated logic circuit of hardware in the processor element or instructions in the form of software.
[0163] An embodiment of the present application provides a measuring instrument, which is used to implement the validity detection method of a digital signal provided in any of the aforementioned embodiments.
[0164] Exemplarily, the metering instrument may be a water meter, a gas meter, or other meters that can receive digital signals in practical applications.
[0165] An embodiment of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed on a computer, the computer executes the above-mentioned digital signal validity detection method.
[0166] The computer-readable storage medium mentioned above can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory, electrically erasable programmable read-only memory, erasable programmable read-only memory, programmable read-only memory, read-only memory, magnetic memory, flash memory, magnetic disk or optical disk. The readable storage medium can be any available medium that can be accessed by a general or special-purpose computer.
[0167] Optionally, a readable storage medium is coupled to a processor so that the processor can read information from the readable storage medium and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can be located in an application specific integrated circuit (ASIC). Of course, the processor and the readable storage medium can also exist in the device as discrete components.
[0168] An embodiment of the present application also provides a computer program product, which includes a computer program. The computer program is stored in a computer-readable storage medium. At least one processor can read the computer program from the computer-readable storage medium. When the at least one processor executes the computer program, the above-mentioned digital signal validity detection method can be implemented.
[0169] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
Claims
1. A method for detecting the validity of a digital signal, characterized in that: include: Sampling the digital signal to be detected to obtain multiple signal sampling values; Determine at least one first sub-digital signal and at least one second sub-digital signal from the digital signal to be detected according to the sampling order of each signal sampling value and the valid signal value range; wherein the valid signal value range is the signal value range of the digital signal to be detected when it is not interfered with, the signal sampling values included in each first sub-digital signal are continuous and are all outside the valid signal value range, and the signal sampling values included in each second sub-digital signal are continuous and are all within the valid signal value range; Determine, according to the at least one first sub-digital signal and the at least one second sub-digital signal, a validity detection result of the digital signal to be detected, wherein the validity detection result is used to indicate whether the digital signal to be detected is valid; Correspondingly, determining the validity detection result of the digital signal to be detected according to the at least one first sub-digital signal and the at least one second sub-digital signal includes: Determining a target first sub-digital signal from the at least one first sub-digital signal according to a duration of the at least one first sub-digital signal; If the duration of the target first sub-digital signal is less than the target duration, then determining the validity detection result of the digital signal to be detected according to the duration of each second sub-digital signal, the target duration is the maximum duration of the invalid signal value in the valid signal, and the invalid signal value is a signal value outside the valid signal value range; Correspondingly, if the duration of the target first sub-digital signal is less than the target duration, determining the validity detection result of the digital signal to be detected according to the duration of each second sub-digital signal includes: If the duration of the target first sub-digital signal is less than the target duration, then the durations of all second sub-digital signals are accumulated, and the accumulated sum is determined as the effective duration of the digital signal to be detected; Calculate the ratio of the effective duration of the digital signal to be detected to the total duration; The validity test result is determined according to the ratio.
2. The method according to claim 1, characterized in that: Determining the validity test result according to the ratio includes: If the ratio is greater than or equal to the target ratio, a second validity detection result is output, the target ratio is the minimum ratio of the cumulative value of the duration of the valid signal value in the valid signal to the total duration of the valid signal, the valid signal value is a signal value within the valid signal value range, and the second validity detection result is used to indicate that the digital signal to be detected is valid; If the ratio is less than the target ratio, a third validity detection result is output, where the third validity detection result is used to indicate that the digital signal to be detected is invalid.
3. The method according to claim 1 or 2, characterized in that: The method further comprises: If the duration of the target first sub-digital signal is greater than or equal to the target duration, a fourth validity detection result is output, where the fourth validity detection result is used to indicate that the digital signal to be detected is invalid.
4. The method according to claim 1, characterized in that: The step of sampling the digital signal to be detected and obtaining a plurality of signal sampling values comprises: During the sampling process, the difference between the signal sampling value obtained by sampling at the current sampling time and the signal sampling value obtained by sampling at the previous sampling time is calculated; According to the difference, adjusting the sampling frequency; The digital signal to be detected continues to be sampled according to the adjusted sampling frequency to obtain the multiple signal sampling values.
5. A digital signal validity detection device, characterized in that: include: An acquisition module is used to sample the digital signal to be detected and obtain multiple signal sampling values; A determination module, configured to determine at least one first sub-digital signal and at least one second sub-digital signal from the digital signal to be detected according to a sampling order of each signal sampling value and a valid signal value range; wherein the valid signal value range is a signal value range of the digital signal to be detected when it is not interfered with, the signal sampling values included in each first sub-digital signal are continuous and are all outside the valid signal value range, and the signal sampling values included in each second sub-digital signal are continuous and are all within the valid signal value range; The determination module is further used to determine a validity detection result of the digital signal to be detected according to the at least one first sub-digital signal and the at least one second sub-digital signal, wherein the validity detection result is used to indicate whether the digital signal to be detected is valid; Accordingly, the determining module is specifically used for: Determining a target first sub-digital signal from the at least one first sub-digital signal according to a duration of the at least one first sub-digital signal; If the duration of the target first sub-digital signal is less than the target duration, then determining the validity detection result of the digital signal to be detected according to the duration of each second sub-digital signal, the target duration is the maximum duration of the invalid signal value in the valid signal, and the invalid signal value is a signal value outside the valid signal value range; Accordingly, the determining module is specifically used for: If the duration of the target first sub-digital signal is less than the target duration, then the durations of all second sub-digital signals are accumulated, and the accumulated sum is determined as the effective duration of the digital signal to be detected; Calculate the ratio of the effective duration of the digital signal to be detected to the total duration; The validity test result is determined according to the ratio.
6. A measuring instrument, characterized in that: It comprises a processing device, wherein the processing device is used to implement the validity detection method of the digital signal as claimed in any one of claims 1 to 4.
7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, they are used to implement the validity detection method of a digital signal as described in any one of claims 1 to 4.
8. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, it is used to implement the validity detection method of a digital signal as claimed in any one of claims 1 to 4.
Citation Information
Patent Citations
Method and device for judging effectiveness of signal
CN102364946A
Charging pile CP signal voltage detection method and device
CN113655268A