Control method and device, equipment and storage medium
By connecting multiple communication modules with docks and CAN bus in cloud control equipment, the target module is determined according to the MAC address to send control instructions, solving the problem of redundant functions of cloud control equipment, and achieving compatibility and flexible control of multiple communication methods.
Patent Information
- Application Number
- CN202411627448.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-14
- Publication Date
- 2025-07-08
AI Technical Summary
Existing cloud control devices cannot flexibly select communication modules according to user needs, resulting in redundant or insufficient functions.
Various communication modules are connected through the expansion dock, and communication between the cloud control device and the controlled device is realized using the CAN bus, and the target communication module is determined based on the MAC address and control instructions are sent.
It realizes compatibility of cloud control equipment for multiple communication methods, avoids functional redundancy, and improves the flexibility and scalability of the control system.
Smart Images

Figure CN120276266A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the technical field of device control, and particularly relates to a control method, device, equipment, and storage medium. Background Art
[0002] At present, for cloud control or similar devices, the communication method with its subordinate devices is determined during production. However, some of the subordinate devices purchased by users may support 485 communication, some support CAN communication, or serial communication, etc. Therefore, different communication modules usually need to be integrated on the cloud control, so that the cloud control cannot select communication modules according to the actual needs of users, resulting in either insufficient functions or redundant functions for the cloud control for users. Summary of the Invention
[0003] Embodiments of this application provide a control method, device, equipment, and storage medium. The cloud control and the controlled device communicate through a docking station. The cloud control connects each communication module through CAN, enabling the cloud control to be compatible with multiple communication methods and avoiding redundant functions of the cloud control.
[0004] According to the first aspect of this application, embodiments of this application provide a control method, which is applied to a cloud control device in a control system. The control system further includes a docking station. The docking station has multiple communication modules, and each communication module has a CAN interface. The cloud control device is connected to the CAN interface through a CAN bus. Each communication module is used to communicate with a controlled device, and each communication module can interact with the cloud device through the CAN interface, including:
[0005] When a control instruction is obtained, determine the mac address in the control instruction for identifying the target controlled device;
[0006] Based on the mac address, determine the target communication module in the docking station;
[0007] Send the control instruction to the target controlled device through the target communication module in the docking station to control the target controlled device.
[0008] In some embodiments, the determining the target communication module in the docking station based on the mac address includes:
[0009] Based on a pre-established first correspondence, determine the IP address corresponding to the mac address;
[0010] Based on a pre-established second correspondence, determine the target communication module corresponding to the IP address.
[0011] In some embodiments, the method further includes:
[0012] Assign an IP address to each communication module to obtain the second corresponding relationship;
[0013] When the controlled device is connected to the communication module, obtain the mac address of each controlled device;
[0014] Determine the first corresponding relationship based on the mac address and the IP address of each communication module.
[0015] In some embodiments, the method further includes:
[0016] Send the mac address to the server so that the server generates a control instruction based on the mac address.
[0017] According to the second aspect of the present application, an embodiment of the present application provides a control device, which is applied to a cloud control device in a control system. The control system further includes a docking station. The docking station has multiple communication modules, and each communication module has a CAN interface. The cloud control device is connected to the CAN interface through a CAN bus. Each communication module is used to communicate with a controlled device, and each communication module can interact with the cloud device through the CAN interface, including:
[0018] A first determination module, configured to determine the mac address for identifying a target controlled device in the control instruction when the control instruction is obtained;
[0019] A second determination module, configured to determine a target communication module in the docking station based on the mac address;
[0020] A control module, configured to send the control instruction to the target controlled device through the target communication module in the docking station to control the target controlled device.
[0021] According to the third aspect of the present application, an embodiment of the present application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the method described in any one of the above is implemented.
[0022] In the fourth aspect, an embodiment of the present application provides a cloud control device, including: the electronic device described above.
[0023] In the fifth aspect, an embodiment of the present application provides a control system, including: the above cloud control device and docking station. The docking station has multiple communication modules, and each communication module has a CAN interface. The cloud control device is connected to the CAN interface through a CAN bus. Each communication module is used to communicate with a controlled device, and each communication module can interact with the cloud device through the CAN interface.
[0024] In some embodiments, the communication module includes at least one of an asynchronous serial communication module, an RS-485 module, and a Bluetooth module.
[0025] In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium storing a computer program, and when the computer program is executed by a processor, the method described in any one of the above is implemented.
[0026] In a seventh aspect, an embodiment of the present application provides a computer program product, and when the computer program product runs on a terminal device, an electronic device is enabled to execute the method described in any one of the above.
[0027] The beneficial effects of the embodiments of the present application compared with the prior art are as follows:
[0028] The control method provided by the embodiment of the present application is applied to a cloud control device in a control system. The control system further includes a docking station. The docking station has multiple communication modules, and each communication module has a CAN interface. The cloud control device is connected to the CAN interface through a CAN bus. Each communication module is used to communicate with a controlled device, and each communication module can interact with the cloud device through the CAN interface, including: when a control instruction is obtained, determining the mac address in the control instruction for identifying the target controlled device, and determining the target communication module in the docking station based on the mac address; sending the control instruction to the target controlled device through the target communication module in the docking station to control the target controlled device. Communication between the cloud control and the controlled device is achieved through the docking station, and the cloud control connects each communication module through CAN, enabling the cloud control to be compatible with multiple communication methods and avoiding functional redundancy of the cloud control.
[0029] It can be understood that the beneficial effects of the second to seventh aspects above can refer to the relevant descriptions in the first aspect above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0031] Figure 1 It is a schematic flowchart of the implementation of a control method provided by an embodiment of the present application;
[0032] Figure 2 It is a schematic flowchart of the implementation of another control method provided by an embodiment of the present application;
[0033] Figure 3 It is a schematic structural diagram of the control device provided by the embodiment of the present application;
[0034] Figure 4 It is a schematic structural diagram of the electronic device provided by the embodiment of the present application. Detailed implementation manners
[0035] In the following description, for the purpose of illustration rather than limitation, specific details such as specific system structures and technologies are presented to thoroughly understand the embodiments of the present application. However, those skilled in the art should clearly understand that the present application can 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 avoid unnecessary details from interfering with the description of the present application.
[0036] It should be understood that when used in the specification of the present application and the appended claims, the term "comprising" indicates the presence of the described features, wholes, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components, and / or their combinations.
[0037] It should also be understood that the term "and / or" used in the specification of the present application and the appended claims refers to any combination and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0038] As used in the specification of the present application and the appended claims, the term "if" can be interpreted as "when", "once", "in response to determining", or "in response to controlling" according to the context. Similarly, the phrases "if determined" or "if controlled to" can be interpreted as meaning "once determined", "in response to determining", "once controlled to", or "in response to controlling" according to the context.
[0039] In addition, in the description of the specification of the present application and the appended claims, the terms "first", "second", "third", etc. are only used for differentiating descriptions and cannot be understood as indicating or implying relative importance.
[0040] The reference to "an embodiment" or "some embodiments" etc. described in the specification of the present application means that a specific feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the present application. Thus, the statements "in an embodiment", "in some embodiments", "in other some embodiments", "in still other embodiments", etc. that appear in different places in this specification do not necessarily all refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways.
[0041] Based on the technical problems of related technologies, embodiments of the present application provide a control method, which can be applied to a cloud control device in a control system. The cloud control device can be an electronic device such as a mobile phone, a tablet computer, a wearable device, a vehicle-mounted device, an Augmented Reality (AR) / Virtual Reality (VR) device, a laptop computer, an Ultra-Mobile Personal Computer (UMPC), a netbook, or a Personal Digital Assistant (PDA). Figure 1 The structural schematic diagram of the control system provided by the embodiments of the present application is as follows Figure 1 As shown, it further includes a docking station. The docking station has multiple communication modules, and each communication module has a CAN interface. The cloud control device is connected to the CAN interface through a CAN bus. Each communication module is used for communicating with a controlled device, and each communication module can interact with the cloud device through the CAN interface.
[0042] In the embodiments of the present application, the communication module can be at least one of an asynchronous serial communication module, an RS-485 module, and a Bluetooth module.
[0043] In the embodiments of the present application, the cloud control device is a core component in the control system. It realizes remote or centralized control of the controlled device through connection with the docking station. The cloud control device may have multiple functions such as data processing and network communication, and is used to receive, parse, and execute control instructions from the cloud or locally.
[0044] In the embodiments of the present application, the docking station is a hardware device with multiple communication modules, and it serves as a bridge between the cloud control device and the controlled device. Each communication module of the docking station has a CAN (Controller Area Network) interface, allowing the cloud control device to communicate with these communication modules through a CAN bus.
[0045] In the embodiments of the present application, the communication module is an independent component in the docking station, and each module has the ability to communicate with the controlled device. These modules may support different communication protocols and interfaces to adapt to different types of controlled devices.
[0046] The functions implemented by the control method provided by the embodiments of the present application can be realized by a processor of an electronic device calling program code, where the program code can be stored in a computer storage medium.
[0047] Figure 2 The implementation flow schematic diagram of a control method provided by the embodiments of the present application is as follows Figure 2As shown, the control method includes:
[0048] Step S101, when a control instruction is obtained, determine the MAC address in the control instruction for identifying the target controlled device.
[0049] In the embodiments of the present application, the control instruction is sent by a control system (such as a cloud server, a central controller, etc.), and is data or a signal for guiding or commanding a controlled device to perform a specific operation. It may include information such as the identification of the target device, the operation to be performed, operation parameters, etc. The MAC address (Media Access Control Address) is the physical address of a network device (such as a network card, a controlled device, etc.), and is used to uniquely identify each device in network communication. It is written by the manufacturer during device production and is usually unchangeable.
[0050] In the embodiments of the present application, when the cloud-controlled device receives a control instruction, it first parses the instruction content and extracts the MAC address of the target controlled device from it. This MAC address is the key information for subsequently determining the target communication module. The controlled device can be a household appliance, for example, an air conditioner, a television, etc.
[0051] In the embodiments of the present application, the format of the control instruction includes the header, body, and tail of the instruction. The header may include information such as the instruction type, the identification of the sender and the receiver, etc.; the body contains specific control information, such as the MAC address of the target device, the operation type, operation parameters, etc.; the tail may include a check code or an end identifier. After understanding the instruction format, it is necessary to determine the position of the MAC address in the instruction. This is usually achieved by looking up the instruction format document or protocol specification. In the instruction format, the MAC address is usually marked as a specific field, such as "target MAC address", "MAC", or a similar name. Once the position of the MAC address field is determined, the MAC address can be extracted.
[0052] In the embodiments of the present application, extracting the MAC address usually involves the following steps:
[0053] Read the field value: According to the instruction format, read the value of the MAC address field. This may be a hexadecimal number, a string, or data in other formats.
[0054] Format conversion: If the read MAC address is not in the standard hexadecimal format (such as six pairs of hexadecimal numbers separated by colons), format conversion may be required. For example, convert a string to a hexadecimal number, or convert consecutive hexadecimal numbers to the colon-separated format.
[0055] Verify the MAC address: The extracted MAC address should be a valid MAC address. This can be achieved by verifying its format (such as whether it contains six hexadecimal pairs separated by colons) and range (such as whether the value of each hexadecimal pair is between 00 and FF).
[0056] Step S102: Determine the target communication module in the docking station based on the MAC address.
[0057] In the embodiments of the present application, the target communication module refers to a specific module in the docking station responsible for communicating with the controlled device. After receiving the control instruction, the system will determine which communication module should be used to send the instruction to the target controlled device according to the MAC address in the control instruction.
[0058] In the embodiments of the present application, the cloud control device or the control system internally maintains a mapping relationship between the MAC address and the communication module. After the MAC address is extracted, the cloud control device will look up this mapping relationship to find the communication module corresponding to the MAC address, that is, the target communication module.
[0059] Step S103: Send the control instruction to the target controlled device through the target communication module in the docking station to control the target controlled device.
[0060] In the embodiments of the present application, the target controlled device refers to the device that needs to receive and execute the control instruction. In this scenario, the target controlled device is connected to the cloud control device through the docking station, receives the instruction from the cloud control device, and executes the corresponding operation.
[0061] In the embodiments of the present application, once the target communication module is determined, the cloud control device will send the control instruction to this module. After receiving the instruction, the target communication module will send the instruction to the target controlled device through its interface or other communication interfaces. After receiving the instruction, the controlled device will parse the instruction content and execute the corresponding operation.
[0062] In the embodiments of the present application, a driver program can be installed in each communication module. After obtaining the control instruction sent by the cloud control device, the conversion process can be performed through the driver program, so as to convert it into a control instruction in a protocol supported by each controlled device.
[0063] In the embodiments of the present application, a driver is a software that enables an operating system or other software to communicate with a hardware device. In the communication module, the driver is responsible for parsing the control instructions from the cloud control device and converting them into a format that the controlled device can understand. The driver in the communication module will parse the received control instructions. This includes identifying the format of the instructions, extracting information such as the identifier (e.g., MAC address) of the target controlled device, the operation type, and the operation parameters. Once the driver has parsed the control instructions, it will convert the instructions into the corresponding format according to the communication protocol supported by the controlled device. This may involve data format conversion, adjustment of the encoding method, or addition of specific protocol headers / footers, etc. The converted control instructions will be sent to the target controlled device through the communication interface of the communication module.
[0064] In the embodiments of the present application, by installing a driver in each communication module and enabling it to parse and convert control instructions, precise control of different controlled devices can be achieved. This method improves the flexibility and scalability of the control system, enabling the system to support a variety of different types of controlled devices and communication protocols.
[0065] The method provided in the embodiments of the present application is applied to a cloud control device in a control system. The control system further includes a docking station. The docking station has multiple communication modules, and each communication module has a CAN interface. The cloud control device is connected to the CAN interface through a CAN bus. Each communication module is used to communicate with a controlled device, and each communication module can interact with the cloud device through the CAN interface. The method includes: when a control instruction is obtained, determining the MAC address in the control instruction for identifying the target controlled device, and determining the target communication module in the docking station based on the MAC address; sending the control instruction to the target controlled device through the target communication module in the docking station to control the target controlled device. Communication between the cloud control and the controlled device is achieved through the docking station. The cloud control connects each communication module through CAN, enabling the cloud control to be compatible with multiple communication methods and avoiding functional redundancy of the cloud control.
[0066] The method provided in the embodiments of the present application realizes precise control of the target device by parsing the MAC address in the control instruction, determining the target communication module, and sending the instruction to the target controlled device. This method improves the flexibility and scalability of the control system, enabling the system to support a variety of different types of controlled devices and communication protocols.
[0067] In some embodiments, step S102 may include:
[0068] Step S1021, determining the IP address corresponding to the MAC address based on a pre-established first correspondence.
[0069] In the embodiments of the present application, during the system initialization or configuration phase, a mapping relationship between a MAC address and an IP address needs to be established. This mapping relationship can be stored in a database, a configuration file, or memory, depending on the implementation of the system. Each entry in the mapping relationship contains a MAC address and a corresponding IP address. These entries are usually created through manual configuration, network scanning, or an automatic discovery process.
[0070] In the embodiments of the present application, after the first corresponding relationship is established, when the system receives a control instruction containing a MAC address, it will look up the first corresponding relationship to find the IP address corresponding to the MAC address. If a matching MAC address is found, the system will obtain the corresponding IP address; if not, the system may return an error code, record a log, or take other exception handling measures.
[0071] Step S1022, determine the target communication module corresponding to the IP address based on a pre-established second corresponding relationship.
[0072] In the embodiments of the present application, also during the system initialization or configuration phase, a mapping relationship between an IP address and a target communication module needs to be established. This mapping relationship can also be stored in a database, a configuration file, or memory. Each entry in the mapping relationship contains an IP address and a corresponding target communication module identifier (such as a module number, a port number, etc.). These entries are usually created through manual configuration or an automatic discovery process.
[0073] In the embodiments of the present application, once the system finds the IP address corresponding to the MAC address through the first corresponding relationship, it will look up the second corresponding relationship to find the target communication module corresponding to the IP address.
[0074] If a matching IP address is found, the system will obtain the corresponding target communication module identifier; if not, the system may also return an error code, record a log, or take other exception handling measures.
[0075] In some dynamically changing network environments, the mapping between the MAC address and the IP address and the mapping between the IP address and the target communication module may need to be updated frequently. Since these mapping relationships contain sensitive information of network devices (such as MAC addresses and IP addresses), the system needs to take appropriate security measures to protect this information from unauthorized access or tampering.
[0076] The method provided by the embodiments of this application, through the pre-established two-layer correspondence relationship (the mapping from MAC address to IP address and the mapping from IP address to the target communication module), enables the system to find the corresponding target communication module according to the received MAC address and send control instructions to the target controlled device. This method improves the flexibility and scalability of the control system, enabling the system to support a variety of different types of network devices and communication protocols.
[0077] In some embodiments, before step S102, the method further includes:
[0078] Step S1, assign an IP address to each communication module to obtain the second correspondence relationship.
[0079] In the embodiments of this application, the second correspondence relationship refers to the correspondence relationship between the communication module and its IP address.
[0080] In the embodiments of this application, it can be configured manually. By obtaining the MAC address (physical address) of each communication module and manually setting a static IP address on a network device (such as a router), the IP address can be assigned to each communication module to obtain the second correspondence relationship.
[0081] Step S2, when the controlled device is connected to the communication module, obtain the MAC addresses of each controlled device.
[0082] In the embodiments of this application, the MAC address is the physical address of the device, which is used below the network layer to uniquely identify the network device.
[0083] In the embodiments of this application, a network scanning tool (such as nmap, arp-scan, etc.) can be used to scan the network to obtain the MAC addresses of the devices connected to the network. In some embodiments, it may be necessary to run a specific software or script on the controlled device to actively report its MAC address.
[0084] Step S3, determine the first correspondence relationship based on the MAC address and the IP addresses of each communication module.
[0085] In the embodiments of this application, the first correspondence relationship refers to the correspondence relationship between the MAC address of the controlled device and the IP address of the communication module.
[0086] In the embodiments of this application, by analyzing the network traffic or using a network management tool, it is determined which communication module each controlled device is connected to the network through. Once it is determined which communication module the controlled device is connected through, its MAC address can be associated with the IP address of this communication module to form the first correspondence relationship.
[0087] In some embodiments, after step S3, the method further includes:
[0088] Step S4: Send the MAC address to the server so that the server generates a control instruction based on the MAC address.
[0089] In the embodiments of the present application, the collected MAC address is sent to the server through a certain communication protocol (such as HTTP, HTTPS, TCP / IP, etc.). This can be achieved by writing client code or using existing tools / APIs. The data sent may include the MAC address itself, as well as possible additional information (such as device type, location, etc.). After receiving the MAC address, the server will perform a series of processing operations, such as: verifying the MAC address: ensuring that the MAC address is valid and conforms to the expected format. Looking up or generating a control instruction: Based on the MAC address, the server may look up the control instruction or policy associated with the address. If there is no ready-made instruction, the server may generate a new control instruction based on predefined rules or algorithms.
[0090] Based on the foregoing embodiments, the embodiments of the present application further provide a control method, and the method includes: two parts of hardware design and software design. Among them, the hardware design includes: selecting a suitable MCU and CAN transceiver, and designing a main control circuit board;
[0091] Standardized interfaces (such as GPIO, UART, SPI, 485, etc.) are used to connect different communication modules. Design and manufacture the circuit boards of each communication module, ensure the unity of size and interface, adopt a unified connection interface (such as CAN interface) and communication protocol to ensure the interoperability between modules; ensure the power supply design and signal integrity of the main controller and each module.
[0092] The software device includes: developing the underlying driver of the CAN bus to ensure the basic CAN communication function. (Underlying driver: Implement the initialization, data sending and receiving functions of the CAN bus. Protocol stack: Define the protocol for device management and data transmission); developing the driver programs of each module (develop independent driver programs for each communication module, responsible for the initialization, configuration and data processing of the module. The driver program interacts with the CAN communication protocol stack through a unified interface); implementing the CAN communication protocol stack and module management system to ensure the scalability and stability of the system.
[0093] In the embodiments of the present application, the control method specifically includes: assigning an IP to each port of the docking station and binding the IP to the corresponding device MAC; when device data is given to the cloud control, the cloud control will add the device MAC to the packet header and then report the data to the server. When the app needs to control the device, the MAC of the controlled device is added to the packet header of the sent data. After receiving the data, the cloud control transmits the data to the IP corresponding to the MAC, realizing that the connection between the cloud control and the server adopts the MQTT connection, and its topic format follows the format of "main topic / cloud control MAC / device MAC". The main topic indicates the purpose of the data. For example, the server sends control "control / cloud control MAC / device MAC", and the device reports status "status / cloud control MAC / device MAC". Different devices are controlled through different topics.
[0094] The method provided by the embodiments of the present application designs various communication methods into a separate module and uses CAN communication to realize the communication between each module. In this way, users can select the corresponding module according to their own needs. Each module is connected through CAN, enabling the cloud control to be compatible with multiple communication methods, and each module can be flexibly combined.
[0095] It should be understood that the magnitudes of the sequence numbers of the steps in the above embodiments do not mean the order of execution. The execution order of each process should be determined according to its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
[0096] According to the foregoing embodiments, the embodiments of the present application provide a control device. Each module included in the device and each unit included in each module can be implemented by a processor in a computer device; of course, it can also be implemented by specific logic circuits. During the implementation process, the processor can be a central processing unit (CPU, Central Processing Unit), a microprocessor (MPU, Microprocessor Unit), a digital signal processor (DSP, Digital Signal Processing), or a field programmable gate array (FPGA, Field Programmable Gate Array), etc.
[0097] The embodiments of the present application provide a control device, Figure 3 is a schematic structural diagram of a control device provided by the embodiments of the present application. As Figure 3 shown, the control device 300 includes:
[0098] A first determination module 301, configured to determine the MAC address for identifying the target controlled device in the control instruction when the control instruction is obtained;
[0099] The second determination module 302 is configured to determine a target communication module in the docking station based on the MAC address;
[0100] The control module 303 is configured to send the control instruction to a target controlled device through the target communication module in the docking station to control the target controlled device.
[0101] In some embodiments, the determining the target communication module in the docking station based on the MAC address includes:
[0102] Determining an IP address corresponding to the MAC address based on a pre-established first correspondence;
[0103] Determining a target communication module corresponding to the IP address based on a pre-established second correspondence.
[0104] In some embodiments, the control device 300 is further configured to:
[0105] Assign an IP address to each communication module to obtain the second correspondence;
[0106] When a controlled device is connected to a communication module, obtaining the MAC addresses of the respective controlled devices;
[0107] Determining a first correspondence based on the MAC addresses and the IP addresses of the respective communication modules.
[0108] In some embodiments, the control device 300 is further configured to:
[0109] Send the MAC address to a server so that the server generates a control instruction based on the MAC address.
[0110] It should be noted that for the information interaction, execution process, etc. between the above-mentioned device / unit, since it is based on the same concept as the method embodiment of the present application, for its specific functions and the technical effects brought, reference can be specifically made to the method embodiment part, and details are not described herein again.
[0111] In addition, Figure 3 The shown control device may be a software unit, a hardware unit, or a unit combining software and hardware built into an existing electronic device, may also be integrated into the electronic device as an independent pendant, or may exist as an independent terminal device.
[0112] Those skilled in the art can clearly understand that, for the convenience and conciseness of description, only the above-mentioned division of each functional unit and module is used as an example. In actual applications, the above functions can be allocated to different functional units and modules according to needs, 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. Each functional unit and module in the embodiment can be integrated into a processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of a software functional unit. In addition, the specific names of each functional unit and module are only for the convenience of mutual distinction and do not limit the protection scope of this application. The specific working process of the units and modules in the above system can refer to the corresponding process in the foregoing method embodiments and will not be elaborated here.
[0113] Figure 4 The following is a schematic structural diagram of the electronic device provided by the embodiment of the present application. As Figure 4 shown, the electronic device 3 of this embodiment may include: at least one processor 30 ( Figure 4 only one processor 30 is shown in the figure), a memory 31, and a computer program 32 stored in the memory 31 and executable on at least one processor 30. When the processor 30 executes the computer program 32, it implements the steps in any of the foregoing method embodiments, or when the processor 30 executes the computer program 32, it implements the functions of each module / unit in the foregoing device embodiments.
[0114] Exemplarily, the computer program 32 can be divided into one or more modules / units. One or more modules / units are stored in the memory 31 and executed by the processor 30 to complete the present application. One or more modules / units can be a series of computer program 32 instruction segments capable of completing specific functions, and these instruction segments are used to describe the execution process of the computer program 32 in the electronic device 3.
[0115] The present application provides a cloud control device, including: the above-mentioned electronic device.
[0116] The embodiment of the present application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program 32, and when the computer program 32 is executed by the processor 30, it can implement the steps in the foregoing method embodiments.
[0117] The embodiment of the present application provides a computer program product. When the computer program product runs on an electronic device, it enables the electronic device to execute and implement the steps in the foregoing method embodiments.
[0118] When 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, to implement all or part of the processes in the above-described embodiment methods of this application, a computer program 32 can be used to instruct the relevant hardware to complete. The computer program 32 can be stored in a computer-readable storage medium. When the computer program 32 is executed by a processor 30, the steps of the above-described method embodiments can be implemented. Among them, the computer program 32 includes computer program code, and the computer program code can be in the form of source code, object code, executable file, or some intermediate form, etc. The computer-readable medium can at least include: any entity or device that can carry the computer program code to the terminal, recording medium, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electrical carrier signal, telecommunication signal, and software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk, or an optical disc, etc. In some jurisdictions, according to legislation and patent practice, the computer-readable medium cannot be an electrical carrier signal and a telecommunication signal.
[0119] In the above embodiments, the descriptions of the various embodiments have their own emphases. For the parts not detailed or recorded in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0120] Those of ordinary skill in the art can realize that the units and algorithm steps of the examples described in combination with the embodiments disclosed herein can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of this application.
[0121] In the embodiments provided in this application, it should be understood that the disclosed device / network device and method can be implemented in other ways. For example, the device / network device embodiments described above are only illustrative. For example, the division of the modules or units is only a logical function division. In actual implementation, there can be other division methods. For example, 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 displayed or discussed coupling or direct coupling or communication connection to each other can be through some interfaces. The indirect coupling or communication connection of the device or unit can be in an electrical, mechanical, or other form.
[0122] The unit described as a separation component may or may not be physically separated. The component displayed as a unit may or may not be a physical unit, that is, it may be located in one place or distributed across multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0123] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A control method, characterized in that, A cloud control device applied to a control system. The control system further includes a docking station. The docking station has multiple communication modules, and each communication module has a CAN interface. The cloud control device is connected to the CAN interface through a CAN bus. Each communication module is used to communicate with a controlled device, and each communication module can interact with the cloud device through the CAN interface, including: When a control instruction is obtained, determining the mac address in the control instruction for identifying a target controlled device; Based on the mac address, determining a target communication module in the docking station; Sending the control instruction to the target controlled device through the target communication module in the docking station to control the target controlled device.
2. The method according to claim 1, wherein The determining the target communication module in the docking station based on the mac address includes: Determining the IP address corresponding to the mac address based on a pre-established first correspondence; Determining the target communication module corresponding to the IP address based on a pre-established second correspondence.
3. The method according to claim 2, wherein The method further includes: Assigning an IP address to each communication module to obtain the second correspondence; When a controlled device is connected to a communication module, obtaining the mac addresses of all controlled devices; Based on the mac addresses and the IP addresses of all communication modules, determining the first correspondence.
4. The method according to claim 3, wherein The method further includes: Sending the mac address to a server so that the server generates the control instruction based on the mac address.
5. A control device, characterized in that, A cloud control device applied to a control system. The control system further includes a docking station. The docking station has multiple communication modules, and each communication module has a CAN interface. The cloud control device is connected to the CAN interface through a CAN bus. Each communication module is used to communicate with a controlled device, and each communication module can interact with the cloud device through the CAN interface, including: A first determination module, configured to determine the mac address in the control instruction for identifying a target controlled device when a control instruction is obtained; A second determination module, configured to determine a target communication module in the docking station based on the mac address; A control module, configured to send the control instruction to a target controlled device through the target communication module in the docking station to control the target controlled device.
6. An electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, the method described in any one of claims 1 to 4 is implemented.
7. A cloud control device, characterized in that, Including: The electronic device according to claim 6.
8. A control system, characterized in that, Including: The cloud control device and the docking station according to claim 7. The docking station has multiple communication modules, and each communication module has a CAN interface. The cloud control device is connected to the CAN interface through a CAN bus. Each communication module is used to communicate with a controlled device, and each communication module can interact with the cloud device through the CAN interface.
9. The control system according to claim 8, characterized in that, The communication module includes at least one of an asynchronous serial communication module, an RS-485 module, and a Bluetooth module.
10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, the method described in any one of claims 1 to 4 is implemented.
Citation Information
Cited By
Universal expansion method and device compatible with various types of battery communication modes
CN121173886A