Data synchronization method of electronic device, power supply circuit, electronic device, and computer program product

Through the data synchronization method between the human-computer interaction module and the main control module, the problem of inconsistent parameters between boards when the electronic equipment is disconnected is solved, ensuring the normal operation and stability of the equipment.

CN119512828BActive Publication Date: 2025-10-10GUANGDONG MOFA E-COMMERCE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411538299.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-30
Publication Date
2025-10-10
Estimated Expiration
2044-10-30

AI Technical Summary

Technical Problem

When electronic devices experience momentary power instability (flash interruption), data between boards may not be correctly saved or processed, affecting the normal operation of the program.

Method used

Through the data synchronization method between the human-computer interaction module and the main control module, the operation data is sent at preset time intervals, the operation status is identified and the parameters are updated to ensure the consistency of parameters between boards in the event of a flash failure.

Benefits of technology

It ensures the normal operation of programs in electronic devices in the event of a power outage, improves the fault tolerance and stability of the system, and enhances the reliability of the device and user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119512828B_ABST
    Figure CN119512828B_ABST
Patent Text Reader

Abstract

The application belongs to the technical field of electronic equipment, and provides a data synchronization method of an electronic device, a power supply circuit, an electronic device and a computer program product. The method comprises receiving first running data sent by a man-machine interaction module at a preset time interval; determining a running state of a master module, and determining a running state of the man-machine interaction module based on the first running state data; if the master module is in a standby state and the man-machine interaction module is not in the standby state, updating stored second running parameter data into first running parameter data, and running with the first running parameter; if the master module is not in the standby state and the man-machine interaction module is in the standby state, not updating the stored second running parameter, and sending second running data to the man-machine interaction module. The application can ensure that any board card can synchronize data through another board card when flash interruption occurs, thereby ensuring normal program running of the electronic device.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application belongs to the technical field of electronic devices, and particularly relates to a data synchronization method of an electronic device, a power supply circuit, an electronic device and a computer program product. BACKGROUND

[0002] A typical electronic device usually integrates two key board cards, one of which is responsible for processing signals and controlling various functions of the device, and the other of which is mainly used for receiving user input and converting it into an instruction signal recognizable by the device.

[0003] However, in actual application, momentary power instability caused by various reasons, i.e. so-called "flashout", will have a significant impact on such electronic devices. When a board card flashes out, it may interrupt the data stream being processed, resulting in part of the data not being correctly saved or processed, thereby affecting the normal operation of the program of the electronic device.

[0004] Therefore, how to effectively deal with the flashout phenomenon and ensure the normal operation of the program of the electronic device is a problem to be solved. SUMMARY

[0005] Therefore, the embodiments of the present application provide a data synchronization method of an electronic device, a power supply circuit, an electronic device and a computer program product, which can synchronize data in time after flashout occurs, ensure the consistency of operating parameters between different board cards, and ensure the normal operation of the program of the electronic device.

[0006] The first aspect of the embodiments of the present application provides a data synchronization method applied to a master module of an electronic device, wherein the electronic device comprises a human-computer interaction module and the master module; wherein the human-computer interaction module stores first running data, and the master module stores second running data, the first running data at least comprises first running parameter data and first running state data, and the second running data at least comprises second running parameter data and second running state data.

[0007] The method comprises:

[0008] receiving the first running data sent by the human-computer interaction module at a preset time interval;

[0009] determining the running state of the master module, and determining the running state of the human-computer interaction module based on the first running state data; wherein the running state at least comprises a standby state;

[0010] if the master module is in the standby state and the human-computer interaction module is not in the standby state, updating the stored second running parameter data to the first running parameter data, and running with the first running parameter;

[0011] If the main control module is not in standby state and the human-computer interaction module is in standby state, the stored second operating parameter is not updated, and the second operating data is sent to the human-computer interaction module; the human-computer interaction module is used to update the stored first operating parameter data to the second operating parameter data, and operate with the second operating parameter.

[0012] A second aspect of an embodiment of the present application provides a data synchronization method, which is applied to a human-computer interaction module of an electronic device, the electronic device comprising a human-computer interaction module, a main control module, and a motor, the human-computer interaction module being connected to the main control module, the main control module being connected to the motor, the human-computer interaction module being configured to output a human-computer interaction signal to the main control module in response to a human-computer interaction operation by a user, the main control module being configured to output a control signal to the motor based on the human-computer interaction signal, and the motor being configured to perform a corresponding action based on the control signal;

[0013] The human-computer interaction module stores first operating data, and the main control module stores second operating data, wherein the first operating data at least includes first operating parameter data and first operating status data, and the second operating data at least includes second operating parameter data and second operating status data;

[0014] The method comprises:

[0015] Sending first operating data to the main control module at a preset time interval; the main control module is used to determine the operating state of the main control module, and determine the operating state of the human-computer interaction module based on the first operating state data, wherein the operating state at least includes a standby state; if the main control module is in the standby state and the human-computer interaction module is not in the standby state, updating the stored second operating parameter data to the first operating parameter data and operating with the first operating parameter; if the main control module is not in the standby state and the human-computer interaction module is in the standby state, not updating the stored second operating parameter, and sending the second operating data to the human-computer interaction module;

