Switch control method and switch sensor

By collecting and fitting the current and voltage values ​​of the switching equipment, detecting the change trend and stability, the problem of low intelligence of existing switching equipment is solved, effective detection and early warning of abnormal events is achieved, and the intelligence and safety of switching sensors are improved.

CN119917779APending Publication Date: 2025-05-02SHENZHEN SHINUO ELECTRIC AUTOMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411980574.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-31
Publication Date
2025-05-02

AI Technical Summary

Technical Problem

Existing switching equipment needs to be controlled manually, reducing the intelligence of switches. How to improve the intelligence of switches has become an urgent problem.

Method used

By collecting the current and voltage values ​​for the preset time period, fitting to determine the trend and stability of the current and voltage, detecting whether there is an abnormal event, and performing early warning operations when an abnormality is detected.

Benefits of technology

Through the change trend and stability detection of current and voltage, abnormal events can be effectively identified and early warning operations can be carried out, improving the intelligence and safety of the switch sensor.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119917779A_ABST
    Figure CN119917779A_ABST
Patent Text Reader

Abstract

The invention provides a switch control method and a switch sensor, and the method is applied to the switch sensor, and the method comprises the steps: collecting a current value in a preset time period, and obtaining a plurality of current values; acquiring a voltage value of the preset time period to obtain a plurality of voltage values; fitting according to the plurality of current values to obtain a current straight line and a current curve; fitting according to the plurality of voltage values to obtain a voltage straight line and a voltage curve; determining a first slope of the current straight line, and determining a second slope of the voltage straight line; determining a first mean square error according to the current curve, and determining a second mean square error according to the voltage curve; detecting whether the switch sensor detects an abnormal event according to the first slope, the second slope, the first mean square error and the second mean square error; if yes, early warning operation is executed. According to the embodiment of the invention, the switch intelligence can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of electronic technology or computer technology, and in particular to a switch control method and a switch sensor. Background Art

[0002] With the rapid development of science and technology, electronic products (such as mobile phones, computers, smart home devices, etc.) have developed rapidly. Of course, switches have also developed rapidly. At present, switches often require manual control, which reduces the intelligence of switches. Therefore, the problem of how to improve the intelligence of switches needs to be solved urgently. Summary of the invention

[0003] The embodiments of the present application provide a switch control method and a switch sensor, which can improve the intelligence of the switch.

[0004] In a first aspect, an embodiment of the present application provides a switch control method, which is applied to a switch sensor, and the method includes:

[0005] Collecting current values ​​in a preset time period to obtain multiple current values;

[0006] Acquire the voltage value in the preset time period to obtain multiple voltage values;

[0007] Perform fitting according to the multiple current values ​​to obtain a current straight line and a current curve;

[0008] Perform fitting according to the multiple voltage values ​​to obtain a voltage straight line and a voltage curve;

[0009] Determine a first slope of the current straight line, and determine a second slope of the voltage straight line;

[0010] Determine a first mean square error according to the current curve, and determine a second mean square error according to the voltage curve;

[0011] detecting whether the switch sensor detects an abnormal event according to the first slope, the second slope, the first mean square error, and the second mean square error;

[0012] If so, perform warning operations.

[0013] In a second aspect, an embodiment of the present application provides a switch sensor, the switch sensor comprising: an acquisition unit, a fitting unit, a determination unit, a detection unit and an execution unit, wherein:

[0014] The acquisition unit is used to collect the current value of a preset time period to obtain a plurality of current values; and to acquire the voltage value of the preset time period to obtain a plurality of voltage values;

[0015] The fitting unit is used to perform fitting according to the multiple current values ​​to obtain a current straight line and a current curve; and to perform fitting according to the multiple voltage values ​​to obtain a voltage straight line and a voltage curve;

[0016] The determining unit is used to determine a first slope of the current straight line and a second slope of the voltage straight line; determine a first mean square error according to the current curve and determine a second mean square error according to the voltage curve;

[0017] The detection unit is used to detect whether the switch sensor detects an abnormal event according to the first slope, the second slope, the first mean square error, and the second mean square error;

[0018] The execution unit is used to execute the early warning operation if so.

[0019] In a third aspect, an embodiment of the present application provides a switch sensor, comprising a processor, a memory, a communication interface, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the processor, and the program includes instructions for executing the steps in the first aspect of the embodiment of the present application.

[0020] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program for electronic data exchange, wherein the computer program enables a computer to execute part or all of the steps described in the first aspect of the embodiment of the present application.

[0021] In a fifth aspect, an embodiment of the present application provides a computer program product, wherein the computer program product includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to cause a computer to execute some or all of the steps described in the first aspect of the embodiment of the present application. The computer program product may be a software installation package.

[0022] The implementation of the embodiments of the present application has the following beneficial effects:

[0023] It can be seen that the switch control method and switch sensor described in the embodiment of the present application collect the current value of a preset time period to obtain multiple current values; obtain the voltage value of the preset time period to obtain multiple voltage values; perform fitting according to the multiple current values ​​to obtain a current straight line and a current curve; perform fitting according to the multiple voltage values ​​to obtain a voltage straight line and a voltage curve; determine the first slope of the current straight line and the second slope of the voltage straight line; determine the first mean square error according to the current curve and the second mean square error according to the voltage curve; detect whether the switch sensor detects an abnormal event according to the first slope, the second slope, the first mean square error and the second mean square error; if so, perform an early warning operation, so that the first slope and the second slope respectively reflect the trend of current and voltage changes, the first mean square error and the second mean square error respectively reflect the stability of current and voltage during operation, and then, abnormal event detection can be performed based on the trend of current and voltage changes and the stability of current and voltage during operation, and corresponding early warning operations can be performed to ensure safety, thereby improving the intelligence of the switch sensor. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be 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 paying creative work.

[0025] Figure 1 is a flow chart of a switch control method provided in an embodiment of the present application;

[0026] Figure 2 is a structural schematic diagram of a switch sensor provided in an embodiment of the present application;

[0027] Figure 3 This is a block diagram of the functional units of a switch sensor provided in an embodiment of the present application. DETAILED DESCRIPTION

[0028] The terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but in a possible example also includes steps or units that are not listed, or in a possible example also includes other steps or units inherent to these processes, methods, products or devices.

