Equipment control method and device, electronic equipment and storage medium

By receiving input instructions and performing protocol conversion, the problem of poor interoperability between devices of different manufacturers and platforms is solved, seamless docking and flexible access of devices is achieved, and the flexibility and scalability of devices are enhanced.

CN119921979APending Publication Date: 2025-05-02GREE ELECTRIC APPLIANCE INC OF ZHUHAI +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411893461.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-20
Publication Date
2025-05-02

AI Technical Summary

Technical Problem

Due to differences in private protocols, smart devices from different manufacturers and platforms have poor interoperability between devices, and users face inconvenient control when using devices from different manufacturers or platforms.

Method used

By receiving input instructions, it is determined whether the protocol identifier matches the private identifier. If it does not match, the protocol conversion will be performed, the device control authority is determined, and the control instruction is determined based on the permission to execute.

Benefits of technology

It realizes seamless docking and flexible access to devices, and controls devices across manufacturers and platforms, enhancing the flexibility and scalability of devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119921979A_ABST
    Figure CN119921979A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides an equipment control method and device, electronic equipment and a storage medium. The method comprises the following steps: receiving an input instruction; the input instruction carries a protocol identifier; when the protocol identifier is not matched with a private identifier, performing protocol conversion on the input instruction, and determining an equipment control authority; determining a control instruction corresponding to the input instruction based on the equipment control authority; and executing the control instruction. According to the embodiment of the invention, cross-manufacturer and cross-platform equipment control can be carried out, and the flexibility and expandability of the equipment are enhanced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of Internet of Things, and in particular to a device control method, a device control apparatus, an electronic device and a computer-readable storage medium. Background Art

[0002] In the current smart device market, devices from different manufacturers and platforms often use their own private protocols for communication and control, which leads to poor interoperability between devices and inconvenience for users when using devices from different manufacturers or platforms. Most existing solutions rely on unified industry standards or protocols, but in actual applications, due to conflicts of interest and technical differences between manufacturers, the promotion and implementation of unified standards face many difficulties, resulting in poor flexibility and scalability of device control. Summary of the invention

[0003] In view of the above problems, embodiments of the present invention are proposed to provide a device control method, a device control apparatus, an electronic device and a computer-readable storage medium that overcome the above problems or at least partially solve the above problems.

[0004] In order to solve the above problem, in a first aspect of the present invention, an embodiment of the present invention discloses a device control method, which is applied to a device to be controlled, wherein the device to be controlled has a corresponding private identifier, and the method includes:

[0005] receiving an input instruction, wherein the input instruction carries a protocol identifier;

[0006] When the protocol identifier does not match the private identifier, performing protocol conversion on the input instruction to determine the device control authority;

[0007] Determining a control instruction corresponding to the input instruction based on the device control authority;

[0008] Execute the control instruction.

[0009] Optionally, the method further comprises:

[0010] When the protocol identifier matches the private identifier, the device control permission is determined to be the first device permission.

[0011] Optionally, when the protocol identifier does not match the private identifier, the step of performing protocol conversion on the input instruction to determine the device control authority includes:

[0012] When the protocol identifier does not match the private identifier, performing protocol conversion on the input instruction and determining a protocol conversion rate;

[0013] The device control authority is determined based on the protocol conversion rate.

[0014] Optionally, the step of determining the device control authority based on the protocol conversion rate includes:

[0015] When the protocol conversion rate is one, determining that the device control authority is the first device authority;

[0016] When the protocol conversion rate is greater than zero and not greater than one, determining that the device control authority is a second device authority, and the second device authority is less than the first device authority;

[0017] When the protocol conversion rate is zero, it is determined that the device control authority is a third device authority; and the third device authority is less than the second device authority.

[0018] Optionally, when the device control authority is the first device authority or the second device authority, the step of determining the control instruction corresponding to the input instruction based on the device control authority includes:

[0019] Read the original command set;

[0020] Based on the original command set and the device control authority, the input instruction is parsed to determine the control instruction.

[0021] Optionally, when the device control authority is the third device authority, the step of determining the control instruction corresponding to the input instruction based on the device control authority includes:

[0022] Determine a downgrade instruction set corresponding to the third device permission;

[0023] The input instruction is parsed based on the degraded instruction set to determine a control instruction.

[0024] Optionally, the device to be controlled is connected to a server, and the method further includes:

[0025] When accessing the network, sending registration information to the server; the server is used to generate authentication information based on the registration information;

[0026] The identifier in the authentication information is obtained as the private identifier.

[0027] In a second aspect of the present invention, an embodiment of the present invention discloses a device control apparatus applied to a device to be controlled, wherein the device to be controlled has a corresponding private identifier, and the apparatus comprises:

[0028] A receiving module, used for receiving an input instruction; the input instruction carries a protocol identifier;

[0029] A conversion module, used for performing protocol conversion on the input instruction to determine the device control authority when the protocol identifier does not match the private identifier;

[0030] A first determining module, configured to determine a control instruction corresponding to the input instruction based on the device control authority;

[0031] An execution module is used to execute the control instruction.

[0032] Optionally, the device further comprises:

[0033] The second determining module is used to determine that the device control permission is the first device permission when the protocol identifier matches the private identifier.

[0034] Optionally, the conversion module includes:

[0035] A conversion submodule, used for performing protocol conversion on the input instruction and determining a protocol conversion rate when the protocol identifier does not match the private identifier;