[0016] receiving second operating data sent by the main control module, and determining an operating state of the main control module based on the second operating data; wherein the operating state includes at least a standby state;

[0017] If the human-computer interaction module is in a standby state and the main control module is not in a standby state, the stored first operating parameter data is updated to second operating parameter data, and the system is operated with the second operating parameter.

[0018] A third aspect of an embodiment of the present application provides a power supply circuit, applied to an electronic device, the electronic device including a human-computer interaction module and a main control module, the power supply circuit including a diode, a resistor, and a capacitor;

[0019] The power supply end of the human-computer interaction module and the master control module is connected with the cathode of the diode and one end of the resistor, the anode of the diode is connected with the power supply of the electronic device, the other end of the resistor is connected with the positive electrode of the capacitor, and the negative electrode of the capacitor is grounded.

[0020] The fourth aspect of the embodiment of the present application provides an electronic device, including a master control module, a human-computer interaction module, a motor, a memory and a computer program stored in the memory and capable of running on the master control module, when the master control module executes the computer program, the electronic device realizes the method provided by the first aspect of the embodiment of the present application;

[0021] Or, including a master control module, a human-computer interaction module, a motor, a memory and a computer program stored in the memory and capable of running on the human-computer interaction module, when the human-computer interaction module executes the computer program, the electronic device realizes the method provided by the second aspect of the embodiment of the present application;

[0022] Or, including a master control module, a human-computer interaction module and the power supply circuit provided by the third aspect of the embodiment of the present application.

[0023] The fifth aspect of the embodiment of the present application provides a computer program product, including a computer program, when the computer program is run, the method provided by the first aspect or the second aspect of the embodiment of the present application is executed.

[0024] A first aspect of an embodiment of the present application provides a data synchronization method, which is applied to a main control module of an electronic device, the electronic device comprising a human-computer interaction module and a main control module; wherein the human-computer interaction module stores first operating data, and the main control module stores second operating data, the first operating data comprising at least first operating parameter data and first operating status data, and the second operating data comprising at least second operating parameter data and second operating status data; the method comprising: receiving first operating data sent by the human-computer interaction module at preset time intervals; determining an operating status of the main control module, and determining an operating status of the human-computer interaction module based on the first operating status data; wherein the operating status comprises at least a standby state; if the main control module is in the standby state and the human-computer interaction module is not in the standby state, updating the stored second operating parameter data to the first operating parameter data and operating with the first operating parameters; if the main control module is not in the standby state and the human-computer interaction module is in the standby state, not updating the stored second operating parameter and sending the second operating data to the human-computer interaction module; the human-computer interaction module is configured to update the stored first operating parameter data to the second operating parameter data and operate with the second operating parameters. The present application sends first operating data to the main control module at preset time intervals through the human-computer interaction module. When the human-computer interaction module is disconnected, it can be identified through the operating status data, and second operating data can be sent to the human-computer interaction module through the main control module to achieve data synchronization of the human-computer interaction module. Conversely, when the main control module is disconnected, data synchronization can be achieved through the first operating data sent by the human-computer interaction module, thereby ensuring that any board of the electronic device can synchronize data through another board when a disconnection occurs, thereby ensuring the consistency of operating parameters between different boards and ensuring the normal operation of the program of the electronic device.

[0025] 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

[0026] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the embodiments or descriptions of the prior art. 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 any creative work.

[0027] Figure 1 This is a flowchart of a data synchronization method provided by an embodiment of the present application;

[0028] Figure 2 This is a schematic diagram of a process for switching operating states provided by an embodiment of the present application;

[0029] Figure 3 This is a flowchart of a data synchronization method provided by another embodiment of the present application;

[0030] Figure 4 This is a connection diagram of a power supply circuit provided by an embodiment of the present application;

[0031] Figure 5 This is a connection diagram of a power supply circuit provided in another embodiment of the present application. DETAILED DESCRIPTION

[0032] In the following description, specific details such as specific system structures and techniques are provided for purposes of illustration rather than limitation to facilitate a thorough understanding of the embodiments of the present application. However, it will be apparent to those skilled in the art that the present application may 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 avoid obscuring the description of the present application with unnecessary detail.

[0033] 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 preclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or collections thereof.

[0034] It will also be understood that the term "and / or" used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.

[0035] As used in this specification and the appended claims, the term "if" can be interpreted as "when" or "upon" 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 "upon determination" or "in response to determining" or "upon detection of [described condition or event]" or "in response to detecting [described condition or event]," depending on the context.

[0036] 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.

[0037] References to "one embodiment" or "some embodiments" in this specification mean that a particular feature, structure, or characteristic described in conjunction with that embodiment is included in one or more embodiments of the present application. Thus, phrases such as "in one embodiment," "in some embodiments," "in other embodiments," and "in other embodiments" appearing in various places in this specification do not necessarily refer to the same embodiment, but rather mean "one or more but not all embodiments," unless otherwise specifically emphasized. The terms "including," "comprising," "having," and variations thereof all mean "including but not limited to," unless otherwise specifically emphasized.

[0038] Example 1