[0029] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0030] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0031] See also Figure 1 , Figure 1 1 is a flow chart of a switch control method provided by an embodiment of the present application. As shown in the figure, it is applied to a switch sensor. The switch control method includes:

[0032] 101. Collect current values ​​in a preset time period to obtain multiple current values.

[0033] In the embodiment of the present application, the switch sensor can be any switch device, and the switch sensor can be applied to electronic equipment or power grid lines.

[0034] The preset time period may be preset or set by system default.

[0035] In a specific implementation, the current value of a preset time period may be collected at every first preset time interval to obtain multiple current values. The first preset time interval may be preset or set by system default.

[0036] 102. Obtain the voltage value in the preset time period to obtain multiple voltage values.

[0037] The voltage value of the preset time period may be collected at every second preset time interval to obtain multiple voltage values. The second preset time interval may be preset or set by system default.

[0038] The first preset time interval and the second preset time interval may be the same or different.

[0039] 103. Perform fitting according to the multiple current values ​​to obtain a current straight line and a current curve.

[0040] In a specific implementation, fitting can be performed based on multiple current values ​​to obtain a current straight line, and fitting can also be performed based on the multiple current values ​​to obtain a current curve.

[0041] Among them, the current straight line reflects the current change curve, and the current curve reflects the current fluctuation.

[0042] In a specific implementation, fitting can be performed based on multiple current values ​​to obtain a current straight line and a current curve, that is, each current value corresponds to a collection time, and the current value and its corresponding collection time can be regarded as a coordinate point. Furthermore, multiple current values ​​can correspond to multiple coordinate points, that is, fitting can be performed based on multiple coordinate points to obtain a current straight line and a current curve.

[0043] 104. Perform fitting according to the multiple voltage values ​​to obtain a voltage straight line and a voltage curve.

[0044] In a specific implementation, fitting can be performed based on multiple voltage values ​​to obtain a voltage straight line, and fitting can also be performed based on multiple voltage values ​​to obtain a voltage curve.

[0045] Among them, the voltage straight line reflects the voltage change curve, and the voltage curve reflects the voltage fluctuation.

[0046] In a specific implementation, fitting can be performed based on multiple voltage values ​​to obtain a voltage line and a voltage curve, that is, each voltage value corresponds to a collection time, and the voltage value and its corresponding collection time can be regarded as a coordinate point. Furthermore, multiple voltage values ​​can correspond to multiple coordinate points, that is, fitting can be performed based on multiple coordinate points to obtain a voltage line and a voltage curve.

[0047] 105. Determine a first slope of the current straight line, and determine a second slope of the voltage straight line.

[0048] Among them, the first slope of the current straight line can be determined, and the first slope reflects the current change trend. The second slope of the voltage straight line can also be determined, and the second slope reflects the voltage change trend.

[0049] 106. Determine a first mean square error according to the current curve, and determine a second mean square error according to the voltage curve.

[0050] In a specific implementation, the current curve may be sampled according to a first sampling rule to obtain multiple sampled currents, and a mean square error calculation may be performed based on the multiple sampled currents to obtain a first mean square error. The first sampling rule may be preset or set by system default.

[0051] Correspondingly, the voltage curve may be sampled according to a second sampling rule to obtain a plurality of sampled voltages, and a mean square error calculation may be performed on the plurality of sampled voltages to obtain a second mean square error. The second sampling rule may be preset or set by system default.

[0052] The first sampling rule and the second sampling rule may be the same or different.

[0053] 107. Detect whether the switch sensor detects an abnormal event according to the first slope, the second slope, the first mean square error, and the second mean square error.

[0054] In a specific implementation, the first slope and the second slope respectively reflect the trends of current and voltage changes, and the first mean square error and the second mean square error respectively reflect the stability of current and voltage during operation. Furthermore, abnormal event detection can be performed based on the trends of current and voltage changes and the stability of current and voltage during operation. Specifically, whether the switch sensor detects an abnormal event can be detected based on the first slope, the second slope, the first mean square error, and the second mean square error, thereby improving the intelligence of the smart switch.

[0055] Among them, the abnormal event may include at least one of the following: a voltage overvoltage event, a voltage undervoltage event, a current overcurrent event, a current undercurrent event, etc., which are not limited here.

[0056] 108. If yes, execute the warning operation.

[0057] Among them, the warning operation may include at least one of the following: voice prompt, vibration prompt, voltage increase operation, voltage reduction operation, current increase operation, current reduction operation, etc., which are not limited here.

[0058] In a specific implementation, after an abnormal event is detected, an early warning operation can be performed. The first slope and the second slope respectively reflect the trends of current and voltage changes, and the first mean square error and the second mean square error respectively reflect the stability of current and voltage during operation. Furthermore, abnormal event detection can be performed based on the trends of current and voltage changes and the stability of current and voltage during operation, and corresponding early warning operations can be performed to ensure safety, thereby improving the intelligence of the switch sensor.

[0059] In the specific implementation, if no, that is, no abnormal event is detected, it means that the equipment is working stably, and abnormal monitoring can continue to ensure safety and further improve the intelligence of the switch.

[0060] Optionally, the above step 107, detecting whether the switch sensor detects an abnormal event according to the first slope, the second slope, the first mean square error, and the second mean square error, may include the following steps:

[0061] determining a first absolute value of the first slope;

[0062] determining a second absolute value of the second slope;

[0063] When the first absolute value is greater than a first preset threshold, and / or the second absolute value is greater than a second preset threshold, determining that the abnormal event is detected;

[0064] or,

[0065] When the first absolute value is less than or equal to the first preset threshold and the second absolute value is less than or equal to the second preset threshold, determining a first relative deviation according to the first slope and the second slope;

[0066] Acquiring target environmental parameters of the switch sensor;

[0067] Determining a first preset range corresponding to the target environmental parameter;

[0068] The first preset range is adjusted according to the first mean square error and the second mean square error to obtain a second preset range;

[0069] When the first relative deviation is not within the second preset range, it is determined that the abnormal event is detected.

[0070] The first preset threshold may be preset or set by system default, and the second preset threshold may also be preset or set by system default.

[0071] In a specific implementation, the absolute value of the first slope can be obtained to obtain the first absolute value, and the absolute value of the second slope can also be obtained to obtain the second absolute value. When the first absolute value is greater than the first preset threshold, and / or the second absolute value is greater than the second preset threshold, it is determined that an abnormal event is detected, that is, at least one of the following abnormal events is detected, namely, a voltage overvoltage event, a voltage undervoltage event, a current overcurrent event, and a current undercurrent event.