[0036] The determination submodule is used to determine the device control authority based on the protocol conversion rate.

[0037] Optionally, the determining submodule includes:

[0038] A first determining unit, configured to determine, when the protocol conversion rate is one, that the device control authority is a first device authority;

[0039] A second determining unit, configured to determine, when the protocol conversion rate is greater than zero and not greater than one, that the device control authority is a second device authority, and the second device authority is less than the first device authority;

[0040] The third determining unit is used to determine that the device control authority is a third device authority when the protocol conversion rate is zero; the third device authority is less than the second device authority.

[0041] Optionally, when the device control permission is the first device permission or the second device permission, the first determining module includes:

[0042] Read submodule, used to read the original command set;

[0043] The first parsing module is used to parse the input instruction and determine the control instruction based on the original command set and the device control authority.

[0044] Optionally, when the device control permission is the third device permission, the first determining module includes:

[0045] An instruction set identification submodule, used to determine a downgrade instruction set corresponding to the third device authority;

[0046] The second parsing module is used to parse the input instruction based on the degraded instruction set to determine the control instruction.

[0047] Optionally, the device to be controlled is connected to a server, and the apparatus further includes:

[0048] A registration module, used to send registration information to the server when accessing the network; the server is used to generate authentication information based on the registration information;

[0049] The authentication module is used to obtain the identifier in the authentication information as the private identifier.

[0050] In the third aspect of the present invention, an embodiment of the present invention discloses an electronic device, including a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein the computer program implements the steps of the device control method as described above when executed by the processor.

[0051] In a fourth aspect of the present invention, an embodiment of the present invention discloses a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the device control method described above are implemented.

[0052] The embodiments of the present invention include the following advantages:

[0053] The embodiment of the present invention receives an input instruction; the input instruction carries a protocol identifier; when the protocol identifier does not match the private identifier, the input instruction is converted into a protocol to determine the device control authority; based on the device control authority, the control instruction corresponding to the input instruction is determined; and the control instruction is executed. The private protocol corresponding to the private identifier of the device is combined with other visitor protocols, which not only ensures the efficient operation of the device in the internal network, but also realizes the security and availability of the device when it is accessed externally. When the protocol identifier does not match the private identifier, the input instruction is converted into a protocol to determine the device control authority and the corresponding control instruction, and the corresponding control instruction is determined by mutual conversion of protocols, thereby realizing seamless connection and flexible access to the device. This allows device control across manufacturers and platforms, enhancing the flexibility and scalability of the device. BRIEF DESCRIPTION OF THE DRAWINGS

[0054] Figure 1 is a flowchart of steps of an embodiment of a device control method of the present invention;

[0055] Figure 2 is a flowchart of steps of another device control method embodiment of the present invention;

[0056] Figure 3 is a flowchart of steps of another device control method embodiment of the present invention;

[0057] Figure 4 is a flowchart of an example of a device control method of the present invention;

[0058] Figure 5 is a structural block diagram of an embodiment of a device control device of the present invention;

[0059] Figure 6 is a structural block diagram of an electronic device provided by an embodiment of the present invention;

[0060] Figure 7 It is a structural block diagram of a storage medium provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0061] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.

[0062] The following is an explanation of the visitor agreement and private agreement:

[0063] Private protocols: Private protocols are designed for manufacturers or platforms to control devices internally, providing comprehensive device control functions. Private protocols contain advanced control instructions, data encryption, and authentication mechanisms for devices, ensuring efficient and secure operation of devices in internal networks.

[0064] Visitor Protocol: It is converted from a private protocol and is used by other manufacturers, platforms or temporary users. It only provides the functions of the successfully converted part of the protocol (it may be part of the functions or all of the functions). The Visitor Protocol is designed to allow devices to be used across manufacturers, reduce the complexity of external access, and ensure the security and availability of devices when they are accessed externally.

[0065] Reference Figure 1 , showing a step flow chart of an embodiment of a device control method of the present invention, the device control method is applied to a device to be controlled, and the device to be controlled has a corresponding private identifier. The device to be controlled is an Internet of Things device to be controlled. An Internet of Things device refers to hardware that has a wireless network connection and is integrated into a device or other device, and can receive and share data. These devices can be a variety of items, including but not limited to sensors, cameras, smart phones, household appliances (such as smart TVs, smart refrigerators, smart speakers, etc.), cars, industrial robots, etc. The device to be controlled has a corresponding private identifier based on its own private protocol. The private identifier can be a specific parameter, a key, or a certain type of data format, which is not specifically limited in the embodiments of the present invention.

[0066] The device control method may specifically include the following steps:

[0067] Step 101, receiving an input instruction; the input instruction carries a protocol identifier;

[0068] When a user needs to operate a device to be controlled so that the device to be controlled can realize a corresponding function or operation, an input instruction can be sent to the device to be controlled. The user sends the input instruction through a mobile application, a web page interface, or other forms of interactive interfaces (such as buttons, switches, etc.).

[0069] The input instruction may be received. The input instruction carries a protocol identifier. The protocol identifier is used to characterize the protocol type initiated by the input instruction. The protocol type may be a visitor protocol or a private protocol.

[0070] Step 102, when the protocol identifier does not match the private identifier, performing protocol conversion on the input instruction to determine the device control authority;

[0071] It can be determined whether the protocol identifier matches the private identifier. When the protocol identifier matches the private identifier, it means that the instruction is generated and initiated based on the private protocol. When the protocol identifier does not match the private identifier, it means that the instruction is generated and initiated based on the visitor protocol.