[0039] An embodiment of the present application provides a data synchronization method, which is applied to a main control module of an electronic device and can be executed by the main control module of the electronic device when running a computer program with corresponding functions. The electronic device includes a human-computer interaction module and a main control module; wherein the human-computer interaction module stores first operating data, and the main control module stores second operating data, the first operating data at least including first operating parameter data and first operating status data, and the second operating data at least including second operating parameter data and second operating status data; the method includes: receiving the first operating data sent by the human-computer interaction module at preset time intervals; determining the operating status of the main control module, and determining the operating status of the human-computer interaction module based on the first operating status data; wherein the operating status includes at least a standby state; if the main control module is in the standby state and the human-computer interaction module is not in the standby state, updating the stored second operating parameter data to the first operating parameter data and operating with the first operating parameters; if the main control module is not in the standby state and the human-computer interaction module is in the standby state, not updating the stored second operating parameter, and sending the second operating data to the human-computer interaction module; the human-computer interaction module is configured to update the stored first operating parameter data to the second operating parameter data and operate with the second operating parameters. The present application sends first operating data to the main control module at preset time intervals through the human-computer interaction module. When the human-computer interaction module is disconnected, it can be identified through the operating status data, and second operating data can be sent to the human-computer interaction module through the main control module to achieve data synchronization of the human-computer interaction module. Conversely, when the main control module is disconnected, data synchronization can be achieved through the first operating data sent by the human-computer interaction module, thereby ensuring that any board of the electronic device can synchronize data through another board when a disconnection occurs, thereby ensuring the consistency of operating parameters between different boards and ensuring the normal operation of the program of the electronic device.

[0040] In application, the electronic device may also include a motor. The human-computer interaction module is connected to the main control module, and the main control module is connected to the motor. The human-computer interaction module is used to output a human-computer interaction signal to the main control module in response to the user's human-computer interaction operation. The main control module is used to output a control signal to the motor based on the human-computer interaction signal, and the motor is used to perform corresponding actions based on the control signal.

[0041] In application, the electronic device may be a massage device, such as a rail-type massage cushion (pillow). The rail-type massage cushion (pillow) generally includes a massage movement and a track for the massage movement to reciprocate to achieve massage of different parts of the body. When in use, the human body lies on the massage cushion (pillow), so that the massage movement corresponds to the part to be massaged to perform the massage action. When the electronic device is a massage device, the human-computer interaction module may be a key module, which may be used to receive operation instructions input by the user and may also provide feedback on the working status to the user, such as lighting different indicator lights to indicate the working status, or may also have a display screen to display work-related status and parameters. The embodiments of the present application do not limit the specific form of the human-computer interaction module.

[0042] like Figure 1 As shown, a data synchronization method provided in an embodiment of the present application includes the following steps S101 to S104:

[0043] Step S101: receiving first operation data sent by a human-computer interaction module at preset time intervals.

[0044] In application, when the electronic device is a massage device, the methods described in this embodiment and subsequent embodiments are described. The human-computer interaction module regularly sends first operating data to the main control module at preset time intervals (e.g., 0.1 seconds, 0.2 seconds, 0.3 seconds, etc.). The first operating data mainly includes first operating status data for indicating the current operating status of the human-computer interaction module, and operating parameters stored by the human-computer interaction module, i.e., first operating parameter data. The first operating parameter data includes at least one of the following data: current massage mode, current massage time gear, current massage head running direction, current massage speed, current massage head position, current massage head strength, current heating gear, current massage countdown, stall AD value, mode data, etc. Similarly, the second operating data mainly includes second operating status data for indicating the current operating status of the main control module, and operating parameters stored by the main control module, i.e., second operating parameter data. The second operating parameter data also includes at least one of the following data: current massage mode, current massage time gear, current massage head running direction, current massage speed, current massage head position, current massage head strength, current heating gear, current massage countdown, stall AD value, mode data, etc.

[0045] Step S102: determining the operating state of the main control module, and determining the operating state of the human-computer interaction module based on the first operating state data; wherein the operating state includes at least a standby state.

[0046] In an application, upon receiving first operating data sent by the human-computer interaction module at preset time intervals, the main control module parses the first operating data to obtain first operating parameter data and first operating status data. The operating status of the human-computer interaction module can be determined using the first operating status data. The operating status includes at least a standby state and may also include other states besides the standby state, such as a working state and a work-end state.

[0047] In an application, when an electronic device is normally shut down and restarted, both the main control module and the human-computer interaction module will initialize their operating parameters. During the initialization process, the operating parameters will be reset to the preset initial parameters and then enter the standby state. In addition, when the main control module and / or the human-computer interaction module are powered on again after a flash, the operating parameters will also be initialized, and the standby state will be entered after the operating parameter initialization is completed. Therefore, determining whether the main control module and / or the human-computer interaction module is in the standby state can determine whether the operating parameter initialization stage has been completed, thereby providing a basis for whether data synchronization is required.

[0048] Step S103: If the main control module is in the standby state and the human-computer interaction module is not in the standby state, the stored second operating parameter data is updated to the first operating parameter data, and the system is operated with the first operating parameter.