[0072] In a specific implementation, when the first absolute value is less than or equal to the first preset threshold and the second absolute value is less than or equal to the second preset threshold, the first relative deviation can be determined based on the first slope and the second slope, that is, the first relative deviation = (first slope - second slope) / (first slope + second slope). The first relative deviation not only reflects the size of the deviation, but also reflects the direction of the deviation, that is, the first relative deviation can reflect the degree and direction of abnormality from the current and voltage to a certain extent.

[0073] Next, the target environment parameters of the switch sensor may also be obtained, and the target environment parameters reflect the working environment of the switch sensor to a certain extent.

[0074] Among them, the target environmental parameters may include environmental parameters where the switch sensor is located, and the environmental parameters may include at least one of the following: target hardware environmental parameters, target software environmental parameters, target space environmental parameters, etc., which are not limited here.

[0075] The target hardware environment parameters may include at least one of the following: processor configuration parameters, memory configuration parameters, circuit diagram layout parameters, component models, load conditions, line conditions, etc., which are not limited here.

[0076] The target software environment parameters may include at least one of the following: system version, network bandwidth, cache status, background program, foreground program, etc., which are not limited here.

[0077] The target space environment parameters may include at least one of the following: ambient temperature, ambient humidity, weather, magnetic field interference intensity, ambient light brightness, etc., which are not limited here.

[0078] In a specific implementation, the mapping relationship between the preset environmental parameters and the preset range can be pre-stored, and then, the first preset range corresponding to the target environmental parameter can be used. In addition, considering the working stability, the first preset range can be adjusted according to the first mean square error and the second mean square error to obtain the second preset range, so that the second preset range is more in line with the actual situation. When the first relative deviation is not in the second preset range, it is determined that an abnormal event is detected. The first mean square error and the second mean square error respectively reflect the stability of the current and voltage during operation. Then, the abnormal event detection can be performed based on the trend of the current and voltage changes and the stability of the current and voltage during operation. Specifically, whether the switch sensor detects an abnormal event can be detected according to the first slope, the second slope, the first mean square error and the second mean square error, thereby improving the intelligence of the intelligent switch.

[0079] Optionally, the first preset range includes a first upper threshold and a first lower threshold;

[0080] The above step of adjusting the first preset range according to the first mean square error and the second mean square error to obtain the second preset range may include the following steps:

[0081] Determine a second relative deviation according to the first mean square error and the second mean square error;

[0082] determining a target adjustment parameter corresponding to the second relative deviation;

[0083] Adjust the first upper threshold according to the target adjustment parameter to obtain a second upper threshold;

[0084] Adjusting the first lower threshold according to the target adjustment parameter to obtain a second lower threshold;

[0085] The second preset range is determined according to the second upper threshold and the second lower threshold.

[0086] In a specific implementation, the second relative deviation can be determined based on the first mean square error and the second mean square error. The second relative deviation = (first mean square error - second mean square error) / (first mean square error + second mean square error). The second relative deviation not only reflects the size of the stability deviation, but also reflects the direction of the stability deviation. That is, the first relative deviation can reflect the degree of stability abnormality and the direction of abnormality from the current and voltage to a certain extent.

[0087] Next, a mapping relationship between a preset relative deviation and an adjustment parameter can be pre-stored, and a value range of the adjustment parameter can be -0.2 to 0.2. Then, a target adjustment parameter corresponding to the second relative deviation can be determined based on the mapping relationship. Accordingly, the first upper threshold can be adjusted according to the target adjustment parameter to obtain a second upper threshold, the second upper threshold = (1 + target adjustment parameter) * first upper threshold, and then the first lower threshold is adjusted according to the target adjustment parameter to obtain a second lower threshold, the second lower threshold = (1 + target adjustment parameter) * first lower threshold. Finally, a second preset range can be determined according to the second upper threshold and the second lower threshold, that is, the second preset range = [second lower threshold, second lower threshold]. In this way, the first mean square error and the second mean square error respectively reflect the stability of the current and voltage during operation. Then, abnormal event detection can be performed based on the trend of current and voltage changes and the stability of the current and voltage during operation. Specifically, whether the switch sensor detects an abnormal event can be detected according to the first slope, the second slope, the first mean square error and the second mean square error, thereby improving the intelligence of the intelligent switch.

[0088] Optionally, the target environment parameters include: target hardware environment parameters, target software environment parameters and target space environment parameters, and the above step of determining the first preset range corresponding to the target environment parameters may include the following steps:

[0089] Determine a reference range corresponding to the target hardware environment parameter, the reference range comprising: a reference upper threshold and a reference lower threshold;

[0090] Determining a first optimization parameter corresponding to the target software environment parameter;

[0091] Optimizing the reference upper limit threshold according to the first optimization parameter to obtain a first reference upper limit threshold;

[0092] Optimizing the reference lower limit threshold according to the first optimization parameter to obtain a first reference lower limit threshold;

[0093] Determining a first feedback adjustment parameter corresponding to the target space environment parameter;

[0094] Performing feedback adjustment on the first reference upper limit threshold according to the first feedback adjustment parameter to obtain the first upper limit threshold;

[0095] Feedback adjustment is performed on the first reference lower threshold according to the first feedback adjustment parameter to obtain the first lower threshold.

[0096] In a specific implementation, a mapping relationship between preset hardware environment parameters and ranges may be pre-stored, and then a reference range corresponding to the target hardware environment parameters may be determined based on the mapping relationship, the reference range including: a reference upper threshold and a reference lower threshold.

[0097] Next, since the quality of the software also affects the working stability of the equipment to a certain extent, the mapping relationship between the preset software environment parameters and the optimization parameters can be pre-stored, and then, the first optimization parameter corresponding to the target software environment parameter can be determined based on the mapping relationship. The value range of the optimization parameter can be -0.12 to 0.12. Accordingly, the reference upper limit threshold can be optimized according to the first optimization parameter to obtain the first reference upper limit threshold, the first reference upper limit threshold = (1 + first optimization parameter) * reference upper limit threshold, and then the reference lower limit threshold is optimized according to the first optimization parameter to obtain the first reference lower limit threshold, that is, the first reference lower limit threshold = (1 + first optimization parameter) * reference lower limit threshold.