[0072] When the protocol identifier does not match the private identifier, the input command needs to be converted to a protocol. The input command can be converted from the visitor protocol to the private protocol, and the corresponding device control authority is determined based on the conversion. The device control authority is used to characterize the degree of openness of the application functions of the device to be controlled. The greater the device control authority, the higher the degree of openness of the application functions of the device to be controlled. For example, if the device control authority is 100%, all application functions are open and users can use all functions. If the device control authority is 0, only basic functions are open, such as switches and other basic functions.

[0073] Step 103, determining a control instruction corresponding to the input instruction based on the device control authority;

[0074] Determine the degree of function openness based on the current device control authority, and determine the control instruction corresponding to the input instruction. For example, the fan air volume is steplessly adjustable, the device control authority is 100%, all application functions are open, and the control parameter of the control instruction can be the corresponding adjustment amount. If the device control authority is 0, only basic functions are open, and the control parameter of the control instruction is the flag setting for opening and closing. If the device control authority is 500%, some functions are open, then the control instruction of the input instruction can be the corresponding air volume level.

[0075] Step 104: execute the control instruction.

[0076] After the control instruction is determined, the control instruction is executed to realize the corresponding function.

[0077] The embodiment of the present invention receives an input instruction; the input instruction carries a protocol identifier; when the protocol identifier does not match the private identifier, the input instruction is converted into a protocol to determine the device control authority; based on the device control authority, the control instruction corresponding to the input instruction is determined; and the control instruction is executed. The private protocol corresponding to the private identifier of the device is combined with other visitor protocols, which not only ensures the efficient operation of the device in the internal network, but also realizes the security and availability of the device when it is accessed externally. When the protocol identifier does not match the private identifier, the input instruction is converted into a protocol to determine the device control authority and the corresponding control instruction, and the corresponding control instruction is determined by mutual conversion of protocols, thereby realizing seamless connection and flexible access to the device. This allows device control across manufacturers and platforms, enhancing the flexibility and scalability of the device.

[0078] Reference Figure 2 , shows a flow chart of steps of another device control method embodiment of the present invention, the device control method is applied to a device to be controlled, and the device to be controlled has a corresponding private identifier. The device control method may specifically include the following steps:

[0079] Step 201, receiving an input instruction; the input instruction carries a protocol identifier;

[0080] The user can send an input command to the device to be controlled through a mobile application, a web interface, or other forms of interactive interfaces. The input command carries a protocol identifier. The protocol type initiated by the input command can be determined by the protocol identifier. The protocol type is a visitor protocol and a private protocol. The device to be controlled receives the input command.

[0081] Step 202, when the protocol identifier does not match the private identifier, performing protocol conversion on the input instruction and determining a protocol conversion rate;

[0082] After receiving the input instruction, it can be determined whether the protocol identifier matches the private identifier. The matching methods include but are not limited to the following matching methods:

[0083] Protocol field matching, compare the definition and value range of each field in the protocol identifier and the private identifier. If the field definition or value range is inconsistent, it indicates that the protocol identifier and the private identifier do not match. If the field definition or value range is consistent, it indicates that the protocol identifier and the private identifier match.

[0084] Protocol format matching verifies whether the protocol formats described by the protocol identifier and the private identifier are the same. If the protocol formats are the same, it indicates that the protocol identifier and the private identifier match. If the protocol formats are different, it indicates that the protocol identifier and the private identifier do not match.

[0085] Port number matching can be determined by checking the port number used by the protocol identifier and the private identifier. If the port number used by the protocol identifier and the private identifier is the same, it indicates that the two protocol identifiers match. If the port number used by the protocol identifier and the private identifier is different, it indicates that the two protocol identifiers do not match.

[0086] When the protocol identifier matches the private identifier, it means that the instruction is generated and initiated based on the private protocol. When the protocol identifier does not match the private identifier, it means that the instruction is generated and initiated based on the visitor protocol. Therefore, when the protocol identifier does not match the private identifier, the input instruction is converted to a protocol and the protocol conversion rate is determined.

[0087] Specifically, a protocol parser may be used to perform protocol conversion on the input instruction, and the protocol conversion rate may be determined based on the converted result. The protocol parser may be a Wireshark protocol parser, a tcpreplay protocol parser, a TCPDump protocol parser, an OmniPeek protocol parser, etc. Those skilled in the art may select one according to their needs, and the embodiment of the present invention does not specifically limit this.

[0088] Wireshark protocol analyzer is used to capture and display data packets passing through the network. It supports multiple network protocols, such as TCP / IP (network communication protocol), HTTP (hypertext protocol), DNS (domain name system), etc. The main functions include: packet capture, which can capture data packets on the network interface in real time. Protocol analysis, which supports decoding of protocols from one to seven layers and provides detailed protocol field information. Filtering function, which provides capture filters and display filters to help users quickly locate data packets of interest. Statistics and graphics functions: It provides a variety of statistical options and graphical display methods to help users understand network performance and characteristics. Usage scenarios: Network problem diagnosis, network administrators can use Wireshark to detect network problems, such as packet loss, delay, etc. Security analysis, network security engineers can use Wireshark to check information security related issues, such as network attacks, malicious traffic, etc. Protocol development, developers can use Wireshark to debug new communication protocols. Learning network protocols, ordinary users can use Wireshark to learn relevant knowledge of network protocols.

