Method for generating AD segment parameters of resistance sensor

By using the data set and deviation marks in the database to perform fine deviation compensation in the segmented linear method of the resistor sensor, the problem of large deviations in physical magnitude values ​​in traditional methods is solved, and the accuracy of calculation is improved.

CN119093934APending Publication Date: 2024-12-06SUZHOU LUZHIYAO TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411276536.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-12
Publication Date
2024-12-06

AI Technical Summary

Technical Problem

When the traditional segmented linear method calculates the physical quantity of the resistor sensor, the calculated value is deviated greatly in the middle of the segment, which affects the accuracy of the calculation.

Method used

By obtaining data groups from pre-established valid relational databases, determining whether to add or remove segments based on linear deviation values, and marking deviation marks in node segment data tables, increasing segment parameters for fine deviation compensation, forming a more Fine physical quantity calculation.

Benefits of technology

The accuracy of the calculated physical magnitude values ​​is improved, the deviation is reduced, and the calculation is enhanced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119093934A_ABST
    Figure CN119093934A_ABST
Patent Text Reader

Abstract

The invention discloses a method for generating AD segment parameters of a resistance sensor, and the method comprises the steps: S1, obtaining a first data group from a pre-established effective relation database, adding the AD value position of the first data group into a first segment, enabling the effective relation database to comprise a plurality of data groups, and enabling the data groups to comprise a plurality of data groups; each data group comprises an AD value and a corresponding physical quantity, and the plurality of data groups are arranged according to the AD value sequence; s2, stepping to a next data group; judging whether the linear deviation values of all data in the current segment are smaller than a preset control deviation value or not; when the first judgment result is yes, adding the next data group into the current segment; when the first judgment result is no, removing the current segment from the current data set, searching physical quantity zero crossing points in the current segment, AD value positions of the physical quantity zero crossing points, positive and negative maximum deviation values and AD value positions of the positive and negative maximum deviation values, and respectively storing the physical quantity zero crossing points and the AD value positions of the physical quantity zero crossing points in the current segment into corresponding node segment data tables; and judging whether positive and negative deviation values exist in the current segment at the same time.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of electronic technology, and in particular to a method for generating AD segmentation parameters of a resistance sensor. Background Art

[0002] In the application of resistive sensors, voltage divider circuits are often used to sample through A / D. The corresponding relationship between resistance value and physical quantity is usually described by a formula, but the calculation amount of this formula is very large, such as exponential and logarithmic calculations. If it is implemented using embedded microprocessor code, the code volume is large and the operation time is long, which is not conducive to embedded real-time and fast processing. Therefore, the more reasonable method is to segmentally linearize the formula. When the embedded code is used for calculation, the operation time is short and the code volume is small.

[0003] The traditional piecewise linear method extracts only a few data groups, and each data group only includes AD values ​​and corresponding physical quantity parameters to form a linear conversion parameter table. When the embedded code calculates the sensor physical quantity according to the linear conversion parameter table after collecting the AD value, each segment has only one slope, and the calculated physical quantity value often has a large deviation in the middle of the segment, such as Figure 1 shown.

[0004] The above contents are only used to assist in understanding the technical solution of the present invention and do not constitute an admission that the above contents are prior art. Summary of the invention

[0005] The main purpose of the present invention is to provide a method for generating AD segmented parameters of a resistance sensor, aiming to solve the problem that the physical quantity values ​​calculated by the traditional piecewise linear method in the prior art often have large deviations in the middle of the segment.

[0006] To achieve the above object, the present invention provides a method for generating AD segment parameters of a resistance sensor, comprising:

[0007] S1: Obtain a first data group from a pre-established valid relational database, and add its AD value position to a first segment, wherein the valid relational database includes a plurality of data groups, each data group includes an AD value and a corresponding physical quantity, and the plurality of data groups are arranged in order of AD values;

[0008] S2: step by step increase the AD value position of the next data group;

[0009] Determine whether the linear deviation values ​​of all data in the current segment are less than the preset control deviation value;

[0010] When the first judgment result is yes, the next data group is added to the current segment;

[0011] When the first judgment result is no, remove the current data group from the current segment and traverse the data group back to the previous data group, search for the physical quantity zero-crossing point and its AD value position, the positive and negative maximum deviation values ​​and their AD value positions in the current segment, and store them in the corresponding node segment data table respectively;

