Detection method and device of electronic equipment, storage medium and magnetic field generator

The magnetic field generator triggers the state transition of electronic equipment and compares the hardware information, which solves the problem of cumbersome hardware detection of electronic equipment in the prior art, realizes automated and comprehensive hardware detection, and improves detection efficiency and accuracy.

CN120540912APending Publication Date: 2025-08-26LCFC HEFEI ELECTRONICS TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510472446.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-15
Publication Date
2025-08-26

AI Technical Summary

Technical Problem

In the prior art, the reliability verification of hardware devices in the sleep/wake cycle of electronic devices relies on manual operation, resulting in cumbersome detection and the inability to fully verify all hardware states, affecting the user experience.

Method used

The external magnetic field is emitted by the magnetic field generator, which triggers the electronic device to automatically convert between the normal working state and the non-working state, and compares the hardware information before and after the conversion, and uses the set similarity and attribute similarity algorithm to determine hardware abnormalities.

Benefits of technology

It realizes automation and comprehensive inspection of electronic equipment hardware, improves detection efficiency and accuracy, especially the detection of key hardware, simplifies the inspection process, and provides intuitive monitoring of hardware such as keyboards and power indicators.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120540912A_ABST
    Figure CN120540912A_ABST
Patent Text Reader

Abstract

The invention provides a detection method and device of electronic equipment, a storage medium and a magnetic field generator, and relates to the technical field of computers.The method comprises the steps that when the electronic equipment is in a normal working state, first hardware information of hardware in the electronic equipment is obtained; responding to an external magnetic field emitted by a magnetic field generator, and triggering the electronic equipment to be converted from a normal working state to a non-working state; responding to the situation that the magnetic field generator stops emitting the external magnetic field, triggering the electronic equipment to be converted from a non-working state to a normal working state, and obtaining second hardware information of hardware in the electronic equipment; based on the first hardware information and the second hardware information, a detection result is obtained, and the detection result represents whether the hardware is abnormal or not after target conversion is carried out on the electronic equipment. According to the method, automatic detection of each hardware device is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to a detection method, device, storage medium, and magnetic field generator for electronic equipment. Background Art

[0002] Because electronic devices frequently transition between operating states, verifying the reliability of their hardware devices during sleep / wake cycles is crucial. This prevents users from experiencing issues with hardware malfunctions (such as sensor failures or peripheral disconnection), which can negatively impact the user experience. Current solutions rely on manual operation, including manually setting the device to sleep and exiting sleep, and then verifying the functionality of each hardware device individually after the system wakes up. Automatically detecting each hardware device has become a pressing technical challenge. Summary of the Invention

[0003] The present disclosure provides a detection method, device, storage medium and magnetic field generator for an electronic device to at least solve the above technical problems existing in the prior art.

[0004] In a first aspect of the present disclosure, a method for detecting an electronic device is provided, the method comprising:

[0005] When the electronic device is in a normal working state, obtaining first hardware information of hardware in the electronic device;

[0006] In response to the external magnetic field emitted by the magnetic field generator, triggering the electronic device to switch from a normal working state to a non-working state;

[0007] In response to the magnetic field generator stopping emitting the external magnetic field, triggering the electronic device to switch from a non-working state to a normal working state, and acquiring second hardware information of hardware in the electronic device;

[0008] Based on the first hardware information and the second hardware information, a detection result is obtained, and the detection result characterizes whether there is an abnormality in each hardware after the electronic device performs a target conversion; wherein the target conversion is that the electronic device is converted from a normal working state to a non-working state, and from the non-working state to a normal working state.

[0009] In one possible implementation manner, obtaining a detection result based on the first hardware information and the second hardware information includes:

[0010] Obtaining a set similarity between the first hardware information and the second hardware information;

[0011] A detection result is obtained based on the set similarity and a first preset condition.

[0012] In one possible implementation manner, obtaining a detection result based on the set similarity and a first preset condition includes:

[0013] If the set similarity satisfies the first preset condition, the detection result is that each hardware is normal after the target conversion is performed on the electronic device.

[0014] In one possible implementation manner, obtaining a detection result based on the set similarity and a first preset condition includes:

[0015] If the set similarity does not meet the first preset condition,

[0016] For each hardware, obtain a first attribute set in the first hardware information and a second attribute set in the second hardware information;

[0017] A detection result is obtained based on the first attribute set and the second attribute set.

[0018] In one possible implementation manner, obtaining a detection result based on the first attribute set and the second attribute set includes:

[0019] Obtaining a comprehensive similarity of the hardware based on each attribute information in the first attribute set and the second attribute set;

[0020] A detection result is obtained according to the comprehensive similarity of the hardware and the second preset condition.

[0021] In one embodiment, the electronic device includes a magnetic field sensor for responding to the external magnetic field, and the method further includes:

[0022] In response to the external magnetic field emitted by the magnetic field generator, the electronic device switches from the normal working state to the non-working state, and in response to the magnetic field generator ceasing to emit the external magnetic field, the electronic device switches from the non-working state to the normal working state, and the detection result of the magnetic field sensor is normal;

