Analog quantity output value restoration method, system and device and storage medium

By calculating and repairing the error value of the analog output device in the PLC, the problem of inaccuracy of output value caused by aging of the analog output device is solved, and the accuracy of industrial control is improved.

CN118963236APending Publication Date: 2024-11-15SHENZHEN HUAMAO AOTE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411065237.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-05
Publication Date
2024-11-15

AI Technical Summary

Technical Problem

Analog output devices are prone to aging during long-term use, resulting in inaccurate output values ​​and affecting the accuracy of industrial control. The prior art is difficult to effectively solve the problem of output value deviation caused by aging.

Method used

By obtaining the analog output value in the target PLC, calculating the PLC error value and error ratio. If it exceeds the preset range, numerical repair will be performed to achieve self-repair and ensure the accuracy of the output value.

Benefits of technology

It effectively avoids the inaccuracy of output values ​​caused by aging of analog output equipment, improves the accuracy of industrial control, and prompts to be detected and sent for maintenance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118963236A_ABST
    Figure CN118963236A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of industrial PLCs, in particular to an analog quantity output value repairing method, system and device and a storage medium, applied to a target PLC, the target PLC is used for receiving an analog quantity output value of a target device, and the method comprises the following steps: obtaining the analog quantity output value of the target device at the current moment, and determining a first PLC value according to the analog quantity output value, the first PLC value is a standard PLC value corresponding to the analog quantity output value; calculating the analog quantity output value to obtain a second PLC value; determining a PLC error value and a PLC error proportion of the first PLC according to the first PLC numerical value and the second PLC numerical value; judging whether the error proportion exceeds a preset proportion interval or not; and if the error proportion exceeds a preset proportion interval, repairing the second PLC value according to the PLC error value to obtain a third PLC value. The beneficial effect of preventing the accuracy of the analog quantity output value from being influenced by the aging of the analog quantity output equipment can be realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of industrial PLC, and in particular to a method, system, device and storage medium for repairing analog output values. Background Art

[0002] During long-term use, the components of analog output devices will gradually wear out and age. This is a natural law that is difficult to avoid for any electronic device. Long-term operation will lead to a decline in component performance, which in turn causes device aging. In addition, the working environment has an important impact on its performance and service life. If the device is in a harsh environment such as high temperature, high humidity, and dust for a long time, its internal electronic components and circuits are easily damaged, which also leads to accelerated aging of the device and inaccurate analog output values, which are too high or too low.

[0003] In the prior art, the problem of easy aging of analog output devices is generally solved by regularly maintaining and calibrating the equipment, selecting high-quality and durable electronic components, and adding protective measures inside the equipment, such as dust covers, heat dissipation devices, etc., to reduce the impact of the external environment on the equipment to reduce the risk of equipment aging. However, in a complex working environment, facing the aged analog output equipment, the only way to ensure the normal progress of the entire work is to replace it. Before replacement, the aging of the analog output equipment often causes a certain amount of inaccuracy in the output data, which is not conducive to the accuracy requirements of industrial control.

[0004] Based on this, how to avoid the accuracy of analog output values ​​being affected by the aging of analog output devices is a technical problem that needs to be solved urgently. Summary of the invention

[0005] The purpose of the present application is to provide a method, system, device and storage medium for repairing analog output values, which can achieve the beneficial effect of avoiding the accuracy of analog output values ​​being affected by aging of analog output devices.

[0006] In a first aspect, the present application provides a method for repairing an analog output value, which is applied to a target PLC, wherein the target PLC is used to receive an analog output value of a target device, and the method comprises: S1: obtaining an analog output value of the target device at the current moment, and determining a first PLC value according to the analog output value, wherein the first PLC value is a standard PLC value corresponding to the analog output value; S2: Calculate the analog output value to obtain a second PLC value, where the second PLC value is a pre-display PLC value corresponding to the analog output value; S3: determining a PLC error value and a PLC error ratio of the first PLC according to the first PLC value and the second PLC value; S4: Determine whether the PLC error ratio exceeds a preset ratio range; S5: If the PLC error ratio exceeds the preset ratio interval, the second PLC value is repaired according to the PLC error value to obtain a third PLC value, where the third PLC value is an actual PLC value.