[0098] Furthermore, the mapping relationship between the preset spatial environment parameters and the feedback adjustment parameters can be pre-stored, and the value range of the feedback adjustment parameters is -0.05 to 0.05. Then, the first feedback adjustment parameter corresponding to the target spatial environment parameter can be determined based on the mapping relationship, and then the first reference upper limit threshold is feedback-adjusted according to the first feedback adjustment parameter to obtain the first upper limit threshold, the first upper limit threshold = (1 + first feedback adjustment parameter) * first reference upper limit threshold, correspondingly, the first reference lower limit threshold is feedback-adjusted according to the first feedback adjustment parameter to obtain the first lower limit threshold, that is, the first lower limit threshold = (1 + first feedback adjustment parameter) * first reference lower limit threshold. In this way, the corresponding second preset range can be determined from the hardware, software, and actual spatial environment depth, so that the final second preset range depth conforms to the actual environment, which helps to ensure the intelligence of the switch sensor.

[0099] Optionally, the above step 108, executing the early warning operation, may include the following steps:

[0100] When the first absolute value is greater than a first preset threshold, determining a first deviation between the first absolute value and the first preset threshold;

[0101] determining a first warning parameter corresponding to the first deviation;

[0102] Execute a warning operation according to the first warning parameter;

[0103] or,

[0104] When the second absolute value is greater than the second preset threshold, determining a second deviation between the second absolute value and the second preset threshold;

[0105] determining a second warning parameter corresponding to the second degree of deviation;

[0106] Execute a warning operation according to the second warning parameter;

[0107] or,

[0108] When the first relative deviation is greater than the second upper threshold, determining a third deviation between the first relative deviation and the second upper threshold;

[0109] determining a third warning parameter corresponding to the third degree of deviation;

[0110] Execute a warning operation according to the third warning parameter;

[0111] or,

[0112] When the first relative deviation is less than the second lower threshold, determining a fourth deviation between the first relative deviation and the second lower threshold;

[0113] determining a fourth warning parameter corresponding to the fourth degree of deviation;

[0114] An early warning operation is performed according to the fourth early warning parameter.

[0115] In a specific implementation, the first warning parameter may include at least one of the following: power off, switching working mode, increasing voltage, reducing voltage, current limiting, increasing current, voice prompt parameter, vibration prompt parameter, etc., which are not limited here.

[0116] In a specific implementation, the second warning parameter may include at least one of the following: power off, switching working mode, increasing voltage, reducing voltage, current limiting, increasing current, voice prompt parameter, vibration prompt parameter, etc., which are not limited here.

[0117] In a specific implementation, the third warning parameter may include at least one of the following: power off, switching working mode, increasing voltage, reducing voltage, current limiting, increasing current, voice prompt parameter, vibration prompt parameter, etc., which are not limited here.

[0118] In a specific implementation, the fourth warning parameter may include at least one of the following: power off, switching working mode, increasing voltage, reducing voltage, current limiting, increasing current, voice prompt parameter, vibration prompt parameter, etc., which are not limited here.

[0119] Among them, the first warning parameter, the second warning parameter, the third warning parameter, and the fourth warning parameter may be the same or different.

[0120] Specifically, when the first absolute value is greater than the first preset threshold, the first deviation between the first absolute value and the first preset threshold can be determined, that is, the first deviation = (first absolute value - first preset threshold) / first preset threshold, and the first mapping relationship between the preset deviation and the warning parameter can be pre-stored, and then, based on the first mapping relationship, the first warning parameter corresponding to the first deviation can be determined, and then the warning operation can be performed according to the first warning parameter.

[0121] Of course, in a specific implementation, when the second absolute value is greater than the second preset threshold, the second deviation between the second absolute value and the second preset threshold is determined, that is, the second deviation = (second absolute value - second preset threshold) / second preset threshold. The second mapping relationship between the preset deviation and the warning parameter can be pre-stored, and then, the second warning parameter corresponding to the second deviation can be determined based on the second mapping relationship, and then the warning operation can be performed according to the second warning parameter.

[0122] Of course, in a specific implementation, when the first relative deviation is greater than the second upper limit threshold, the third deviation between the first relative deviation and the second upper limit threshold can be determined, that is, the third deviation = (first relative deviation - second upper limit threshold) / second upper limit threshold, and the third mapping relationship between the preset deviation and the warning parameter can be pre-stored, and then, the third warning parameter corresponding to the third deviation can be determined based on the third mapping relationship, and then the warning operation can be performed according to the third warning parameter.

[0123] Of course, in a specific implementation, when the first relative deviation is less than the second lower limit threshold, the fourth deviation between the first relative deviation and the second lower limit threshold is determined, that is, the fourth deviation = (first relative deviation - second lower limit threshold) / second lower limit threshold, and the fourth mapping relationship between the preset deviation and the warning parameter can be pre-stored, and then, the fourth warning parameter corresponding to the fourth deviation can be determined based on the fourth mapping relationship, and then the warning operation is performed according to the fourth warning parameter.

[0124] In this way, after an abnormal event is detected, an early warning operation can be performed. Specifically, a dynamic early warning can be issued based on the actual degree and direction of deviation to ensure safety, thereby improving the intelligence of the switch sensor.

[0125] Optionally, the following steps may also be included:

[0126] Acquire the power value of the preset time period to obtain multiple power values;

[0127] Perform fitting according to the multiple power values ​​to obtain a power straight line and a power curve;

[0128] Determine a third mean square error corresponding to the power curve;

[0129] Determine a target standard deviation according to the first mean square error, the second mean square error, and the third mean square error;

[0130] Obtaining the monotonicity of the power straight line;

[0131] Then, the above step of performing feedback adjustment on the first reference upper limit threshold according to the first feedback adjustment parameter to obtain the first upper limit threshold may include the following steps:

[0132] Performing feedback adjustment on the first reference upper limit threshold according to the first feedback adjustment parameter to obtain a second reference upper limit threshold;

[0133] Adjusting the second reference upper threshold according to the monotonicity and the target standard deviation to obtain the first upper threshold;

[0134] Then, the above step of performing feedback adjustment on the first reference lower limit threshold according to the first feedback adjustment parameter to obtain the first lower limit threshold may include the following steps:

[0135] Performing feedback adjustment on the first reference lower limit threshold according to the first feedback adjustment parameter to obtain a second reference lower limit threshold;