[0023] In response to the external magnetic field emitted by the magnetic field generator, the electronic device does not switch from the normal working state to the non-working state, or, in response to the magnetic field generator stopping emitting the external magnetic field, the electronic device does not switch from the non-working state to the normal working state, and the detection result of the magnetic field sensor is that an abnormality is present.

[0024] In one possible implementation manner, the obtaining first hardware information of hardware in the electronic device includes:

[0025] Scanning all hardware listed in the device manager through the device manager of the electronic device to obtain hardware information of each hardware;

[0026] Based on the hardware information of each hardware, first hardware information of the hardware in the electronic device is obtained.

[0027] In a second aspect of the present disclosure, a detection device for an electronic device is provided, the device comprising:

[0028] An information acquisition module, configured to acquire first hardware information of hardware in the electronic device when the electronic device is in a normal working state;

[0029] a trigger module, configured to trigger the electronic device to switch from a normal working state to a non-working state in response to an external magnetic field emitted by the magnetic field generator;

[0030] The trigger module is further configured to trigger the electronic device to switch from a non-operating state to a normal operating state in response to the magnetic field generator stopping emitting the external magnetic field, and to obtain second hardware information of hardware in the electronic device;

[0031] A comparison module is used to obtain a detection result based on the first hardware information and the second hardware information, and the detection result characterizes whether there is an abnormality in each hardware after the electronic device performs a target conversion; wherein the target conversion is that the electronic device converts from a normal working state to a non-working state, and from the non-working state to a normal working state.

[0032] A third aspect of the present disclosure provides a magnetic field generator, comprising an electromagnetic module and a power supply module;

[0033] The power supply module is used to periodically power the electromagnetic module so that when the electromagnetic module is powered on, it emits an external magnetic field, triggering the electronic device to switch from a normal working state to a non-working state; when the electromagnetic module is powered off, the external magnetic field disappears, triggering the electronic device to switch from a non-working state to a normal working state.

[0034] In one embodiment, the power supply module includes a charging interface for inserting an electronic device, so that the electronic device supplies power to the electromagnetic module through the charging interface.

[0035] The present invention discloses a detection method, device, storage medium, and magnetic field generator for electronic devices. When the electronic device is in the open state, the magnetic field generator emits an external magnetic field to trigger the device to automatically switch between normal working state and non-working state. By comparing the first hardware information before the target conversion with the second hardware information after the target conversion, it can be determined whether there are any abnormalities in the various hardware of the electronic device after the target conversion. This method not only realizes the automatic detection of hardware, but also can effectively detect the key hardware in the electronic device, and the detection process is comprehensive and efficient.

[0036] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present disclosure, nor are they intended to limit the scope of the present disclosure. Other features of the present disclosure will become readily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] The above and other objects, features and advantages of the exemplary embodiments of the present disclosure will become readily understood by reading the detailed description below with reference to the accompanying drawings, in which several embodiments of the present disclosure are shown by way of example and not limitation, wherein:

[0038] In the drawings, the same or corresponding reference numerals denote the same or corresponding parts.

[0039] Figure 1 A schematic diagram of an implementation flow of a detection method for an electronic device according to an embodiment of the present disclosure is shown;

[0040] Figure 2 Another implementation flow diagram of the detection method of the electronic device according to the embodiment of the present disclosure is shown;

[0041] Figure 3 A schematic structural diagram of a magnetic field generator according to an embodiment of the present disclosure is shown;

[0042] Figure 4 A schematic structural diagram of a power supply module according to an embodiment of the present disclosure is shown;

[0043] Figure 5 A control waveform diagram according to an embodiment of the present disclosure is shown;

[0044] Figure 6 Another structural schematic diagram of the magnetic field generator according to an embodiment of the present disclosure is shown;

[0045] Figure 7 A schematic diagram of an application scenario of an embodiment of the present disclosure is shown;

[0046] Figure 8 A schematic structural diagram of a detection device for an electronic device according to an embodiment of the present disclosure is shown. DETAILED DESCRIPTION

[0047] To make the purposes, features, and advantages of the present disclosure more apparent and understandable, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present disclosure, not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of the present disclosure without creative work shall fall within the scope of protection of the present disclosure.

[0048] When an electronic device switches from an active state to a non-active state (such as entering sleep or hibernation), hardware such as Bluetooth, mouse, camera, and fingerprint recognition will be powered off. When the electronic device returns to an active state, the hardware may not be correctly recognized or may be lost, thus affecting the normal use of the electronic device. Currently, the relevant technologies for detecting the hardware status of electronic devices before and after the active state transition are as follows:

[0049] By opening and closing the electronic device's lid, or using software commands, the device can be switched between operating and non-operating states. Manual inspection of each piece of hardware before and after the state transition is then required. This method is not only prone to missing certain hardware components, but also cumbersome and time-consuming.

[0050] Furthermore, this method has limitations and cannot fully verify the status of all hardware. For example, when using software to perform state transitions, the Hall effect sensor functionality cannot be verified because it does not involve opening or closing the lid. When using the lid to perform state transitions, once the lid is closed, the status of hardware such as the keyboard and power indicator cannot be directly observed, making it difficult to detect such hardware.