[0007] By adopting the above technical solution, the internal built-in ADC analog-to-digital converter of the analog output device (i.e., the target device) can obtain the analog output value of the current moment through measurement. In this case, the target PLC will obtain the expected display value corresponding to the target device. The value of the expected display value displayed on the target PLC is the first PLC value. The acquired analog output value is then calculated to obtain the second PLC value. The second PLC value refers to the value actually displayed on the target PLC without repair. For example, assuming that the theoretical value output by the target device should be 18200 (first PLC value) displayed on the target PLC, the second PLC value converted according to the measured analog output value is 17805. In this case, the PLC error value and the PLC error ratio are obtained according to the first PLC value and the second PLC value. It is determined whether the error is within an acceptable range according to the PLC error ratio. If not, the actually displayed PLC value is repaired according to the numerical value of the PLC error value. Based on this, self-repair is performed when the output value error is large, thereby achieving the beneficial effect of avoiding the accuracy of the analog output value affected by the aging of the analog output device.

[0008] Optionally, the formula used in the step of calculating the analog output value to obtain the second PLC value is: Among them, Y is the second PLC value, H is the upper limit of the target PLC range, L is the lower limit of the target PLC range, X is the analog output value, and B is the bit precision of the ADC analog-to-digital conversion used by the target PLC.

[0009] By adopting the above technical solution, after obtaining the analog output value, the second PLC value is obtained by calculation for preview, so as to determine whether the value needs to be repaired later. For example, assuming that the target device uses a 16-bit precision ADC analog-to-digital converter, the analog output value obtained at the current moment is 51000. The second PLC value obtained by calculation is 17805, which can be compared with the first PLC value to determine whether repair is needed later and the value that needs to be compensated during the repair.

[0010] Optionally, before the step of obtaining the analog output value at the current moment, the method includes: Determine whether the time difference between the current moment and the last repair determination moment reaches a preset time difference threshold, where the last repair determination moment is the moment corresponding to the last execution of step S4; If the current time has reached the preset time difference threshold from the previous repair determination time, steps S1 to S4 are executed.

[0011] By adopting the above technical solution, the time difference between the current moment and the last execution of step S4 is determined, that is, a self-check is performed at every preset time interval, thereby ensuring timely maintenance and detection during operation, and thus timely numerical repair.

[0012] Optionally, after the step of repairing the second PLC value according to the PLC error value if the PLC error ratio exceeds the preset ratio interval, the method includes: Obtaining the repair result corresponding to each of the repair determination moments, and determining the repair determination moment of executing step S5 as the repair moment; Determine whether the repair time within a preset time period reaches a preset repair threshold, the preset time period taking the current time as the end time; If the repair time in the preset time period reaches the preset repair threshold, a first prompt message is sent.

[0013] By adopting the above technical solution, if the current detection determines that repair is required, that is, executing step S5, it is determined whether the number of repair moments reaches the preset number within the preset time period before the current moment, that is, multiple repairs are performed within a certain period of time. In this case, it can be determined that the target device has serious aging problems, and the first prompt information is sent to the relevant personnel to facilitate maintenance.

[0014] Optionally, after the step of repairing the second PLC value according to the PLC error value if the PLC error ratio exceeds the preset ratio interval, the method includes: Determine a repair cumulative value according to the repair result; Determining whether the repair cumulative value exceeds a preset cumulative value threshold; If the repair cumulative value exceeds the preset cumulative value threshold, a second prompt message is sent.

[0015] By adopting the above technical solution, if step S5 needs to be executed after this detection, the current accumulated repair cumulative value is obtained. If the accumulated repair value reaches the preset cumulative value threshold, it may be difficult to achieve accurate numerical output no matter how the repair is performed. At this time, a second prompt message is sent to notify relevant personnel to repair or replace the target equipment.