[0049] In the application, if the master module is in standby state, the running parameter data inside the master module is considered as preset initial parameters, and synchronization is needed. At this time, if the human-computer interaction module is not in standby state, the running parameter data inside the human-computer interaction module is considered as the current latest running parameter data, which can be used to synchronize the data inside the master module. By updating the stored second running parameter data (at this time, the preset initial parameters) to the first running parameter data, the data update synchronization is realized, and then the first running parameter data is used for running. Wherein, the master module running with the first running parameter data means that the corresponding control of the motor is performed according to the current massage mode, the current massage time gear, the current massage head running direction, the current massage speed, the current massage head position, the current massage head force, the current heating gear, the current massage countdown, the stall AD value, the mode data and other data in the first running parameter data. These parameters will guide the master module how to accurately control the motor in the massage equipment, including but not limited to adjusting the running direction and speed of the motor, setting the force threshold of the stall, monitoring the number of stall occurrences, timing the stall, and determining the current position of the motor, etc. In this way, even in the case that the master module is temporarily in standby state, the system can update the control logic of the master module through the latest data provided by the human-computer interaction module, to ensure that the equipment can accurately execute the corresponding massage operation according to the latest instructions of the user. This mechanism not only enhances the flexibility and response speed of the equipment, but also improves the intelligent level of the equipment, so that the equipment can maintain good user experience in various use scenarios, while reducing the equipment failure rate caused by different parameters.

[0050] In step S104, if the master module is not in standby state and the human-computer interaction module is in standby state, the stored second running parameter is not updated, and the second running data is sent to the human-computer interaction module; the human-computer interaction module is used to update the stored first running parameter data to the second running parameter data, and run with the second running parameter.

[0051] In application, if the main control module is not in standby state, it is considered that the data of the main control module has not been initialized, and the data stored in the main control module is the latest operating data. At this time, if the human-computer interaction module is in standby state, it is considered that the data of the human-computer interaction module has been initialized, and the data stored in the human-computer interaction module needs to be updated to the latest data. The main control module sends the second operating data to the human-computer interaction module. After the human-computer interaction module receives the second operating data, it updates the stored first operating parameter data (which is the preset initial parameter at this time) to the second operating parameter data, and runs with the second operating parameters. Among them, the human-computer interaction module running with the second operating parameters refers to performing corresponding control according to the current massage mode, current massage time gear, current massage head running direction, current massage speed, current massage head position, current massage head strength, current heating gear, current massage countdown, stall AD value, mode data and other data in the first operating parameter data. The human-computer interaction module will control the device's display based on these parameters. For example, it will light up the corresponding indicator lights on the keypad according to the mode, heating gear, timing gear, and other parameters in the data packet, and light up or flash the indicator light on the power button according to changes in power parameters (such as a solid white light when the battery is high, a breathing orange light when the battery is low, a breathing orange light when charging, and a solid green light when fully charged). Through this mechanism, even if the human-computer interaction module is disconnected and restarted, it can quickly synchronize the latest operating parameters with the main control module, ensuring a high degree of consistency between the user interface and the actual operating status of the device. This two-way data synchronization not only improves the device's response speed and enhances the user experience, but also ensures that the device can accurately reflect the user's operating intentions under any circumstances, thereby improving the stability and reliability of the overall system.

[0052] In the embodiment of the present application, the human-computer interaction module sends first operating data to the main control module at preset time intervals. When the human-computer interaction module is disconnected, it can be identified through the operating status data, and the main control module sends second operating data to the human-computer interaction module to achieve data synchronization of the human-computer interaction module. Conversely, when the main control module is disconnected, data synchronization can be achieved through the first operating data sent by the human-computer interaction module. This ensures that any board of the electronic device can synchronize data through another board when a disconnection occurs, thereby ensuring the consistency of operating parameters between different boards and ensuring the normal operation of the program of the electronic device. This method improves the fault tolerance and stability of the system, reduces the overall failure risk caused by single point failures, and enhances the reliability of the device and user experience.

[0053] In one embodiment, step S102 further includes the following step S201:

[0054] Step S201: If the main control module is in the standby state and the human-computer interaction module is in the standby state, the stored second operating parameters are not updated and the system operates with the second operating parameters;

[0055] Wherein, when in the standby state, the second operating parameter is a preset initial parameter.

[0056] In the application, when the main control module and the human-computer interaction module are both in standby state, it is considered that the electronic device has been shut down and restarted normally. At this time, the data inside the main control module and the human-computer interaction module are all preset initial parameters, and no data synchronization is required. Therefore, the stored second operating parameters are not updated, and the device operates with the second operating parameters (which are the preset initial parameters at this time).

[0057] In one embodiment, the following step S301 is further included:

[0058] Step S301: If the main control module is not in the standby state and the second operating parameter data changes, the second operating data is sent to the human-computer interaction module; the human-computer interaction module is used to update the stored first operating parameter data to the second operating parameter data and operate with the second operating parameter; or

[0059] The receiving human-computer interaction module sends the first operating data when the human-computer interaction module is not in the standby state and the first operating parameter data changes, updates the stored second operating parameter data to the first operating parameter data, and operates with the first operating parameter.