[0012] Determine whether there are both positive and negative deviation values ​​in the current segment;

[0013] When the second judgment result is yes, a first deviation mark is added to the data in the current segment and stored in the corresponding node segment data table;

[0014] When the second judgment result is no, a second deviation mark is marked on the data in the current segment and stored in the corresponding node segment data table;

[0015] S3: Determine whether the last data group has been traversed;

[0016] When the third judgment result is no, enter the next segment and jump to S2;

[0017] When the third judgment result is yes, the last data group is recorded as the final node and all node segment data tables are output.

[0018] Preferably, in the method for generating AD segment parameters of the resistance sensor, before the step of sequentially traversing the data groups in the pre-established valid relational database, the method further comprises:

[0019] Build an effective relational database.

[0020] Preferably, in the method for generating AD segment parameters of the resistance sensor, the step of establishing a valid relationship database includes:

[0021] According to the AD full-scale value, calculate the voltage list of the corresponding voltage divider circuit;

[0022] According to the voltage list, calculate the corresponding sensor resistance value list;

[0023] According to the relationship function between the physical quantity and the resistance of the sensor, a list of physical quantity data corresponding to the list of sensor resistance values ​​is calculated, and a corresponding table between AD values ​​and physical quantities is formed;

[0024] The valid relationship database is determined according to the formed correspondence table between AD values ​​and physical quantities and the upper and lower limit values ​​of the physical quantities of the sensor.

[0025] Preferably, in the method for generating AD segment parameters of the resistance sensor, the resistance sensor is a temperature sensor, a humidity sensor, or a resistive pressure sensor.

[0026] Preferably, in the method for generating AD segmentation parameters of the resistance sensor, the resistance sensor is a temperature sensor;

[0027] Correspondingly, according to the relationship function between the physical quantity and resistance of the sensor, a physical quantity data list corresponding to the sensor resistance value list is calculated, and a corresponding table between AD value and physical quantity is formed. The relationship function between the physical quantity and resistance of the sensor is:

[0028] R2=EXP(B*(1 / T2-1 / T1)+LN(R1));

[0029] in,

[0030] R2 is the resistance value corresponding to T2;

[0031] R1 is the reference resistance value corresponding to the sensor;

[0032] T1 is the reference temperature value corresponding to the sensor;

[0033] B is the variation coefficient value corresponding to the sensor;

[0034] T2 is the temperature value to be calculated.

[0035] In order to achieve the above object, the present invention also provides an AD segment calculation method, comprising:

[0036] According to the segment node data table generated by the above generation method, AD segment calculation is performed.

[0037] In order to achieve the above object, the present invention also provides a device for generating AD segment parameters of a resistance sensor, characterized in that:

[0038] an acquisition unit, configured to acquire a first data group from a pre-established valid relational database, and add its AD value position to the first segment, wherein the valid relational database includes a plurality of data groups, each data group includes an AD value and a corresponding physical quantity, and the plurality of data groups are arranged in order of AD values;

[0039] A stepping unit is used to stepwise increase the AD value position of the next data group; judge whether the linear deviation values ​​of all data in the current segment are less than the preset control deviation value; when the first judgment result is yes, add the next data group to the current segment and traverse the data groups to return to the previous data group; when the first judgment result is no, remove the current data group from the current segment, search for the zero-crossing point of the physical quantity and its AD value position, the positive and negative maximum deviation values ​​and their AD value positions in the current segment, and store them in the corresponding node segment data table respectively;

[0040] Determine whether there are both positive and negative deviation values ​​in the current segment; when the second determination result is yes, mark the data in the current segment with a first deviation identifier and store it in the corresponding node segment data table; when the second determination result is no, mark the data in the current segment with a second deviation identifier and store it in the corresponding node segment data table;

[0041] The judgment unit is used to judge whether the last data group has been traversed; when the third judgment result is no, enter the next segment and jump to the step unit; when the third judgment result is yes, record the last data group as the end node and output all node segment data tables.

[0042] In order to achieve the above object, the present invention further provides an AD segment calculation device, comprising:

[0043] The calculation unit is used to perform AD segment calculation according to the segment node data table generated by the above-mentioned generating device.