[0051] Based on the above problems, the present disclosure proposes the following technical solutions:

[0052] In a first aspect of the present disclosure, a detection method for an electronic device is provided. Figure 1 As shown, the method includes the following steps:

[0053] Step 101: When the electronic device is in a normal working state, first hardware information of hardware in the electronic device is obtained.

[0054] The electronic device may be a smart device such as a laptop computer or a tablet computer. When the electronic device is in a normal working state (i.e., S0 state), parameter information of a display, a hard disk, various sensors, a Universal Serial Bus (USB) device, and all other key hardware, such as the hardware's identity document (ID), name, status, etc., is read and collected by calling a system application programming interface (API), and the information is stored as first hardware information.

[0055] Step 102 : In response to the external magnetic field emitted by the magnetic field generator, trigger the electronic device to switch from a normal working state to a non-working state.

[0056] Electronic devices are often equipped with magnetic field sensors. A magnetic field sensor, such as a Hall effect sensor, can sense changes in the surrounding magnetic field and convert these changes into electrical signals. To achieve state transitions in an electronic device, a magnetic field generator, which emits a magnetic field, is placed near the magnetic field sensor. After the generator emits the magnetic field, the magnetic field sensor quickly senses the magnetic field changes and responds immediately, triggering the electronic device's internal control mechanism, allowing it to automatically transition from its current normal operating state to its non-operating state (i.e., S3 or S4).

[0057] Through this operation, when the cover of the electronic device (such as the display cover of a laptop computer) is open, as long as the magnetic field emitted by the magnetic field generator is received by the magnetic field sensor, the electronic device can automatically switch from the normal working state to the non-working state.

[0058] Step 103 : In response to the magnetic field generator stopping emitting the external magnetic field, triggering the electronic device to switch from a non-working state to a normal working state, obtaining second hardware information of the hardware in the electronic device.

[0059] After a preset time, the magnetic field generator stops emitting the external magnetic field. A magnetic field sensor within the electronic device responds to the disappearance of the external magnetic field, triggering a control mechanism within the electronic device to automatically restore the electronic device from a non-operating state to a normal operating state. After the electronic device returns to normal operating state, it reads and collects parameter information from all hardware components and stores this information as second hardware information.

[0060] Step 104, based on the first hardware information and the second hardware information, obtain a detection result, which characterizes whether there is an abnormality in each hardware after the electronic device performs a target conversion; wherein the target conversion is that the electronic device converts from a normal working state to a non-working state, and from the non-working state to a normal working state.

[0061] Based on the difference between the first hardware information and the second hardware information, the detection result is determined. Specifically, the entire contents of the first hardware information and the second hardware information can be compared as a whole, and by comparing the difference between the two, the overall detection result of all hardware can be obtained. If the first hardware information and the second hardware information are completely consistent, or the difference is within the allowable error range, then the detection result is determined to be that each hardware is normal after the electronic device undergoes target conversion. This indicates that during the target conversion process of the electronic device, all hardware maintains good performance and stability. Among them, the target conversion is the process in which the electronic device enters a normal working state again after it is converted from a normal working state to a non-working state.

[0062] If the comparison results show that the first hardware information and the second hardware information are inconsistent, or the difference exceeds the allowable error range, the hardware corresponding to the mismatching information is further located and analyzed. The hardware detection result is determined to be abnormal after the target conversion of the electronic device. This indicates that the hardware device may have a hardware failure or driver problem.

[0063] The detection method of this embodiment uses an external magnetic field emitted by a magnetic field generator to trigger an automatic transition between normal and non-operating states when the electronic device's cover is open. By comparing the first hardware information before the target transition with the second hardware information after the target transition, it is possible to determine whether any hardware anomalies exist after the target transition. This method not only enables automatic detection of all hardware components within the electronic device, but also effectively detects all key hardware components within the electronic device, resulting in a comprehensive and efficient detection process.

[0064] On the other hand, when applying this detection method, the entire detection process is carried out when the electronic device is in the open state. During this period, the entire detection process of the electronic device can be tracked and monitored in real time with the help of another device through video recording or image capture. The detection process is accurately recorded to provide detailed data support for subsequent analysis. In addition, the electronic device remains in the open state throughout the process, which greatly facilitates the detection of hardware such as keyboards and power indicators. Through visual monitoring, the operating status of such hardware after the electronic device undergoes target conversion can be easily and intuitively obtained. For example, the brightness changes of the keyboard during the state conversion process of the electronic device can be clearly obtained, so as to quickly and accurately determine whether these hardware are working normally during the state conversion process.

[0065] In one embodiment of the present disclosure, a detection result is obtained based on the first hardware information and the second hardware information, which can be specifically achieved through the following steps: first, the set similarity between the first hardware information and the second hardware information is obtained; and then the detection result is obtained based on the set similarity and a first preset condition.