[0060] In the application, during normal operation, the human-computer interaction module sends the first operating data to the main control module at a preset time interval. However, when the main control module is not in standby mode, if the internal data of the main control module is updated, the main control module may also actively send the second operating data to the human-computer interaction module. After the human-computer interaction module receives the second operating data, if it is determined that the main control module is not in standby mode, it will update the second operating parameter to its own data, that is, update the stored first operating parameter data to the second operating parameter data, and operate with the second operating parameter. Similarly, when the human-computer interaction module is not in standby mode, if its internal data is updated, it may also actively send the first operating data to the main control module before the preset time interval is reached. After the main control module receives the first operating data, if it is determined that the human-computer interaction module is not in standby mode, it will update the second operating parameter data to the first operating parameter data, that is, update the stored second operating parameter data to the first operating parameter data, and operate with the first operating parameter.

[0061] The embodiment of the present application adds a mechanism for any board to actively send the latest data to the other board when the data changes, in addition to the preset time interval. When the main control module and the human-computer interaction module are both in standby mode, the system defaults to running with initial parameters and does not require additional synchronization. Under normal working conditions, not only regular data exchange is maintained, but also real-time data synchronization updates are achieved. In this way, whether it is the main control module or the human-computer interaction module, as long as changes are detected in the internal data, they can immediately notify the other party to update the data, ensuring that both parties always have the latest status information of each other. This solution greatly improves the real-time and accuracy of the data. Even in the event of a flash disconnection, the latest operating parameters can be quickly obtained from the other party, thereby effectively ensuring the continuity and correct operation of the electronic equipment program and enhancing the overall stability and reliability of the system.

[0062] In one embodiment, after step S102, the following step S401 is further included:

[0063] Step S401: The main control module sends second operating data to the human-computer interaction module; the human-computer interaction module is used to receive the second operating data and compare the second operating parameter data with the stored first operating parameter data. If they are inconsistent, the first operating data is sent to the main control module again.

[0064] In the application, after the main control module is restarted after a flash, when it receives the first operating data sent by the human-computer interaction module at a preset time interval, it updates the stored second operating parameter data to the received first operating parameter data. And according to the updated parameters, the motor's running direction and running speed, stall force, number of stalls, stall timing, and current position of the motor are updated. At the same time, the main control module feeds back the updated second operating parameter data to the human-computer interaction module. The human-computer interaction module can determine whether the data of the main control module is synchronized by comparing the updated second operating parameter data fed back by the main control module with the first operating parameter data stored in itself. If the comparison is inconsistent, it is considered that the synchronization of the operating parameters within the main control module has failed, and it is necessary to send the first operating parameter data stored in itself again for the main control module to update.

[0065] In the application, you can set a certain number of data transmission times, such as 3 times or 5 times. If synchronization still fails, you can take corresponding alarm measures, such as controlling the light to flash or making voice broadcasts.

[0066] In one embodiment, the main control module and the human-computer interaction module each have an independent storage sector for storing operational data. For example, the main control module and the human-computer interaction module may use their respective fifth sectors as operational data storage areas. This sector is used solely for storing operational data and for synchronizing operational data between the main control module and the human-computer interaction module. During each data exchange, the main control module or the human-computer interaction module sends the complete fifth sector stored data to the other's fifth sector.

[0067] The main control module and human-computer interaction module of the present embodiment use independent storage sectors to store operating data and interactions, which can effectively isolate operating data from other types of data and avoid data confusion or erroneous overwriting. Designating a specific sector to store operating data simplifies the data synchronization process. Only the data in that sector needs to be focused on at a time, which not only speeds up data synchronization but also reduces the probability of synchronization errors. Furthermore, centralized storage of operating data avoids the space waste and inefficient access caused by random storage. Furthermore, the data in independent sectors only involves operating data, making it easier for the system to recover to a known good state in the event of a flash or other abnormality, thereby improving system stability and security. Furthermore, as device functions are added or improved, independent storage sectors can be easily expanded or adjusted without affecting the data structure of other parts of the system, providing convenience for future additions of new functions or system upgrades. In summary, the method of dividing data into independent sectors for storage and interaction not only improves the efficiency of data management and synchronization and enhances the stability and security of the system, but also enables the device to maintain efficient and reliable operation in complex and changing usage environments.

[0068] In one embodiment, the operation state includes at least a standby state, an operation state, and an operation end state;

[0069] The human-computer interaction module and / or the main control module enters the standby state in any of the following situations: shutdown and restart, flash restart in the running state, and flash restart in the end of operation state;

[0070] The human-computer interaction module and / or the main control module enter the operation state based on the user's power-on operation in the standby state;

[0071] In the running state, the human-computer interaction module and / or the main control module enters the running end state based on the user's shutdown operation or when the preset shutdown conditions are met.

[0072] In applications, such as Figure 2 As shown, switching between various operating states of the electronic device includes the following steps S11 to S16:

[0073] Step S11, inserting the adapter: inserting the electronic device into the adapter and connecting to external power supply.

[0074] Step S12, powering on the circuit board: After the electronic device is plugged into the adapter, the power button is pressed, and the self-locking circuit locks the power supply to power on the circuit board. At this time, the functions of the electronic device are not released and cannot directly enter the working state.