[0016] Optionally, after the step of repairing the second PLC value according to the PLC error value to obtain a third PLC value if the PLC error ratio exceeds the preset ratio interval, the method includes: The preset time difference threshold is shortened according to a preset time difference unit.

[0017] By adopting the above technical solution, if step S5 is executed, the detection interval is shortened to increase the detection frequency, so as to timely identify the serious aging problem of the target device.

[0018] Optionally, the step of determining a PLC error value and a PLC error ratio of the first PLC according to the first PLC value and the second PLC value includes: According to the first PLC value and the second PLC value, the formula used to determine the PLC error value is: Err=Y-Yplc Wherein, Err is the PLC error value, Y is the second PLC value, and Yplc is the first PLC value; The formula used to determine the PLC error ratio is: Wherein, Err_p is the PLC error ratio.

[0019] A second aspect of the present application provides a system for repairing an analog output value, comprising: a first value acquisition module, used for acquiring the analog output value of the target device at the current moment, and determining a first PLC value according to the analog output value, wherein the first PLC value is a standard PLC value corresponding to the analog output value; a second value acquisition module, used for calculating the analog output value to obtain a second PLC value, wherein the second PLC value is a pre-display PLC value corresponding to the analog output value; an error parameter determination module, configured to determine a PLC error value and a PLC error ratio of the first PLC according to the first PLC value and the second PLC value; An error judgment module is used to judge whether the PLC error ratio exceeds a preset ratio range; A value repair module is used to repair the second PLC value according to the PLC error value to obtain a third PLC value if the PLC error ratio exceeds the preset ratio interval, and the third PLC value is the actual PLC value.

[0020] A third aspect of the present application provides an electronic device, including a memory and a processor, wherein the memory stores a computer program that can be loaded by the processor and execute the above-mentioned method for repairing the analog output value.

[0021] A fourth aspect of the present application provides a storage medium storing a computer program that can be loaded by a processor and execute the above-mentioned method for repairing analog output values.

[0022] In summary, the present application includes at least one of the following beneficial effects: 1. The analog output device (i.e., the target device) has an internal ADC analog-to-digital converter, which can obtain the analog output value at the current moment through measurement. In this case, the target PLC will obtain the expected display value corresponding to the target device. The value of the expected display value displayed on the target PLC is the first PLC value. The acquired analog output value is then calculated to obtain the second PLC value. The second PLC value refers to the value actually displayed on the target PLC without repair. For example, assuming that the theoretical value output by the target device should be 18200 (first PLC value) displayed on the target PLC, the second PLC value converted according to the measured analog output value is 17805. In this case, the PLC error value and the PLC error ratio are obtained according to the first PLC value and the second PLC value. It is determined whether the error is within an acceptable range according to the PLC error ratio. If not, the actually displayed PLC value is repaired according to the numerical value of the PLC error value. Based on this, self-repair is performed when the output value error is large, thereby achieving the beneficial effect of avoiding the accuracy of the analog output value affected by the aging of the analog output device.

[0023] 2. After obtaining the analog output value, the second PLC value is obtained through calculation for preview, so as to determine whether the value needs to be repaired later. For example, assuming that the target device uses a 16-bit precision ADC analog-to-digital converter, the analog output value obtained at the current moment is 51000. The second PLC value obtained by calculation is 17805, which can be compared with the first PLC value to determine whether repair is needed later and the value that needs to be compensated during the repair.

[0024] 3. If this detection determines that repair is needed, that is, execute step S5, then determine whether the number of repair moments reaches the preset number within the preset time period before the current moment, that is, multiple repairs are performed within a certain period of time. In this case, it can be determined that the target equipment has serious aging problems. At this time, the first prompt information is sent to the relevant personnel to facilitate maintenance. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] Figure 1 It is a flowchart of a method for repairing an analog output value provided in an embodiment of the present application; Figure 2 It is a virtual structural schematic diagram of the repair system of the analog output value provided by the present application. DETAILED DESCRIPTION