[0066] The first hardware information and the second hardware information can be considered as sets containing multiple elements, specifically various attribute information of each piece of hardware. Then, using a set similarity calculation method, such as the Jaccard similarity coefficient or cosine similarity, the set similarity between the first hardware information and the second hardware information is determined, that is, the degree of similarity between them is assessed. For example, by calculating the Jaccard similarity coefficient, which is the number of elements in the intersection of the first hardware information and the second hardware information divided by the number of elements in the union, a quantified set similarity value can be obtained. Finally, this calculated set similarity is compared with a first preset condition to determine the final detection result. For example, the first preset condition is that the set similarity is equal to 1. If the calculated set similarity is equal to 1, the detection result is determined to be that all hardware components are normal after the electronic device undergoes target conversion. If the calculated set similarity is not equal to 1, it indicates that a hardware component has experienced an abnormality after the electronic device undergoes target conversion, and further detection is performed to determine which hardware component has the abnormality. The detection result is determined to be that the hardware component has the abnormality, while the remaining hardware components are normal.

[0067] The method of this embodiment calculates the collective similarity between the first and second hardware information to obtain a detection result. This allows for a more comprehensive and efficient assessment of the functioning of each hardware component after the target conversion of the electronic device, based on the collective similarity. Compared to traditional manual, one-by-one inspection methods, the use of a collective similarity algorithm enables automated comparison, significantly improving detection efficiency.

[0068] In another embodiment of the present disclosure, a detection result is obtained based on the set similarity and the first preset condition, which specifically includes the following steps: if the set similarity meets the first preset condition, the detection result is obtained that each hardware is normal after the electronic device performs target conversion.

[0069] A first preset condition is set in advance, and the first preset condition can be a range of similarity. This range can be set according to the actual application scenario and detection requirements, and is used to determine whether the set similarity has reached an acceptable normal range. The calculated set similarity is compared with the first preset condition. If the set similarity meets the first preset condition, that is, the set similarity is within the range specified by the first preset condition, it indicates that the first hardware information and the second hardware information have a high similarity in content, which can indicate that the various hardware in the electronic device maintains normal working conditions and performance after the target conversion. Therefore, it is determined that the detection result is that the various hardware in the electronic device are normal after the target conversion of the electronic device.

[0070] In another embodiment of the present disclosure, if the set similarity does not meet the first preset condition, for each hardware, a first attribute set in the first hardware information and a second attribute set in the second hardware information are obtained; and a detection result is obtained based on the first attribute set and the second attribute set.

[0071] If the set similarity does not meet the first preset condition, it indicates that the overall similarity between the first hardware information and the second hardware information does not meet expectations. In this case, a more detailed comparative analysis of each hardware is required. The specific steps are as follows:

[0072] First, for each piece of hardware, all attribute information from the first hardware information is extracted to form a first attribute set for the hardware. Similarly, all attribute information from the second hardware information is extracted to form a second attribute set. The first attribute set and the second attribute set respectively represent the attribute states of the hardware before and after the transition between the operating states of the electronic device.

[0073] Next, each attribute in the two attribute sets for the same hardware is compared one by one. The specific comparison method can be determined based on the attribute type and characteristics. For example, for attributes such as the hardware device ID and driver version, a hash matching algorithm can be used to determine their similarity. For attributes such as the device status, an exclusive-or equality check algorithm can be used to determine their similarity. The specific comparison method is not limited here and can be determined based on specific needs in actual applications.

[0074] Finally, the detection result is determined based on the similarity of each attribute. Specifically, if there is an attribute with low similarity, it indicates that the hardware is abnormal after the electronic device performs the target conversion. The cause of the abnormality is related to the attribute with low similarity. If there is no attribute with low similarity, it indicates that the hardware is normal after the electronic device performs the target conversion.

[0075] The method of this embodiment can accurately determine the detection result of each hardware device by comparing the similarity of the attributes of each hardware device before and after the target conversion of the electronic device.

[0076] In another embodiment of the present disclosure, a comprehensive similarity of the hardware is obtained based on the attribute information in the first attribute set and the second attribute set; and a detection result is obtained based on the comprehensive similarity of the hardware and the second preset condition. For each hardware, after completing the similarity comparison of all attribute parameters, a comprehensive similarity is determined based on these comparison results to quantify the degree of similarity of the hardware device before and after the state transition. The comprehensive similarity can be determined using weighted summation, average value, or other statistical methods, and can be determined based on actual needs and detection objectives.

[0077] Finally, the comprehensive similarity of each hardware device is compared with the second preset condition. If the second preset condition is met, the detection result of the hardware is normal after the electronic device performs target conversion. If the second preset condition is not met, the detection result of the hardware is abnormal after the electronic device performs target conversion. The second preset condition is usually whether it is greater than a threshold, and the threshold is a value less than 1. When an abnormality occurs in the hardware, further, based on the comparison results of the attribute parameters, the specific cause of the abnormality of the hardware is located, such as a change in the device activation status, a driver error, unrecognized hardware device, etc., to form a difference report. And automatically generate processing measures or alarm information based on the difference report. For example, update the driver, re-enable the device, etc.

[0078] The method of this embodiment quantifies the similarity of the hardware before and after the target conversion, and determines whether the hardware status is normal by combining the similarity with the second preset condition. When an anomaly is detected, it can automatically locate the cause and generate treatment measures or alarm information, thereby improving the efficiency and accuracy of equipment maintenance.