[0075] Step S13: Entering the Standby State (i.e., Power_Standby): After the circuit board is powered on, data initialization is performed, resetting the operating data stored in the human-computer interaction module and the main control module to the preset initial parameter data. This preset initial parameter data can be the factory default parameters before the user sets the parameters, or it can be the user-set parameters after the user sets and saves the parameters. This process ensures that the device starts operating in a consistent and preset state each time it is started, avoiding potential problems caused by residual data from previous operations.

[0076] Step S14, entering the working state (i.e., Power_ON state): After entering the standby state, the device can start working by a preset trigger mode, such as long pressing the power button or pressing the power button twice in succession. During operation, the device operates with preset initial parameters. In this state, if the main control module or the human-computer interaction module has a flash disconnection, the module with the flash disconnection will perform data initialization after powering on and re-enter the standby state.

[0077] Step S15, entering the work-end state (i.e., Power_OFF state): In the working state, the work-end state can be entered through user active operation, such as long pressing the power off button. In addition, the work-end state can also be automatically entered after a preset working time, such as 15 minutes, 30 minutes, etc. In the work-end state, if the main control module or the human-computer interaction module has a flash disconnect, the module with the flash disconnect will perform data initialization after powering on and re-enter the standby state.

[0078] Step S16: Power off and self-locking circuit disconnected: After entering the work end state, if there is no operation within a specified time period (e.g., 1 minute, 5 minutes, etc.), the power is turned off. At the same time, if there is no operation within the execution time period (e.g., 1 minute, 5 minutes, etc.) when the circuit board is powered on, the power is also turned off.

[0079] Example 2

[0080] An embodiment of the present application provides a data synchronization method, which is applied to a human-computer interaction module of an electronic device and can be executed by the human-computer interaction module of the electronic device when running a computer program with corresponding functions. The electronic device includes a human-computer interaction module, a main control module, and a motor. The human-computer interaction module is connected to the main control module, and the main control module is connected to the motor. The human-computer interaction module is configured to output a human-computer interaction signal to the main control module in response to a human-computer interaction operation of a user. The main control module is configured to output a control signal to the motor based on the human-computer interaction signal. The motor is configured to perform a corresponding action based on the control signal.

[0081] Among them, the human-computer interaction module stores first operating data, and the main control module stores second operating data. The first operating data at least includes first operating parameter data and first operating status data, and the second operating data at least includes second operating parameter data and second operating status data.

[0082] like Figure 3 As shown, the embodiment of the present application provides a data synchronization method, including the following steps S111 to S113:

[0083] Step S111: Send first operating data to the main control module at a preset time interval; the main control module is used to determine the operating status of the main control module, and determine the operating status of the human-computer interaction module based on the first operating status data, and the operating status at least includes a standby state; if the main control module is in the standby state and the human-computer interaction module is not in the standby state, the stored second operating parameter data is updated to the first operating parameter data, and the system operates with the first operating parameters; if the main control module is not in the standby state and the human-computer interaction module is in the standby state, the stored second operating parameter is not updated, and the second operating data is sent to the human-computer interaction module.

[0084] In application, when the electronic device is a massage device, the methods described in this embodiment and subsequent embodiments are described. The human-computer interaction module regularly sends first operating data to the main control module at preset time intervals (e.g., 0.1 seconds, 0.2 seconds, 0.3 seconds, etc.). The first operating data mainly includes first operating status data for indicating the current operating status of the human-computer interaction module, and operating parameters stored by the human-computer interaction module, i.e., first operating parameter data. The first operating parameter data includes at least one of the following data: current massage mode, current massage time gear, current massage head running direction, current massage speed, current massage head position, current massage head strength, current heating gear, current massage countdown, stall AD value, mode data, etc. Similarly, the second operating data mainly includes second operating status data for indicating the current operating status of the main control module, and operating parameters stored by the main control module, i.e., second operating parameter data. The second operating parameter data also includes at least one of the following data: current massage mode, current massage time gear, current massage head running direction, current massage speed, current massage head position, current massage head strength, current heating gear, current massage countdown, stall AD value, mode data, etc. Upon receiving the first operating data transmitted by the human-computer interaction module at preset time intervals, the main control module parses the first operating data to obtain first operating parameter data and first operating status data. The operating status of the human-computer interaction module can be determined using the first operating status data. The operating status includes at least a standby state and may also include other states besides the standby state, such as a working state and a work-end state.

[0085] In application, if the main control module is in standby state, it is considered that the operating parameter data inside the main control module is the preset initial parameter and needs to be synchronized. At this time, if the human-computer interaction module is not in standby state, it is considered that the operating parameter data inside the human-computer interaction module is the current latest operating parameter data, which can be used to synchronize the data in the main control module. By updating the stored second operating parameter data (which is the preset initial parameter at this time) to the first operating parameter data, data update synchronization is achieved, and then the system is operated with the first operating parameter data. If the main control module is not in standby state, it is considered that the data of the main control module has not been initialized, and the data stored in the main control module is the latest operating data. At this time, if the human-computer interaction module is in standby state, it is considered that the data of the human-computer interaction module has been initialized, and the data stored in the human-computer interaction module needs to be updated to the latest data. The main control module sends the second operating data to the human-computer interaction module.