[0044] In order to achieve the above object, the present invention further provides a computer device, comprising:

[0045] at least one processor; and,

[0046] a memory communicatively connected to the at least one processor; wherein,

[0047] The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the above-mentioned method for generating AD segment parameters of the resistance sensor or the above-mentioned AD segment calculation method.

[0048] In order to achieve the above object, the present invention also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the above-mentioned method for generating AD segmentation parameters of a resistance sensor or the above-mentioned AD segmentation calculation method.

[0049] The present invention has at least the following beneficial effects:

[0050] The present invention improves the traditional piecewise linear algorithm by adding more parameters to the piecewise linear table. The added parameters are used to perform fine deviation compensation after preliminary piecewise calculation, so that the deviation of the calculated physical value is small.

[0051] Furthermore, in the node segmentation data table, for each data group in a segment with bidirectional deviation, the AD value, the corresponding physical quantity value, the segment data deviation mark, the first maximum deviation value of the segment and its corresponding AD value, the second maximum deviation value of the segment and its corresponding AD value, and the AD value corresponding to the data group of the physical quantity zero crossing point in the segment; for each data group in a segment with only unidirectional deviation, the AD value, the corresponding physical quantity value, the segment data deviation mark, the first maximum deviation value of the segment and its corresponding AD value are included. In this way, the calculated physical quantity value can be compensated more precisely, and the accuracy of the calculation can be improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] Figure 1 It is a data deviation diagram solved by a traditional piecewise linear table in the prior art;

[0053] Figure 2 A comparison chart of deviation values ​​between the algorithm of the present invention and the traditional algorithm;

[0054] Figure 3 It is a flow chart of the method for generating AD segmentation parameters of the resistance sensor of the present invention;

[0055] Figure 4 is a schematic diagram of a computer device of the present invention;

[0056] Figure 5 This is a comparison table of deviation values ​​between the algorithm of the present invention and the traditional algorithm.

[0057] The purpose, features and advantages of the present invention will be further described with reference to the accompanying drawings in conjunction with the embodiments. DETAILED DESCRIPTION

[0058] The technical solution of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments. The present invention will be described in detail below with reference to the accompanying drawings and in conjunction with the embodiments. It should be noted that the embodiments of the present invention and the features in the embodiments can be combined with each other without conflict.

[0059] In the embodiments of the present invention, the term "and / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B may represent three situations: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the associated objects before and after are in an "or" relationship.

[0060] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.

[0061] In the embodiments of the present invention, the term "plurality" refers to two or more than two, and other quantifiers are similar.

[0062] In the present invention, unless otherwise specified, the directional words used, such as "up, down, top, bottom", usually refer to the directions shown in the drawings, or to the components themselves in the vertical, perpendicular or gravity directions; similarly, for ease of understanding and description, "inside and outside" refer to the inside and outside relative to the outline of each component itself, but the above-mentioned directional words are not used to limit the present invention.

[0063] In order to make the purpose, technical scheme and advantages of the embodiments of the present invention clearer, the embodiments of the present invention will be described in detail below in conjunction with the accompanying drawings. However, it can be understood by those skilled in the art that in the embodiments of the present invention, many technical details are proposed in order to enable the reader to better understand the present invention. However, even without these technical details and various changes and modifications based on the following embodiments, the technical scheme claimed in the present invention can also be implemented. The division of the following embodiments is for the convenience of description and should not constitute any limitation on the specific implementation of the present invention. The various embodiments can be combined and referenced with each other under the premise of no contradiction.

[0064] The present invention provides a method for generating AD segmentation parameters of a resistance sensor. The resistance sensor may be, but is not limited to, a temperature sensor, a humidity sensor, or a resistive pressure sensor. In other embodiments, the corresponding sensor type may be set as required. When the resistance sensor is a temperature sensor, the corresponding physical quantity is temperature; when the resistance sensor is a humidity sensor, the corresponding physical quantity is humidity. Figure 3 A flow chart of a method for generating AD segment parameters of a resistance sensor is shown.

[0065] At step 101, the voltage list of the corresponding voltage divider circuit is calculated according to the AD full scale value. Taking the AD full scale of 1024 as an example, it is necessary to calculate the voltage list of the corresponding voltage divider circuit between 0-1023. The specific calculation method can be a conventional calculation method. If the full scale is 1024, then 1024 voltage values ​​of the corresponding voltage divider circuit will be generated.