[0079] In another embodiment of the present disclosure, in order to further improve the accuracy and stability of the detection, the number of cyclic detection times is set, such as 100 times, and the above steps 101-104 are cycled to obtain the final detection result.

[0080] Take the example of attribute information including hardware ID, name, current status (such as enabled, disabled, error, etc.), driver version, and health status assessment results (such as intelligently predicted health status). Among them, the hardware ID and name can be used to determine whether it is the same hardware. If the hardware ID or name is consistent, it can be determined that it belongs to the same hardware. If it is not completely consistent, the Jaccard similarity can be used to determine the similarity of the two IDs or names. If the similarity value is high, it can also be determined that it belongs to the same hardware.

[0081] For the same hardware, obtain its first attribute set and second attribute set. Both the first attribute set and the second attribute set include the hardware's current state, driver version, and health status assessment results. Determine the similarity of the current state, driver version, and health status assessment results in sequence. Specifically, treat the hardware state as a discrete enumeration value and directly compare the device states in the first attribute set and the second attribute set. If they are identical, the hardware state similarity is determined to be 1. If they are different, the hardware state similarity is determined to be 0. For the driver version, calculate the difference between the driver version numbers in the two attribute sets and divide this difference by the maximum value among the device driver version numbers to obtain the relative difference. Finally, subtract the relative difference from 1 to obtain the driver version similarity. For the health status assessment results, health status differences can be quantified based on differences in assessment scores, consistency in assessment levels, or through an algorithm. The specific method depends on the type and format of the health status assessment results. Ultimately, the health status assessment result similarity is obtained.

[0082] Finally, the similarities of the current state, driver version, and health status assessment results are weighted and summed to obtain the overall similarity. Using weighted methods to determine the overall similarity allows for flexible adjustment of the influence of each attribute on the overall similarity. By setting weights, we can more accurately capture differences between hardware.

[0083] In another embodiment of the present disclosure, a device manager in an electronic device may be used to scan all hardware listed in the device manager to obtain hardware information of each hardware; and then first hardware information of the hardware in the electronic device may be obtained based on the hardware information of each hardware.

[0084] The device manager is an internal management system for electronic devices, responsible for managing all hardware on the device. This includes, but is not limited to, the processor, memory, storage devices, input / output devices (such as keyboards and mice), and various sensors. The device manager can be used to scan individual hardware components. During the scan, information such as the model and driver version of each hardware component is read. By scanning and collecting detailed information about these hardware components, the first hardware information of the electronic device can be obtained. The process for obtaining the second hardware information is similar.

[0085] This embodiment uses the device manager to scan electronic devices and obtain comprehensive hardware information. This is not only simple but also allows for rapid collection of detailed hardware information, including storage devices and various input and output devices. This provides a solid foundation for more efficient and comprehensive hardware testing.

[0086] In another embodiment of the present disclosure, the electronic device includes a magnetic field sensor for responding to an external magnetic field, and the detection method further includes: in response to the external magnetic field emitted by the magnetic field generator, the electronic device is converted from a normal working state to a non-working state, and in response to the magnetic field generator stopping emitting the external magnetic field, the electronic device is converted from the non-working state to a normal working state, and the detection result of the magnetic field sensor is normal; in response to the external magnetic field emitted by the magnetic field generator, the electronic device does not convert from the normal working state to the non-working state, or in response to the magnetic field generator stopping emitting the external magnetic field, the electronic device does not convert from the non-working state to the normal working state, and the detection result of the magnetic field sensor is abnormal.

[0087] When a magnetic field generator emits an external magnetic field, if the electronic device is operating normally and the magnetic field sensor is functioning properly, the magnetic field sensor should accurately detect the external magnetic field and trigger the electronic device to switch from normal operation to non-operating state. If the electronic device fails to respond and complete the state transition in a timely manner under these conditions, it indicates a possible malfunction in the magnetic field sensor.

[0088] Accordingly, when the magnetic field generator no longer emits an external magnetic field, the magnetic field sensor should normally detect the disappearance of the external magnetic field and trigger the electronic device to return to normal operation from a non-operating state. If the electronic device fails to perform a state transition, this also indicates a possible anomaly in the magnetic field sensor. If the magnetic field sensor can both detect the external magnetic field, triggering the electronic device to switch from normal operation to a non-operating state, and also detect the disappearance of the external magnetic field, triggering the electronic device to return to normal operation from a non-operating state, then the magnetic field sensor is functioning normally.

[0089] The detection method of this embodiment combines the response characteristics of the external magnetic field with the magnetic field sensor within the electronic device. This not only simulates user control of the electronic device through operations such as opening and closing the lid, but also effectively detects the operating status of the magnetic field sensor. This demonstrates the comprehensiveness of the detection of the electronic device's internal hardware.

[0090] In order to better understand the above embodiment, a specific example is used below to illustrate the hardware parameters including hardware ID, current status of the hardware, hardware driver version, and hardware health status assessment result. It can be understood that the actual operation is not limited to these parameters. Figure 2 As shown, the example includes the following steps:

[0091] Step 201: The electronic device is in a normal working state and obtains first hardware information.