[0086] Step S112: Receive the second operating data sent by the main control module, and determine the operating state of the main control module based on the second operating data; wherein the operating state at least includes a standby state.

[0087] Step S113: If the human-computer interaction module is in the standby state and the main control module is not in the standby state, the stored first operating parameter data is updated to the second operating parameter data, and the system is operated with the second operating parameter.

[0088] In one embodiment, the following step S221 is further included:

[0089] Step S221: If the human-computer interaction module is not in the standby state and the first operating parameter data changes, the first operating data is sent to the main control module; the main control module is used to update the stored second operating parameter data to the first operating parameter data and operate with the first operating parameter; or

[0090] The receiving main control module sends the second operating data when the main control module is not in the standby state and the second operating parameter data changes, updates the stored first operating parameter data to the second operating parameter data, and operates with the second operating parameter.

[0091] In one embodiment, after step S112, the following step S331 is further included:

[0092] Step S331: If the main control module is in the standby state, the stored first operating parameters are not updated and the system operates with the first operating parameters;

[0093] Wherein, when in the standby state, the first operating parameter is a preset initial parameter.

[0094] 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 this application.

[0095] Example 3

[0096] The embodiment of the present application provides a power supply circuit, which is applied to an electronic device. The electronic device includes a human-computer interaction module 1 and a main control module 2. The power supply circuit includes a diode 4, a resistor 5 and a capacitor 6.

[0097] The power supply ends of the human-computer interaction module 1 and the main control module 2 are connected to the cathode of the diode 4 and one end of the resistor 5, the anode of the diode 4 is connected to the power supply 3 of the electronic device, the other end of the resistor 5 is connected to the positive electrode of the capacitor 6, and the negative electrode of the capacitor 6 is grounded.

[0098] In applications, such as Figure 5As shown, the electronic device's power supply provides +5V to power the circuit board, which then passes through diode D4 to supply VCC to the human-machine interaction module and the main control module. When the +5V voltage is normal, VCC charges supercapacitor C18 through resistor R29 while powering the human-machine interaction module and the main control module. If the +5V voltage is lost due to a flash, supercapacitor C18 powers the human-machine interaction module and the main control module through resistor R29, maintaining their operation but preventing power from reaching the rest of the circuit board.

[0099] The embodiment of the present application connects large capacitors to the power supply pins of the human-computer interaction module and the main control module for energy storage, ensuring that the chip can still obtain stable voltage support in the early stage of power outage, thereby providing the device with sufficient time to process important tasks such as data preservation or safe shutdown, further protecting the security of data, and significantly improving the robustness and work efficiency of electronic equipment in unstable power supply environments as a whole.

[0100] Example 4

[0101] An embodiment of the present application provides an electronic device, including a main control module, a human-computer interaction module, a motor, a memory, and a computer program stored in the memory and executable on the main control module. When the main control module executes the computer program, the electronic device implements the method provided in the first embodiment of the present application.

[0102] Alternatively, the electronic device includes a main control module, a human-computer interaction module, a motor, a memory, and a computer program stored in the memory and executable on the human-computer interaction module. When the human-computer interaction module executes the computer program, the electronic device implements the method provided in the second embodiment of the present application.

[0103] Alternatively, it includes a main control module, a human-computer interaction module and a power supply circuit as provided in Example 3 of the present application.

[0104] In applications, in some embodiments, the memory can be an internal storage unit of an electronic device, such as a hard disk or memory of the electronic device. In other embodiments, the memory can also be an external storage device of the electronic device, such as a plug-in hard disk equipped on the electronic device, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card, etc. Furthermore, the memory can also include both an internal storage unit of the electronic device and an external storage device. The memory is used to store an operating system, application programs, a boot loader (BootLoader), data, and other programs, such as the program code of a computer program. The memory can also be used to temporarily store data that has been output or is about to be output.

[0105] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of this application. Their specific functions and technical effects can be found in the method embodiment section and will not be repeated here.

[0106] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In actual applications, the above-mentioned functions can be distributed and 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 into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into 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, and will not be repeated here.

[0107] An 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.

[0108] An embodiment of the present application provides a computer program product, including a computer program. When the computer program is run, the method provided in the first aspect or the second aspect of the embodiment of the present application is executed.

[0109] 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. The computer program can be stored in a computer-readable storage medium, and when the computer program is executed by the processor, it can implement the steps of the above-mentioned various method embodiments. Among them, the computer program includes computer program code, which 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 / electronic device, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), 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, a computer-readable medium cannot be an electric carrier signal or a telecommunication signal.

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

[0111] Those skilled 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 beyond the scope of this application.

[0112] In the embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of modules or units is only a logical function division. In actual implementation, there may be other division methods, 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.

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

[0114] 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 various embodiments of the present application, and should all be included in the scope of protection of the present application.

Claims