[0066] At step 102, a corresponding sensor resistance value list is calculated based on the voltage list. Taking the AD full scale of 1024 as an example, 1024 voltage values ​​can be calculated accordingly. Similarly, each voltage value has a corresponding resistance value, so the corresponding 1024 resistance values ​​can be calculated. Each voltage value corresponds to its resistance value.

[0067] At step 103, according to the relationship function between the physical quantity and resistance of the sensor, a list of physical quantity data corresponding to the list of sensor resistance values ​​is calculated, and a corresponding table between AD values ​​and physical quantities is formed. It should be noted that the sensor can be a humidity sensor, a temperature sensor, or a resistive pressure sensor. When the sensor is a humidity sensor, the physical quantity of the sensor corresponds to the humidity value; when the sensor is a temperature sensor, the physical quantity of the sensor corresponds to the temperature value. Taking the AD full scale as 1024 and the physical quantity as the temperature value as an example, the temperature value corresponding to each resistance value can be calculated, and a table of the relationship between the AD value and the physical quantity can be formed.

[0068] The function of the relationship between the physical quantity of the sensor and the resistance may be different for different sensors. For example, the function of the relationship between the physical quantity of the sensor and the resistance is: R2 = EXP (B * (1 / T2-1 / T1) + LN (R1));

[0069] in,

[0070] R2 is the resistance value corresponding to T2;

[0071] R1 is the reference resistance value corresponding to the sensor;

[0072] T1 is the reference temperature value corresponding to the sensor;

[0073] B is the variation coefficient value corresponding to the sensor;

[0074] T2 is the temperature value to be calculated.

[0075] For different sensors, R1 and T1 may be different. For example, in this embodiment, R1 is 5000 ohms and T1 is 25°C.

[0076] At step 104, the effective relation database is determined based on the formed correspondence table between AD values ​​and physical quantities and the upper and lower limits of the physical quantities of the sensor. According to the upper and lower limits of the physical quantities of the sensor, the correspondence between the AD values ​​and the physical quantities formed in step 103 can be obtained by taking the data within the upper and lower limits of the physical quantities of the sensor. In this way, an effective relation database can be formed. In the effective relation data, each data group corresponds to an AD value and the physical quantity value corresponding to the AD value. In the effective relation database, each data group is sorted according to the order of the AD value. For example, in the effective relation database, the first data group T_AD_L I ST[0] stores the AD value and the corresponding physical quantity value in the first data group, the second data group T_AD_L I ST[1] stores the AD value and the corresponding physical quantity value in the second data group, and so on.

[0077] In step 105, the first data group of T_AD_L I ST[0] is taken as the first segment node, and its corresponding AD value and physical quantity value. Specifically, the first data group is obtained from a pre-established valid relational database, and its AD value position is added to the first segment, wherein the valid relational database includes multiple data groups, each data group includes an AD value and a corresponding physical quantity, and the multiple data groups are arranged in the order of AD values. Figure 2 As shown, there are 6 segments in total (the 6th segment is not marked). In step 105, the first data group in the valid relational database is taken and added to the first segment.

[0078] In step 106, the AD value position of the data group is incremented by 1, and the next data group is obtained. The sequence number of each data group is incremented by 1. For example, if the data group obtained last time is T_AD_L I ST[0], then the data group obtained this time is T_AD_L I ST[1], and the data group obtained next time will be T_AD_L I ST[2], and so on. Assuming that the AD value in the data group T_AD_L I ST[0] is 25, then the AD value of T_AD_L I ST[1] is 26, and so on.

[0079] like Figure 5 As shown, Figure 5 There are 16 data groups in it, a row of data with an AD value of 25 is the first data group T_AD_L I ST[0], a row of data with an AD value of 26 is the second data group T_AD_L I ST[1], and so on.