[0092] Step 202: In response to the external magnetic field, the electronic device enters a non-operating state.

[0093] Step 203: In response to the disappearance of the external magnetic field, the electronic device wakes up again to a normal working state.

[0094] Step 204: Under normal working conditions, obtain second hardware information.

[0095] Step 205 determines whether the first hardware information and the second hardware information are similar. Specifically, the Jaccard distance between the first hardware information and the second hardware information satisfies a first preset condition, which is whether the Jaccard distance is equal to 1. If not, step 206 is executed. If so, step 210 is executed, and the comprehensive similarity is determined to be 1.

[0096] Step 206: Read the hardware IDs in the first hardware information and the second hardware information respectively.

[0097] Step 207: Determine whether the hardware IDs in the first hardware information and the second hardware information match. If they match, it indicates that they are the same hardware, and proceed to step 208. If they do not match, continue to obtain hardware IDs until a hardware ID belonging to the same hardware is found in the two hardware information.

[0098] Step 208: Obtain all attributes of the hardware in the first hardware information to obtain a first attribute set. Obtain all attributes in the second hardware information to obtain a second attribute set. In this example, the first attribute set and the second attribute set include hardware status, driver version, and health status, respectively.

[0099] Step 209 : Determine the hardware status similarity, driver version similarity, and health similarity.

[0100] In step 210 , weighted summation is performed on the similarities determined in step 209 to obtain a comprehensive similarity.

[0101] Step 211 , determining whether the comprehensive similarity satisfies a second preset condition; if so, determining that the hardware is not abnormal; if not, determining that the hardware is abnormal.

[0102] Step 212 , determining whether all hardware in the hardware information has been compared. If not, repeat step 206 until all hardware has been compared. If so, execute step 213 .

[0103] Step 213: Generate a detection result of the electronic device.

[0104] This example automatically triggers electronic devices to switch operating states through an external magnetic field and compares the first hardware information before the target switch with the second hardware information after the target switch to obtain the detection results of each hardware. This improves the efficiency and accuracy of hardware detection. During the hardware information comparison process, attribute information such as hardware status, driver version, and health status is taken into account, making the hardware comparison more comprehensive. By adding weights to determine the comprehensive similarity, the impact of each attribute on the final detection result can be flexibly adjusted, making the detection results more accurate.

[0105] In a second aspect of the present disclosure, a magnetic field generator is provided. Figure 3 As shown, the magnetic field generator includes an electromagnetic module 301 and a power supply module 302 .

[0106] Among them, the power supply module 302 is used to periodically power the electromagnetic module 301 so that when the electromagnetic module 301 is powered on, a magnetic field is generated, triggering the electronic device to switch from a normal working state to a non-working state; when the electromagnetic module 301 is powered off, the magnetic field disappears, triggering the electronic device to enter a normal working state again from a non-working state.

[0107] Electromagnetic module 301 is a device that generates magnetism when powered, such as an electromagnet. The model of the electromagnetic module should be determined based on the characteristics of the magnetic field sensor and the specific requirements of the actual application scenario. For example, the magnetic field sensor commonly found in laptop computers typically has a range of 1.8 to 2.5 millitesla, equivalent to 18 to 25 gauss. In this case, an electromagnetic module with a magnetic flux density of approximately 3800 gauss should be selected.

[0108] like Figure 4 As shown, the power supply module 302 includes a power supply 3021 and a timer 3022. By setting the time of the timer 3022, the time when the electromagnetic module 301 emits the magnetic field is controlled. Figure 5 As shown, when the timer general-purpose input / output (GPIO) outputs a high level, the power supply path is connected, and the power supply 3021 supplies power to the electromagnetic module 301. The electromagnetic module 301 emits a magnetic field. The magnetic field sensor responds to the magnetic field, which is equivalent to closing the cover of the electronic device, triggering the electronic device to enter a non-working state. After a period of time, the timer GPIO outputs a low level, cutting off the power supply path, and the electromagnetic module 301 stops emitting the magnetic field. The magnetic field sensor responds to stop emitting the magnetic field, which is equivalent to opening the cover of the electronic device, triggering the electronic device to enter a normal working state again. Among them, Figure 5 When the cover opening and closing control signal is at a low level, the control device closes the cover; when it is at a high level, the control device opens the cover.

[0109] The magnetic field generator of this embodiment is applicable to various electronic devices and has a very high utilization rate. Moreover, the installation process is simple and easy, and the electronic devices can realize automatic switching of working states.

[0110] In one embodiment of the present disclosure, the magnetic field generator further includes a bracket 303, which is used to fix the electromagnetic module 301 at a designated position on the electronic device, and the designated position is determined according to the position of the magnetic field sensor in the electronic device. Figure 6 As shown, the bracket 303 can be a clamp with adjustable opening, wherein the shaded portion is a sponge. It should be noted that the specific structural design of the bracket 303 is not limited to the attached Figure 6 In fact, any structurally sound bracket that meets the functional requirements of the electromagnetic generator can be used in this electromagnetic generator. The electromagnetic module 301 and bracket 303 are connected in a manner that allows for easy disassembly and reassembly, allowing for convenient replacement of the electromagnetic module 301 with different magnetic properties to meet different detection requirements.

