Distance measurement correction factor training method, device, distance measurement method and electrician tool
By training the distance measurement correction coefficient in the electrician tool, correcting the relationship between the induced current and the electric field strength, the inaccuracy problem caused by the influence of conductive substances of the electrician tool distance measurement module is solved, and more accurate distance measurement is achieved.
Patent Information
- Application Number
- CN202111385045.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-22
- Publication Date
- 2025-03-21
- Estimated Expiration
- 2041-11-22
AI Technical Summary
The modules used for distance measurement in existing electrical tools are susceptible to surrounding conductive substances, resulting in inaccurate distances from the measured electrical tools to the charged object.
A distance measurement correction coefficient training method is provided. By obtaining the correction coefficient of the distance measurement module, correcting the relationship between the induced current and the electric field intensity, setting the loss function using the actual measured value and simulation value, and iteratively performing the gradient descent algorithm to train the correction coefficient until the accuracy meets the requirements.
More precise measurements of the distance between the electrical tool and the charged object are achieved, reducing the impact of surrounding conductive substances on the measurement results.
Smart Images

Figure CN114089350B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of electrical tools, and in particular to a distance measurement correction coefficient training method and device, a distance measurement method and an electrical device. Background Art
[0002] In order to ensure the safety of the work during power maintenance, electricians usually need to evaluate the distance between electrician tools and live objects. For example, when using a screwdriver for power maintenance, in order to ensure the safety of the operator, it is necessary to understand the distance between the screwdriver and the live object to avoid safety accidents caused by contact with the live object.
[0003] However, the distance measurement module in the existing electrician's tool is easily affected by the surrounding conductive materials, which results in inaccurate measured distance from the electrician's tool to the charged object. Summary of the invention
[0004] Based on this, it is necessary to provide a distance measurement correction coefficient training method, device, distance measurement method and electrical device that can accurately measure the distance from electrical tools to charged objects in order to address the above technical problems.
[0005] In a first aspect, the present application provides a ranging correction coefficient training method, the method comprising:
[0006] Obtaining a correction coefficient of the ranging module, the correction coefficient is used to correct the relationship between the induced current monitored by the ranging module and the electric field strength at the location of the charged object; the ranging module is used to calculate the straight-line distance from the ranging module to the charged object according to the electric field strength;
[0007] Obtaining an actual measured value of the straight-line distance;
[0008] Obtaining a simulation value of the straight-line distance from the ranging module to the charged object;
[0009] Setting a loss function based on actual measured values, simulated values and correction coefficients;
[0010] Iteratively execute the step of training the correction coefficient based on the gradient descent algorithm and the loss function until the accuracy of the loss function meets the preset accuracy requirement or the number of iterations reaches the preset number of iterations, and use the trained correction coefficient as the ranging correction coefficient.
[0011] In one embodiment, the setting of the loss function based on the actual measurement value, the simulation value and the correction coefficient includes:
[0012] Set the distance translation item;
[0013] Constructing a relationship function between the actual measurement value and the simulation value based on the actual measurement value, the simulation value, the correction coefficient and the distance translation term;
[0014] A loss function is set based on the relationship function.
[0015] In one embodiment, the training of the correction coefficient based on the gradient descent algorithm and the loss function includes:
[0016] Set the learning rate;
[0017] Calculating the gradient of the correction coefficient based on the loss function;
[0018] Update the correction factor according to the learning rate and the gradient of the correction factor.
[0019] In one embodiment, the above-mentioned training correction coefficient based on the gradient descent algorithm and the loss function also includes:
[0020] Calculate the gradient of the distance translation term based on the loss function;
[0021] The distance translation term is updated according to the learning rate and the gradient of the distance translation term, and the step of constructing a relationship function between the actual measurement value and the simulation value based on the actual measurement value, the simulation value, the correction coefficient and the distance translation term is entered.
[0022] In a second aspect, the present application also provides a ranging method, including:
[0023] Obtain the induced current of a charged object in an electric field;
[0024] Calculate the electric field strength at the location of the charged object based on the ranging correction coefficient obtained by the ranging correction coefficient training method and the induced current;
[0025] The straight-line distance from the distance measuring module to the charged object is calculated according to the electric field strength at the location of the charged object.
[0026] In a third aspect, the present application further provides an electrician tool, the electrician tool comprising:
[0027] The ranging module is used for:
[0028] Monitor the induced current of charged objects in an electric field;
[0029] Calculating the electric field strength at the location of the charged object based on the ranging correction coefficient obtained by the ranging correction coefficient training method and the induced current;
[0030] The straight-line distance from the distance measuring module to the charged object is calculated according to the electric field strength at the location of the charged object.
[0031] In one embodiment, the electrician tool further comprises:
[0032] The control module is connected to the distance measuring module and is used to receive the straight-line distance from the distance measuring module to the charged object sent by the distance measuring module.
[0033] In one embodiment, the electrician tool further comprises:
[0034] The voltage measurement module is connected to the control module and is used to measure the voltage value of the charged object that the electrician tool contacts.
[0035] In one embodiment, the electrician tool further comprises:
[0036] The torque measurement module is connected to the control module and is used to measure the torque of the electric tool when it is in working state.
[0037] In a fourth aspect, the present application further provides a distance measurement correction coefficient training device, the device comprising:
[0038] A correction coefficient acquisition module is used to obtain a correction coefficient of a distance measurement module, and the correction coefficient is used to correct the relationship between the induced current monitored by the distance measurement module and the electric field strength at the location of the charged object; the distance measurement module is used to calculate the straight-line distance from the distance measurement module to the charged object according to the electric field strength;
[0039] An actual value acquisition module, used to acquire the actual measured value of the straight-line distance;
[0040] A simulation value acquisition module, used to obtain a simulation value of the straight-line distance from the distance measurement module to the charged object;
[0041] A loss function setting module, used for setting a loss function based on the actual measurement value, the simulation value and the correction coefficient;
[0042] The parameter determination module is used to iteratively execute the step of training the correction coefficient based on the gradient descent algorithm and the loss function until the accuracy of the loss function meets the preset accuracy requirement or the number of iterations reaches a preset number of iterations, and the trained correction coefficient is used as the ranging correction coefficient.
[0043] The above-mentioned distance measurement correction coefficient training method, device, distance measurement method and electrician tool first obtain the correction coefficient of the distance measurement module, wherein the correction coefficient is used to correct the relationship between the induced current monitored by the distance measurement module and the electric field strength at the location of the charged object, and the distance measurement module is used to calculate the straight-line distance from the distance measurement module to the charged object according to the electric field strength, and then obtain the actual measurement value of the straight-line distance and the simulation value of the straight-line distance from the distance measurement module to the charged object, and set the loss function based on the above-mentioned actual measurement value, simulation value and correction coefficient, and finally iteratively execute the steps of training the correction coefficient based on the gradient descent algorithm and the loss function until the accuracy of the loss function meets the preset accuracy requirement or the number of iterations reaches the preset number of iterations, and the trained correction coefficient is used as the distance measurement correction coefficient. The above-mentioned distance measurement correction coefficient training method continuously updates the distance measurement correction coefficient based on the gradient descent method until the accuracy of the loss function meets the requirements, thereby achieving more accurate measurement of the distance from the electrician tool to the charged object. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the conventional technology, the drawings required for use in the embodiments or the conventional technology descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0045] Figure 1 Schematic diagram of a flow chart of a distance measurement correction coefficient training method in one embodiment;
[0046] Figure 2 A schematic diagram of a flow chart of a step of setting a loss function based on actual measurement values, simulation values and correction coefficients in one embodiment;
[0047] Figure 3 A schematic diagram of a flow chart of a step of training a correction coefficient based on a gradient descent algorithm and a loss function in one embodiment;
[0048] Figure 4 is a flow chart of a distance measurement method in one embodiment;
[0049] Figure 5 is a schematic diagram of the structure of an electrician's tool in one embodiment;
[0050] Figure 6 A schematic diagram of the structure of a distance measurement correction coefficient training device in one embodiment;
[0051] Figure 7 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0052] In order to facilitate understanding of the present application, the present application will be described more fully below with reference to the relevant drawings. Embodiments of the present application are provided in the drawings. However, the present application can be implemented in many different forms and is not limited to the embodiments described herein. On the contrary, the purpose of providing these embodiments is to make the disclosure of the present application more thorough and comprehensive.
[0053] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein in the specification of this application are only for the purpose of describing specific embodiments and are not intended to limit this application.
[0054] It should be noted that when an element is considered to be "connected" to another element, it can be directly connected to the other element, or connected to the other element through an intermediate element. In addition, the "connection" in the following embodiments should be understood as "electrical connection", "communication connection", etc. if there is transmission of electrical signals or data between the connected objects.
[0055] When used herein, the singular forms "a", "an", and "said / the" may also include plural forms, unless the context clearly indicates otherwise. It should also be understood that the terms "include / comprise" or "have" etc. specify the presence of stated features, wholes, steps, operations, components, parts or combinations thereof, but do not exclude the possibility of the presence or addition of one or more other features, wholes, steps, operations, components, parts or combinations thereof.
[0056] In view of the problem of inaccurate distance measurement from an electrician's tool to a charged object mentioned in the background technology, the present invention provides a distance measurement correction coefficient training method, such as Figure 1 As shown, the method includes:
[0057] S200, obtaining a correction coefficient of a distance measurement module.
[0058] Among them, the correction coefficient is used to correct the relationship between the induced current monitored by the ranging module and the electric field strength at the location of the charged object. In the process of calculating the electric field strength, it is easy to be affected by the surrounding conductive materials, resulting in inaccurate calculated electric field values. Using the correction coefficient to correct the relationship between the induced current monitored by the ranging module and the electric field strength at the location of the charged object can make the electric field strength calculation process less susceptible to the influence of the surrounding conductive materials.
[0059] The distance measuring module includes an electromagnetic field sensor, and the distance measuring module is used to calculate the straight-line distance from the distance measuring module to the charged object according to the electric field strength.
[0060] The electromagnetic field sensor in the distance measurement module can calculate the analog charge value Q of any point in the electric field by using the analog charge method. If the analog charge value Q(t) of a point in the electric field at a certain time t and the induced current I(t) of the point at the time t are known, the electric field strength E(t) of the point can be calculated. The induced current I(t) can be directly obtained by the electromagnetic field sensor.
[0061] Specifically, Where K is the correction coefficient, ε is a constant, ε=8.854187817×10 -12 , A is the cross-sectional area of the conductor (i.e., the charged body). Given I(t), K, ε, and Q(t), the electric field intensity E(t) can be solved.
[0062] S400: Obtain an actual measured value of the straight-line distance.
[0063] The actual measured value is the manually measured distance between the measuring module and the charged object.
[0064] S600: Obtain a simulation value of a straight-line distance from a distance measurement module to a charged object.
[0065] The simulation value is calculated by the electric field strength calculated by the ranging module based on the simulated charge method or other field strength calculation methods. Specifically, the simulation value of the straight-line distance from the ranging module to the charged object can be obtained by dividing the voltage of the charged object by the electric field strength at the location of the charged object.
[0066] S800, setting a loss function based on the actual measured value, the simulation value and the correction coefficient.
[0067] The loss function is used to measure the difference between the actual measured value and the simulated value.
[0068] S900, iteratively executing the step of training the correction coefficient based on the gradient descent algorithm and the loss function until the accuracy of the loss function meets the preset accuracy requirement or the number of iterations reaches the preset number of iterations, and using the trained correction coefficient as the ranging correction coefficient.
[0069] The loss function accuracy and the number of iterations are pre-set according to the actual needs of the project. When the number of iterations of the gradient descent algorithm reaches the preset number of iterations or the loss function accuracy has met the preset accuracy, the gradient descent algorithm is stopped and the correction coefficient at this time is output as the ranging correction coefficient used in the final ranging module to calculate the straight-line distance from the ranging module to the charged object.
[0070] The above-mentioned distance measurement correction coefficient training method first obtains the correction coefficient of the distance measurement module, wherein the correction coefficient is used to correct the relationship between the induced current monitored by the distance measurement module and the electric field strength at the location of the charged object, and the distance measurement module is used to calculate the straight-line distance from the distance measurement module to the charged object according to the electric field strength, and then obtains the actual measurement value of the straight-line distance and the simulation value of the straight-line distance from the distance measurement module to the charged object, and sets the loss function based on the above-mentioned actual measurement value, simulation value and correction coefficient, and finally iteratively executes the steps of training the correction coefficient based on the gradient descent algorithm and the loss function until the accuracy of the loss function meets the preset accuracy requirement or the number of iterations reaches the preset number of iterations, and the trained correction coefficient is used as the distance measurement correction coefficient. The above-mentioned distance measurement correction coefficient training method continuously updates the distance measurement correction coefficient based on the gradient descent method until the accuracy of the loss function meets the requirements, thereby achieving more accurate measurement of the distance from the electrician tool to the charged object.
[0071] In one embodiment, Figure 2 The above step 800 includes:
[0072] S810, setting a distance translation item.
[0073] Among them, because when the ranging module calculates the above distance simulation value, there is a time difference between the electric field value used and the signal transmission, and the staff using the ranging module for measurement is in a moving state, this will cause the electric field value used in the process of calculating the simulation value of the ranging module to be the previous electric field value, resulting in an offset error between the calculated simulation value and the actual measurement value. Therefore, a distance translation item is set to take the staff's mobile state into consideration in the process of calculating the straight-line distance from the ranging module to the charged object, thereby improving the accuracy of the simulation value obtained by the ranging module.
[0074] S820, constructing a relationship function between the actual measurement value and the simulation value based on the actual measurement value, the simulation value, the correction coefficient and the distance translation term.
[0075] Wherein, y represents the simulation value, x represents the actual measurement value, X0 represents the distance translation term, K represents the correction coefficient, and the relationship function among y, K, x and X0 can be expressed as y=K(x-X0).
[0076] S830, setting a loss function based on the relationship function.
[0077] Among them, the loss function J based on the above relationship function can be expressed as:
[0078]
[0079] Where X can be a column vector consisting of actual measurement values obtained by n measurements at different distances when a certain K and X0 are selected, X = [x1, x2, ..., x n ] T , norm represents the Euclidean norm, which can be expressed as
[0080] Among them, by setting the preset accuracy, when the output value of the above loss function meets the preset accuracy, the correction coefficient K and the distance translation term X0 updated for the last time are output, and the correction coefficient K obtained at this time is used as the ranging correction coefficient for subsequent measurements.
[0081] In one embodiment, Figure 3 As shown, the above step S900 includes:
[0082] S910, set the learning rate.
[0083] S920, calculating the gradient of the correction coefficient based on the loss function.
[0084] S930, updating the correction coefficient according to the learning rate and the gradient of the correction coefficient.
[0085] Among them, the updated correction coefficient is equal to the original correction coefficient minus the learning rate multiplied by the gradient value of the original correction coefficient.
[0086] In one embodiment, Figure 3 As shown, the above step S930 further includes the following steps:
[0087] S940, calculating the gradient of the distance translation term based on the loss function;
[0088] S950, update the distance translation term according to the learning rate and the gradient of the distance translation term, and proceed to step S820.
[0089] Among them, the updated distance translation term is equal to the original distance translation term minus the learning rate multiplied by the gradient value of the original distance translation term.
[0090] like Figure 4 As shown, the present invention also provides a distance measurement method, which includes:
[0091] S1000, obtaining the induced current of the charged object in the electric field.
[0092] S2000: Calculate the electric field strength at the location of the charged object based on the ranging correction coefficient obtained by the ranging correction coefficient training method and the induced current.
[0093] S3000: Calculate the straight-line distance from the distance measurement module to the charged object based on the electric field strength at the location of the charged object.
[0094] The straight-line distance from the ranging module to the charged object is equal to the voltage of the charged object divided by the electric field strength at the location of the charged object.
[0095] Among them, Table 1 shows the difference between the simulation value and the actual value measured by the above distance measurement method.
[0096] Table 1 Simulated and actual values of the distance from the ranging module to the charged object
[0097]
[0098]
[0099] It can be seen from Table 1 that the ranging correction coefficient obtained based on the ranging correction coefficient training method has a high measurement accuracy for the ranging method to measure the distance from the ranging module to the charged object, and can output a simulation value with stable accuracy when the actual value is too large or too small.
[0100] For the specific limitations of the above-mentioned ranging method, please refer to the limitations of the ranging correction coefficient training method mentioned above, which will not be repeated here.
[0101] It should be understood that although Figure 1-Figure 4 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 1-Figure 4 At least part of the steps may include multiple steps or multiple stages. These steps or stages are not necessarily performed at the same time, but can be performed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed in turn or alternately with other steps or at least part of the steps or stages in other steps.
[0102] like Figure 5 As shown, the present invention also provides an electrician tool, the electrician tool comprising:
[0103] The ranging module 100 is used for:
[0104] Monitor the induced current of charged objects in an electric field;
[0105] Calculating the electric field strength at the location of the charged object based on the ranging correction coefficient obtained by the ranging correction coefficient training method and the induced current;
[0106] The straight-line distance from the ranging module to the charged object is calculated based on the electric field strength at the location of the charged object.
[0107] Among them, the electrician tool can be a screwdriver. Electricians can use the screwdriver to accurately measure the distance from the screwdriver to a live object during daily inspections, which greatly improves the safety of the electrician's work process.
[0108] The electrician's tool may also be a tool required to be used in the electrical work process, such as pliers.
[0109] The distance measurement module includes an electromagnetic field sensor. Specifically, an electromagnetic field sensor of model UAV-LF-04 can be used, the frequency range of the sensor is 5Hz-400kHz, and the electric field measurement error is less than 5%.
[0110] In one embodiment, Figure 5 As shown, the above-mentioned electrician tools also include:
[0111] The control module 200 is connected to the distance measuring module 100 and is used to receive the straight-line distance from the distance measuring module to the charged object sent by the distance measuring module.
[0112] The control module 200 may be an MCU (Microcontroller Unit), or other integrated control chips such as an embedded control panel. Specifically, the control module 200 may use an STM32F103 single-chip microcomputer, which uses a Cortex-M3 core, has a maximum CPU speed of 72MHz, and has the characteristics of short interrupt delay and low debugging cost.
[0113] In one embodiment, Figure 5 As shown, the above-mentioned electrician tools also include:
[0114] The voltage measurement module 300 is connected to the control module 200 and is used to measure the voltage value of the charged object that the electrician tool contacts.
[0115] The voltage measurement module 300 is also used to send the above voltage value to the controller.
[0116] Among them, the voltage measurement module 300 is a module that can realize the voltage measurement function. Specifically, the voltage measurement module 300 can be an IM1253B power monitoring module, which can collect single-phase AC and DC power parameters, including voltage, current, active power and other parameters.
[0117] In one embodiment, Figure 5 As shown, the above-mentioned electrician tools also include:
[0118] The torque measurement module 400 is connected to the control module 200 and is used to measure the torque of the electrician tool when it is in working state.
[0119] The torque measurement module 400 is also used to send the torque value to the control module 200 .
[0120] The torque detection module 400 is a module that can realize the torque measurement function. Specifically, the torque detection module 400 can be a JNNT-S micro static torque measurement module.
[0121] In one embodiment, Figure 5 As shown, the above-mentioned electrician tools also include:
[0122] The alarm module 500 is connected to the control module 200, and is used to send out an alarm signal when the voltage value measured by the voltage measurement module exceeds a preset voltage range and / or the distance measured by the distance measurement module exceeds a preset distance range.
[0123] In one embodiment, Figure 5 As shown, the above-mentioned electrician tools also include:
[0124] The display module 600 is connected to the control module 200 and is used to display the straight-line distance from the distance measuring module to the charged object, the voltage value and the torque value.
[0125] The display module 600 may be a liquid crystal display or an LED screen. Specifically, the display module uses a 0.3-inch OLED display. In addition to receiving and displaying the straight-line distance, the voltage value, and the torque value sent by the control module 600, the display module 600 is also used to realize the interaction between the user and the electrician tool.
[0126] In one embodiment, Figure 5 As shown, the above-mentioned electrician tools also include:
[0127] The input module 700 is connected to the control module 200 and is used to adjust the value displayed by the display module 600 when there is no linear distance, voltage value or torque value.
[0128] like Figure 6 As shown, the present application also provides a distance measurement correction coefficient training device, comprising:
[0129] A correction coefficient acquisition module 20 is used to obtain a correction coefficient of a distance measurement module, wherein the correction coefficient is used to correct the relationship between the induced current monitored by the distance measurement module and the electric field strength at the location of the charged object; the distance measurement module is used to calculate a simulation value of the straight-line distance from the distance measurement module to the charged object according to the electric field strength;
[0130] An actual value acquisition module 40 is used to acquire the actual measurement value of the straight-line distance;
[0131] A simulation value acquisition module 60, used to obtain a simulation value of the straight-line distance from the distance measurement module to the charged object;
[0132] A loss function setting module 80, used to set a loss function based on the actual measurement value, the simulation value and the correction coefficient;
[0133] The parameter determination module 90 is used to iteratively execute the step of training the correction coefficient based on the gradient descent algorithm and the loss function until the accuracy of the loss function meets the preset accuracy requirement or the number of iterations reaches the preset number of iterations, and the trained correction coefficient is used as the ranging correction coefficient.
[0134] In one embodiment, the loss function setting module 800 includes:
[0135] The translation item setting unit is used to set the distance translation item.
[0136] The relationship function construction unit is used to construct the relationship function between the actual measurement value and the simulation value based on the actual measurement value, the simulation value, the correction coefficient and the distance translation term.
[0137] The loss function setting unit is used to set the loss function based on the relationship function.
[0138] In one embodiment, the parameter determination module 900 includes:
[0139] Learning rate setting unit, used to set the learning rate.
[0140] The correction coefficient updating unit is used to update the correction coefficient according to the learning rate and the gradient of the correction coefficient.
[0141] In one embodiment, the parameter determination module 900 further includes:
[0142] The distance translation term calculation unit is used to calculate the gradient of the distance translation term based on the loss function.
[0143] A distance translation term updating unit is used to update the distance translation term according to the learning rate and the gradient of the distance translation term, and is also used to construct a relationship function between the actual measurement value and the simulation value based on the actual measurement value, the simulation value, the correction coefficient and the distance translation term.
[0144] For the specific limitations of the ranging correction coefficient training device, please refer to the limitations of the ranging correction coefficient training method above, which will not be repeated here. The various modules in the above-mentioned ranging correction coefficient training device 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. It should be noted that the division of modules in the embodiment of the present application is schematic, which is only a logical function division, and there may be other division methods in actual implementation.
[0145] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Figure 7 As shown. The computer device includes a processor, a memory, a communication interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, an operator network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a distance measurement correction coefficient training method is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covered on the display screen, or a button, trackball or touchpad set on the computer device housing, or an external keyboard, touchpad or mouse, etc.
[0146] Those skilled in the art will understand that Figure 7 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0147] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:
[0148] S200, obtaining a correction coefficient of a distance measurement module.
[0149] S400: Obtain an actual measured value of the straight-line distance.
[0150] S600: Obtain a simulation value of a straight-line distance from a distance measurement module to a charged object.
[0151] S800, setting a loss function based on the actual measurement value, the simulation value and the correction coefficient.
[0152] S900, iteratively executing the step of training the correction coefficient based on the gradient descent algorithm and the loss function until the accuracy of the loss function meets the preset accuracy requirement or the number of iterations reaches a preset number of iterations, and using the trained correction coefficient as the ranging correction coefficient.
[0153] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0154] S810, setting a distance translation item.
[0155] S820, constructing a relationship function between the actual measurement value and the simulation value based on the actual measurement value, the simulation value, the correction coefficient and the distance translation term.
[0156] S830, setting a loss function based on the relationship function.
[0157] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0158] S910, set the learning rate.
[0159] S920, calculating the gradient of the correction coefficient based on the loss function.
[0160] S930, updating the correction coefficient according to the learning rate and the gradient of the correction coefficient.
[0161] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0162] S940, calculating the gradient of the distance translation term based on the loss function;
[0163] S950, update the distance translation term according to the learning rate and the gradient of the distance translation term, and proceed to step S820.
[0164] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:
[0165] S1000, obtaining the induced current of the charged object in the electric field.
[0166] S2000: Calculate the electric field strength at the location of the charged object based on the ranging correction coefficient obtained by the ranging correction coefficient training method and the induced current.
[0167] S3000: Calculate the straight-line distance from the distance measurement module to the charged object based on the electric field strength at the location of the charged object.
[0168] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0169] S200, obtaining a correction coefficient of a distance measurement module.
[0170] S400: Obtain an actual measured value of the straight-line distance.
[0171] S600: Obtain a simulation value of a straight-line distance from a distance measurement module to a charged object.
[0172] S800, setting a loss function based on the actual measurement value, the simulation value and the correction coefficient.
[0173] S900, iteratively executing the step of training the correction coefficient based on the gradient descent algorithm and the loss function until the accuracy of the loss function meets the preset accuracy requirement or the number of iterations reaches a preset number of iterations, and using the trained correction coefficient as the ranging correction coefficient.
[0174] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0175] S810, setting a distance translation item.
[0176] S820, constructing a relationship function between the actual measurement value and the simulation value based on the actual measurement value, the simulation value, the correction coefficient and the distance translation term.
[0177] S830, setting a loss function based on the relationship function.
[0178] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0179] S910, set the learning rate.
[0180] S920, calculating the gradient of the correction coefficient based on the loss function.
[0181] S930, updating the correction coefficient according to the learning rate and the gradient of the correction coefficient.
[0182] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0183] S940, calculating the gradient of the distance translation term based on the loss function;
[0184] S950, update the distance translation term according to the learning rate and the gradient of the distance translation term, and proceed to step S820.
[0185] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0186] S1000, obtaining the induced current of the charged object in the electric field.
[0187] S2000: Calculate the electric field strength at the location of the charged object based on the ranging correction coefficient obtained by the ranging correction coefficient training method and the induced current.
[0188] S3000: Calculate the straight-line distance from the distance measurement module to the charged object based on the electric field strength at the location of the charged object.
[0189] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).
[0190] In the description of this specification, the description with reference to the terms "some embodiments", "other embodiments", "ideal embodiments", etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic descriptions of the above terms do not necessarily refer to the same embodiment or example.
[0191] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0192] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims
1. A distance measurement correction coefficient training method, characterized in that: The method comprises: Obtaining a correction coefficient of the ranging module, the correction coefficient is used to correct the relationship between the induced current monitored by the ranging module and the electric field strength at the location of the charged object; the ranging module is used to calculate a simulation value of the straight-line distance from the ranging module to the charged object according to the electric field strength; Obtaining an actual measured value of the straight-line distance; Obtaining a simulation value of the straight-line distance from the ranging module to the charged object; Setting a loss function based on the actual measurement value, the simulation value and the correction coefficient; Iteratively execute the step of training the correction coefficient based on the gradient descent algorithm and the loss function until the accuracy of the loss function meets the preset accuracy requirement or the number of iterations reaches the preset number of iterations, and use the trained correction coefficient as the ranging correction coefficient.
2. The method according to claim 1, characterized in that: The setting of the loss function based on the actual measured value, the simulation value and the correction coefficient comprises: Set the distance translation item; Constructing a relationship function between the actual measurement value and the simulation value based on the actual measurement value, the simulation value, the correction coefficient and the distance translation term; A loss function is set based on the relationship function.
3. The method according to claim 2, characterized in that: The training of the correction coefficient based on the gradient descent algorithm and the loss function includes: Set the learning rate; Calculating the gradient of the correction coefficient based on the loss function; The correction coefficient is updated according to the learning rate and the gradient of the correction coefficient.
4. The method according to claim 3, characterized in that: After training the correction coefficient based on the gradient descent algorithm and the loss function, the following further comprises: Calculating the gradient of the distance translation term based on the loss function; The distance translation term is updated according to the learning rate and the gradient of the distance translation term, and the step of constructing a relationship function between the actual measurement value and the simulation value based on the actual measurement value, the simulation value, the correction coefficient and the distance translation term is entered.
5. A distance measurement method, characterized in that: include: Obtain the induced current of a charged object in an electric field; Calculate the electric field strength at the location of the charged object based on the ranging correction coefficient obtained by the ranging correction coefficient training method according to any one of claims 1 to 4 and the induced current; The straight-line distance from the distance measuring module to the charged object is calculated according to the electric field strength at the location of the charged object.
6. An electrician's tool, characterized in that: The tools include: A distance measurement module, wherein the distance measurement module is used for: Monitor the induced current of charged objects in an electric field; Calculate the electric field strength at the location of the charged object based on the ranging correction coefficient obtained by the ranging correction coefficient training method according to any one of claims 1 to 4 and the induced current; The straight-line distance from the distance measuring module to the charged object is calculated according to the electric field strength at the location of the charged object.
7. The electrician tool according to claim 6, characterized in that: The electrician's tool also includes: The control module is connected to the distance measuring module and is used to receive the straight-line distance from the distance measuring module to the charged object sent by the distance measuring module.
8. The electrician tool according to claim 7, characterized in that: The electrician's tool also includes: The voltage measuring module is connected to the control module and is used to measure the voltage value of the charged object contacted by the electrician tool.
9. The electrician tool according to any one of claims 7-8, characterized in that: The electrician's tool also includes: The torque measurement module is connected to the control module and is used to measure the torque magnitude when the electrician tool is in a working state.
10. A distance measurement correction coefficient training device, characterized in that: include: A correction coefficient acquisition module is used to obtain a correction coefficient of a distance measurement module, wherein the correction coefficient is used to correct the relationship between the induced current monitored by the distance measurement module and the electric field strength at the location of the charged object; the distance measurement module is used to calculate a simulation value of the straight-line distance from the distance measurement module to the charged object according to the electric field strength; An actual value acquisition module, used to acquire the actual measured value of the straight-line distance; A simulation value acquisition module, used to obtain a simulation value of the straight-line distance from the distance measurement module to the charged object; A loss function setting module, used for setting a loss function based on the actual measurement value, the simulation value and the correction coefficient; The parameter determination module is used to iteratively execute the step of training the correction coefficient based on the gradient descent algorithm and the loss function until the accuracy of the loss function meets the preset accuracy requirement or the number of iterations reaches a preset number of iterations, and the trained correction coefficient is used as the ranging correction coefficient.
Citation Information
Patent Citations
Wireless sensor network distance measuring system and method based on deep convolutional neural network
CN109618288A
Model performance optimization method, apparatus and device, and storage medium
WO2021169473A1