1. A data synchronization method, characterized in that: A main control module applied to an electronic device, the electronic device comprising a human-computer interaction module and a main control module; wherein the human-computer interaction module stores first operating data, and the main control module stores second operating data, the first operating data comprising at least first operating parameter data and first operating status data, and the second operating data comprising at least second operating parameter data and second operating status data; The method comprises: receiving first operation data sent by the human-computer interaction module at preset time intervals; Determine the operating state of the main control module, and determine the operating state of the human-computer interaction module based on the first operating state data; wherein the operating state includes at least a standby state, an operating state, and an operation end state; If the main control module is in a standby state and the human-computer interaction module is not in a standby state, the stored second operating parameter data is updated to the first operating parameter data, and the system is operated with the first operating parameter; If the main control module is not in the standby state and the human-computer interaction module is in the standby state, the stored second operating parameter is not updated, and the second operating data is sent to the human-computer interaction module; the human-computer interaction module is used to update the stored first operating parameter data to the second operating parameter data, and operate with the second operating parameter; If the main control module is in a standby state and the human-computer interaction module is in a standby state, the stored second operating parameter is not updated and the system operates with the second operating parameter; Wherein, when in the standby state, the second operating parameter is a preset initial parameter; The human-computer interaction module and / or the main control module enters the standby state in any one of the following situations: shutdown and restart, flash restart in running state, and flash restart in running end state.

2. The data synchronization method according to claim 1, wherein: Also includes: If the main control module is not in the standby state and the second operating parameter data changes, the second operating data is sent to the human-computer interaction module; the human-computer interaction module is used to update the stored first operating parameter data to the second operating parameter data and operate with the second operating parameters; or The first operation parameter data is received when the human-computer interaction module is not in a standby state and the first operation parameter data changes, and the stored second operation parameter data is updated to the first operation parameter data, and the system is operated with the first operation parameter.

3. The data synchronization method according to claim 1, wherein: In the standby state, the human-computer interaction module and / or the main control module enters the operating state based on a power-on operation by a user; In the running state, the human-computer interaction module and / or the main control module enters the running end state based on a shutdown operation of the user or when a preset shutdown condition is met.

4. A data synchronization method, characterized in that: A human-computer interaction module applied to an electronic device, the electronic device comprising a human-computer interaction module, a main control module, and a motor, the human-computer interaction module being connected to the main control module, the main control module being connected to the motor, the human-computer interaction module being configured to output a human-computer interaction signal to the main control module in response to a user's human-computer interaction operation, the main control module being configured to output a control signal to the motor based on the human-computer interaction signal, and the motor being configured to perform a corresponding action based on the control signal; The human-computer interaction module stores first operating data, and the main control module stores second operating data, wherein the first operating data at least includes first operating parameter data and first operating status data, and the second operating data at least includes second operating parameter data and second operating status data; The method comprises: Sending first operating data to the main control module at a preset time interval; the main control module is used to determine the operating state of the main control module, and determine the operating state of the human-computer interaction module based on the first operating state data, wherein the operating state at least includes a standby state; if the main control module is in the standby state and the human-computer interaction module is not in the standby state, updating the stored second operating parameter data to the first operating parameter data and operating with the first operating parameter; if the main control module is not in the standby state and the human-computer interaction module is in the standby state, not updating the stored second operating parameter, and sending the second operating data to the human-computer interaction module; receiving second operating data sent by the main control module, and determining an operating state of the main control module based on the second operating data; wherein the operating state includes at least a standby state, an operating state, and an operation end state; If the human-computer interaction module is in a standby state and the main control module is not in a standby state, updating the stored first operating parameter data to second operating parameter data and operating with the second operating parameter; If the main control module is in a standby state and the human-computer interaction module is in a standby state, the stored first operating parameter is not updated and the system operates with the first operating parameter; Wherein, when in the standby state, the first operating parameter is a preset initial parameter; The human-computer interaction module and / or the main control module enters the standby state in any one of the following situations: shutdown and restart, flash restart in running state, and flash restart in running end state.

5. The data synchronization method according to claim 4, wherein: Also includes: If the human-computer interaction module is not in the standby state and the first operating parameter data changes, sending the first operating data to the main control module; The main control module is used to update the stored second operating parameter data to the first operating parameter data, and operate with the first operating parameter; or The second operating data sent by the main control module when the main control module is not in a standby state and the second operating parameter data changes are received, and the stored first operating parameter data is updated to the second operating parameter data, and the system is operated with the second operating parameter.

6. An electronic device, characterized in that: The electronic device comprises a main control module, a human-computer interaction module, a motor, a memory, and a computer program stored in the memory and executable on the main control module, wherein when the main control module executes the computer program, the electronic device implements the method according to any one of claims 1 to 3; Alternatively, the electronic device includes a main control module, a human-computer interaction module, a motor, a memory, and a computer program stored in the memory and executable on the human-computer interaction module. When the human-computer interaction module executes the computer program, the electronic device implements the method as claimed in any one of claims 4 to 5.

7. A computer program product, characterized in that The invention comprises a computer program, which, when being executed, enables the method according to any one of claims 1 to 3 or any one of claims 4 to 5 to be executed.

Citation Information

Patent Citations

  • Method and device for controlling massage equipment, mobile terminal and massage equipment

    CN111588616A

  • Massage equipment, control method and device of massage equipment and storage medium

    CN114053580A