[0136] The second reference lower threshold is adjusted according to the monotonicity and the target standard deviation to obtain the first lower threshold.

[0137] In a specific implementation, the power value of a preset time period can also be obtained to obtain multiple power values. Specifically, the power value of a preset time period can be obtained every third preset interval to obtain multiple power values. The third preset interval can be pre-set or system default.

[0138] The first preset time interval, the second preset time interval, and the third preset time interval may be the same or different.

[0139] Next, fitting can be performed based on multiple power values ​​to obtain a power line and a power curve, that is, each power value corresponds to a collection time, and the power value and its corresponding collection time can be regarded as a coordinate point. Furthermore, multiple power values ​​can correspond to multiple coordinate points, that is, fitting can be performed based on multiple coordinate points to obtain a power line and a power curve.

[0140] Among them, the power straight line reflects the power change curve, and the power curve reflects the power fluctuation.

[0141] Next, the power curve can also be sampled according to the third sampling rule to obtain multiple sampling powers, and a mean square error calculation is performed based on the multiple sampling powers to obtain a third mean square error. The third sampling rule can be preset or the system defaults, and then a standard deviation calculation is performed based on the first mean square error, the second mean square error and the third mean square error to obtain a target standard deviation. The voltage and current restrain each other to a certain extent, and the voltage, current and power form a whole. The target standard deviation reflects the overall working stability of the whole.

[0142] Furthermore, the monotonicity of the power line can also be obtained, and the monotonicity reflects the overall change direction.

[0143] On the one hand, the first reference upper limit threshold can be feedback-adjusted according to the first feedback adjustment parameter to obtain the second reference upper limit threshold, that is, the second reference upper limit threshold = (1 + first feedback adjustment parameter) * first reference upper limit threshold, and then the second reference upper limit threshold is adjusted according to the monotonicity and the target standard deviation to obtain the first upper limit threshold. The mapping relationship between the preset standard deviation and the feedback adjustment parameter can also be pre-stored, and then the second feedback adjustment parameter corresponding to the target standard deviation can be determined based on the mapping relationship. The value range of the second feedback adjustment parameter can be 0 to 0.02. For example, when the monotonicity is upward, the first upper limit threshold = (1 + second feedback adjustment parameter) * second reference upper limit threshold, and when the monotonicity is downward, the first upper limit threshold = (1-second feedback adjustment parameter) * second reference upper limit threshold.

[0144] On the other hand, the first reference lower limit threshold can also be feedback-adjusted according to the first feedback adjustment parameter to obtain the second reference lower limit threshold, that is, the second reference lower limit threshold = (1 + first feedback adjustment parameter) * first reference lower limit threshold, and then the second reference lower limit threshold is adjusted according to the monotonicity and the target standard deviation to obtain the first lower limit threshold. The mapping relationship between the preset standard deviation and the feedback adjustment parameter can also be pre-stored, and then the second feedback adjustment parameter corresponding to the target standard deviation can be determined based on the mapping relationship. The value range of the second feedback adjustment parameter can be 0 to 0.02. For example, when the monotonicity is upward, the first lower limit threshold = (1 + second feedback adjustment parameter) * second reference lower limit threshold, and when the monotonicity is downward, the first lower limit threshold = (1-second feedback adjustment parameter) * second reference lower limit threshold.

[0145] It can be seen that the switch control method described in the embodiment of the present application is applied to the switch sensor, and the current value of the preset time period is collected to obtain multiple current values; the voltage value of the preset time period is obtained to obtain multiple voltage values; fitting is performed according to the multiple current values ​​to obtain a current straight line and a current curve; fitting is performed according to the multiple voltage values ​​to obtain a voltage straight line and a voltage curve; the first slope of the current straight line is determined, and the second slope of the voltage straight line is determined; the first mean square error is determined according to the current curve, and the second mean square error is determined according to the voltage curve; according to the first slope, the second slope, the first mean square error and the second mean square error, it is detected whether the switch sensor detects an abnormal event; if so, an early warning operation is performed, so that the first slope and the second slope respectively reflect the trend of current and voltage changes, and the first mean square error and the second mean square error respectively reflect the stability of current and voltage during operation, and then, abnormal event detection can be performed based on the trend of current and voltage changes and the stability of current and voltage during operation, and corresponding early warning operations are performed to ensure safety, thereby improving the intelligence of the switch sensor.

[0146] In accordance with the above embodiment, please refer to Figure 2 , Figure 2 : is a schematic diagram of the structure of a switch sensor provided in an embodiment of the present application. As shown in the figure, the switch sensor includes a processor, a memory, a communication interface, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the processor. In the embodiment of the present application, the program includes instructions for executing the following steps:

[0147] Collecting current values ​​in a preset time period to obtain multiple current values;

[0148] Acquire the voltage value in the preset time period to obtain multiple voltage values;

[0149] Perform fitting according to the multiple current values ​​to obtain a current straight line and a current curve;

[0150] Perform fitting according to the multiple voltage values ​​to obtain a voltage straight line and a voltage curve;

[0151] Determine a first slope of the current straight line, and determine a second slope of the voltage straight line;

[0152] Determine a first mean square error according to the current curve, and determine a second mean square error according to the voltage curve;

[0153] detecting whether the switch sensor detects an abnormal event according to the first slope, the second slope, the first mean square error, and the second mean square error;

[0154] If so, perform warning operations.

[0155] Optionally, in the aspect of detecting whether the switch sensor detects an abnormal event according to the first slope, the second slope, the first mean square error, and the second mean square error, the program includes instructions for executing the following steps:

[0156] determining a first absolute value of the first slope;

[0157] determining a second absolute value of the second slope;

[0158] When the first absolute value is greater than a first preset threshold, and / or the second absolute value is greater than a second preset threshold, determining that the abnormal event is detected;

[0159] or,

[0160] When the first absolute value is less than or equal to the first preset threshold and the second absolute value is less than or equal to the second preset threshold, determining a first relative deviation according to the first slope and the second slope;

[0161] Acquiring target environmental parameters of the switch sensor;

[0162] Determining a first preset range corresponding to the target environmental parameter;

[0163] The first preset range is adjusted according to the first mean square error and the second mean square error to obtain a second preset range;

[0164] When the first relative deviation is not within the second preset range, it is determined that the abnormal event is detected.

[0165] Optionally, the first preset range includes a first upper threshold and a first lower threshold;