[0080] In step 107, it is determined whether the linear deviation values ​​of all data in the current segment are less than the preset control deviation value. If the first judgment result is yes, the next data group is added to the current segment and the judgment is continued. Assuming that the current segment is still in the first segment, it is determined whether the deviation values ​​of the physical quantities corresponding to all data groups in the first segment and the actual physical quantities are less than the preset control deviation value. Figure 2 As shown, the deviation between the actual physical quantity corresponding to each data group in the first section and the physical quantity calculated by the traditional method is the linear deviation value of each data group data, that is, the absolute value of the deviation between the actual physical quantity of each data group in the first section and the physical quantity calculated by the traditional method. The preset control deviation value is set according to the requirements.

[0081] Assuming that the linear deviation values ​​of all data in the current segment are less than the preset control deviation value, then continue to take the next data group, and continue to judge whether the linear deviation values ​​of all data after the current segment is added to the next data group are less than the preset control deviation value. If the condition is still met, continue to take the next data group; if the condition is not met, the currently taken data group is not used as the data in the current segment, and step 108 is executed to return to the previous data group. The previous data group is the end position of the current segment and also the starting position of the next segment.

[0082] For example, after taking T_AD_L I ST[0], continue to take T_AD_L I ST[1]. T_AD_L I ST[0] and T_AD_L IST[1] are both data in the first segment. At this time, determine whether the linear deviation values ​​of all data in the first segment are less than the preset control deviation value. When the linear deviation values ​​of all data in the first segment are less than the preset control deviation value, continue to take T_AD_L IST[2] and add it to the first segment; continue to determine whether the linear deviation values ​​of all data in the first segment are less than the preset control deviation value. If the determination result is no, move T_AD_L I ST[2] out of the first segment. At this time, T_AD_L I ST[1] is used as the currently traversed data, and T_AD_L I ST[1] is used as the end position of the first segment and the starting position of the second segment; continue to take T_AD_L I ST[2]. At this time, T_AD_L I ST[1] and T_AD_L I ST[2] are the data of the second segment. Determine whether the linear deviation values ​​of all data in the second segment are less than the preset control deviation value, and so on.

[0083] In step 109, the current data group removes the current segment, searches for the zero-crossing point of the physical quantity in the current segment and its AD value position, the positive and negative maximum deviation values ​​and their AD value positions, and stores them in the corresponding node segment data table. At this time, the judgment result of step 107 is no. It should be noted that the zero-crossing point of the physical quantity in the current segment is a data group with a positive and negative deviation value of 0, and the actual physical quantity in this data group - the physical quantity calculated by the traditional method is 0. Figure 2As shown, there is no zero point of physical quantity in the first segment, the second segment, the fourth segment, the fifth segment, and the sixth segment, while there is a data group with a zero point of physical quantity in the third segment. The maximum positive and negative deviation value is the absolute value of the deviation value between the actual physical quantity and the traditionally calculated physical quantity in the segment. When the deviation value between the actual physical quantity and the traditionally calculated physical quantity in the segment is greater than 0, it is a negative deviation; when the deviation value between the actual physical quantity and the traditionally calculated physical quantity in the segment is less than 0, it is a positive deviation. The maximum deviation of the first segment is a negative deviation, and there is a data group with the largest negative deviation in the first segment. The maximum deviation of the second segment is also a negative deviation, and there is a data group with the largest negative deviation in the second segment. The third segment has both negative and positive deviations, so the deviation value of 0 in the third segment is the data group with the zero point of physical quantity.

[0084] At step 110, it is determined whether there are both positive and negative deviation values ​​in the current segment. Figure 1 For example, the first segment only has negative deviations, the second segment only has negative deviations, and the third segment has both negative deviations and positive deviations. When there are both positive and negative deviations in the current segment, step 112 is executed, and all data in the current segment need to be marked with the second deviation mark and stored in the corresponding node segment data table. When there are not both positive and negative deviations in the current segment, step 111 is executed, and all data in the current segment need to be marked with the first deviation mark and stored in the corresponding node segment data table. When there is a two-way deviation in the segment, each node in the segment in the node segment data table includes the following data: AD value, corresponding physical quantity value, segment data deviation mark, the first maximum deviation value of the segment and its corresponding AD value, the second maximum deviation value of the segment and its corresponding AD value, and the AD value corresponding to the data group of the physical quantity zero crossing point in the segment; when there is no two-way deviation in the segment, each node in the segment in the node segment data table includes the following data: AD value, corresponding physical quantity value, segment data deviation mark, the first maximum deviation value of the segment and its corresponding AD value.