[0026] The following examples will help those skilled in the art to further understand the effects of the present application, but are not intended to limit the present application in any form. It should be noted that, for those of ordinary skill in the art, several modifications and improvements may be made without departing from the concept of the present application. These all fall within the scope of protection of the present application.

[0027] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.

[0028] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.

[0029] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0030] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.

[0031] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.

[0032] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.

[0033] In order to make the purpose, technical solution and advantages of the present application clearer, the analog output value repair method of the present application is explained below from the perspective of the analog output value repair device. The analog output value repair device can be an electronic device, and the electronic device can be, for example, a mobile phone terminal, a computer terminal and other devices.

[0034] The present application is further described in detail below in conjunction with the accompanying drawings.

[0035] Reference Figure 1 , is a flow chart of a method for repairing an analog output value provided in an embodiment of the present application. The method provided in the present application is applied to a target PLC, and the target PLC is used to receive an analog output value of a target device. The method includes: S1: obtaining an analog output value of the target device at the current moment, and determining a first PLC value according to the analog output value, wherein the first PLC value is a standard PLC value corresponding to the analog output value; S2: Calculate the analog output value to obtain a second PLC value, where the second PLC value is a pre-display PLC value corresponding to the analog output value; S3: determining a PLC error value and a PLC error ratio of the first PLC according to the first PLC value and the second PLC value; S4: Determine whether the PLC error ratio exceeds a preset ratio range; S5: If the PLC error ratio exceeds the preset ratio interval, the second PLC value is repaired according to the PLC error value to obtain a third PLC value, where the third PLC value is an actual PLC value.

[0036] The following is a detailed description of each step: In step S1, the analog output value of the target device at the current moment is obtained, and a first PLC value is determined according to the analog output value, where the first PLC value is a standard PLC value corresponding to the analog output value.

[0037] Specifically, the analog output device (i.e., the target device) has an internal ADC analog-to-digital converter, which can obtain the analog output value at the current moment through measurement. In this case, the target PLC will obtain the expected display value corresponding to the target device, and the value of the expected display value displayed on the target PLC is the first PLC value. For example, assuming that the analog output value of the target device is 51000, theoretically, it should be displayed on the target PLC as 18200 (the first PLC value), which is predetermined according to the output characteristics of the target device and serves as a standard for subsequent calibration and repair.

[0038] In step S2, the analog output value is operated to obtain a second PLC value, where the second PLC value is a pre-display PLC value corresponding to the analog output value.

[0039] Specifically, the second PLC value converted from the measured analog output value, that is, the value displayed by the PLC when no value repair has been performed in this detection, is first obtained by the relevant processor to perform the subsequent step of comparing the second PLC value with the first PLC value. The formula used to convert the analog output value is: Among them, Y is the second PLC value, H is the upper limit of the target PLC range, L is the lower limit of the target PLC range, X is the analog output value, and B is the bit precision of the ADC analog-to-digital conversion used by the target PLC.

[0040] For example, assuming that the target PLC's range (L to H) is -32000 to 32000, and the analog output value 16-bit X0 obtained at the current moment is 51000, then That is, the second PLC value Y0 is 17805, and this second PLC value is used for subsequent judgment and comparison of the error magnitude and as the subsequent repair reference value.

[0041] In step S3, according to the first PLC value and the second PLC value, determine the PLC error value and PLC error ratio of the first PLC.

[0042] Specifically, based on the first PLC value and the second PLC value, first determine their difference as the error value, and then determine their error ratio based on the ratio of the error value to the first PLC value. The PLC error value is used for difference compensation in subsequent repair, and the PLC error ratio is used to determine whether the error range is within an acceptable range, that is, within the preset ratio interval described below.

[0043] More specifically, the steps of determining the PLC error value and PLC error ratio of the first PLC according to the first PLC value and the second PLC value include: The formula for determining the PLC error value according to the first PLC value and the second PLC value is: Err = Y - Yplc where Err is the PLC error value, Y is the second PLC value, and Yplc is the first PLC value; The formula for determining the PLC error ratio is: where Err_p is the PLC error ratio.