[0089] The tcpreplay protocol parser includes the tcpreplay tool, the tcprewrite tool, and the tcpprep tool. The tcpprep tool is used to separate the two parties (server / client) of the communication traffic of the message and generate a cache file. The tcprewrite tool is used to modify the message, mainly modifying the layer 2, layer 3, and layer 4 message headers of the data packet, such as the MAC address, IP address, and port. The tcpreplay tool is used to replay the data packet, and you can select parameters such as the primary network card, the secondary network card, and the packet sending speed. Use the tcpprep tool to separate the communication traffic of the data packets in the PCAP file and generate a cache file. Use the tcprewrite tool to modify the data packet as needed, such as modifying the IP address, MAC address, etc. Use the tcpreplay tool to replay the modified data packet to the network according to the specified parameters. Usage scenarios include: network performance testing, testing the performance of network devices by replaying data packets, such as throughput, latency, etc. Functional testing, testing whether the network device functions normally by replaying specific data packets. Reproduce network problems by replaying captured data packets to locate and solve the problem.

[0090] The TCPDump protocol parser runs in command line mode. The main functions include: Packet capture, TCPDump can capture packets on the network interface. Protocol parsing, used to detect 2-3 layer network problems. Filtering function, TCPDump provides flexible expressions for filtering packets, and users can capture specific packets as needed. Data preservation, captured packets can be saved to files for subsequent analysis. Usage scenarios include: Network problem diagnosis, network administrators can use TCPDump to detect packet loss, latency and other problems in the network. Traffic analysis, by analyzing captured packets, network administrators can understand the distribution and characteristics of network traffic.

[0091] The main functions of OmniPeek protocol parser include: real-time capture and analysis, OmniPeek can capture data packets on the network interface in real time, and perform detailed analysis and decoding. Protocol parsing, OmniPeek supports the parsing of multiple network protocols, including TCP / IP, HTTP, FTP, DNS, etc. Traffic analysis, OmniPeek provides traffic analysis tools to help users understand the distribution and characteristics of network traffic. Expert analysis, OmniPeek provides expert analysis functions that can automatically identify problems and anomalies in the network. Usage scenarios include: network performance optimization, network administrators can use OmniPeek to analyze network traffic, identify performance bottlenecks and optimize them. Troubleshooting, by analyzing captured data packets, network administrators can quickly locate network faults.

[0092] Step 203, determining the device control authority based on the protocol conversion rate;

[0093] The device control authority is determined according to the protocol conversion rate.

[0094] In an optional embodiment of the present invention, the step of determining the device control authority based on the protocol conversion rate includes:

[0095] Sub-step S2031, when the protocol conversion rate is one, determining that the device control authority is the first device authority;

[0096] When the protocol conversion rate is one, it means that the current visitor protocol can be completely converted to a private protocol. It can be determined that the device control authority is consistent with the private protocol, and the device control authority is the first device authority.

[0097] Sub-step S2032, when the protocol conversion rate is greater than zero and not greater than one, determining that the device control authority is a second device authority, and the second device authority is less than the first device authority;

[0098] When the protocol conversion rate is greater than zero and not greater than one, it means that the current visitor protocol can be converted to a private protocol without any difference, and the functions of the convertible part are opened, and the device control authority is determined to be the second device authority. The second device authority is less than the first device authority.

[0099] Sub-step S2033, when the protocol conversion rate is zero, determining that the device control authority is a third device authority; the third device authority is less than the second device authority.

[0100] When the protocol conversion rate is zero, it means that the current visitor protocol cannot be converted into a private protocol, so only basic functions are opened, and the device control authority is determined to be the third device authority. The third device authority is less than the second device authority.

[0101] In summary, the control permissions of the devices are sorted in descending order as the first device permission, the second device permission and the third device permission.

[0102] Step 204, when the protocol identifier matches the private identifier, determining that the device control authority is the first device authority;

[0103] When the protocol identifier matches the private identifier, that is, the currently used protocol is the private protocol, the device control authority can be determined as the first device authority.

[0104] Step 205, determining a control instruction corresponding to the input instruction based on the device control authority;

[0105] The corresponding control parameters of the control instructions can be determined according to different device control permissions, so as to perform different controls.

[0106] In one example of the present invention, when the device control authority is the first device authority or the second device authority, the step of determining the control instruction corresponding to the input instruction based on the device control authority includes: reading the original command set; based on the original command set and the device control authority, parsing the input instruction to determine the control instruction.

[0107] When the device control authority is the first device authority or the second device authority, the command set under the original private protocol, that is, the original command set, can be used for parsing. The original command set can be read from the memory, register, etc. Based on the open functions corresponding to the device control authority and the original command set, the input instructions are parsed to determine the control instructions.

[0108] In one example of the present invention, when the device control authority is the third device authority, the step of determining the control instruction corresponding to the input instruction based on the device control authority includes: determining a downgraded instruction set corresponding to the third device authority; parsing the input instruction based on the downgraded instruction set to determine the control instruction.

[0109] When the device control authority is a third-party device authority, that is, the command set under the original private protocol is not applicable, it needs to be downgraded relative to the original command set, and only the downgraded instruction set of basic functions is retained for parsing. The downgraded instruction set corresponding to the third-party device authority can be determined from the memory, registers, etc. The input instruction is parsed based on the downgraded instruction set to determine the control instruction.

[0110] Step 206: execute the control instruction.