[0085] It should be understood that the segment data deviation flag indicates whether there is a bidirectional deviation in each segment. If there is a bidirectional deviation in the segment, the segment data is marked as the second deviation flag, or the segment data deviation flag of the segment can be set to 1; if there is no bidirectional deviation in the segment, the segment data is marked as the first deviation flag, or the segment data deviation flag of the segment can be set to 0. The specific flag used to mark whether there is a bidirectional deviation in each segment can also be indicated according to specific needs.

[0086] Among them, when the segment where the data group is located only has the maximum positive deviation, the segment data deviation mark is represented as the first deviation mark; when the segment where the data group is located only has the maximum negative deviation, the segment data deviation mark is represented as the first deviation mark; when the segment where the data group is located has both the maximum positive deviation and the maximum negative deviation, the segment data deviation mark is represented as the second deviation mark. That is, when the segment where the data group is located has a unidirectional deviation (that is, there is only a positive deviation or only a negative deviation in the segment), the segment data deviation mark is represented as the first deviation mark; when the segment where the data group is located has a bidirectional deviation, the segment data deviation mark is represented as the second deviation mark.

[0087] When there is only one-way deviation, the first maximum deviation value is the maximum deviation value in the one-way deviation. When there is a two-way deviation, the first maximum deviation value is one deviation value in the two-way deviation, and the second maximum deviation value is another deviation value in the two-way deviation.

[0088] For the sake of convenience, the AD value corresponding to the first maximum deviation value is the first deviation position, and the AD value corresponding to the second maximum deviation value is the second deviation position.

[0089] Further, when the data in the segment where the current data group is located is a bidirectional deviation, that is, there are positive deviations and negative deviations in the segment where the current data group is located. At this time, the first deviation position and the second deviation position are on both sides of the data group of the zero-crossing AD value in the data group segment where they are located and are the maximum deviation positions of the physical quantity on the current side. When there is a positive maximum deviation on one side of the zero-crossing AD value (the side where the AD value is smaller than the zero-crossing AD value), the first deviation position is the data group position where the positive maximum deviation value is located, and the corresponding AD value is the first deviation value; the second deviation position is the data group position where the negative maximum deviation value is located, and the corresponding AD value is the second deviation value. Similarly, when there is a negative maximum deviation on one side of the zero-crossing AD value (the side where the AD value is smaller than the zero-crossing AD value), the first deviation position is the data group position where the negative maximum deviation value is located, and the second deviation position is the data group position where the positive maximum deviation value is located.

[0090] When the data in the segment where the current data group is located is not a bidirectional deviation, then the segment where the current data group is located either has only positive deviation or only negative deviation. At this time, whether there is only positive deviation or only negative deviation, the maximum positive and negative deviation positions are both the first deviation positions, and the corresponding AD value is the first deviation value.

[0091] At step 113, it is determined whether the last data group has been traversed. It is determined whether all data groups have been traversed. If the current data group is not the last data group, it proceeds to the next segment and continues to execute step 106. If the current data group is the last data group, it records the last data group as the final node and outputs all node segment data tables.

[0092] The present invention also provides an AD segmentation calculation method, which includes: performing AD segmentation calculation according to the segmentation node data table generated by the above generation method.

[0093] It should be noted that the node segmentation data table generated by the above-mentioned method for generating AD segmentation parameters of the resistance sensor includes, for each data group in the segment with bidirectional deviation, the AD value, the corresponding physical quantity value, the segment data deviation mark, the first maximum deviation value of the segment and its corresponding AD value, the second maximum deviation value of the segment and its corresponding AD value, and the AD value corresponding to the data group of the physical quantity zero crossing point in the segment; for each data group in the segment with only unidirectional deviation, the AD value, the corresponding physical quantity value, the segment data deviation mark, the first maximum deviation value of the segment and its corresponding AD value. In this way, the calculated physical quantity value can be compensated more precisely, thereby improving the accuracy of the calculation. Figure 2 As shown, the piecewise linear table formed by fitting the node segmented data table provided by the present invention has a small deviation compared with the actual piecewise linear table. Figure 1 Significantly reduced. Figure 2 It can be seen that the deviation between the data generated by the algorithm of the present invention and the actual data is very small, and the two curves are basically overlapped.