[0044] For example, assume that the first PLC value is 18200 and the second PLC value is 17805. Then the PLC error value Err = Y - Yplc = -395, and then substitute the obtained PLC error value into That is, the PLC error ratio is obtained.

[0045] In step S4, determine whether the PLC error ratio exceeds the preset ratio interval.

[0046] Specifically, the preset ratio interval can be adjusted by relevant personnel through relevant control devices according to actual needs. For the convenience of description in the embodiments of the present application, take -0.01 < Err_p < 0.01 as an example. Combining the example in step S3, -0.0217 exceeds the preset acceptable error range, so step S5 is executed; otherwise, this detection is ended.

[0047] More specifically, before the step of obtaining the analog quantity output value at the current moment, the method includes: Determine whether the time difference between the current moment and the last repair determination moment reaches a preset time difference threshold, where the last repair determination moment is the moment corresponding to the last execution of step S4; If the current time has reached the preset time difference threshold from the previous repair determination time, steps S1 to S4 are executed.

[0048] Specifically, the time difference between the current moment and the last execution of step S4 is determined, that is, a self-check is performed at a preset interval, so as to ensure timely maintenance and detection during operation, so as to perform timely numerical repair. Step S5 is a trigger system, which is triggered only when the error exceeds the acceptable range. In addition, relevant personnel can also actively send control instructions through relevant control equipment to perform repairs. In this case, even if the PLC error ratio does not exceed the preset ratio range, calibration repair can be performed, that is, the following step S5.

[0049] In step S5, if the PLC error ratio exceeds the preset ratio interval, the second PLC value is repaired according to the PLC error value to obtain a third PLC value, and the third PLC value is an actual PLC value.

[0050] Specifically, when it is determined that the PLC error ratio exceeds the preset ratio interval, the second PLC value (displayed value before repair) is adjusted to the third PLC value (actual displayed value after repair) based on the PLC error value. In this embodiment, the repair formula Yplc can be used. new =Yplc+Err to adjust the value, where Yplc new is the third PLC value, Yplc is the second PLC value, Err is the PLC error value, that is, 18200-(-395)=18200+395=18595, wherein 18200 is the first PLC value in the example, -395 is the PLC error value, and the obtained 18595 is the third PLC value. In addition, the repair formula provided in this embodiment can be further improved by adding error correction terms, error weights, and error value compensation, so as to improve the accuracy and reliability of the PLC control system in practical applications. Each method has its specific application scenarios and technical requirements, so it is necessary to carefully consider when selecting an appropriate improvement strategy, and this application is not limited here.

[0051] More specifically, after the step of repairing the second PLC value according to the PLC error value if the PLC error ratio exceeds the preset ratio interval, the method includes: Obtaining the repair result corresponding to each of the repair determination moments, and determining the repair determination moment of executing step S5 as the repair moment; Determine whether the repair time within a preset time period reaches a preset repair threshold, the preset time period taking the current time as the end time; If the repair time in the preset time period reaches the preset repair threshold, a first prompt message is sent.

[0052] Specifically, if the error value determined in this detection exceeds the error range, historical data is obtained to obtain the repair time information of each execution step S5 in the historical record, that is, the relevant system will record each time the PLC display value is repaired, recording the repaired value, time point, and number of repairs. After the repair operation is performed this time, it is determined whether the number of repairs within a certain period of time (i.e., within a preset time period) exceeds the preset repair threshold, that is, whether multiple repairs or continuous repairs are performed within a certain period of time. If so, it is determined that the target device may have a serious aging problem, and even frequent adjustments may be difficult to obtain a more accurate output value. At this time, a first prompt message is sent to the relevant personnel, wherein the first prompt message can be audio information, display information such as indicator lights, text information, etc., which is not limited here.