[0111] After the control instruction is determined, the control instruction is executed to realize the corresponding function.

[0112] The embodiment of the present invention receives an input instruction; the input instruction carries a protocol identifier; when the protocol identifier does not match the private identifier, the input instruction is converted into a protocol to determine a protocol conversion rate; the device control authority is determined based on the protocol conversion rate; when the protocol identifier matches the private identifier, the device control authority is determined to be the first device authority; the control instruction corresponding to the input instruction is determined based on the device control authority; and the control instruction is executed. By combining the private protocol with the visitor protocol, all advanced functions of the device can be directly used when the controlled device is controlled through the private protocol. When the controlled device is controlled through the visitor protocol, the protocol can be converted, and by converting the protocols to each other or downgrading the control, it is achieved that it is not dependent on a unified industry standard or protocol. Manufacturers can achieve cross-platform control of devices without modifying existing devices or protocols, so that the control of the device is seamlessly connected and flexibly accessed, thereby improving the practicality of the device.

[0113] Reference Figure 3 , shows a flow chart of steps of another device control method embodiment of the present invention, the device control method is applied to the device to be controlled, and the device to be controlled is connected to the server. The device to be controlled and the server can be connected through the Internet of Things. Among them, middleware can also be set as a communication bridge between different devices to realize the reception, analysis, conversion and sending of control instructions. The middleware can support multiple communication methods, such as Wi-Fi (mobile hotspot), Bluetooth, Zigbee, etc., to meet the communication needs of different devices. Among them, Wi-Fi can convert wired network signals into wireless signals to realize wireless connection and data transmission of network devices. The working principle of Wi-Fi mainly depends on the radio wave transmission between the wireless router and the Wi-Fi receiving device. The wireless router is responsible for converting the wired network signal into a wireless signal and transmitting it through radio waves, while the Wi-Fi receiving device (such as a computer, a mobile phone, etc.) receives these wireless signals through the built-in Wi-Fi module and converts them into readable data information. Bluetooth uses UHF radio waves in the ISM band of 2.4 to 2.485GHz for communication. The working principle of Bluetooth is that Bluetooth technology uses frequency hopping technology to divide the transmitted data into data packets, and transmit the data packets separately through the designated Bluetooth channels. Zigbee uses the media access layer and physical layer of the IEEE 802.15.4 standard. Zigbee technology achieves communication through the coordination between thousands of tiny sensors. These sensors only require very low power consumption and transmit data from one sensor to another through radio waves in a relay manner, thereby realizing data transmission and collection.

[0114] The device control method may specifically include the following steps:

[0115] Step 301, when accessing the network, sending registration information to the server; the server is used to generate authentication information based on the registration information;

[0116] When the device to be controlled is connected to the network of the Internet of Things, registration information can be sent to the server. The registration information includes the type, identity, network protocol type, etc. of the device to be controlled, which is not specifically limited in the embodiment of the present invention.

[0117] The server can determine the unique device identifier and access token of the device to be controlled based on the registration information and generate authentication information.

[0118] Step 302, obtaining the identifier in the authentication information as a private identifier;

[0119] The device to be controlled obtains the identifier in the authentication information as a private identifier

[0120] Step 303, receiving an input instruction; the input instruction carries a protocol identifier;

[0121] When a user needs to operate a device to be controlled so that the device to be controlled can realize a corresponding function or operation, an input instruction can be sent to the device to be controlled. The device to be controlled can receive the input instruction, wherein the input instruction carries a protocol identifier.

[0122] Step 304, when the protocol identifier does not match the private identifier, performing protocol conversion on the input instruction to determine the device control authority;

[0123] It can be determined whether the protocol identifier matches the private identifier. When the protocol identifier matches the private identifier, it means that the instruction is generated and initiated based on the private protocol. When the protocol identifier does not match the private identifier, it means that the instruction is generated and initiated based on the visitor protocol.

[0124] When the protocol identifier does not match the private identifier, the input instruction can be converted from the visitor protocol to the private protocol, and the corresponding device control authority is determined based on the conversion situation.

[0125] Step 305, when the protocol identifier matches the private identifier, determining that the device control authority is the first device authority;

[0126] When the protocol identifier matches the private identifier, the device control permission can be directly determined as the first device permission.

[0127] Step 306, determining a control instruction corresponding to the input instruction based on the device control authority;

[0128] The degree of function openness is determined based on the current device control authority, and the control instruction of the input instruction is determined.

[0129] Step 307: execute the control instruction.

[0130] After the control instruction is determined, the control instruction is executed to realize the corresponding function.

[0131] Furthermore, in the process of protocol parsing and conversion, encryption technology is used to protect the security of control instructions and parameters to prevent data leakage. The encryption method can be symmetric encryption or asymmetric encryption. The principle of symmetric encryption is to use the same key to encrypt and decrypt data. It is characterized by fast speed and is suitable for encrypting large amounts of data; but key management is complex. Once the key is leaked, the security of the entire system will be threatened. Common encryption algorithms include Advanced Encryption Standard (AES), such as AES-128, AES-192, AES-256, etc. The principle of asymmetric encryption is to use a pair of keys (public key and private key) to encrypt and decrypt data. The public key is used to encrypt data, and the private key is used to decrypt data. The characteristics of asymmetric encryption are high security, but the encryption and decryption speed is slow, and it is suitable for scenarios such as key exchange and digital signatures. Common algorithms include RSA, elliptic curve cryptography (ECC), etc.