[0094] The present invention provides a device for generating AD segment parameters of a resistance sensor. The device for generating AD segment parameters of a resistance sensor comprises an acquisition unit, a stepping unit, and a judgment unit.

[0095] The acquisition unit is used to acquire the first data group from a pre-established valid relation database, and add its AD value position to the first segment, wherein the valid relation database includes a plurality of data groups, each data group includes an AD value and a corresponding physical quantity, and the plurality of data groups are arranged in order of AD values;

[0096] The stepping unit is used to stepwise increase the AD value position of the next data group; judge whether the linear deviation values ​​of all data in the current segment are less than the preset control deviation value; when the first judgment result is yes, add the next data group to the current segment; when the first judgment result is no, remove the current data group from the current segment, search for the zero-crossing point of the physical quantity and its AD value position, the positive and negative maximum deviation values ​​and their AD value positions in the current segment, and store them in the corresponding node segment data table respectively;

[0097] Determine whether there are both positive and negative deviation values ​​in the current segment; when the second determination result is yes, mark the data in the current segment with a first deviation identifier and store it in the corresponding node segment data table; when the second determination result is no, mark the data in the current segment with a second deviation identifier and store it in the corresponding node segment data table;

[0098] The judgment unit is used to judge whether the last data group has been traversed; when the third judgment result is no, enter the next segment and jump to the step unit; when the third judgment result is yes, record the last data group as the end node and output all node segment data tables.

[0099] The present invention provides an AD segment calculation device, which includes a calculation unit, and the calculation unit is used to perform AD segment calculation according to the segment node data table generated by the generating device according to claim 7.

[0100] In order to achieve the above object, the present invention also provides a computer device, such as Figure 4 As shown, the cleaning base station includes at least one processor 501; and a memory 502 that is communicatively connected to the at least one processor 501; wherein the memory 502 stores instructions that can be executed by the at least one processor 501, and the instructions are executed by the at least one processor 501 so that the at least one processor 501 can execute the above-mentioned method for generating AD segmentation parameters of the resistance sensor, or the above-mentioned AD segmentation calculation method.

[0101] The memory 502 and the processor 501 are connected in a bus manner, and the bus may include any number of interconnected buses and bridges, and the bus connects various circuits of one or more processors 501 and the memory 502 together. The bus can also connect various other circuits such as peripheral devices, voltage regulators, and power management circuits, which are well known in the art and are therefore not further described herein. The bus interface provides an interface between the bus and the transceiver. The transceiver can be one element or multiple elements, such as multiple receivers and transmitters, providing a unit for communicating with various other devices on a transmission medium. The data processed by the processor 501 is transmitted on a wireless medium via an antenna, and further, the antenna also receives data and transmits the data to the processor 501.

[0102] The processor 501 is responsible for managing the bus and general processing, and can also provide various functions, including timing, peripheral interfaces, voltage regulation, power management and other control functions. The memory 502 can be used to store data used by the processor 501 when performing operations.

[0103] In order to achieve the above object, the present invention provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the above-mentioned method for generating AD segmentation parameters of a resistance sensor or the above-mentioned AD segmentation calculation method.

[0104] That is, those skilled in the art can understand that all or part of the steps in the above-mentioned implementation method can be completed by instructing the relevant hardware through a program, and the program is stored in a storage medium, including a number of instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor to execute all or part of the steps of the method described in each implementation of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.

[0105] Obviously, the embodiments described above are only some embodiments of the present invention, rather than all embodiments. Based on the embodiments of the present invention, ordinary technicians in this field can make other different forms of changes or modifications without creative work, which should fall within the scope of protection of the present invention.

Claims

1. A method for generating AD segmentation parameters of a resistance sensor, characterized in that: include: S1: Obtain a first data group from a pre-established valid relational database, and add its AD value position to a first segment, wherein the valid relational database includes a plurality of data groups, each data group includes an AD value and a corresponding physical quantity, and the plurality of data groups are arranged in order of AD values; S2: step to the next data group; Determine whether the linear deviation values ​​of all data in the current segment are less than the preset control deviation value; When the first judgment result is yes, the next data group is added to the current segment; When the first judgment result is no, remove the current data group from the current segment and traverse the data group back to the previous data group, search for the physical quantity zero-crossing point and its AD value position, the positive and negative maximum deviation values ​​and their AD value positions in the current segment, and store them in the corresponding node segment data table respectively; Determine whether there are both positive and negative deviation values ​​in the current segment; When the second judgment result is yes, a first deviation mark is added to the data in the current segment and stored in the corresponding node segment data table; When the second judgment result is no, a second deviation mark is marked on the data in the current segment and stored in the corresponding node segment data table; S3: Determine whether the last data group has been traversed; When the third judgment result is no, enter the next segment and jump to S2; When the third judgment result is yes, the last data group is recorded as the final node and all node segment data tables are output.