[0053] More specifically, after the step of repairing the second PLC value according to the PLC error value if the PLC error ratio exceeds the preset ratio interval, the method further includes: Determine a repair cumulative value according to the repair result; Determining whether the repair cumulative value exceeds a preset cumulative value threshold; If the repair cumulative value exceeds the preset cumulative value threshold, a second prompt message is sent.

[0054] Specifically, after this detection determines that the error value exceeds the error range and repair is performed, it will be determined whether the cumulative repair value exceeds the cumulative repair value range, that is, the preset cumulative value threshold. The preset cumulative value threshold can be set by relevant personnel according to needs. If the cumulative repair value is too high, it is also likely that the target device is seriously aged, and no matter how the repair is performed, it is difficult to achieve the required accuracy. In this case, a second prompt message can be sent. The description of the second prompt message can refer to the above-mentioned first prompt message, and will not be repeated here.

[0055] Further, after the step of repairing the second PLC value according to the PLC error value to obtain a third PLC value if the PLC error ratio exceeds the preset ratio interval, the method includes: The preset time difference threshold is shortened according to a preset time difference unit.

[0056] Specifically, after the error value is determined to be beyond the error range in this test and repaired, the time for the next execution of steps S1 to S4 can be adjusted to shorten, that is, the frequency of analog output value detection is increased, and the accuracy of the output value is focused on, so as to timely identify the serious aging problems that may exist in the target device and improve the reliability of the data. If no repair is required for the next test, the preset time difference threshold can be adjusted back to the original setting to save computing power.

[0057] A second aspect of the present application provides a system for repairing an analog output value, comprising: A first value acquisition module 100 is used to acquire the analog output value of the target device at the current moment, and determine a first PLC value according to the analog output value, wherein the first PLC value is a standard PLC value corresponding to the analog output value; A second value acquisition module 200, for calculating the analog output value to obtain a second PLC value, wherein the second PLC value is a pre-display PLC value corresponding to the analog output value; An error parameter determination module 300, configured to determine a PLC error value and a PLC error ratio of the first PLC according to the first PLC value and the second PLC value; The error judgment module 400 is used to judge whether the PLC error ratio exceeds a preset ratio range; The value repair module 500 is used to repair the second PLC value according to the PLC error value to obtain a third PLC value if the PLC error ratio exceeds the preset ratio interval, and the third PLC value is the actual PLC value.

[0058] The specific definition of the repair device for analog output value can be found in the definition of the repair method for analog output value in the above text, which will not be repeated here. Each module in the above-mentioned repair device for analog output value can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0059] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.

[0060] The method for repairing an analog output value provided in an embodiment of the present application can be applied to terminal devices such as electronic devices, computers, wearable devices, vehicle-mounted devices, tablet computers, laptop computers, netbooks, personal digital assistants (PDA), augmented reality (AR) / virtual reality (VR) devices, mobile phones, etc. The embodiment of the present application does not impose any restrictions on the specific type of terminal devices.

[0061] The embodiment of the present application further provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps in each embodiment of the above method can be implemented.

[0062] An embodiment of the present application provides a computer program product. When the computer program product runs on a mobile terminal, the mobile terminal can implement the steps in each embodiment of the above method when executing the computer program product.

[0063] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may at least include: any entity or device that can carry the computer program code to the camera / terminal device, a recording medium, a computer memory, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), an electric carrier signal, a telecommunication signal, and a software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.

[0064] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0065] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0066] In the embodiments provided in the present application, it should be understood that the disclosed devices / network equipment and methods can be implemented in other ways. For example, the device / network equipment embodiments described above are only schematic. For example, the division of modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0067] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0068] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. A method for repairing an analog output value, applied to a target PLC, wherein the target PLC is used to receive the analog output value of a target device, characterized in that: The method comprises: S1: obtaining an analog output value of the target device at the current moment, and determining a first PLC value according to the analog output value, wherein the first PLC value is a standard PLC value corresponding to the analog output value; S2: Calculate the analog output value to obtain a second PLC value, where the second PLC value is a pre-display PLC value corresponding to the analog output value; S3: determining a PLC error value and a PLC error ratio of the first PLC according to the first PLC value and the second PLC value; S4: Determine whether the PLC error ratio exceeds a preset ratio range; S5: If the PLC error ratio exceeds the preset ratio interval, the second PLC value is repaired according to the PLC error value to obtain a third PLC value, where the third PLC value is an actual PLC value.