[0132] Encryption can be used in different ways in different scenarios, such as:

[0133] Data transmission encryption: Use SSL / TLS protocols, which are based on public key infrastructure (PKI) and symmetric key encryption algorithms to protect data confidentiality, integrity and authentication.

[0134] Virtual Private Network (VPN) technology establishes an encrypted communication tunnel over a public network to ensure the confidentiality and integrity of data transmission.

[0135] Device identity authentication: Device identity authentication is achieved through technologies such as X.509 certificates, ensuring that only authenticated devices can join the network and communicate with other devices.

[0136] Data storage encryption: Encrypt the data stored on IoT devices to prevent data leakage. This is usually achieved using symmetric encryption algorithms, because symmetric encryption algorithms are faster in encryption and decryption speed and more suitable for processing large amounts of data.

[0137] Remote access control: Use encryption technology to protect remote access to IoT devices to prevent unauthorized access. This can be achieved through security protocols such as VPN and SSH.

[0138] The embodiment of the present invention sends registration information to the server when accessing the network; the server is used to generate authentication information based on the registration information; obtains the identifier in the authentication information as a private identifier; receives an input instruction; the input instruction carries a protocol identifier; when the protocol identifier does not match the private identifier, the input instruction is converted into a protocol to determine the device control authority; when the protocol identifier matches the private identifier, the device control authority is determined to be the first device authority; based on the device control authority, the control instruction corresponding to the input instruction is determined; the control instruction is executed; the private protocol corresponding to the private identifier of the device is combined with other visitor protocols, thereby ensuring the efficient operation of the device in the internal network and achieving the security and availability of the device when accessed externally. When the protocol identifier does not match the private identifier, the input instruction is converted into a protocol to determine the device control authority and the corresponding control instruction, and the corresponding control instruction is determined by mutual conversion of protocols, thereby achieving seamless docking and flexible access of the device. Therefore, device control can be performed across manufacturers and platforms, enhancing the flexibility and scalability of the device.

[0139] In order to make the implementation process of the embodiments of the present invention clear to those skilled in the art, the following reference is made to Figure 4 Let me explain this with an example:

[0140] The device to be controlled has a complete private protocol built in by default when it leaves the factory. The private protocol corresponds to a private identifier. The device to be controlled automatically selects the corresponding protocol for parsing and execution based on the type of command received. The server establishes a unified device management platform, which is responsible for device registration, authentication, authority management and command forwarding.

[0141] First, when the device to be controlled accesses the network, it first registers and authenticates with the server to obtain a unique device identifier and access token.

[0142] When the device to be controlled receives an input command, it will first check whether the control command has the private identification of the device. If it does, all the advanced functions of the device can be used directly. If it does not carry an identification, it will enter the protocol parsing and conversion stage: the protocol parser will be used to parse the private protocols of different manufacturers and extract the control instructions and parameters. Then the parsed control instructions and parameters will be converted into a protocol format that the target device can recognize to achieve mutual conversion of protocols. If the protocol conversion is successful, the functions of the corresponding part of the conversion can be used. If some of the protocol conversions fail, the functions of these parts cannot be used. When the entire protocol cannot be converted directly, a control degradation strategy is adopted to degrade complex control instructions into basic control operations, such as switching, adjustment, etc. A degraded control instruction set is designed to ensure that the device can still maintain basic functions and responses under degraded control.

[0143] It should be noted that, for the sake of simplicity, the method embodiments are described as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.

[0144] Reference Figure 5 , shows a structural block diagram of an embodiment of a device control device of the present invention, the device control device is applied to a device to be controlled, and the device to be controlled has a corresponding private identifier. The device control device may specifically include the following modules:

[0145] The receiving module 501 is used to receive an input instruction; the input instruction carries a protocol identifier;

[0146] A conversion module 502, configured to perform protocol conversion on the input instruction to determine device control authority when the protocol identifier does not match the private identifier;

[0147] A first determining module 503, configured to determine a control instruction corresponding to the input instruction based on the device control authority;

[0148] The execution module 504 is used to execute the control instruction.

[0149] In an optional embodiment of the present invention, the device further comprises:

[0150] The second determining module is used to determine that the device control permission is the first device permission when the protocol identifier matches the private identifier.

[0151] In an optional embodiment of the present invention, the conversion module 502 includes:

[0152] A conversion submodule, used for performing protocol conversion on the input instruction and determining a protocol conversion rate when the protocol identifier does not match the private identifier;

[0153] The determination submodule is used to determine the device control authority based on the protocol conversion rate.

[0154] In an optional embodiment of the present invention, the determining submodule includes:

[0155] A first determining unit, configured to determine, when the protocol conversion rate is one, that the device control authority is a first device authority;

[0156] A second determining unit, configured to determine, when the protocol conversion rate is greater than zero and not greater than one, that the device control authority is a second device authority, and the second device authority is less than the first device authority;

[0157] The third determining unit is used to determine that the device control authority is a third device authority when the protocol conversion rate is zero; the third device authority is less than the second device authority.

[0158] In an optional embodiment of the present invention, when the device control authority is the first device authority or the second device authority, the first determining module 503 includes:

[0159] Read submodule, used to read the original command set;

[0160] The first parsing module is used to parse the input instruction and determine the control instruction based on the original command set and the device control authority.

[0161] In an optional embodiment of the present invention, when the device control authority is the third device authority, the first determining module 503 includes:

