Control method and system, terminal equipment and computer readable storage medium
By using the host module to poll the communication address of the broadcast slave module in the intelligent scalp massage device and sending control instructions, the problem of single functions and inability to automatically adjust in the prior art is solved, and the system performance and user experience are improved.
Patent Information
- Application Number
- CN202411997384.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-05-06
AI Technical Summary
The overall design of existing smart scalp massage devices cannot meet the diverse functional needs of users, and the multi-module replacement device has a single function and cannot be automatically adjusted to reduce the user experience.
The host module polls the communication address of the broadcast slave module, detects its online status, and sends control commands to automatically adjust the function to enhance coordination between the host and slave module.
It improves the overall performance and user experience of the system, and realizes the automatic adjustment function of the slave module according to changes in the system host mode.
Smart Images

Figure CN119925153A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of control technology, and in particular, relates to a control method, system, terminal device and computer-readable storage medium. Background Art
[0002] With the improvement of people's lifestyles and health awareness, smart scalp massage devices have become the preferred choice for people to relax their body and mind and protect their scalp. However, most smart scalp massage devices on the market are designed as a whole, that is, all functions are integrated into one device, which cannot be disassembled or replaced. Users may need multiple functions, but the current market products cannot meet such diverse needs, resulting in users having to purchase multiple devices.
[0003] Although some products on the market are designed with multi-module replaceable devices that allow users to replace different functional modules, the functions of these modules are still relatively simple. When in use, these modules will not automatically adjust their functions according to the mode changes of the system host. Due to the lack of coordination between modules, users feel like they are operating two independent devices rather than an integrated system when using them, resulting in lower overall system performance and poor user experience. Summary of the invention
[0004] The embodiments of the present application provide a control method, system, terminal device and computer-readable storage medium, in which different slave modules can automatically adjust functions according to mode changes of the system host, enhance the coordination between the host and multiple functional modules, improve the overall system performance and enhance the user experience.
[0005] In a first aspect, an embodiment of the present application provides a control method, including:
[0006] Upon receiving a broadcast message sent by the host module, a reply message is sent to the host module, so that the host module sends a first instruction according to the reply message, the first instruction is used to indicate the current host mode of the host module; wherein the broadcast message is the communication address of multiple slave modules;
[0007] After receiving the first instruction, a slave function matching the master mode indicated by the first instruction is executed.
[0008] In the embodiment of the present application, the system sends a broadcast message for the purpose of detecting whether there is an online slave module in the system. Once the slave module is detected to be online, the system will establish a communication connection with the slave module. After the communication connection is established, the system will send a control instruction (first instruction) to the slave module. These instructions can control the slave module to execute the slave function corresponding to the mode set by the system. It is equivalent to the system being able to understand the online status of different slave modules in real time through polling broadcast, ensuring that the control and management are immediately performed when the slave module goes online. By sending different control instructions, the system can flexibly control different slave functions corresponding to different slave modules. Different slave modules can execute the functions corresponding to the mode according to the different control modes of the system, enhance the coordination between the host and multiple functional modules, improve the overall system performance and improve the user experience.
[0009] In a possible implementation of the first aspect, a first sensor is included between the host module and the slave module;
[0010] The first instruction is an instruction sent by the host module when the host module detects the first signal and receives a reply message within a preset time after sending the broadcast message; wherein the first signal is a signal sent when the first sensor detects the slave module.
[0011] In the embodiment of the present application, after sending the broadcast message, the host module waits for a reply message within a preset time, which ensures that the system can complete the communication and response within a reasonable time, thereby improving the response speed and efficiency of the system.
[0012] In a possible implementation of the first aspect, the scalp massage device includes massage teeth, and the massage teeth are provided with a detachable protective device; when the slave module including the automatic start-stop function is installed on the host module, the slave module includes a second sensor; the second sensor is used to detect the distance between the slave module and the target position of the user, and the slave module is used to implement the automatic start-stop function on the target position of the user; the method further includes:
[0013] When the first instruction is an automatic start-stop mode and an installation signal is received by the host module indicating that the protection device is installed on the massage teeth;
[0014] Acquire a first distance between the slave module and the protection device detected by the second sensor;
[0015] Acquire a first preset threshold between the slave module and the target position, where the first preset threshold is a preset automatic start parameter corresponding to the slave module executing the automatic start-stop mode;
[0016] Determine, according to the first distance and the first preset threshold, a corresponding start threshold when the slave module executes the automatic start-stop mode;
[0017] The slave function matching the automatic start-stop mode is executed according to the start threshold; wherein, when executing the slave function corresponding to the automatic start-stop mode, if the second sensor detects that the second distance between the slave module and the target position is equal to or less than the start threshold, the slave module is automatically turned on; if the second distance detected by the second sensor is greater than the start threshold, the slave module is automatically turned off.
[0018] In the embodiment of the present application, the first distance detected by the second sensor represents the distance between the slave module and the user's target position. This ensures that the system can accurately obtain the distance between the slave module and the target position, and determines the start threshold corresponding to the automatic start-stop mode of the slave module according to the first value and the preset threshold set before the device leaves the factory. This ensures that the slave module can automatically start under certain conditions, thereby improving the automation of the system.
[0019] In a possible implementation manner of the first aspect, determining a start threshold corresponding to the automatic start / stop mode of the slave module according to the first distance and the preset threshold includes:
[0020] Calculating an error value between the first distance and the preset threshold;
[0021] If the error value is within a second preset threshold, the first preset threshold is determined as a start threshold corresponding to the automatic start-stop mode of the slave module;
[0022] If the error value exceeds the second preset threshold, the first distance is determined as the start threshold corresponding to the automatic start-stop mode of the slave module.
[0023] In the embodiment of the present application, the preset threshold is compared with the first distance actually detected, and the startup threshold is dynamically adjusted according to the comparison result, thereby improving the adaptability of the system. In different usage environments, the first distance may be different, and dynamically adjusting the threshold can enable the system to better adapt to different environmental conditions.
[0024] In a possible implementation of the first aspect, after the first distance is determined as the start threshold corresponding to the automatic start function of the slave module, the first distance is stored in a storage position corresponding to the slave module, so as to read the first distance from the storage position when executing the slave function matching the automatic start-stop mode.
[0025] In an embodiment of the present application, the startup threshold after automatic calibration is stored in a designated storage location, so that the system can quickly access the value when needed, thereby reducing data retrieval time and improving system efficiency.
[0026] In a possible implementation manner of the first aspect, the scalp massage device includes a mounting surface on which massage teeth are mounted, and obtaining a first distance between the slave module and the target position detected by the second sensor includes:
[0027] Detecting the operating status of the massage teeth;
[0028] When the massage teeth are stationary and the massage teeth are in a vertical state with respect to the mounting surface, the first distance between the slave module and the target position detected by the second sensor is obtained.
[0029] In the embodiment of the present application, by detecting the running state of the massage teeth, it is ensured that the system will obtain the first value detected by the second sensor only when the massage teeth are in a stationary state and perpendicular to the mounting surface (vertical). This ensures that the obtained value is obtained in the state required by the system, thereby improving the accuracy and reliability of the data.
[0030] In a possible implementation of the first aspect, a third sensor is included between the host module and the massage teeth; detecting the operating state of the massage teeth includes:
[0031] The host module is used to obtain the triggering times of the third sensor when the massage teeth reciprocate;
[0032] When the number of triggers sensed by the third sensor reaches a preset number, it is determined that the massage teeth are stationary and the massage teeth are in a vertical state with the mounting surface.
[0033] In the embodiment of the present application, by judging the number of triggers, the system can accurately record the movement of the massage teeth, avoiding the distance measurement when the massage teeth are in operation, and improving the accuracy of data measurement.
[0034] In a second aspect, an embodiment of the present application provides a control system, including: a host module and a slave module;
[0035] The slave module is used to implement any control method as described in the first aspect above.
[0036] In a third aspect, an embodiment of the present application provides a terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, a control method as described in any one of the first aspects above is implemented.
[0037] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the control method as described in any one of the first aspects above.
[0038] In a fifth aspect, an embodiment of the present application provides a computer program product, which, when executed on a terminal device, enables the terminal device to execute any one of the control methods in the first aspect.
[0039] It can be understood that the beneficial effects of the second to fifth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] In order to more clearly illustrate the technical solutions in the embodiments of the present application, 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 labor.
[0041] Figure 1 is a schematic structural diagram of a scalp massage device provided in an embodiment of the present application;
[0042] Figure 2 It is a flow chart of the control method provided in the embodiment of the present application;
[0043] Figure 3 It is a schematic diagram of a flow chart of a slave module executing an automatic start-stop mode provided in an embodiment of the present application;
[0044] Figure 4 is a schematic diagram of a structure for measuring a first distance provided in an embodiment of the present application;
[0045] Figure 5 It is a schematic diagram of a flow chart of detecting the state of massage teeth provided in an embodiment of the present application;
[0046] Figure 6 is a schematic block diagram of a process for detecting the state of massage teeth provided in an embodiment of the present application;
[0047] Figure 7 It is a structural schematic diagram of the initialization of the slave module provided in an embodiment of the present application;
[0048] Figure 8 It is a structural schematic diagram of the control method provided in the embodiment of the present application;
[0049] Fig. 9 It is a structural diagram of a terminal device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0050] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0051] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.
[0052] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0053] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.
[0054] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0055] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the phrases "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. appearing in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways.
[0056] With the improvement of people's lifestyles and health awareness, smart scalp massage devices have become the preferred choice for people to relax their body and mind and protect their scalp. However, most smart scalp massage devices on the market are designed as a whole, that is, all functions are integrated into one device, which cannot be disassembled or replaced. Users may need multiple functions, but the current market products cannot meet such diverse needs, resulting in users having to purchase multiple devices.
[0057] Although some products on the market are designed with multi-module replaceable devices that allow users to replace different functional modules, the functions of these modules are still relatively simple. When in use, these modules will not automatically adjust their functions according to the mode changes of the system host. Due to the lack of coordination between modules, users feel like they are operating two independent devices rather than an integrated system when using them, resulting in lower overall system performance and poor user experience.
[0058] In order to solve the above problems, an embodiment of the present application provides a control method, in which the host in the scalp massage device sends the communication address of the slave through polling broadcast to determine whether there is a slave module online. If a device replies, the broadcast is stopped, the communication address is bound, the communication is adapted to the slave, and the slave function corresponding to the current host mode is set to synchronize the state. If the communication is disconnected, the slave communication address is rebroadcast. When the host mode is the automatic start-stop mode, the slave module corresponding to the automatic start-stop mode automatically corrects by covering the massage tooth cover, automatically corrects the limit trigger value, and stores it in the memory, so as to achieve the purpose of correcting the sensing distance. And before the slave module automatically corrects, the external Hall is combined with the self-induction pulse number of the brushless motor to judge the state of the massage teeth in the scalp massage device, and the automatic correction is completed when it is determined that the massage teeth are stationary and in a vertical state, which can greatly reduce the influence of inconsistent sensing distances obtained due to inconsistent structural parts size.
[0059] See also Figure 1 , is a schematic diagram of the structure of the intelligent scalp massage device provided in the embodiment of the present application, including a host module, including a mainboard, inorganic brushes, red, green, blue (RGB) lights, batteries, etc.; a slave module, including a liquid guide module, a phototherapy module (including an automatic start-stop function), a laser module (including an automatic start-stop function), an electronic management system (EMS) module (including a boost), a camera module, structural parts, connecting wires, batteries, etc., and also includes a turntable and massage teeth. The turntable, i.e., the massage teeth, can be installed on the host and can rotate with the motor in the host when the host is working. The host module and the slave module each use an independent microcontroller, which can achieve high modularity and flexibility of the system. The host module is responsible for overall control and coordination, and the slave module is responsible for the execution of specific functions, and efficient data exchange and status are carried out through a serial communication protocol.
[0060] See also Figure 2 , is a flow chart of a control method provided in an embodiment of the present application. As an example but not a limitation, the method may include the following steps:
[0061] S101, upon receiving a broadcast message sent by a host module, sending a reply message to the host module, so that the host module sends a first instruction according to the reply message, the first instruction being used to indicate the current host mode of the host module; wherein the broadcast message is the communication address of multiple slave modules;
[0062] In the embodiment of the present application, the communication between the host module and the slave module can be realized through a broadcast and reply mechanism. The host module sends the communication address of each slave module through a polling broadcast message, inquires about the current state or mode, and determines whether there is a slave module online. After receiving the broadcast message, the slave module parses the message content and sends a reply message according to the current state or mode. The host module binds the communication address of the slave module of the reply message, and the two establish a communication connection.
[0063] After the host module establishes a communication connection with the slave module, the host module generates and sends a first instruction, the purpose of which is to indicate the current host mode of the host module. For example, if the reply message of the slave module indicates that the phototherapy module (including the automatic start-stop function) is installed in place or online, the host module may send an instruction to indicate that the mode of the host module is the automatic start-stop mode, so as to instruct the slave module to execute the slave function corresponding to the automatic start-stop mode.
[0064] In one embodiment, a first sensor is included between the host module and the slave module; the method further includes:
[0065] The first instruction is an instruction sent by the host module when it detects a first signal and receives a reply message within a preset time after sending a broadcast message; wherein the first signal is a signal sent by the first sensor when it senses that the slave module is installed on the host module.
[0066] In the embodiment of the present application, the first sensor is a Hall sensor, and a Hall sensor mechanism is installed at the junction of the host module and the slave module. The Hall sensor is a sensor that can detect a magnetic field. When the magnet on the slave module approaches the Hall sensor of the host module, the sensor will detect the change in the magnetic field. Each slave module is equipped with a magnet to trigger the Hall sensor on the host module.
[0067] The host module sends the communication address of the slave module by broadcasting, asking whether there is a slave module connected. If the Hall sensor detects a magnetic field, it means that a slave module has been installed, and sends the signal that the detected slave module has been installed to the host module. At this time, the host module waits for the slave module to reply. If the slave module replies to confirm within the preset time, the host module will stop broadcasting and bind the communication address of this slave module. The host module will send the first command to control the working mode of the slave module. If the slave module does not receive a reply message within the preset time, the host module will prompt "The device is not installed in place, please reinstall the module."
[0068] In the above method, after sending a broadcast message, the host module waits for a reply message within a preset time, which ensures that the system can complete communication and response within a reasonable time, thereby improving the response speed and efficiency of the system.
[0069] S102, after receiving the first instruction, executing a slave function matching the master mode indicated by the first instruction.
[0070] In the embodiment of the present application, the slave module receives the first instruction sent by the host module through a communication interface (such as UART, Wi-Fi, Bluetooth, etc.), the slave module parses the content of the first instruction, determines the current host mode of the host module, and the slave module executes the corresponding slave function according to the parsed host mode. These functions are pre-defined and matched with the host mode to ensure coordination and consistency between the host and the slave.
[0071] Exemplarily, if the slave module bound to the host module is the communication address of the laser module, if the first instruction corresponds to host mode 1: skin touch start mode, the slave module automatically starts the laser function after receiving the instruction; if the first instruction corresponds to host mode 2: timing mode, the slave module performs laser treatment continuously or intermittently according to the preset time parameters after receiving the instruction.
[0072] In one embodiment, the scalp massage device includes massage teeth, and the massage teeth are equipped with a detachable protective device; when the slave module including the automatic start-stop function is installed on the host module, the slave module includes a second sensor; the second sensor is used to detect the distance between the slave module and the user's target position, and the slave module is used to implement the automatic start-stop function corresponding to the automatic start-stop mode on the user's target position; Figure 3 , which is a flow chart of the slave module executing the automatic start-stop mode provided in an embodiment of the present application, and the method further includes:
[0073] When the first instruction is an automatic start-stop mode and an installation signal is received by the host module indicating that the protection device is installed on the massage teeth;
[0074] S201, obtaining a first distance between the slave module and the protection device detected by the second sensor.
[0075] In the embodiment of the present application, when the slave module is such as light therapy, laser module, they have in common that they are all implemented through LED lights and automatic start-stop functions, and the automatic start-stop function is implemented through a proximity sensor, such as light therapy, laser module includes a distance sensor, i.e., a second sensor, for detecting the distance between the slave module and the user's target position, wherein the target position can be the user's head or hand position, etc. Before executing the automatic start-stop function, it is necessary to determine the function startup parameters of the slave module.
[0076] One way to implement this is Figure 4 As shown, it is a schematic diagram of the structure of measuring the first distance provided in an embodiment of the present application, such as Figure 4 As shown, the scalp massage device includes massage teeth, and the massage teeth are provided with a detachable protective device, which can be a massage tooth cover. The scalp massage device includes a mounting surface with massage teeth mounted thereon, and when the slave module is mounted on the master module, the distance sensor, i.e., the second sensor, is arranged on the mounting surface. When the massage tooth cover is covered on the massage teeth, the distance from the slave module to the plane of the upper end of the massage tooth cover can be measured as the first distance, and the distance is used to determine the function startup parameters of the slave module.
[0077] In one embodiment, the scalp massage device includes a mounting surface with massage teeth mounted thereon, see Figure 5 , is a flow chart of detecting the state of massage teeth provided in an embodiment of the present application, such as Figure 5 As shown, step S201 includes:
[0078] S301, detecting the operating status of the massage teeth.
[0079] In an embodiment of the present application, before the distance sensor of the phototherapy or laser module measures the first distance, it is necessary to detect the operating status of the massage teeth. The massage teeth will reciprocate when working, usually moving up and down or left and right. If the massage tooth cover is put on, the massage teeth are still reciprocating instead of being stationary. Since the massage teeth are reciprocating, the distance value detected by the proximity sensor may be affected by the position of the massage teeth, rather than being a fixed and accurate value.
[0080] For example, if the massage teeth are at the lowest point, the distance detected by the proximity sensor is 10 mm; at the highest point, the distance detected is 15 mm. Therefore, the value of the proximity sensor will fluctuate between 10 mm and 15 mm, causing the start-stop module of the slave module to run incorrectly.
[0081] In one embodiment, a third sensor is included between the host module and the massage teeth, and step S301 includes:
[0082] The host module obtains the triggering number of the third sensor when the massage teeth reciprocate; when the triggering number of the third sensor reaches a preset number, it is determined that the massage teeth are stationary and the massage teeth are vertical to the mounting surface.
[0083] In the embodiment of the present application, the mounting surface of the massage teeth is a turntable mounted on the motor shaft of the host module, which rotates with the rotation of the motor, and a third sensor (the Hall sensor and the first sensor are independent of each other) is installed between the host module and the turntable. The six magnets evenly distributed on the turntable are used to trigger the Hall sensor (the third sensor), and the inorganic brush of the host module drives the motor to rotate the turntable.
[0084] Every time the brushless motor rotates one circle, the internal Hall sensor will trigger 6 pulses. This is because there are 6 magnets on the turntable, and each magnet will trigger a pulse when passing through the Hall sensor. After the host receives the pulse signal from the Hall sensor, it starts counting. Every time a pulse is received, the counter is incremented by 1. Through debugging, the number of pulses a when the massage teeth are stationary is recorded. This value is predetermined and represents the number of pulses required for the motor to rotate from a certain reference position to the stationary position of the massage teeth. When the massage teeth need to be stationary, the host starts counting the number of pulses (number of triggers) by detecting the trigger signal of the Hall sensor (the third sensor). When the count reaches the preset number of pulses a (preset number of times), the host stops the motor. At this time, the massage teeth are stationary and the massage teeth are in a vertical state, that is, the massage teeth are perpendicular to the mounting surface.
[0085] See also Figure 6 , is a flow chart of detecting the state of massage teeth provided in an embodiment of the present application, such as Figure 6 As shown, when the main unit is running at a constant speed, the Hall sensor senses the turntable and senses the trigger. Then the number of pulses at the motor end is calculated, and when the number of pulses reaches the preset number obtained through testing, the motor is stopped, and the massage teeth are stationary and in a vertical state.
[0086] In the above method, by judging the number of triggers, the system can accurately record the movement of the massage teeth, avoiding the distance measurement when the massage teeth are in operation, and improving the accuracy of data measurement.
[0087] S302, when the massage teeth are stationary and the massage teeth are in a vertical state with the mounting surface, the first distance between the slave module and the target position detected by the second sensor is obtained.
[0088] In an embodiment of the present application, if it is detected that the massage teeth are in a stationary state and their massage teeth are in a vertical state, that is, the number of pulses (triggering times) triggered by the Hall sensor (the third sensor) is detected, when the count reaches a preset number of pulses a (preset number of times), the measured first distance is obtained from the distance sensor, that is, the second sensor. At this time, the first distance is a relatively accurate value and can be used as a standard for running the automatic start and stop function.
[0089] In the above method, by detecting the operating state of the massage teeth, it is ensured that the system acquires the value when the massage teeth are not in operation, and the system acquires the first value detected by the second sensor. This ensures that the acquired value is obtained in the state required by the system, thereby improving the accuracy and reliability of the data.
[0090] S202, obtaining a first preset threshold between the slave module and the target position, where the first preset threshold is a preset automatic start parameter corresponding to the automatic start-stop mode executed by the slave module.
[0091] In the embodiment of the present application, the intelligent scalp massage device sets the factory parameters, i.e., the first preset threshold, for the automatic start and stop function of the slave module before leaving the factory. As in the above example, when the massage tooth cover is on the upper end of the massage tooth and the massage tooth is in a static vertical state, while the first distance is read by the distance sensor, the corresponding factory parameters, i.e., the first preset threshold, of the device will also be displayed on the distance sensor at the same time.
[0092] S203: Determine a start threshold corresponding to when the slave module executes the automatic start-stop mode according to the first distance and the first preset threshold.
[0093] In an embodiment of the present application, in one implementation, without considering any factors, the factory parameters of the device before leaving the factory, that is, the first preset threshold, can be used as the starting threshold corresponding to the automatic start and stop function of the slave module.
[0094] In another implementation, the distance detected by the distance sensor may be inaccurate due to factors such as wear or corrosion of the light-transmitting element of the distance sensor, and there may be an error between the distance detected by the distance sensor and the preset parameters. In this case, the start threshold can be further determined based on the error between the two.
[0095] S204, executing the slave function matching the automatic start-stop mode according to the start threshold; wherein, when executing the slave function corresponding to the automatic start-stop mode, if the second sensor detects that the second distance between the slave module and the target position is equal to or less than the start threshold, the slave module is automatically turned on; if the second distance detected by the second sensor is greater than the start threshold, the slave module is automatically turned off.
[0096] In an embodiment of the present application, when the slave module starts to run the automatic start-stop function corresponding to the automatic start-stop mode corresponding to the host module, when the slave module is close to the scalp or skin, the distance sensor detects the distance between the slave module and the scalp or skin. If the distance reaches or approaches the start threshold, the laser or phototherapy function of the slave module is automatically started. On the contrary, when the distance exceeds the start threshold, the function is stopped.
[0097] In the above method, the first value detected by the second sensor represents the distance between the slave module and the limit part of the target object. This ensures that the system can accurately obtain the distance between the slave module and the target object, and sets the first value as the start threshold corresponding to the automatic start and stop mode of the slave module. This ensures that the slave module can automatically start under certain conditions, thereby improving the automation of the system.
[0098] In one embodiment, step S203 includes:
[0099] Calculate the error value between the first distance and the first preset threshold; if the error value is within the second preset threshold, determine the first preset threshold as the start threshold corresponding to the automatic start-stop mode of the slave module; if the error value exceeds the second preset threshold, determine the first distance as the start threshold corresponding to the automatic start-stop mode of the slave module.
[0100] In the embodiments of the present application, Figure 4 As shown, when the massage tooth cover is placed on the upper end of the massage tooth and the massage tooth is in a static vertical state, the deviation between the first distance read by the distance sensor and the first preset threshold is calculated. If the deviation is within a certain error (the second preset threshold), the factory parameter, i.e., the first preset threshold, is still used as the start threshold corresponding to the automatic start mode of the slave module; if the error between the two is large, the first distance actually measured is used as the start threshold, and the first preset threshold needs to be automatically calibrated to the first distance actually measured.
[0101] See also Figure 7 , is a schematic diagram of the structure of the initialization of the slave module provided in the embodiment of the present application, such as Figure 7As shown, when installing a phototherapy or laser module with an automatic start-stop function, it is necessary to set the parameters of the distance sensor, including the maximum current (Imax), gain (Tgain), and limit trigger value (ADref) of the sensor, to determine the required sensing distance (Scm). In fact, this distance is also the distance between the massage tooth cover and the distance sensor (second sensor) after the massage tooth cover is covered. When the massage tooth cover is covered (with sensor induction trigger), read the current trigger value (ADvalue) of the sensor, i.e., the first value, and the limit trigger value (ADref), i.e., the first preset threshold. When it is determined that the error value between the current trigger value (ADvalue) and the limit trigger value (ADref) is too large (exceeding the second preset threshold), the limit trigger value (ADref) (first preset threshold) is automatically corrected to the first distance read.
[0102] In the above method, by adjusting the preset threshold to the first value, the system can dynamically adjust according to the actual detected value, thereby improving the adaptability of the system. In different usage environments, the first value may be different, and dynamically adjusting the threshold can enable the system to better adapt to different environmental conditions.
[0103] In one embodiment, the method further comprises:
[0104] After determining the first distance as the start threshold corresponding to the automatic start function of the slave module, the first distance is stored in a storage position corresponding to the slave module, so as to read the first distance from the storage position when executing the slave function matching the automatic start-stop mode.
[0105] In the embodiments of the present application, Figure 7 As shown, after the automatic correction of the limit trigger value, the limit trigger value (ADref) is set to the current trigger value (ADvalue), that is, the first distance, and then the first distance is stored in the chip memory of the slave module. Each subsequent power-on will read the first distance first, and then run the automatic start function of the slave module according to the first distance.
[0106] In the above method, the first value is stored in a designated storage location so that the system can quickly access the value when needed, thereby reducing the time for data retrieval and improving the efficiency of the system.
[0107] See also Figure 8 , is a schematic diagram of the structure of the control method provided in the embodiment of the present application, such as Figure 8 As shown, the steps for the host module to control the mode of the slave module include:
[0108] 1. When the host module is initialized, it polls and sends broadcast messages to the slave modules;
[0109] 2. When the slave module is installed in place, it will reply to the broadcast message from the host module.
[0110] The slave module continuously sends heartbeat packets to the host module to maintain communication; a heartbeat packet is a data packet used in network communication to detect connection status, keep the connection active, and synchronize status information. The heartbeat packet can be sent periodically to confirm whether the connection is still active.
[0111] 3. After receiving the heartbeat packet from the slave module, the host module sends a first instruction to the slave module, wherein the first instruction is used to indicate the working mode of the slave module;
[0112] 4. After receiving the command, the slave module parses the first command and executes the function corresponding to the working mode according to the working mode corresponding to the first command;
[0113] 5. The slave module feeds back the execution result of the working mode corresponding to the first instruction to the host module.
[0114] It should be noted that if the host module has not received the heartbeat packet from the slave module, the communication between the two is interrupted, and the host module needs to resend the broadcast message to detect the online slave module.
[0115] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0116] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0117] Fig. 9 Schematic diagram of the structure of the terminal device provided in the embodiment of the present application. Fig. 9 As shown, the terminal device 9 of this embodiment includes: at least one processor 90 ( Fig. 9Only one is shown in the figure) a processor, a memory 91, and a computer program 92 stored in the memory 91 and executable on at least one processor 90, and when the processor 90 executes the computer program 92, the steps in any of the above-mentioned control method embodiments are implemented.
[0118] The terminal device may be a computing device such as a desktop computer, a notebook, a PDA, or a cloud server. The terminal device may include, but is not limited to, a processor and a memory. Those skilled in the art will understand that Fig. 9 It is only an example of the terminal device 9 and does not constitute a limitation on the terminal device 9. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components, for example, it may also include input and output devices, network access devices, etc.
[0119] The processor 90 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0120] In some embodiments, the memory 91 may be an internal storage unit of the terminal device 9, such as a hard disk or memory of the terminal device 9. In other embodiments, the memory 91 may also be an external storage device of the terminal device 9, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the terminal device 9. Further, the memory 91 may also include both an internal storage unit of the terminal device 9 and an external storage device. The memory 91 is used to store an operating system, an application program, a boot loader (BootLoader), data, and other programs, such as program codes of a computer program. The memory 91 may also be used to temporarily store data that has been output or is to be output.
[0121] The embodiment of the present application further provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.
[0122] An embodiment of the present application provides a computer program product. When the computer program product runs on a terminal device, the terminal device can implement the steps in the above-mentioned method embodiments when executing the computer program product.
[0123] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may at least include: any entity or device that can carry the computer program code to the device / terminal device, a recording medium, a computer memory, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), an electric carrier signal, a telecommunication signal, and a software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.
[0124] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0125] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0126] In the embodiments provided in the present application, it should be understood that the disclosed devices / terminal equipment and methods can be implemented in other ways. For example, the device / terminal equipment embodiments described above are only schematic, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0127] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0128] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A control method, characterized in that: A slave module used in a scalp massage device, wherein the scalp massage device also includes a host module; the method includes: Upon receiving the broadcast message sent by the host module, sending a reply message to the host module, so that the host module sends a first instruction according to the reply message, wherein the first instruction is used to indicate the current host mode of the host module; wherein the broadcast message is the communication address of the plurality of slave modules; After receiving the first instruction, a slave function matching the master mode indicated by the first instruction is executed.
2. The control method according to claim 1, characterized in that: A first sensor is included between the host module and the slave module; The first instruction is an instruction sent by the host module when it detects a first signal and receives the reply message within a preset time after sending the broadcast message; wherein, the first signal is a signal sent when the first sensor senses that the slave module is installed on the host module.
3. The control method according to claim 1, characterized in that: The scalp massage device includes massage teeth, and the massage teeth are equipped with a detachable protective device; when the slave module including the automatic start-stop function is installed on the host module, the slave module includes a second sensor, and the second sensor is used to detect the distance between the slave module and the target position of the user, and the slave module is used to implement the automatic start-stop function on the target position of the user; The method further comprises: When the first instruction is an automatic start-stop mode and an installation signal is received by the host module indicating that the protection device is installed on the massage teeth; Acquire a first distance between the slave module and the protection device detected by the second sensor; Acquire a first preset threshold between the slave module and the target position, where the first preset threshold is a preset automatic start parameter corresponding to the slave module executing the automatic start-stop mode; Determine a start threshold corresponding to the automatic start-stop mode executed by the slave module according to the first distance and the first preset threshold; The slave function matching the automatic start-stop mode is executed according to the start threshold; wherein, when executing the slave function corresponding to the automatic start-stop mode, if the second sensor detects that the second distance between the slave module and the target position is equal to or less than the start threshold, the slave module is automatically turned on; if the second distance detected by the second sensor is greater than the start threshold, the slave module is automatically turned off.
4. The control method according to claim 3, characterized in that: The scalp massage device includes a mounting surface on which massage teeth are mounted, and the obtaining of a first distance between the slave module and the target position detected by the second sensor includes: Detecting the operating status of the massage teeth; When the massage teeth are stationary and the massage teeth are in a vertical state with respect to the mounting surface, the first distance between the slave module and the target position detected by the second sensor is obtained.
5. The control method according to claim 4, characterized in that: A third sensor is included between the host module and the massage teeth; the detecting the operating state of the massage teeth includes: Acquiring, through the host module, the number of triggers sensed by the third sensor when the massage teeth reciprocate; When the triggering times sensed by the third sensor reach a preset times, it is determined that the massage teeth are stationary and the massage teeth are in a vertical state with the mounting surface.
6. The control method according to claim 3, characterized in that: The step of determining a start threshold corresponding to the automatic start / stop mode of the slave module according to the first distance and the preset threshold comprises: Calculating an error value between the first distance and the first preset threshold; If the error value is within a second preset threshold, the first preset threshold is determined as a start threshold corresponding to the automatic start-stop mode of the slave module; If the error value exceeds the second preset threshold, the first distance is determined as the start threshold corresponding to the automatic start-stop mode of the slave module.
7. The control method according to claim 6, characterized in that: The method further comprises: After determining the first distance as the start threshold corresponding to the automatic start function of the slave module, the first distance is stored in a storage position corresponding to the slave module, so as to read the first distance from the storage position when executing the slave function matching the automatic start-stop mode.
8. A control system, characterized in that: include: Host module, slave module; The slave module is used to implement the control method as described in any one of claims 1 to 7 above.
9. A terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.