Device control method and device, washing equipment and storage medium
By connecting each serial interface to multiple devices in the washing equipment and controlling it when a valid data frame is detected, the high cost problem caused by the insufficient number of serial interfaces in the existing technology is solved, and the control of all devices is realized. efficient control.
Patent Information
- Application Number
- CN202410734220.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-06
- Publication Date
- 2024-10-11
AI Technical Summary
In existing washing equipment, due to the limited number of serial interfaces on the control board, when the number of devices exceeds the number of interfaces, it is usually necessary to add serial interfaces to control all devices, resulting in high costs.
By connecting each serial interface to multiple devices, serial port multiplexing is realized. The corresponding relationship between the pre-stored device identification and the serial interface is used to determine the target serial interface, and control is only performed when a valid data frame is detected. Improve control accuracy.
All devices can be controlled without additional serial interfaces, which reduces costs and improves the control accuracy of the devices to be controlled.
Smart Images

Figure CN118749860A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the technical field of washing equipment, and in particular, relates to a device control method, apparatus, washing equipment and storage medium. Background Art
[0002] A washing machine (such as a dishwasher) is usually equipped with many sensors or communication modules, and each sensor or each communication module usually communicates with each other through a serial interface on a control board to realize various functions of the washing machine. However, since the number of serial interfaces on the control board is limited, when the number of components of the washing machine that need to be controlled by the control board exceeds the number of existing serial interfaces, the prior art usually achieves control of all components by adding serial interfaces. It can be seen that the prior art has the problem of high cost. Summary of the invention
[0003] The embodiment of the present application provides a device control method, apparatus, washing equipment and storage medium, wherein each serial interface is connected to multiple devices to realize serial port multiplexing, without the need to add additional serial interfaces, thereby reducing costs. At the same time, the device to be controlled is controlled through the target serial interface only when the control data frame is detected to be a valid data frame, thereby improving the control accuracy of the device to be controlled.
[0004] In a first aspect, an embodiment of the present application provides a device control method, which is applied to a washing device, wherein the washing device is provided with a first number of devices and a second number of serial interfaces, the first number is greater than the second number, and each of the serial interfaces is connected to a plurality of the devices; the method comprises:
[0005] In response to the device control instruction, acquiring a control data frame and a device identification of a device to be controlled;
[0006] Determining a target serial interface corresponding to the device to be controlled based on a pre-stored correspondence between the device identification and the serial interface;
[0007] If the control data frame is a valid data frame, the device to be controlled is controlled through the target serial interface.
[0008] Optionally, before controlling the device to be controlled through the target serial interface if the control data frame is a valid data frame, the method further includes:
[0009] If the format of the control data frame is the same as the format of the setting data frame corresponding to the device to be controlled, determining that the control data frame is a valid data frame;
[0010] If the format of the control data frame is different from the format of the setting data frame corresponding to the device to be controlled, it is determined that the control data frame is an invalid data frame.
[0011] Optionally, the device to be controlled includes a plurality of devices; if the control data frame is a valid data frame, controlling the device to be controlled through the target serial interface includes:
[0012] Determine the control priority of each of the components to be controlled according to the functional level of each of the components to be controlled in the washing device; the functional level is used to characterize the importance of each of the components to be controlled in the washing device;
[0013] Each of the components to be controlled is controlled in sequence through the target serial interface according to the control priority.
[0014] Optionally, the target serial interface is connected to a power board, and the target serial interface is in a control board of the washing device; the device to be controlled is not in the power board; and controlling the device to be controlled through the target serial interface includes:
[0015] Determining the communication status between the control board and the power board;
[0016] If the communication state is a busy state, a target communication duration between the control board and the power board is determined based on the set communication rules and the current communication environment between the control board and the power board; after the target communication duration, the device to be controlled is controlled through the target serial interface;
[0017] If the communication state is an idle state, the device to be controlled is controlled through the target serial interface after a set time.
[0018] Optionally, after controlling the device to be controlled through the target serial interface, the method further includes:
[0019] The control board and the power board are controlled to continue communicating through the target serial interface.
[0020] Optionally, controlling the device to be controlled through the target serial interface includes:
[0021] Based on a set time interval, a set number of control data frames are sent to the device to be controlled via the target serial interface; the set number of times is greater than 1.
[0022] Optionally, the device to be controlled is a three-color lamp; after the device to be controlled through the target serial interface, the method further includes:
[0023] Acquire the current generated by the three-color lamp through a detection circuit;
[0024] If the current current is different from the set current corresponding to the target color corresponding to the control data frame, the control data frame continues to be sent to the three-color lamp through the target serial interface until the three-color lamp displays the target color.
[0025] In a second aspect, an embodiment of the present application provides a device control apparatus, which is applied to a washing device, wherein the washing device is provided with a first number of devices and a second number of serial interfaces, the first number is greater than the second number, and each of the serial interfaces is connected to a plurality of the devices; the device comprises:
[0026] A first acquisition unit, configured to acquire a control data frame and a device identification of a device to be controlled in response to a device control instruction;
[0027] A first determining unit, configured to determine a target serial interface corresponding to the device to be controlled based on a pre-stored correspondence between a device identifier and a serial interface;
[0028] The first control unit is configured to control the device to be controlled through the target serial interface if the control data frame is a valid data frame.
[0029] In a third aspect, an embodiment of the present application provides a washing device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the device control method as described in any one of the first aspects above is implemented.
[0030] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the device control method as described in any one of the above-mentioned first aspects is implemented.
[0031] In a fifth aspect, an embodiment of the present application provides a computer program product. When the computer program product is run on a washing device, the washing device can execute the device control method described in any one of the first aspects above.
[0032] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:
[0033] A device control method provided by an embodiment of the present application, wherein the washing equipment is provided with a first number of devices and a second number of serial interfaces, the first number is greater than the second number, and each serial interface is connected to a plurality of devices; the method comprises: in response to a device control instruction, obtaining a control data frame and a device identification of the device to be controlled; determining a target serial interface corresponding to the device to be controlled based on a correspondence between the device identification and the serial interface stored in advance; if the control data frame is a valid data frame, the device to be controlled is controlled through the target serial interface. Compared with the prior art that realizes the control of all devices by adding serial interfaces, in this method, each serial interface is connected with multiple devices to realize serial port multiplexing, without the need to add additional serial interfaces, thereby reducing costs. At the same time, the device to be controlled is controlled through the target serial interface only when it is detected that the control data frame is a valid data frame, thereby improving the control accuracy of the device to be controlled. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] 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.
[0035] Figure 1 It is a partial structural schematic diagram of a washing device provided in one embodiment of the present application;
[0036] Figure 2 is a flow chart of an implementation of a device control method provided in an embodiment of the present application;
[0037] Figure 3 is a flow chart of an implementation of a device control method provided by another embodiment of the present application;
[0038] Figure 4 is a partial structural schematic diagram of a washing device provided in another embodiment of the present application;
[0039] Figure 5 is a flow chart of an implementation of a device control method provided in yet another embodiment of the present application;
[0040] Figure 6 is a flow chart of an implementation of a device control method provided by another embodiment of the present application;
[0041] Figure 7 is a partial structural schematic diagram of a washing device provided in yet another embodiment of the present application;
[0042] Figure 8 is a structural schematic diagram of a device control apparatus provided in an embodiment of the present application;
[0043] Fig. 9 It is a structural schematic diagram of a washing device provided in another embodiment of the present application. DETAILED DESCRIPTION
[0044] 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.
[0045] 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.
[0046] 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.
[0047] 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.
[0048] 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.
[0049] 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.
[0050] In practical applications, a washing machine (such as a dishwasher) is usually equipped with many sensors or communication modules, and each sensor or each communication module usually communicates with each other through a serial interface on a control board in the washing machine to realize various functions of the washing machine. However, since the number of serial interfaces on the control board is limited, when the number of devices that need to be controlled by the control board of the washing machine exceeds the number of existing serial interfaces, the prior art usually realizes the control of all devices by adding serial interfaces. It can be seen that the prior art has the problem of high cost.
[0051] Based on this, an embodiment of the present application provides a washing device that can control all devices in the washing device without adding an additional serial interface, thereby reducing costs.
[0052] Specifically, see Figure 1 , Figure 1 Schematic diagram of a part of the structure of a washing device provided in one embodiment of the present application. Figure 1 As shown, the washing device 1 comprises: a control panel 10 and a first number of components 20. The control panel 10 comprises: a second number of serial interfaces 11. The control panel 10 is connected to each component 20 via each serial interface 11.
[0053] In practical applications, the control board is a circuit board that is mainly used to control the working status and operation program of the washing equipment. It can realize functions such as signal input, signal processing and signal output, and control the parameter adjustment, operation mode and fault diagnosis of the washing equipment.
[0054] It should be noted that the control board 10 controls each device 20 through each serial interface 11 .
[0055] The various components in the washing equipment include but are not limited to: various sensors, various communication modules, power boards, and three-color lights, etc.
[0056] In practical applications, the power board is mainly used to control the power input of the washing equipment, including stabilizing the current and voltage, etc., to ensure the stability and safety of the washing equipment.
[0057] The first number is greater than the second number. The first number can be determined according to the number of components in the washing device in real life. The second number can be determined according to the number of serial interfaces in the control board of the washing device in real life.
[0058] In the embodiment of the present application, in order to achieve control over all devices without adding additional serial interfaces, each serial interface 11 can be connected to multiple devices 20, thereby achieving multiplexing of each serial interface 11.
[0059] See also Figure 2 , Figure 2 1 is a flowchart of a device control method provided in an embodiment of the present application. In the embodiment of the present application, the device control method is executed by a washing device, wherein the washing device may be a dishwasher.
[0060] like Figure 2 As shown, the device control method provided in an embodiment of the present application may include S101 to S103, which are described in detail as follows:
[0061] In S101, in response to a device control instruction, a control data frame and a device identification of a device to be controlled are acquired.
[0062] In the embodiment of the present application, the washing device receives the device control instruction which may be: detecting a preset operation for the washing device. The preset operation may be determined according to actual needs and is not limited here. Exemplarily, the preset operation may be clicking on a preset control, that is, if the washing device detects that the user clicks on a preset control on the washing device, it is considered that a preset operation for the washing device is detected; of course, the preset operation may also be a time-triggered operation, and the washing device may be configured with a corresponding washing process during operation, and the washing process includes trigger nodes for multiple key events, and the above-mentioned key events include events for controlling a certain device in the washing device. In this case, if the washing device detects that a trigger node associated with an event for controlling a certain device in the washing device is reached, operations S101 to S103 are executed to perform a control operation on a certain device in the washing device.
[0063] Based on this, the washing device can respond to the device control instruction and obtain the control data frame and the device identification of the device to be controlled. The device identification includes but is not limited to: number, serial number and name.
[0064] In one implementation of the embodiment of the present application, the device control instruction carries a control data frame and a device identification of the device to be controlled. Therefore, the washing device can extract the control data frame and the device identification of the device to be controlled from the device control instruction.
[0065] In S102, based on the pre-stored correspondence between the device identification and the serial interface, a target serial interface corresponding to the device to be controlled is determined.
[0066] In the embodiment of the present application, the washing device pre-stores the correspondence between each device identification and each serial interface. Therefore, the washing device can determine the target serial interface corresponding to the device to be controlled according to the device identification of the device to be controlled and the above correspondence.
[0067] After the washing equipment determines the target serial interface corresponding to the device to be controlled, it means that the control board of the washing equipment can communicate with the device to be controlled through the target serial interface, thereby realizing control of the device to be controlled.
[0068] In the embodiment of the present application, after determining the target serial interface corresponding to the device to be controlled, the washing device can detect whether the acquired control data frame is a valid data frame in order to improve the control accuracy and success rate of the device to be controlled. The valid data frame is used to describe that the control data frame is a data frame used to control the device to be controlled.
[0069] The washing device can compare the format of the control data frame with the format of the setting data frame corresponding to the device to be controlled to determine whether the control data frame is a valid data frame. The setting data frame can be set according to the standard data frame corresponding to the device to be controlled in real life.
[0070] Exemplarily, assuming that the device to be controlled is a three-color lamp, the corresponding standard data frame is: 551101; assuming that the device to be controlled is a power board, the corresponding standard data frame is: FFAA01.
[0071] In one embodiment of the present application, when the washing device detects that the format of the control data frame is the same as the format of the setting data frame corresponding to the device to be controlled, it can determine that the control data frame is a valid data frame, that is, the control data frame is a data frame used to control the device to be controlled.
[0072] Based on this, when the washing device detects that the control data frame is a valid data frame, step S103 may be executed.
[0073] In another embodiment of the present application, when the washing device detects that the format of the control data frame is different from the format of the setting data frame corresponding to the device to be controlled, it can determine that the control data frame is an invalid data frame, that is, the control data frame is not a data frame for controlling the device to be controlled. The invalid data frame is used to describe that the control data frame is not a data frame for controlling the device to be controlled.
[0074] In this embodiment, when the washing device detects that the control data frame is an invalid data frame, it may not perform any operation on the component to be controlled.
[0075] In S103, if the control data frame is a valid data frame, the device to be controlled is controlled through the target serial interface.
[0076] In the embodiment of the present application, when the washing device detects that the format of the control data frame is the same as the format of the setting data frame corresponding to the device to be controlled, it indicates that the control data frame is a valid data frame, that is, the control data frame is a data frame used to control the device to be controlled. Therefore, the washing device can send the control data frame to the device to be controlled through the target serial interface, so that the device to be controlled performs corresponding operations based on the control data frame, so as to achieve the purpose of the washing device controlling the device to be controlled through the target serial interface.
[0077] From the above, it can be seen that the embodiment of the present application provides a device control method, in which the washing equipment is provided with a first number of devices and a second number of serial interfaces, the first number is greater than the second number, and each serial interface is connected to multiple devices; the method includes: in response to the device control instruction, obtaining the control data frame and the device identification of the device to be controlled; based on the correspondence between the pre-stored device identification and the serial interface, determining the target serial interface corresponding to the device to be controlled; if the control data frame is a valid data frame, the device to be controlled is controlled through the target serial interface. Compared with the prior art that realizes the control of all devices by adding serial interfaces, in this method, each serial interface is connected with multiple devices to realize serial port multiplexing, without the need to add additional serial interfaces, thereby reducing costs. At the same time, the device to be controlled will only be controlled through the target serial interface when it is detected that the control data frame is a valid data frame, thereby improving the control accuracy of the device to be controlled.
[0078] See also Figure 3 , Figure 3 is a flowchart of a device control method provided by another embodiment of the present application. Figure 2 Corresponding embodiment, in this embodiment, when there are multiple devices to be controlled and there is only one target serial interface, in order to avoid signal blocking and improve the control success rate of each device to be controlled, step S103 may specifically include S201 to S202, which are described in detail as follows:
[0079] In S201, the control priority of each of the components to be controlled is determined according to the functional level of each of the components to be controlled in the washing device; the functional level is used to characterize the importance of each of the components to be controlled in the washing device.
[0080] In this embodiment, when there are multiple devices to be controlled and there is only one target serial interface, in order to avoid signal blockage and improve the control success rate of each device to be controlled, the washing device can determine the control priority of each device to be controlled according to the functional level of each device to be controlled in the washing device. The functional level is used to characterize the importance of each device to be controlled in the washing device.
[0081] It should be noted that the higher the function level of the component to be controlled, the higher its importance in the washing equipment, and the higher its control priority.
[0082] In one embodiment of the present application, the washing machine may determine the functional level of each component to be controlled based on the number of times each component to be controlled is used, the triggering reason, and the use result.
[0083] In S202, each of the components to be controlled is controlled in turn through the target serial interface according to the control priority.
[0084] In this embodiment, after determining the control priority of each component to be controlled, the washing equipment can send the control data frames corresponding to each component to be controlled to each component to be controlled through the target serial interface in sequence from high to low priority based on the control priority, so that each component to be controlled can perform its corresponding operation based on its corresponding control data frame in sequence, so as to achieve the purpose of the washing equipment controlling each component to be controlled through the target serial interface.
[0085] From the above, it can be seen that the device control method provided in this embodiment determines the control priority of each device to be controlled according to the functional level of each device to be controlled in the washing equipment; the functional level is used to characterize the importance of each device to be controlled in the washing equipment; each device to be controlled is controlled in turn through the target serial interface according to the control priority, thereby avoiding signal jams and improving the control success rate of each device to be controlled.
[0086] In one embodiment of the present application, see Figure 4 , Figure 4 FIG. 1 is a partial structural diagram of a washing device provided in another embodiment of the present application. Figure 4As shown, the target serial interface 11 in the control board 10 is connected to the power board 30 and the device to be controlled 20 respectively. At this time, in order to achieve successful control of the device to be controlled while ensuring normal power supply of the washing device, the washing device can be specifically configured as follows: Figure 4 Steps S301 to S303 shown execute step S103.
[0087] Based on this, see Figure 5 , Figure 5 FIG. 1 is a flowchart of a device control method according to another embodiment of the present application. Figure 2 Corresponding embodiment, in this embodiment, when the target serial interface is also connected to the power board, the target serial interface is in the control board of the washing device, and the device to be controlled is not in the power board, in order to ensure that the washing device is powered normally and the device to be controlled is successfully controlled, step S103 may specifically include S301 to S303, which are described in detail as follows:
[0088] In S301, the communication status between the control board and the power board is determined.
[0089] In this embodiment, the washing machine can determine the communication status between the control board and the power board based on the transmission time interval and transmission times of the communication data frame corresponding to the power board, wherein the communication status is used to describe whether the communication between the control board and the power board is busy.
[0090] The communication state includes but is not limited to: a busy state and an empty state. The busy state is used to describe that the communication between the control board and the power board is busy, and the idle state is used to describe that the communication between the control board and the power board is not busy.
[0091] In some possible embodiments, when the washing device detects that the transmission time interval is less than the first threshold and the number of transmissions is greater than the second threshold, it indicates that the communication state between the control board and the power board is busy. The first threshold and the second threshold can be set according to actual needs and are not limited here.
[0092] Based on this, when the washing device detects that the communication status between the control board and the power board is busy, step S302 can be executed.
[0093] When the washing device detects that the transmission time interval is greater than or equal to the first threshold, or the number of transmissions is less than or equal to the second threshold, it indicates that the communication state between the control board and the power board is in an idle state. Based on this, when the washing device detects that the communication state between the control board and the power board is in an idle state, step S303 can be executed.
[0094] In S302, if the communication status is a busy state, the target communication duration between the control board and the power board is determined based on the set communication rules and the current communication environment between the control board and the power board; after the target communication duration, the device to be controlled is controlled through the target serial interface.
[0095] In this embodiment, when the washing device detects that the communication status between the control board and the power board is busy, it means that the target serial interface is mainly used to realize the communication between the control board and the power board. Therefore, in order to realize effective communication with the device to be controlled and prevent signal jam, the washing device can determine the target communication duration between the control board and the power board based on the set communication rules between the control board and the power board and the current communication environment.
[0096] The setting of communication rules includes but is not limited to the setting of the sending frequency of the communication data frame.
[0097] The current communication environment is used to describe the communication quality between the control board and the power board at the current moment.
[0098] In some possible embodiments, when the communication quality in the current communication environment is normal, the washing device can calculate the target communication duration between the control board and the power board based on the set sending frequency and the third number of communication data frames that have not yet been sent.
[0099] In other possible embodiments, when the current communication environment has abnormal communication quality, the washing device can calculate the target communication duration between the control board and the power board based on the set sending frequency, the third number of communication data frames that have not yet been sent, and the preset duration increase.
[0100] Afterwards, the washing device can send the control data frame to the device to be controlled through the target serial interface after the target communication time, so that the device to be controlled performs corresponding operations based on the control data frame, thereby achieving the purpose of the washing device controlling the device to be controlled through the target serial interface.
[0101] In S303, if the communication state is an idle state, the device to be controlled is controlled through the target serial interface after a set time.
[0102] In this embodiment, when the washing device detects that the communication state between the control board and the power board is in an idle state, it indicates that the target serial interface can realize the communication between the control board and the device to be controlled. However, since the serial interface usually has a data digestion process in the process of transmitting data frames, in order to ensure that the previous data frame is digested and avoid signal jams, the washing device can send the control data frame to the device to be controlled through the target serial interface after the set time, so that the device to be controlled performs the corresponding operation based on the control data frame, so as to achieve the purpose of the washing device controlling the device to be controlled through the target serial interface. Among them, the set time can be set according to actual needs and is not limited here.
[0103] In some possible embodiments, the set duration may be set to 5 data frame transmission cycles.
[0104] In one embodiment of the present application, after the device to be controlled is controlled through the target serial interface, that is, the control data frame is sent to the device to be controlled through the target serial interface, in order to ensure that each device in the washing equipment is powered normally, the washing equipment can control the control board and the power board to continue communicating through the target serial interface.
[0105] As can be seen from the above, the device control method provided in this embodiment determines the communication status between the control board and the power board; if the communication status is busy, the target communication duration between the control board and the power board is determined based on the set communication rules and current communication environment between the control board and the power board; after the target communication duration, the device to be controlled is controlled through the target serial interface; if the communication status is idle, the device to be controlled is controlled through the target serial interface after the set duration. This ensures that the device to be controlled is successfully controlled while the washing equipment is powered normally.
[0106] See also Figure 6 , Figure 6 FIG. 1 is a flowchart of a device control method according to another embodiment of the present invention. Figure 2 Corresponding embodiment, in this embodiment, when the device to be controlled is a three-color lamp, since the three-color lamp can display different colors, in order to ensure that the three-color lamp can display accurate colors and further improve the control accuracy of the device to be controlled, after step S103, S401 to S402 may also be included, as detailed as follows:
[0107] In S401, the current generated by the three-color lamp is obtained through a detection circuit.
[0108] It should be noted that since the current generated by the three-color lamp is different when it displays different colors, in order to ensure that the three-color lamp can display accurate colors and further improve the control accuracy of the controlled device, a detection circuit for detecting the current of the three-color lamp is provided after the three-color lamp in the washing equipment.
[0109] For example, see Figure 7 , Figure 7 FIG. 1 is a partial structural diagram of a washing device provided in another embodiment of the present application. Figure 7 As shown, the target serial interface 11 in the control board 10 is connected to the three-color lamp 21 and other devices 22 respectively, and the three-color lamp 21 is also connected to the detection circuit 40.
[0110] In this embodiment, the washing machine controls the device to be controlled through the target serial interface, that is, sends the control data frame to the three-color lamp through the target serial interface, and after the three-color lamp performs a corresponding operation based on the control data frame, the washing machine can obtain the current current generated by the three-color lamp through the detection circuit. The current current specifically refers to the current of the three-color lamp when performing a corresponding operation based on the received control data frame.
[0111] Afterwards, the washing device can compare the current with the set current of the target color corresponding to the control data frame. The set current can be set according to the current generated when the three-color lamp displays the target color in real life.
[0112] In one embodiment of the present application, when the washing device detects that the current current is different from the set current corresponding to the target color corresponding to the control data frame, step S402 may be executed.
[0113] In S402, if the current current is different from the set current corresponding to the target color corresponding to the control data frame, the control data frame continues to be sent to the three-color lamp through the target serial interface until the three-color lamp displays the target color.
[0114] In this embodiment, when the washing device detects that the current current is different from the set current corresponding to the target color corresponding to the control data frame, it means that the color displayed by the three-color light at this time is not the target color. Therefore, the washing device can control the control board to continue sending control data frames to the three-color light through the target serial interface until the three-color light displays the target color.
[0115] From the above, it can be seen that the device control method provided in this embodiment obtains the current current of the detection circuit connected to the three-color lamp; if the current current is different from the set current corresponding to the target color corresponding to the control data frame, the control data frame continues to be sent to the three-color lamp through the target serial interface until the three-color lamp displays the target color, thereby ensuring that the three-color lamp can display accurate colors and further improving the control accuracy of the device to be controlled.
[0116] In one embodiment of the present application, in order to ensure that the device to be controlled can successfully receive the control data frame, thereby further improving the control success rate of the device to be controlled, the washing device can send a set number of control data frames to the device to be controlled through the target serial interface based on a set time interval; the set number of times is greater than 1. The set time interval can be set according to actual needs and is not limited here.
[0117] In some possible embodiments, the set time interval may be set based on the time interval at which a control board in a washing device in real life sends data frames through a serial interface.
[0118] 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.
[0119] Corresponding to a device control method described in the above embodiment, Figure 8 The schematic diagram of the structure of a device control device provided by an embodiment of the present application is shown. For the convenience of explanation, only the part related to the embodiment of the present application is shown. Figure 8 The device control apparatus 800 includes: a first acquisition unit 81, a first determination unit 82 and a first control unit 83. Wherein:
[0120] The first acquisition unit 81 is used for acquiring a control data frame and a device identification of a device to be controlled in response to a device control instruction.
[0121] The first determining unit 82 is used to determine a target serial interface corresponding to the device to be controlled based on a pre-stored correspondence between device identifiers and serial interfaces.
[0122] The first control unit 83 is configured to control the device to be controlled through the target serial interface if the control data frame is a valid data frame.
[0123] In one embodiment of the present application, the device control apparatus 800 further includes: a second determination unit and a third determination unit.
[0124] The second determining unit is configured to determine that the control data frame is a valid data frame if the format of the control data frame is the same as the format of the setting data frame corresponding to the device to be controlled.
[0125] The third determining unit is configured to determine that the control data frame is an invalid data frame if the format of the control data frame is different from the format of the setting data frame corresponding to the device to be controlled.
[0126] In one embodiment of the present application, the to-be-controlled device includes a plurality of devices; the first control unit 83 specifically includes: a fourth determination unit and a second control unit. Among them:
[0127] The fourth determining unit is used to determine the control priority of each of the components to be controlled according to the functional level of each of the components to be controlled in the washing device; the functional level is used to characterize the importance of each of the components to be controlled in the washing device.
[0128] The second control unit is used to control each of the components to be controlled in sequence through the target serial interface according to the control priority.
[0129] In one embodiment of the present application, the target serial interface is connected to a power board, and the target serial interface is in the control board of the washing device; the device to be controlled is not in the power board; the first control unit 83 specifically includes: a fifth determination unit, a sixth determination unit and a seventh determination unit. Among them:
[0130] The fifth determining unit is used to determine the communication status between the control board and the power board.
[0131] The sixth determination unit is used to determine the target communication duration between the control board and the power board based on the set communication rules and the current communication environment between the control board and the power board if the communication state is a busy state; after the target communication duration, the device to be controlled is controlled through the target serial interface.
[0132] The seventh determining unit is configured to control the device to be controlled through the target serial interface after a set time period if the communication state is an idle state.
[0133] In one embodiment of the present application, the device control apparatus 800 further includes: a third control unit.
[0134] The third control unit is used to control the control board and the power board to continue communicating through the target serial interface.
[0135] In one embodiment of the present application, the first control unit 83 specifically includes: a first sending unit.
[0136] The first sending unit is used to send a set number of control data frames to the device to be controlled through the target serial interface based on a set time interval; the set number of times is greater than 1.
[0137] In one embodiment of the present application, the device to be controlled is a three-color lamp; the device control apparatus 800 further includes: a second acquisition unit and a second sending unit.
[0138] The second acquisition unit is used to acquire the current generated by the three-color lamp through a detection circuit.
[0139] The second sending unit is used to continue sending the control data frame to the three-color lamp through the target serial interface until the three-color lamp displays the target color if the current current is different from the set current corresponding to the target color corresponding to the control data frame.
[0140] 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.
[0141] 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.
[0142] Fig. 9 This is a schematic diagram of the structure of a washing device provided in another embodiment of the present application. Fig. 9 As shown, the washing device 9 of this embodiment includes: at least one processor 90 ( Fig. 9 Only one is shown in the figure) a processor, a memory 91, and a computer program 92 stored in the memory 91 and executable on the at least one processor 90, and when the processor 90 executes the computer program 92, the steps in any of the above-mentioned device control method embodiments are implemented.
[0143] The washing device may include, but is not limited to, a processor 90 and a memory 91. Those skilled in the art will appreciate that Fig. 9 This is only an example of the washing device 9 and does not constitute a limitation on the washing device 9. The washing device 9 may include more or fewer components than shown in the figure, or a combination of certain components, or different components, for example, it may also include input and output devices, network access devices, etc.
[0144] The processor 90 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0145] In some embodiments, the memory 91 may be an internal storage unit of the washing device 9, such as the memory of the washing device 9. In other embodiments, the memory 91 may also be an external storage device of the washing device 9, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the washing device 9. Further, the memory 91 may also include both the internal storage unit of the washing device 9 and the external storage device. The memory 91 is used to store an operating system, an application program, a boot loader (BootLoader), data, and other programs, such as the program code of the computer program. The memory 91 may also be used to temporarily store data that has been output or is to be output.
[0146] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.
[0147] An embodiment of the present application provides a computer program product. When the computer program product is run on a washing device, the washing device can implement the steps in the above-mentioned various method embodiments when the computer program product is executed.
[0148] 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 such an understanding, the present application implements all or part of the process in the above-mentioned embodiment method, and can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium, and the computer program can be implemented when executed by a processor. The steps of each method embodiment described above. Wherein, the computer program includes a computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form, etc. The computer-readable medium can at least include: any entity or device, recording medium, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium that can carry the computer program code to the washing device. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk, etc. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.
[0149] 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.
[0150] The embodiments described above 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, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such 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 device control method, characterized in that: Applied to a washing device, the washing device is provided with a first number of devices and a second number of serial interfaces, the first number is greater than the second number, and each of the serial interfaces is connected to a plurality of the devices; the method comprises: In response to the device control instruction, acquiring a control data frame and a device identification of a device to be controlled; Determining a target serial interface corresponding to the device to be controlled based on a pre-stored correspondence between the device identification and the serial interface; If the control data frame is a valid data frame, the device to be controlled is controlled through the target serial interface.
2. The device control method according to claim 1, characterized in that: Before controlling the device to be controlled through the target serial interface if the control data frame is a valid data frame, the method further includes: If the format of the control data frame is the same as the format of the setting data frame corresponding to the device to be controlled, determining that the control data frame is a valid data frame; If the format of the control data frame is different from the format of the setting data frame corresponding to the device to be controlled, it is determined that the control data frame is an invalid data frame.
3. The device control method according to claim 1, characterized in that: The devices to be controlled include multiple devices, and the target serial interface is one; The controlling the device to be controlled through the target serial interface includes: Determining the control priority of each of the components to be controlled according to the functional level of each of the components to be controlled in the washing device; The functional level is used to characterize the importance of each of the components to be controlled in the washing device; Each of the components to be controlled is controlled in sequence through the target serial interface according to the control priority.
4. The device control method according to claim 1, characterized in that: The target serial interface is connected to a power board, and the target serial interface is located in a control board of the washing device; The device to be controlled is not located in the power board; The controlling the device to be controlled through the target serial interface includes: Determining the communication status between the control board and the power board; If the communication state is a busy state, a target communication duration between the control board and the power board is determined based on the set communication rules and the current communication environment between the control board and the power board; after the target communication duration, the device to be controlled is controlled through the target serial interface; If the communication state is an idle state, the device to be controlled is controlled through the target serial interface after a set time.
5. The device control method according to claim 4, characterized in that: After controlling the device to be controlled through the target serial interface, the method further includes: The control board and the power board are controlled to continue communicating through the target serial interface.
6. The device control method according to claim 1, characterized in that: The controlling the device to be controlled through the target serial interface includes: Based on a set time interval, a set number of control data frames are sent to the device to be controlled via the target serial interface; the set number of times is greater than 1.
7. The device control method according to any one of claims 1 to 6, characterized in that: The device to be controlled is a three-color lamp; after the device to be controlled through the target serial interface, the method further includes: Acquire the current generated by the three-color lamp through a detection circuit; If the current current is different from the set current corresponding to the target color corresponding to the control data frame, the control data frame continues to be sent to the three-color lamp through the target serial interface until the three-color lamp displays the target color.
8. A device control apparatus, characterized in that: Applied to a washing device, the washing device is provided with a first number of devices and a second number of serial interfaces, the first number is greater than the second number, and each of the serial interfaces is connected to a plurality of the devices; the device comprises: A first acquisition unit, configured to acquire a control data frame and a device identification of a device to be controlled in response to a device control instruction; A first determining unit, configured to determine a target serial interface corresponding to the device to be controlled based on a pre-stored correspondence between a device identifier and a serial interface; The first control unit is configured to control the device to be controlled through the target serial interface if the control data frame is a valid data frame.
9. A washing device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the device control method according to any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the device control method according to any one of claims 1 to 7 is implemented.