[0162] An instruction set identification submodule, used to determine a downgrade instruction set corresponding to the third device authority;

[0163] The second parsing module is used to parse the input instruction based on the degraded instruction set to determine the control instruction.

[0164] In an optional embodiment of the present invention, the device to be controlled is connected to a server, and the apparatus further includes:

[0165] A registration module, used to send registration information to the server when accessing the network; the server is used to generate authentication information based on the registration information;

[0166] The authentication module is used to obtain the identifier in the authentication information as the private identifier.

[0167] The embodiment of the present invention receives an input instruction; the input instruction carries a protocol identifier; when the protocol identifier does not match the private identifier, the input instruction is converted into a protocol to determine the device control authority; based on the device control authority, the control instruction corresponding to the input instruction is determined; and the control instruction is executed. The private protocol corresponding to the private identifier of the device is combined with other visitor protocols, which not only ensures the efficient operation of the device in the internal network, but also realizes the security and availability of the device when it is accessed externally. When the protocol identifier does not match the private identifier, the input instruction is converted into a protocol to determine the device control authority and the corresponding control instruction, and the corresponding control instruction is determined by mutual conversion of protocols, thereby realizing seamless connection and flexible access to the device. This allows device control across manufacturers and platforms, enhancing the flexibility and scalability of the device.

[0168] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0169] Reference Figure 6 , an embodiment of the present invention further provides an electronic device, including:

[0170] A processor 601 and a storage medium 602, wherein the storage medium 602 stores a computer program executable by the processor 601, and when the electronic device is controlled to run, the processor 601 executes the computer program to implement the device control method as described in any one of the embodiments of the present invention.

[0171] The device control method is applied to a device to be controlled, the device to be controlled has a corresponding private identifier, and the device control method includes:

[0172] receiving an input instruction, wherein the input instruction carries a protocol identifier;

[0173] When the protocol identifier does not match the private identifier, performing protocol conversion on the input instruction to determine the device control authority;

[0174] Determining a control instruction corresponding to the input instruction based on the device control authority;

[0175] Execute the control instruction.

[0176] Optionally, the method further comprises:

[0177] When the protocol identifier matches the private identifier, the device control permission is determined to be the first device permission.

[0178] Optionally, when the protocol identifier does not match the private identifier, the step of performing protocol conversion on the input instruction to determine the device control authority includes:

[0179] When the protocol identifier does not match the private identifier, performing protocol conversion on the input instruction and determining a protocol conversion rate;

[0180] The device control authority is determined based on the protocol conversion rate.

[0181] Optionally, the step of determining the device control authority based on the protocol conversion rate includes:

[0182] When the protocol conversion rate is one, determining that the device control authority is the first device authority;

[0183] When the protocol conversion rate is greater than zero and not greater than one, determining that the device control authority is a second device authority, and the second device authority is less than the first device authority;

[0184] When the protocol conversion rate is zero, it is determined that the device control authority is a third device authority; and the third device authority is less than the second device authority.

[0185] Optionally, when the device control authority is the first device authority or the second device authority, the step of determining the control instruction corresponding to the input instruction based on the device control authority includes:

[0186] Read the original command set;

[0187] Based on the original command set and the device control authority, the input instruction is parsed to determine the control instruction.

[0188] Optionally, when the device control authority is the third device authority, the step of determining the control instruction corresponding to the input instruction based on the device control authority includes:

[0189] Determine a downgrade instruction set corresponding to the third device permission;

[0190] The input instruction is parsed based on the degraded instruction set to determine a control instruction.

[0191] Optionally, the device to be controlled is connected to a server, and the method further includes:

[0192] When accessing the network, sending registration information to the server; the server is used to generate authentication information based on the registration information;

[0193] The identifier in the authentication information is obtained as the private identifier.

[0194] The embodiment of the present invention receives an input instruction; the input instruction carries a protocol identifier; when the protocol identifier does not match the private identifier, the input instruction is converted into a protocol to determine the device control authority; based on the device control authority, the control instruction corresponding to the input instruction is determined; and the control instruction is executed. The private protocol corresponding to the private identifier of the device is combined with other visitor protocols, which not only ensures the efficient operation of the device in the internal network, but also realizes the security and availability of the device when it is accessed externally. When the protocol identifier does not match the private identifier, the input instruction is converted into a protocol to determine the device control authority and the corresponding control instruction, and the corresponding control instruction is determined by mutual conversion of protocols, thereby realizing seamless connection and flexible access to the device. This allows device control across manufacturers and platforms, enhancing the flexibility and scalability of the device.

[0195] The memory may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the processor.

[0196] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0197] Reference Figure 7 The embodiment of the present invention further provides a computer-readable storage medium 701, on which a computer program is stored. When the computer program is executed by a processor, the device control method as described in any one of the embodiments of the present invention is executed.

[0198] The device control method is applied to a device to be controlled, the device to be controlled has a corresponding private identifier, and the device control method includes:

[0199] receiving an input instruction, wherein the input instruction carries a protocol identifier;

[0200] When the protocol identifier does not match the private identifier, performing protocol conversion on the input instruction to determine the device control authority;

[0201] Determining a control instruction corresponding to the input instruction based on the device control authority;

[0202] Execute the control instruction.

[0203] Optionally, the method further comprises:

[0204] When the protocol identifier matches the private identifier, the device control permission is determined to be the first device permission.