[0166] In the aspect of adjusting the first preset range according to the first mean square error and the second mean square error to obtain the second preset range, the above program includes instructions for executing the following steps:

[0167] Determine a second relative deviation according to the first mean square error and the second mean square error;

[0168] determining a target adjustment parameter corresponding to the second relative deviation;

[0169] Adjust the first upper threshold according to the target adjustment parameter to obtain a second upper threshold;

[0170] Adjusting the first lower threshold according to the target adjustment parameter to obtain a second lower threshold;

[0171] The second preset range is determined according to the second upper threshold and the second lower threshold.

[0172] Optionally, the target environment parameters include: target hardware environment parameters, target software environment parameters and target space environment parameters. In determining the first preset range corresponding to the target environment parameters, the program includes instructions for executing the following steps:

[0173] Determine a reference range corresponding to the target hardware environment parameter, the reference range comprising: a reference upper threshold and a reference lower threshold;

[0174] Determining a first optimization parameter corresponding to the target software environment parameter;

[0175] Optimizing the reference upper limit threshold according to the first optimization parameter to obtain a first reference upper limit threshold;

[0176] Optimizing the reference lower limit threshold according to the first optimization parameter to obtain a first reference lower limit threshold;

[0177] Determining a first feedback adjustment parameter corresponding to the target space environment parameter;

[0178] Performing feedback adjustment on the first reference upper limit threshold according to the first feedback adjustment parameter to obtain the first upper limit threshold;

[0179] Feedback adjustment is performed on the first reference lower threshold according to the first feedback adjustment parameter to obtain the first lower threshold.

[0180] Optionally, in the aspect of executing the early warning operation, the above program includes instructions for executing the following steps:

[0181] When the first absolute value is greater than a first preset threshold, determining a first deviation between the first absolute value and the first preset threshold;

[0182] determining a first warning parameter corresponding to the first deviation;

[0183] Execute a warning operation according to the first warning parameter;

[0184] or,

[0185] When the second absolute value is greater than the second preset threshold, determining a second deviation between the second absolute value and the second preset threshold;

[0186] determining a second warning parameter corresponding to the second degree of deviation;

[0187] Execute a warning operation according to the second warning parameter;

[0188] or,

[0189] When the first relative deviation is greater than the second upper threshold, determining a third deviation between the first relative deviation and the second upper threshold;

[0190] determining a third warning parameter corresponding to the third degree of deviation;

[0191] Execute a warning operation according to the third warning parameter;

[0192] or,

[0193] When the first relative deviation is less than the second lower threshold, determining a fourth deviation between the first relative deviation and the second lower threshold;

[0194] determining a fourth warning parameter corresponding to the fourth degree of deviation;

[0195] An early warning operation is performed according to the fourth early warning parameter.

[0196] It can be seen that the switch sensor described in the embodiment of the present application collects the current value of a preset time period to obtain multiple current values; obtains the voltage value of the preset time period to obtain multiple voltage values; performs fitting according to the multiple current values ​​to obtain a current straight line and a current curve; performs fitting according to the multiple voltage values ​​to obtain a voltage straight line and a voltage curve; determines the first slope of the current straight line and the second slope of the voltage straight line; determines the first mean square error according to the current curve and the second mean square error according to the voltage curve; detects whether the switch sensor detects an abnormal event according to the first slope, the second slope, the first mean square error and the second mean square error; if so, performs an early warning operation, so that the first slope and the second slope respectively reflect the trend of current and voltage changes, and the first mean square error and the second mean square error respectively reflect the stability of current and voltage during operation, and then, abnormal event detection can be performed based on the trend of current and voltage changes and the stability of current and voltage during operation, and corresponding early warning operations can be performed to ensure safety, thereby improving the intelligence of the switch sensor.

[0197] Figure 3 is a functional unit composition block diagram of a switch sensor 300 involved in an embodiment of the present application, the switch sensor 300 comprises: an acquisition unit 301, a fitting unit 302, a determination unit 303, a detection unit 304 and an execution unit 305, wherein:

[0198] The acquisition unit 301 is used to collect the current value of a preset time period to obtain multiple current values; obtain the voltage value of the preset time period to obtain multiple voltage values;

[0199] The fitting unit 302 is used to perform fitting according to the multiple current values ​​to obtain a current straight line and a current curve; and to perform fitting according to the multiple voltage values ​​to obtain a voltage straight line and a voltage curve;

[0200] The determining unit 303 is used to determine a first slope of the current line and a second slope of the voltage line; determine a first mean square error according to the current curve and determine a second mean square error according to the voltage curve;

[0201] The detection unit 304 is used to detect whether the switch sensor detects an abnormal event according to the first slope, the second slope, the first mean square error, and the second mean square error;

[0202] The execution unit 305 is used to execute the early warning operation if yes.

[0203] Optionally, in the aspect of detecting whether the switch sensor detects an abnormal event according to the first slope, the second slope, the first mean square error, and the second mean square error, the detection unit 304 is specifically configured to:

[0204] determining a first absolute value of the first slope;

[0205] determining a second absolute value of the second slope;

[0206] When the first absolute value is greater than a first preset threshold, and / or the second absolute value is greater than a second preset threshold, determining that the abnormal event is detected;

[0207] or,

[0208] When the first absolute value is less than or equal to the first preset threshold and the second absolute value is less than or equal to the second preset threshold, determining a first relative deviation according to the first slope and the second slope;

[0209] Acquiring target environmental parameters of the switch sensor;

[0210] Determining a first preset range corresponding to the target environmental parameter;

[0211] The first preset range is adjusted according to the first mean square error and the second mean square error to obtain a second preset range;

[0212] When the first relative deviation is not within the second preset range, it is determined that the abnormal event is detected.

[0213] Optionally, the first preset range includes a first upper threshold and a first lower threshold;

[0214] In the aspect of adjusting the first preset range according to the first mean square error and the second mean square error to obtain the second preset range, the detection unit 304 is specifically used for:

[0215] Determine a second relative deviation according to the first mean square error and the second mean square error;

[0216] determining a target adjustment parameter corresponding to the second relative deviation;

[0217] Adjust the first upper threshold according to the target adjustment parameter to obtain a second upper threshold;

[0218] Adjusting the first lower threshold according to the target adjustment parameter to obtain a second lower threshold;