2. The method for generating AD segment parameters of a resistance sensor according to claim 1, characterized in that: Before the step of sequentially traversing the data groups in the pre-established valid relational database, the method further comprises: Build an effective relational database.

3. The method for generating AD segment parameters of a resistance sensor according to claim 1, characterized in that: The establishing of the effective relational database comprises: According to the AD full-scale value, calculate the voltage list of the corresponding voltage divider circuit; According to the voltage list, calculate the corresponding sensor resistance value list; According to the relationship function between the physical quantity and the resistance of the sensor, a list of physical quantity data corresponding to the list of sensor resistance values ​​is calculated, and a corresponding table between AD values ​​and physical quantities is formed; The valid relationship database is determined according to the formed correspondence table between AD values ​​and physical quantities and the upper and lower limit values ​​of the physical quantities of the sensor.

4. The method for generating AD segment parameters of a resistance sensor as claimed in claim 3, characterized in that: The resistance sensor is a temperature sensor, a humidity sensor, or a resistance pressure sensor.

5. The method for generating AD segment parameters of a resistance sensor as claimed in claim 4, characterized in that: The resistance sensor is a temperature sensor; Correspondingly, according to the relationship function between the physical quantity and resistance of the sensor, a physical quantity data list corresponding to the sensor resistance value list is calculated, and a corresponding table between AD value and physical quantity is formed. The relationship function between the physical quantity and resistance of the sensor is: R2=EXP(B*(1 / T2-1 / T1)+LN(R1)); in, R2 is the resistance value corresponding to T2; R1 is the reference resistance value corresponding to the sensor; T1 is the reference temperature value corresponding to the sensor; B is the variation coefficient value corresponding to the sensor; T2 is the temperature value to be calculated.

6. An AD segmentation calculation method, characterized in that: include: Perform AD segment calculation according to the segment node data table generated by the generation method according to any one of claims 1 to 6.

7. A device for generating AD segment parameters of a resistance sensor, characterized in that: an acquisition unit, configured to acquire a first data group from a pre-established valid relational database, and add its AD value position to the first segment, wherein the valid relational database includes a plurality of data groups, each data group includes an AD value and a corresponding physical quantity, and the plurality of data groups are arranged in order of AD values; A stepping unit is used to stepwise increase the AD value position of the next data group; judge whether the linear deviation values ​​of all data in the current segment are less than the preset control deviation value; when the first judgment result is yes, add the next data group to the current segment; when the first judgment result is no, remove the current data group from the current segment and traverse the data groups back to the previous data group, search for the zero-crossing point of the physical quantity and its AD value position, the positive and negative maximum deviation values ​​and their AD value positions in the current segment, and store them in the corresponding node segment data table respectively; Determine whether there are both positive and negative deviation values ​​in the current segment; when the second determination result is yes, mark the data in the current segment with a first deviation identifier and store it in the corresponding node segment data table; when the second determination result is no, mark the data in the current segment with a second deviation identifier and store it in the corresponding node segment data table; The judgment unit is used to judge whether the last data group has been traversed; when the third judgment result is no, enter the next segment and jump to the step unit; when the third judgment result is yes, record the last data group as the end node and output all node segment data tables.

8. An AD segment calculation device, characterized in that: include: A calculation unit is used to perform AD segment calculation according to the segment node data table generated by the generating device according to claim 7.

9. A computer device, characterized in that: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method for generating AD segmentation parameters of the resistance sensor as described in any one of claims 1 to 5, or the AD segmentation calculation method as described in claim 6.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method for generating AD segment parameters of a resistance sensor according to any one of claims 1 to 5 or the AD segment calculation method according to claim 6 is implemented.