Data synchronization method of electronic equipment, power supply circuit, electronic equipment and computer program product
By implementing data synchronization method between the main control module of the electronic device and the human-computer interaction module, the data flow interruption caused by flash interruption is solved, ensuring the normal operation of the device program and the stability of the system.
Patent Information
- Application Number
- CN202411538299.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-30
- Publication Date
- 2025-02-25
- Estimated Expiration
- 2044-10-30
AI Technical Summary
When the electronic device is powered unstable (flashed), it may cause data flow to be interrupted, affecting the normal operation of the device program.
By implementing data synchronization method between the main control module of the electronic device and the human-computer interaction module, the running data is sent using preset time intervals to identify the running status of the board, and when a flash break occurs, the data is synchronized through another board to ensure the consistency of the running parameters.
Effectively respond to flash breaking phenomena, ensure the normal operation of electronic equipment programs, improve the fault tolerance and stability of the system, and reduce the overall failure risk caused by single point of failure.
Smart Images

Figure CN119512828A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the technical field of electronic equipment, and in particular, relates to a data synchronization method for electronic equipment, a power supply circuit, an electronic equipment, and a computer program product. Background Art
[0002] A typical electronic device usually integrates two key boards. One is responsible for processing signals and controlling the various functions of the device, and the other is mainly used to receive user input and convert it into command signals that the device can recognize.
[0003] However, in actual applications, momentary power instability due to various reasons, the so-called "flash outage", can have a significant impact on such electronic devices. When a board flashes out, it may interrupt the data flow being processed, causing some data to fail to be correctly saved or processed, thus affecting the normal operation of the electronic device program.
[0004] Therefore, how to effectively deal with the flash disconnection phenomenon and ensure the normal operation of the programs of electronic equipment is a problem that needs to be solved. Summary of the invention
[0005] In view of this, the embodiments of the present application provide a data synchronization method, power supply circuit, electronic device and computer program product for an electronic device, which can synchronize data in time after a flash failure occurs, ensure the consistency of operating parameters between different boards, and ensure the normal operation of the program of the electronic device.
[0006] 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, wherein 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, 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;
[0007] The method comprises:
[0008] Receiving first operation data sent by the human-computer interaction module at preset time intervals;
[0009] 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;
[0010] 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;
[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, wherein the electronic device comprises a human-computer interaction module, a main control module and a motor, wherein the human-computer interaction module is connected to the main control module, and the main control module is connected to the motor, wherein the human-computer interaction module is used to output a human-computer interaction signal to the main control module in response to a human-computer interaction operation of a user, wherein the main control module is used to output a control signal to the motor based on the human-computer interaction signal, and wherein the motor is used 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, the operating state at least including 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, then 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, then not updating the stored second operating parameter, and sending the second operating data to the human-computer interaction module;
[0016] receiving second operation data sent by the main control module, and determining the operation state of the main control module based on the second operation data; wherein the operation state at least includes 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, which is applied to an electronic device, wherein the electronic device includes a human-computer interaction module and a main control module, and the power supply circuit includes a diode, a resistor, and a capacitor;
[0019] The power supply ends of the human-computer interaction module and the main control module are connected to the cathode of the diode and one end of the resistor, the anode of the diode is connected to the power supply of the electronic device, the other end of the resistor is connected to the positive electrode of the capacitor, and the negative electrode of the capacitor is grounded.
[0020] A fourth aspect of the embodiments 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, wherein when the main control module executes the computer program, the electronic device implements the method provided in the first aspect of the embodiments of the present application;
[0021] Alternatively, 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 human-computer interaction module, wherein when the human-computer interaction module executes the computer program, the electronic device implements the method provided in the second aspect of the embodiment of the present application;
[0022] Alternatively, it includes a main control module, a human-computer interaction module and a power supply circuit as provided in the third aspect of the embodiment of the present application.
[0023] A fifth aspect of the embodiments of the present application provides a computer program product, including a computer program. When the computer program is executed, the method provided in the first aspect or the second aspect of the embodiments of the present application is executed.
[0024] A data synchronization method provided in a first aspect of an embodiment of the present application 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 operation data, and the main control module stores second operation data, the first operation data at least comprising first operation parameter data and first operation status data, and the second operation data at least comprising second operation parameter data and second operation status data; the method comprises: receiving first operation data sent by the human-computer interaction module at a preset time interval; determining the operation status of the main control module, and determining the operation status of the human-computer interaction module based on the first operation status data; wherein the operation status at least comprises 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 operation parameter data to the first operation parameter data, and operating with the first operation 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 operation parameter, and sending the second operation data to the human-computer interaction module; the human-computer interaction module is used to update the stored first operation parameter data to the second operation parameter data, and operate with the second operation parameter. 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 temporarily, 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 realize data synchronization of the human-computer interaction module. Conversely, when the main control module is disconnected temporarily, data synchronization can be realized through the first operating data sent by the human-computer interaction module, so 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 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 any creative work.
[0027] Figure 1 This is a flow chart of a data synchronization method provided by an embodiment of the present application;
[0028] Figure 2 It is a schematic diagram of a process of 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 yet another embodiment of the present application. DETAILED DESCRIPTION
[0032] 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.
[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 exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.
[0034] 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.
[0035] 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.
[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" 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 statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear 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. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0038] Embodiment 1
[0039] The 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 operation data, and the main control module stores second operation data, the first operation data at least includes first operation parameter data and first operation status data, and the second operation data at least includes second operation parameter data and second operation status data; the method includes: receiving the first operation data sent by the human-computer interaction module at a preset time interval; determining the operation status of the main control module, and determining the operation status of the human-computer interaction module based on the first operation status data; wherein the operation 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, then updating the stored second operation parameter data to the first operation parameter data, and running with the first operation parameter; if the main control module is not in the standby state and the human-computer interaction module is in the standby state, then not updating the stored second operation parameter, and sending the second operation data to the human-computer interaction module; the human-computer interaction module is used to update the stored first operation parameter data to the second operation parameter data, and run with the second operation parameter. 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 temporarily, 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 realize data synchronization of the human-computer interaction module. Conversely, when the main control module is disconnected temporarily, data synchronization can be realized through the first operating data sent by the human-computer interaction module, so 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 further 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. 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 feedback 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 a preset time interval.
[0044] In the application, when the electronic device is a massage device, the method mentioned in this embodiment and the subsequent embodiments is described. The human-computer interaction module regularly sends the first operation data to the main control module at a preset time interval (for example, 0.1 seconds, 0.2 seconds, 0.3 seconds, etc.), and the first operation data mainly includes the first operation state data for indicating the current working state of the human-computer interaction module, and the operation parameters stored by the human-computer interaction module, that is, the first operation parameter data. The first operation parameter data includes at least one of 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 strength, the current heating gear, the current massage countdown, the stall AD value, the mode data, etc. Similarly, the second operation data mainly includes the second operation state data for indicating the current working state of the main control module, and the operation parameters stored by the main control module, that is, the second operation parameter data. The second operation parameter data also includes at least one of 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 strength, the current heating gear, the current massage countdown, the stall AD value, the 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 at least includes a standby state.
[0046] In the application, when the main control module receives the first operation data sent by the human-computer interaction module at a preset time interval, it parses the first operation data to obtain the first operation parameter data and the first operation status data. The operation status of the human-computer interaction module can be known through the first operation status data. The operation status includes at least the standby state, and may also include other states other than the standby state, such as the working state, the work end state, etc.
[0047] In the application, when the electronic device is shut down and restarted normally, the main control module and the human-computer interaction module will initialize the 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, judging 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 experienced, 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 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 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 (the preset initial parameter at this time) to the first operating parameter data, the update synchronization of the data is realized, and then the first operating parameter data is run. Among them, the main control module runs with the first operating parameter data, which means that the motor is controlled accordingly 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. These parameters will guide the main control module on how to accurately control the motor in the massage device, including but not limited to adjusting the running direction and speed of the motor, setting the strength threshold of the stall, monitoring the number of stalls, performing the timing of the stall, and determining the current position of the motor, etc. In this way, even when the main control module is temporarily in standby mode, the system can update the control logic of the main control module through the latest data provided by the human-computer interaction module, ensuring that the device can accurately perform the corresponding massage operations according to the user's latest instructions. This mechanism not only enhances the flexibility and response speed of the device, but also improves the intelligence level of the device, allowing the device to maintain a good user experience in a variety of different usage scenarios, while reducing the device failure rate caused by parameter asynchrony.
[0050] Step S104: 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.
[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 runs with the second operating parameters, which means that 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 strength, the current heating gear, the current massage countdown, the stall AD value, the mode data and other data in the first operating parameter data are controlled accordingly. The human-computer interaction module will control the performance of the device based on these parameters, such as lighting up the corresponding indicator lights on the keypad according to the mode, heating gear, timing gear and other parameters in the data packet, lighting up or flashing the indicator lights on the power button according to the changes in the power parameters (such as the white light is always on when the power is high, the orange light flashes when the power is low, the orange light flashes when charging, and the green light is always on 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 to ensure that the user interface is highly consistent with the actual operating status of the device. This two-way data synchronization not only improves the response speed of the device 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 the first operation data to the main control module at a preset time interval. When the human-computer interaction module is disconnected, it can be identified by the operation status data, and the second operation data is 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 operation data sent by the human-computer interaction module, so that any board of the electronic device can synchronize data through another board when a disconnection occurs, thereby ensuring the consistency of operation 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 a standby state and the human-computer interaction module is in a 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 data synchronization is not required. Therefore, the stored second operating parameters are not updated, and the device runs with the second operating parameters (at this time, the preset initial parameters).
[0057] In one embodiment, the following step S301 is also 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 is not in the standby state and the first operating parameter data changes, and the first operating data sent is updated to the first operating parameter data, and the first operating parameter is operated.
[0060] In the application, when working normally, the human-computer interaction module sends the first operation data to the main control module at a preset time interval. However, when the main control module is not in the standby state, if the internal data of the main control module is updated, the second operation data can also be actively sent to the human-computer interaction module. After the human-computer interaction module receives the second operation data, if it is determined that the main control module is not in the standby state, the second operation parameter is updated to its own data, that is, the stored first operation parameter data is updated to the second operation parameter data, and the second operation parameter is operated. Similarly, when the human-computer interaction module is not in the standby state, if its internal data is updated, it can also actively send the first operation data to the main control module when the preset time interval is not reached. After the main control module receives the first operation data, if it is determined that the human-computer interaction module is not in the standby state, the second operation parameter data is updated to the first operation parameter data, that is, the stored second operation parameter data is updated to the first operation parameter data, and the first operation parameter is operated.
[0061] The embodiment of the present application adds a mechanism for any board to actively send the latest data to another 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 the initial parameter operation without additional synchronization; and 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, the other party can be notified immediately 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 operation data to the human-computer interaction module; the human-computer interaction module is used to receive the second operation data, and compare the second operation parameter data with the stored first operation parameter data. If they are inconsistent, the first operation data is sent to the main control module again.
[0064] In the application, after the main control module is restarted after a flash, when the first operating data sent by the human-computer interaction module at a preset time interval is received, the stored second operating parameter data is updated to the received first operating parameter data. And the running direction and running speed of the motor, the stall force, the number of stalls, the stall timing, and the current position of the motor are updated according to the updated parameters. 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 inside 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 the 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 are respectively provided with an independent storage sector for storing operation data. For example, the main control module and the human-computer interaction module can use their respective fifth sectors as operation data storage areas, which are only used to store operation data and to synchronize operation data between the main control module and the human-computer interaction module. Each time data is exchanged, the main control module or the human-computer interaction module sends the complete fifth sector storage data to the fifth sector of the other party.
[0067] The main control module and the human-computer interaction module of the embodiment of the present application use independent storage sectors to store operation data and interaction, which can effectively isolate operation data from other types of data to avoid data confusion or erroneous overwriting. And specifying a specific sector to store operation data simplifies the data synchronization process. Each time, you only need to pay attention to the data of this sector, which not only speeds up the data synchronization speed, but also reduces the probability of errors during synchronization. In addition, the centralized storage of operation data avoids the waste of space and low access efficiency caused by random storage; in addition, the data of the independent sector only involves operation data, making it easier for the system to recover to a known good state when encountering flash or other abnormal situations, thereby improving the stability and security of the system. At the same time, with the increase or improvement of device functions, the independent storage sector is easy to expand or adjust, and will not affect the data structure of other parts of the system, which provides convenience for the possibility of adding new functions or upgrading the system in the future. In summary, the method of dividing independent sectors to store data and interacting not only improves the efficiency of data management and synchronization, enhances the stability and security of the system, but also enables the device to maintain an efficient and reliable working state in the face of complex and changing use 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 operating state in the standby state based on the user's power-on operation;
[0071] When the human-computer interaction module and / or the main control module is in the running state, it 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, the 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 state): After the circuit board is powered on, data initialization is performed, and the operating data stored in the human-computer interaction module and the main control module are reset to the preset initial parameter data. The preset initial parameter data can be the factory default initial parameters before the user sets the parameters, and can be the parameters saved by the user after the user sets and saves the parameters. This process ensures that each time the device is started, it can start working in a unified and preset state, avoiding potential problems caused by residual data left over from the last operation.
[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, pressing the power button twice in succession, etc., and works 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 power-on and re-enter the standby state.
[0077] Step S15, entering the work end state (i.e., Power_OFF state): In the work state, the work end state can be entered through active user operation, such as long pressing the power off button. In addition, when the work reaches a preset time, such as 15 minutes, 30 minutes, etc., the work end state can also be automatically entered. In the work end 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 power-on and re-enter the standby state.
[0078] Step S16, power off, self-locking circuit disconnected: after entering the work end state, if there is no operation within a specified time period (such as 1 minute, 5 minutes, etc.), the power is turned off. At the same time, when the circuit board is powered on, if there is no operation within the execution time period (such as 1 minute, 5 minutes, etc.), the power can also be turned off.
[0079] Embodiment 2
[0080] The 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 used 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 used to output a control signal to the motor based on the human-computer interaction signal, and the motor is used to perform a corresponding action based on the control signal.
[0081] 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, sending 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, then the stored second operating parameter data is updated to the first operating parameter data, and the first operating parameter is operated; if the main control module is not in the standby state, and the human-computer interaction module is in the standby state, then the stored second operating parameter is not updated, and the second operating data is sent to the human-computer interaction module.
[0084] In the application, when the electronic device is a massage device, the method mentioned in this embodiment and the subsequent embodiments is described. The human-computer interaction module regularly sends the first operation data to the main control module at a preset time interval (for example, 0.1 seconds, 0.2 seconds, 0.3 seconds, etc.), and the first operation data mainly includes the first operation state data for indicating the current working state of the human-computer interaction module, and the operation parameters stored by the human-computer interaction module, that is, the first operation parameter data. The first operation parameter data includes at least one of 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 strength, the current heating gear, the current massage countdown, the stall AD value, the mode data, etc. Similarly, the second operation data mainly includes the second operation state data for indicating the current working state of the main control module, and the operation parameters stored by the main control module, that is, the second operation parameter data. The second operation parameter data also includes at least one of 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 strength, the current heating gear, the current massage countdown, the stall AD value, the mode data, etc. When receiving the first operation data sent by the human-computer interaction module at a preset time interval, the main control module parses the first operation data to obtain the first operation parameter data and the first operation status data. The operation status of the human-computer interaction module can be known through the first operation status data. The operation status includes at least the standby state, and may also include other states other than the standby state, such as the working state, the work end state, etc.
[0085] In the application, if the main control module is in the 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 the 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 (the preset initial parameter at this time) to the first operating parameter data, the data update synchronization is achieved, and then the first operating parameter data is run. If the main control module is not in the 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 the 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: receiving second operation data sent by the main control module, and determining the operation state of the main control module based on the second operation data; wherein the operation 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 also 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 second operating parameter data is changed and the stored first operating parameter data is updated to the second operating parameter data, and the system 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 a standby state, the first operating parameter stored is not updated and the system operates with the first operating parameter;
[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 the present application.
[0095] Embodiment 3
[0096] The embodiment of the present application provides a power supply circuit, which is applied to an electronic device, wherein the electronic device includes a human-computer interaction module 1 and a main control module 2, and 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 power supply of the electronic device provides +5V voltage to power the circuit board, and then supplies power to the VCC of the human-machine interaction module and the main control module through a diode D4. When +5V is normal, while supplying power to the human-machine interaction module and the main control module, VCC charges the super capacitor C18 through resistor R29. If +5V disappears due to flash, the super capacitor C18 supplies power to the human-machine interaction module and the main control module through resistor R29, maintaining the operation of the human-machine interaction module and the main control module, but does not supply power to the rest of the circuit board.
[0099] The embodiment of the present application connects a large capacitor to the power supply pins of the human-computer interaction module and the main control module for energy storage, thereby ensuring that the chip can still obtain stable voltage support in the early stage of power failure, thereby providing the device with sufficient time to handle important tasks such as data preservation or safe shutdown, further protecting the security of data, and significantly improving the overall robustness and work efficiency of electronic equipment in unstable power supply environments.
[0100] Embodiment 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 Embodiment 2 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 application, the memory may be an internal storage unit of an electronic device in some embodiments, such as a hard disk or memory of the electronic device. The memory may also be an external storage device of the electronic device in other embodiments, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (SecureDigital, SD) card, a flash card (Flash Card), etc. equipped on the electronic device. Further, the memory may 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, an application program, a boot loader (BootLoader), data, and other programs, such as program code of a computer program, etc. The memory may also be used to temporarily store data that has been output or is 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 the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.
[0106] 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.
[0107] 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.
[0108] An embodiment of the present application provides a computer program product, including a computer program. When the computer program is executed, 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, and the computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor, the steps of the above-mentioned various method embodiments can be implemented. 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 / electronic 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.
[0110] 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.
[0111] 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.
[0112] In the embodiments provided in the present 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 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.
[0113] 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.
[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 embodiments of the present application, and should all be included in the protection scope 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, the main control module stores second operating data, the first operating data at least comprises first operating parameter data and first operating status data, the second operating data at least comprises 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 at least includes a standby 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 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.
2. The data synchronization method according to claim 1, characterized in that: After 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, the method further includes: 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.
3. The data synchronization method according to claim 1, characterized in that: 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 parameter; or The first operation data sent by the human-computer interaction module when the human-computer interaction module is not in a standby state and the first operation parameter data changes are received, 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.
4. The data synchronization method according to claim 1, characterized in that: The operating state at least includes a standby state, an operating state and an operation end state; 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 the running state, and flash restart in the running end state; The human-computer interaction module and / or the main control module enters the operating state in the standby 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.
5. 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 used 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 being used to output a control signal to the motor based on the human-computer interaction signal, and the motor being used 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, the operating state at least including 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, then 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, then not updating the stored second operating parameter, and sending the second operating data to the human-computer interaction module; receiving second operation data sent by the main control module, and determining the operation state of the main control module based on the second operation data; wherein the operation state at least includes a standby state; 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.
6. The data synchronization method according to claim 5, characterized in that: Also includes: 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 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 operates with the second operating parameter.
7. The data synchronization method according to claim 6, characterized in that: After receiving the second operation data sent by the main control module and determining the operation state of the main control module based on the second operation data, the method further includes: If the main control module is in a standby state, the stored first operating parameter is not updated and the main control module is operated with the first operating parameter; Wherein, when in the standby state, the first operating parameter is a preset initial parameter.
8. A power supply circuit, characterized in that: Applied to electronic equipment, the electronic equipment includes a human-computer interaction module and a main control module, and the power supply circuit includes a diode, a resistor and a capacitor; The power supply ends of the human-computer interaction module and the main control module are connected to the cathode of the diode and one end of the resistor, the anode of the diode is connected to the power supply of the electronic device, the other end of the resistor is connected to the positive electrode of the capacitor, and the negative electrode of the capacitor is grounded.
9. 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 4; Alternatively, 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 human-computer interaction module, wherein when the human-computer interaction module executes the computer program, the electronic device implements the method according to any one of claims 5 to 6; Alternatively, it comprises a main control module, a human-computer interaction module and the power supply circuit as claimed in claim 8.
10. A computer program product, characterized in that The invention comprises a computer program, which enables the method according to any one of claims 1 to 4 or any one of claims 5 to 6 to be executed when the computer program is 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
Sleep control method for wireless control module, projector, and storage medium
CN115568005A
Signal synchronous acquisition method and device, readable storage medium and equipment
CN116224383A
Reset method and electronic device
WO2024082801A1