[0219] The second preset range is determined according to the second upper threshold and the second lower threshold.

[0220] Optionally, the target environment parameters include: target hardware environment parameters, target software environment parameters and target space environment parameters. In determining the first preset range corresponding to the target environment parameters, the detection unit 304 is specifically used to:

[0221] Determine a reference range corresponding to the target hardware environment parameter, the reference range comprising: a reference upper threshold and a reference lower threshold;

[0222] Determining a first optimization parameter corresponding to the target software environment parameter;

[0223] Optimizing the reference upper limit threshold according to the first optimization parameter to obtain a first reference upper limit threshold;

[0224] Optimizing the reference lower limit threshold according to the first optimization parameter to obtain a first reference lower limit threshold;

[0225] Determining a first feedback adjustment parameter corresponding to the target space environment parameter;

[0226] Performing feedback adjustment on the first reference upper limit threshold according to the first feedback adjustment parameter to obtain the first upper limit threshold;

[0227] Feedback adjustment is performed on the first reference lower threshold according to the first feedback adjustment parameter to obtain the first lower threshold.

[0228] Optionally, in the aspect of executing the warning operation, the warning unit 305 is specifically used for:

[0229] When the first absolute value is greater than a first preset threshold, determining a first deviation between the first absolute value and the first preset threshold;

[0230] determining a first warning parameter corresponding to the first deviation;

[0231] Execute a warning operation according to the first warning parameter;

[0232] or,

[0233] When the second absolute value is greater than the second preset threshold, determining a second deviation between the second absolute value and the second preset threshold;

[0234] determining a second warning parameter corresponding to the second degree of deviation;

[0235] Execute a warning operation according to the second warning parameter;

[0236] or,

[0237] When the first relative deviation is greater than the second upper threshold, determining a third deviation between the first relative deviation and the second upper threshold;

[0238] determining a third warning parameter corresponding to the third degree of deviation;

[0239] Execute a warning operation according to the third warning parameter;

[0240] or,

[0241] When the first relative deviation is less than the second lower threshold, determining a fourth deviation between the first relative deviation and the second lower threshold;

[0242] determining a fourth warning parameter corresponding to the fourth degree of deviation;

[0243] An early warning operation is performed according to the fourth early warning parameter.

[0244] It can be seen that the switch sensor described in the embodiment of the present application collects the current value of a preset time period to obtain multiple current values; obtains the voltage value of the preset time period to obtain multiple voltage values; performs fitting according to the multiple current values ​​to obtain a current straight line and a current curve; performs fitting according to the multiple voltage values ​​to obtain a voltage straight line and a voltage curve; determines the first slope of the current straight line and the second slope of the voltage straight line; determines the first mean square error according to the current curve and the second mean square error according to the voltage curve; detects whether the switch sensor detects an abnormal event according to the first slope, the second slope, the first mean square error and the second mean square error; if so, performs an early warning operation, so that the first slope and the second slope respectively reflect the trend of current and voltage changes, and the first mean square error and the second mean square error respectively reflect the stability of current and voltage during operation, and then, abnormal event detection can be performed based on the trend of current and voltage changes and the stability of current and voltage during operation, and corresponding early warning operations can be performed to ensure safety, thereby improving the intelligence of the switch sensor.

[0245] It can be understood that the functions of each program module of the switch sensor of this embodiment can be specifically implemented according to the method in the above method embodiment. The specific implementation process can refer to the relevant description of the above method embodiment, which will not be repeated here.

[0246] An embodiment of the present application also provides a computer storage medium, wherein the computer storage medium stores a computer program for electronic data exchange, wherein the computer program enables a computer to execute part or all of the steps of any method recorded in the above method embodiment, and the above computer includes a switch sensor.

[0247] The present application also provides a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to cause a computer to execute some or all of the steps of any method described in the method embodiment. The computer program product may be a software installation package, and the computer includes a switch sensor.

[0248] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.

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

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

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

[0252] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0253] If the above-mentioned integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a memory, including a number of instructions to enable a computer device (which can be a personal computer, server or network device, etc.) to perform all or part of the steps of the above-mentioned methods of each embodiment of the present application. The aforementioned memory includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or CD-ROM and other media that can store program codes.

[0254] A person skilled in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable memory, and the memory can include: a flash drive, a read-only memory (English: Read-Only Memory, abbreviated as: ROM), a random access memory (English: Random Access Memory, abbreviated as: RAM), a magnetic disk or an optical disk, etc.

[0255] The embodiments of the present application are introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method and core idea of ​​the present application. At the same time, for general technical personnel in this field, according to the idea of ​​the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A switch control method, characterized in that: Applied to a switch sensor, the method comprises: Collecting current values ​​in a preset time period to obtain multiple current values; Acquire the voltage value in the preset time period to obtain multiple voltage values; Perform fitting according to the multiple current values ​​to obtain a current straight line and a current curve; Perform fitting according to the multiple voltage values ​​to obtain a voltage straight line and a voltage curve; Determine a first slope of the current straight line, and determine a second slope of the voltage straight line; Determine a first mean square error according to the current curve, and determine a second mean square error according to the voltage curve; detecting whether the switch sensor detects an abnormal event according to the first slope, the second slope, the first mean square error, and the second mean square error; If so, perform warning operations.

2. The method according to claim 1, characterized in that The detecting whether the switch sensor detects an abnormal event according to the first slope, the second slope, the first mean square error, and the second mean square error comprises: determining a first absolute value of the first slope; determining a second absolute value of the second slope; When the first absolute value is greater than a first preset threshold, and / or the second absolute value is greater than a second preset threshold, determining that the abnormal event is detected; or, When the first absolute value is less than or equal to the first preset threshold and the second absolute value is less than or equal to the second preset threshold, determining a first relative deviation according to the first slope and the second slope; Acquiring target environmental parameters of the switch sensor; Determining a first preset range corresponding to the target environmental parameter; The first preset range is adjusted according to the first mean square error and the second mean square error to obtain a second preset range; When the first relative deviation is not within the second preset range, it is determined that the abnormal event is detected.

3. The method according to claim 2, characterized in that The first preset range includes a first upper threshold and a first lower threshold; The step of adjusting the first preset range according to the first mean square error and the second mean square error to obtain a second preset range includes: Determine a second relative deviation according to the first mean square error and the second mean square error; determining a target adjustment parameter corresponding to the second relative deviation; Adjust the first upper threshold according to the target adjustment parameter to obtain a second upper threshold; Adjusting the first lower threshold according to the target adjustment parameter to obtain a second lower threshold; The second preset range is determined according to the second upper threshold and the second lower threshold.