[0111] The position of the magnetic field sensor of different electronic devices may be different. In order to enable the magnetic field sensor to accurately sense the magnetic field emitted by the electromagnetic module 301, the electromagnetic module 301 can be placed near the magnetic field sensor through the bracket 303. Generally, the magnetic field sensor of electronic devices that support touch screens is generally set at the screen end, such as Figure 7 As shown in S1. For electronic devices that do not support touch screens, the magnetic field sensor is generally set on the motherboard end, such as Figure 7 When the magnetic field sensor is located at S1, the electromagnetic module 301 needs to be placed at the screen end. When the magnetic field sensor is located at S2, the electromagnetic module 301 needs to be placed at the motherboard end. Figure 7 AA and BB are only used to indicate that the two endpoints are in a connected state.

[0112] In one embodiment of the present disclosure, the power supply module 302 includes a charging interface for inserting an electronic device, such as a USB. By inserting the charging interface into an electronic device with a corresponding interface, the electronic device is used as a power source to directly provide the required power to the electromagnetic module 301. In this embodiment, the power supply module 302 is not installed on the bracket 1, but is connected to the electromagnetic module 301 via a power cord. Figure 7 As shown, the electromagnetic module 301 is clamped at a designated position by a bracket 303, and the power supply module 302 is inserted into a corresponding interface of the electronic device through a charging interface. The power supply module 302 and the electromagnetic module 301 are connected via a power line.

[0113] This embodiment uses the electronic device as a power source to directly power the electromagnetic module without the need for an additional power supply module, thereby improving convenience of use.

[0114] In a third aspect of the present disclosure, a detection device for an electronic device is provided, such as Figure 8 As shown, the device includes:

[0115] The information acquisition module 801 is configured to acquire first hardware information of hardware in the electronic device when the electronic device is in a normal working state;

[0116] A trigger module 802 is configured to trigger the electronic device to switch from a normal working state to a non-working state in response to the external magnetic field emitted by the magnetic field generator;

[0117] The trigger module 802 is further configured to trigger the electronic device to switch from a non-operating state to a normal operating state in response to the magnetic field generator stopping emitting the external magnetic field, and to obtain second hardware information of hardware in the electronic device;

[0118] The comparison module 803 is used to obtain a detection result based on the first hardware information and the second hardware information, and the detection result characterizes whether there is an abnormality in each hardware after the electronic device performs a target conversion; wherein the target conversion is that the electronic device is converted from a normal working state to a non-working state, and from the non-working state to a normal working state.

[0119] In one embodiment of the present disclosure, the comparison module 803 is further configured to obtain a set similarity between the first hardware information and the second hardware information; and obtain a detection result based on the set similarity and a first preset condition.

[0120] In another embodiment of the present disclosure, the comparison module 803 is further configured to obtain a detection result that each hardware is normal after the target conversion is performed on the electronic device if the set similarity satisfies a first preset condition.

[0121] In another embodiment of the present disclosure, the comparison module 803 is further used to obtain, for each hardware, a first attribute set in the first hardware information and a second attribute set in the second hardware information if the set similarity does not meet the first preset condition; and obtain a detection result based on the first attribute set and the second attribute set.

[0122] In another embodiment of the present disclosure, the comparison module 803 is further configured to obtain a comprehensive similarity of the hardware based on each attribute information in the first attribute set and the second attribute set; and obtain a detection result according to the comprehensive similarity of the hardware and the second preset condition.

[0123] In another embodiment of the present disclosure, the electronic device includes a magnetic field sensor for responding to an external magnetic field, and the detection device also includes a magnetic field sensor detection module (not shown in the figure), which is used to respond to the external magnetic field emitted by the magnetic field generator, convert the electronic device from a normal working state to a non-working state, and respond to the magnetic field generator stopping emitting the external magnetic field, convert the electronic device from the non-working state to the normal working state, and obtain a normal detection result of the magnetic field sensor; respond to the external magnetic field emitted by the magnetic field generator, the electronic device does not convert from the normal working state to the non-working state, or respond to the magnetic field generator stopping emitting the external magnetic field, the electronic device does not convert from the non-working state to the normal working state, and obtain an abnormal detection result of the magnetic field sensor.

[0124] In another embodiment of the present disclosure, the information acquisition module 801 is also used to scan all hardware listed in the device manager through the device manager in the electronic device to obtain hardware information of each hardware; based on the hardware information of each hardware, obtain the first hardware information of the hardware in the electronic device.

[0125] The present disclosure also provides a computer-readable storage medium storing executable instructions. The computer-readable storage medium stores executable instructions that, when executed by a processor, cause the processor to perform the electronic device detection method provided in the embodiments of the present application. In some embodiments, the computer-readable storage medium may be a memory device such as FRAM, ROM, PROM, EPROM, EEPROM, flash memory, magnetic surface storage, optical disk, or CD-ROM; or may be various devices including any one or any combination of the aforementioned memories.

[0126] In some embodiments, executable instructions may be in the form of a program, software, software module, script, or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a stand-alone program or as a module, component, subroutine, or other unit suitable for use in a computing environment.