[0205] Optionally, when the protocol identifier does not match the private identifier, the step of performing protocol conversion on the input instruction to determine the device control authority includes:

[0206] When the protocol identifier does not match the private identifier, performing protocol conversion on the input instruction and determining a protocol conversion rate;

[0207] The device control authority is determined based on the protocol conversion rate.

[0208] Optionally, the step of determining the device control authority based on the protocol conversion rate includes:

[0209] When the protocol conversion rate is one, determining that the device control authority is the first device authority;

[0210] When the protocol conversion rate is greater than zero and not greater than one, determining that the device control authority is a second device authority, and the second device authority is less than the first device authority;

[0211] When the protocol conversion rate is zero, it is determined that the device control authority is a third device authority; and the third device authority is less than the second device authority.

[0212] Optionally, when the device control authority is the first device authority or the second device authority, the step of determining the control instruction corresponding to the input instruction based on the device control authority includes:

[0213] Read the original command set;

[0214] Based on the original command set and the device control authority, the input instruction is parsed to determine the control instruction.

[0215] Optionally, when the device control authority is the third device authority, the step of determining the control instruction corresponding to the input instruction based on the device control authority includes:

[0216] Determine a downgrade instruction set corresponding to the third device permission;

[0217] The input instruction is parsed based on the degraded instruction set to determine a control instruction.

[0218] Optionally, the device to be controlled is connected to a server, and the method further includes:

[0219] When accessing the network, sending registration information to the server; the server is used to generate authentication information based on the registration information;

[0220] The identifier in the authentication information is obtained as the private identifier.

[0221] The embodiment of the present invention receives an input instruction; the input instruction carries a protocol identifier; when the protocol identifier does not match the private identifier, the input instruction is converted into a protocol to determine the device control authority; based on the device control authority, the control instruction corresponding to the input instruction is determined; and the control instruction is executed. The private protocol corresponding to the private identifier of the device is combined with other visitor protocols, which not only ensures the efficient operation of the device in the internal network, but also realizes the security and availability of the device when it is accessed externally. When the protocol identifier does not match the private identifier, the input instruction is converted into a protocol to determine the device control authority and the corresponding control instruction, and the corresponding control instruction is determined by mutual conversion of protocols, thereby realizing seamless connection and flexible access to the device. This allows device control across manufacturers and platforms, enhancing the flexibility and scalability of the device.

[0222] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0223] It will be appreciated by those skilled in the art that the embodiments of the present invention may be provided as methods, devices, or computer program products. Therefore, the embodiments of the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the embodiments of the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

[0224] The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0225] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0226] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0227] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention.

[0228] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.

[0229] The above is a detailed introduction to a device control method, a device control apparatus, an electronic device and a computer-readable storage medium provided by the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for a general technician in this field, according to the idea of ​​the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.

Claims

1. A device control method, characterized in that: Applied to a device to be controlled, the device to be controlled has a corresponding private identifier, and the method includes: receiving an input instruction, wherein the input instruction carries a protocol identifier; When the protocol identifier does not match the private identifier, performing protocol conversion on the input instruction to determine the device control authority; Determining a control instruction corresponding to the input instruction based on the device control authority; Execute the control instruction.

2. The method according to claim 1, characterized in that The method further comprises: When the protocol identifier matches the private identifier, the device control permission is determined to be the first device permission.

3. The method according to claim 1, characterized in that When the protocol identifier does not match the private identifier, the step of performing protocol conversion on the input instruction to determine the device control authority includes: When the protocol identifier does not match the private identifier, performing protocol conversion on the input instruction and determining a protocol conversion rate; The device control authority is determined based on the protocol conversion rate.

4. The method according to claim 3, characterized in that The step of determining the device control authority based on the protocol conversion rate comprises: When the protocol conversion rate is one, determining that the device control authority is the first device authority; When the protocol conversion rate is greater than zero and not greater than one, determining that the device control authority is a second device authority, and the second device authority is less than the first device authority; When the protocol conversion rate is zero, it is determined that the device control authority is a third device authority; and the third device authority is less than the second device authority.

5. The method according to claim 4, characterized in that When the device control authority is the first device authority or the second device authority, the step of determining the control instruction corresponding to the input instruction based on the device control authority includes: Read the original command set; Based on the original command set and the device control authority, the input instruction is parsed to determine the control instruction.

6. The method according to claim 5, characterized in that When the device control authority is the third device authority, the step of determining the control instruction corresponding to the input instruction based on the device control authority includes: Determine a downgrade instruction set corresponding to the third device permission; The input instruction is parsed based on the degraded instruction set to determine a control instruction.

7. The method according to claim 1, characterized in that The device to be controlled is connected to a server, and the method further includes: When accessing the network, sending registration information to the server; the server is used to generate authentication information based on the registration information; The identifier in the authentication information is obtained as the private identifier.

8. A device control device, characterized in that: Applied to a device to be controlled, the device to be controlled has a corresponding private identifier, and the device comprises: A receiving module, used for receiving an input instruction; the input instruction carries a protocol identifier; A conversion module, used for performing protocol conversion on the input instruction to determine the device control authority when the protocol identifier does not match the private identifier; A first determining module, configured to determine a control instruction corresponding to the input instruction based on the device control authority; An execution module is used to execute the control instruction.

9. An electronic device, characterized in that: The device comprises a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein when the computer program is executed by the processor, the steps of the device control method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the device control method according to any one of claims 1 to 7 are implemented.