4. The method according to claim 3, characterized in that The target environment parameters include: target hardware environment parameters, target software environment parameters and target space environment parameters, and the determining of the first preset range corresponding to the target environment parameters includes: Determine a reference range corresponding to the target hardware environment parameter, the reference range comprising: a reference upper threshold and a reference lower threshold; Determining a first optimization parameter corresponding to the target software environment parameter; Optimizing the reference upper limit threshold according to the first optimization parameter to obtain a first reference upper limit threshold; Optimizing the reference lower limit threshold according to the first optimization parameter to obtain a first reference lower limit threshold; Determining a first feedback adjustment parameter corresponding to the target space environment parameter; Performing feedback adjustment on the first reference upper limit threshold according to the first feedback adjustment parameter to obtain the first upper limit threshold; Feedback adjustment is performed on the first reference lower threshold according to the first feedback adjustment parameter to obtain the first lower threshold.

5. The method according to claim 3 or 4, characterized in that: The performing of the early warning operation includes: When the first absolute value is greater than a first preset threshold, determining a first deviation between the first absolute value and the first preset threshold; determining a first warning parameter corresponding to the first deviation; Execute a warning operation according to the first warning parameter; or, When the second absolute value is greater than the second preset threshold, determining a second deviation between the second absolute value and the second preset threshold; determining a second warning parameter corresponding to the second degree of deviation; Execute a warning operation according to the second warning parameter; or, When the first relative deviation is greater than the second upper threshold, determining a third deviation between the first relative deviation and the second upper threshold; determining a third warning parameter corresponding to the third degree of deviation; Execute a warning operation according to the third warning parameter; or, When the first relative deviation is less than the second lower threshold, determining a fourth deviation between the first relative deviation and the second lower threshold; determining a fourth warning parameter corresponding to the fourth degree of deviation; An early warning operation is performed according to the fourth early warning parameter.

6. A switch sensor, characterized in that: The switch sensor comprises: an acquisition unit, a fitting unit, a determination unit, a detection unit and an execution unit, wherein: The acquisition unit is used to collect the current value of a preset time period to obtain a plurality of current values; and to acquire the voltage value of the preset time period to obtain a plurality of voltage values; The fitting unit is used to perform fitting according to the multiple current values ​​to obtain a current straight line and a current curve; and to perform fitting according to the multiple voltage values ​​to obtain a voltage straight line and a voltage curve; The determining unit is used to determine a first slope of the current straight line and a second slope of the voltage straight line; determine a first mean square error according to the current curve and determine a second mean square error according to the voltage curve; The detection unit is used to detect whether the switch sensor detects an abnormal event according to the first slope, the second slope, the first mean square error, and the second mean square error; The execution unit is used to execute the early warning operation if so.

7. The switch sensor according to claim 6, characterized in that: In the aspect of detecting whether the switch sensor detects an abnormal event according to the first slope, the second slope, the first mean square error, and the second mean square error, the detection unit is specifically used for: determining a first absolute value of the first slope; determining a second absolute value of the second slope; When the first absolute value is greater than a first preset threshold, and / or the second absolute value is greater than a second preset threshold, determining that the abnormal event is detected; or, When the first absolute value is less than or equal to the first preset threshold and the second absolute value is less than or equal to the second preset threshold, determining a first relative deviation according to the first slope and the second slope; Acquiring target environmental parameters of the switch sensor; Determining a first preset range corresponding to the target environmental parameter; The first preset range is adjusted according to the first mean square error and the second mean square error to obtain a second preset range; When the first relative deviation is not within the second preset range, it is determined that the abnormal event is detected.

8. The switch sensor according to claim 7, characterized in that: The first preset range includes a first upper threshold and a first lower threshold; In the aspect of adjusting the first preset range according to the first mean square error and the second mean square error to obtain the second preset range, the detection unit is specifically used for: Determine a second relative deviation according to the first mean square error and the second mean square error; determining a target adjustment parameter corresponding to the second relative deviation; Adjust the first upper threshold according to the target adjustment parameter to obtain a second upper threshold; Adjusting the first lower threshold according to the target adjustment parameter to obtain a second lower threshold; The second preset range is determined according to the second upper threshold and the second lower threshold.

9. The switch sensor according to claim 8, characterized in that: The target environment parameters include: target hardware environment parameters, target software environment parameters and target space environment parameters. In determining the first preset range corresponding to the target environment parameters, the detection unit is specifically used to: Determine a reference range corresponding to the target hardware environment parameter, the reference range comprising: a reference upper threshold and a reference lower threshold; Determining a first optimization parameter corresponding to the target software environment parameter; Optimizing the reference upper limit threshold according to the first optimization parameter to obtain a first reference upper limit threshold; Optimizing the reference lower limit threshold according to the first optimization parameter to obtain a first reference lower limit threshold; Determining a first feedback adjustment parameter corresponding to the target space environment parameter; Performing feedback adjustment on the first reference upper limit threshold according to the first feedback adjustment parameter to obtain the first upper limit threshold; Feedback adjustment is performed on the first reference lower threshold according to the first feedback adjustment parameter to obtain the first lower threshold.

10. The switch sensor according to claim 8 or 9, characterized in that: In terms of executing the warning operation, the warning unit is specifically used to: When the first absolute value is greater than a first preset threshold, determining a first deviation between the first absolute value and the first preset threshold; determining a first warning parameter corresponding to the first deviation; Execute a warning operation according to the first warning parameter; or, When the second absolute value is greater than the second preset threshold, determining a second deviation between the second absolute value and the second preset threshold; determining a second warning parameter corresponding to the second degree of deviation; Execute a warning operation according to the second warning parameter; or, When the first relative deviation is greater than the second upper threshold, determining a third deviation between the first relative deviation and the second upper threshold; determining a third warning parameter corresponding to the third degree of deviation; Execute a warning operation according to the third warning parameter; or, When the first relative deviation is less than the second lower threshold, determining a fourth deviation between the first relative deviation and the second lower threshold; determining a fourth warning parameter corresponding to the fourth degree of deviation; An early warning operation is performed according to the fourth early warning parameter.