[0127] As an example, executable instructions may, but need not, correspond to a file in a file system, may be stored as part of a file that stores other programs or data, such as in one or more scripts in a HyperText Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple coordinating files (e.g., files storing one or more modules, subroutines, or code portions).

[0128] By way of example, executable instructions may be deployed to be executed on one computing device, or on multiple computing devices at one site, or on multiple computing devices distributed across multiple sites and interconnected by a communication network.

[0129] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in this disclosure can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved. This is not limited herein.

[0130] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features being referred to. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. Throughout the present disclosure, "plurality" means two or more, unless otherwise specifically defined.

[0131] The above description is merely a specific embodiment of the present disclosure, but the scope of protection of the present disclosure is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this disclosure should be included in the scope of protection of the present disclosure. Therefore, the scope of protection of the present disclosure should be based on the scope of protection of the claims.

Claims

1. A method for detecting an electronic device, characterized in that: The method comprises: When the electronic device is in a normal working state, obtaining first hardware information of hardware in the electronic device; In response to the external magnetic field emitted by the magnetic field generator, triggering the electronic device to switch from a normal working state to a non-working state; In response to the magnetic field generator stopping emitting the external magnetic field, triggering the electronic device to switch from a non-working state to a normal working state, and acquiring second hardware information of hardware in the electronic device; Based on the first hardware information and the second hardware information, a detection result is obtained, and the detection result characterizes whether there is an abnormality in each hardware after the electronic device performs a target conversion; wherein the target conversion is that the electronic device is converted from a normal working state to a non-working state, and from the non-working state to a normal working state.

2. The electronic device detection method according to claim 1, wherein: The obtaining a detection result based on the first hardware information and the second hardware information includes: Obtaining a set similarity between the first hardware information and the second hardware information; A detection result is obtained based on the set similarity and a first preset condition.

3. The electronic device detection method according to claim 2, wherein: The obtaining of a detection result based on the set similarity and the first preset condition includes: If the set similarity satisfies the first preset condition, the detection result is that each hardware is normal after the electronic device performs the target conversion.

4. The electronic device detection method according to claim 2, wherein: The obtaining of a detection result based on the set similarity and the first preset condition includes: If the set similarity does not meet the first preset condition, For each hardware, obtain a first attribute set in the first hardware information and a second attribute set in the second hardware information; A detection result is obtained based on the first attribute set and the second attribute set.

5. The electronic device detection method according to claim 4, characterized in that: The obtaining a detection result based on the first attribute set and the second attribute set includes: Obtaining a comprehensive similarity of the hardware based on each attribute information in the first attribute set and the second attribute set; A detection result is obtained according to the comprehensive similarity of the hardware and the second preset condition.

6. The electronic device detection method according to claim 1, wherein: The electronic device includes a magnetic field sensor for responding to the external magnetic field, and the method further includes: In response to the external magnetic field emitted by the magnetic field generator, the electronic device switches from the normal working state to the non-working state, and in response to the magnetic field generator ceasing to emit the external magnetic field, the electronic device switches from the non-working state to the normal working state, and the detection result of the magnetic field sensor is normal; In response to the external magnetic field emitted by the magnetic field generator, the electronic device does not switch from the normal working state to the non-working state, or, in response to the magnetic field generator stopping emitting the external magnetic field, the electronic device does not switch from the non-working state to the normal working state, and the detection result of the magnetic field sensor is that an abnormality is present.

7. The electronic device detection method according to claim 1, wherein: The obtaining of first hardware information of hardware in the electronic device includes: Scanning all hardware listed in the device manager through the device manager of the electronic device to obtain hardware information of each hardware; Based on the hardware information of each hardware, first hardware information of the hardware in the electronic device is obtained.

8. A detection device for an electronic device, characterized in that: The device comprises: An information acquisition module, configured to acquire first hardware information of hardware in the electronic device when the electronic device is in a normal working state; a trigger module, configured to trigger the electronic device to switch from a normal working state to a non-working state in response to an external magnetic field emitted by the magnetic field generator; The trigger module is further configured to trigger the electronic device to switch from a non-operating state to a normal operating state in response to the magnetic field generator stopping emitting the external magnetic field, and to obtain second hardware information of hardware in the electronic device; A comparison module is used to obtain a detection result based on the first hardware information and the second hardware information, and the detection result characterizes whether there is an abnormality in each hardware after the electronic device performs a target conversion; wherein the target conversion is that the electronic device converts from a normal working state to a non-working state, and from the non-working state to a normal working state.

9. A magnetic field generator, characterized in that: The magnetic field generator includes an electromagnetic module and a power supply module; The power supply module is used to periodically power the electromagnetic module so that when the electromagnetic module is powered on, it emits an external magnetic field, triggering the electronic device to switch from a normal working state to a non-working state; when the electromagnetic module is powered off, the external magnetic field disappears, triggering the electronic device to switch from a non-working state to a normal working state.

10. The magnetic field generator according to claim 9, characterized in that The power supply module includes a charging interface for inserting an electronic device, so that the electronic device supplies power to the electromagnetic module through the charging interface.