2. The method for repairing analog output value according to claim 1, characterized in that: The formula used in the step of calculating the analog output value to obtain the second PLC value is: Among them, Y is the second PLC value, H is the upper limit of the target PLC range, L is the lower limit of the target PLC range, X is the analog output value, and B is the bit precision of the ADC analog-to-digital conversion used by the target PLC.

3. The method for repairing analog output value according to claim 1, characterized in that: Before the step of obtaining the analog output value at the current moment, the method includes: Determine whether the time difference between the current moment and the last repair determination moment reaches a preset time difference threshold, where the last repair determination moment is the moment corresponding to the last execution of step S4; If the current time has reached the preset time difference threshold from the previous repair determination time, steps S1 to S4 are executed.

4. The method for repairing analog output value according to claim 3, characterized in that: After the step of repairing the second PLC value according to the PLC error value if the PLC error ratio exceeds the preset ratio interval, the method includes: Obtaining the repair result corresponding to each of the repair determination moments, and determining the repair determination moment of executing step S5 as the repair moment; Determine whether the repair time within a preset time period reaches a preset repair threshold, the preset time period taking the current time as the end time; If the repair time in the preset time period reaches the preset repair threshold, a first prompt message is sent.

5. The method for repairing analog output value according to claim 4, characterized in that: After the step of repairing the second PLC value according to the PLC error value if the PLC error ratio exceeds the preset ratio interval, the method includes: Determine a repair cumulative value according to the repair result; Determining whether the repair cumulative value exceeds a preset cumulative value threshold; If the repair cumulative value exceeds the preset cumulative value threshold, a second prompt message is sent.

6. The method for repairing analog output value according to claim 4, characterized in that: After the step of repairing the second PLC value according to the PLC error value to obtain a third PLC value if the PLC error ratio exceeds the preset ratio interval, the method includes: The preset time difference threshold is shortened according to a preset time difference unit.

7. The method for repairing analog output value according to claim 1, characterized in that: The step of determining a PLC error value and a PLC error ratio of the first PLC according to the first PLC value and the second PLC value comprises: According to the first PLC value and the second PLC value, the formula used to determine the PLC error value is: Err=Y-Yplc Wherein, Err is the PLC error value, Y is the second PLC value, and Yplc is the first PLC value; The formula used to determine the PLC error ratio is: Wherein, Err_p is the PLC error ratio.

8. A system for repairing analog output values, characterized in that: include: A first value acquisition module, used for acquiring the analog output value of the target device at the current moment, and determining a first PLC value according to the analog output value, wherein the first PLC value is a standard PLC value corresponding to the analog output value; A second value acquisition module, used for calculating the analog output value to obtain a second PLC value, wherein the second PLC value is a pre-display PLC value corresponding to the analog output value; an error parameter determination module, configured to determine a PLC error value and a PLC error ratio of the first PLC according to the first PLC value and the second PLC value; An error judgment module is used to judge whether the PLC error ratio exceeds a preset ratio range; A value repair module is used to repair the second PLC value according to the PLC error value to obtain a third PLC value if the PLC error ratio exceeds the preset ratio interval, and the third PLC value is the actual PLC value.

9. An electronic device, characterized in that: The invention comprises a memory and a processor, wherein the memory stores a computer program which can be loaded by the processor and executes the method for repairing an analog output value as claimed in any one of claims 1 to 7.

10. A storage medium, characterized in that: A computer program is stored which can be loaded by a processor and execute the method for repairing an analog output value as claimed in any one of claims 1 to 7.