Integrated control method and system for embedded devices

By using encryption keys and serial code functions to communicate between the control platform and embedded devices, the problem that multiple people are required to participate in the management of multiple embedded devices is solved, unified control and efficient management of equipment are realized, and production efficiency is improved. .

CN114513357BActive Publication Date: 2024-08-27CHENGDU GUOXINAN INFORMATION IND BASE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210137561.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-02-15
Publication Date
2024-08-27
Estimated Expiration
2042-02-15

AI Technical Summary

Technical Problem

In the existing technology, managing and operating a large number of different embedded devices requires the participation of multiple people, resulting in a waste of human resources and low production efficiency.

Method used

By using encryption keys and serial code functions for encryption and decryption communication between the control platform and embedded devices, unified control and management of different embedded devices is achieved, symmetric key encryption is used for data exchange, and key updates are performed and the sequence code carried in the response message for verification.

Benefits of technology

It achieves unified control of a large number of different embedded devices, reduces waste of human resources, improves production efficiency, and improves data exchange speed and efficiency through symmetric key encryption.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114513357B
    Figure CN114513357B
Patent Text Reader

Abstract

The present invention discloses an integrated control method and system for embedded devices, and relates to the technical field of computer software. The method includes: when a control platform sends a control command to an embedded device, a first target sequence code generated based on a sequence code function corresponding to the embedded device is carried in the control command; after the embedded device decrypts and executes the control command, a response message carrying the first target sequence code is sent to the control platform; after the control platform decrypts the response message, the sequence code function found out by the address corresponding to the embedded device is used to verify whether the sequence code carried in the decrypted response message is valid; and when the verification result is that the sequence code carried in the response message is valid, the control result for the embedded device is determined according to the response message. The integrated control method and system for embedded devices provided by the present application can realize unified control of a large number of different embedded devices, and reduce the waste of human resources.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of computer software, and in particular to an integrated control method and system for embedded devices. Background Art

[0002] With the development of electronic technology and computer software technology, embedded devices are widely used in various fields such as industrial production, industrial control, traffic management, etc., and are developing towards intelligence. Its basic feature is that the equipment has networking function and can realize network remote control.

[0003] There are many types of embedded devices. Currently, the control of embedded devices is often carried out independently using corresponding software. When an enterprise or unit has a large number of embedded devices for different purposes, each embedded device needs to be configured and managed separately. Therefore, multiple people are often required to manage and operate them, which wastes a lot of human resources and reduces production efficiency.

[0004] Therefore, how to provide an effective solution to achieve unified management of a large number of different embedded devices, reduce waste of human resources, and improve production efficiency has become a difficult problem to be solved in the prior art. Summary of the invention

[0005] The purpose of the present invention is to provide an integrated control method and system for embedded devices, so as to solve the problem in the prior art that a large number of different embedded devices need to be managed and operated by multiple people.

[0006] In a first aspect, the present invention provides an integrated control method for an embedded device, which is applied to an integrated control system for an embedded device, wherein the integrated control system for the embedded device comprises a control platform and an embedded device that is communicatively connected to the control platform, including:

[0007] The control platform encrypts the control command using a first encryption key and sends the encrypted command to the embedded device, wherein the control command carries a first target sequence code, and the first target sequence code is generated based on a sequence code function corresponding to the embedded device;

[0008] The embedded device decrypts the encrypted control command using a first decryption key corresponding to the first encryption key to obtain a decrypted control command;

[0009] The embedded device executes the decrypted control command;

[0010] The embedded device generates a first response message for indicating success or failure of execution of the control command, and encrypts the first response message using the first encryption key and sends the first response message to the control platform, wherein the first response message carries the first target sequence code;

[0011] The control platform searches out the first decryption key corresponding to the first encryption key and the sequence code function corresponding to the embedded device based on the address corresponding to the embedded device;

[0012] The control platform decrypts the encrypted first response message using the first decryption key;

[0013] The control platform verifies whether the sequence code carried in the decrypted first response message is valid based on the found sequence code function;

[0014] When the verification result is that the sequence code carried in the decrypted first response message is valid, the control platform determines the control result for the embedded device according to the decrypted first response message.

[0015] In a possible design, the control command carries the number of message retransmissions, and before the control platform encrypts the control command using the first encryption key and sends it to the embedded device, the method further includes:

[0016] The control platform generates a random number;

[0017] The control platform calculates the function value of the sequence code function corresponding to the embedded device based on the number of message retransmissions carried in the control command and the random number;

[0018] The control platform generates an initial sequence code according to the random number, the number of message retransmissions carried in the control command and the function value;

[0019] The control platform performs shift processing on each byte in the initial sequence code to obtain the first target sequence code;

[0020] The calculation formula of the function value is y=f(x,n), x represents the random number, and n represents the number of message retransmissions carried in the control command.

[0021] In one possible design, the control command carries a number of message retransmission times, and the method further includes:

[0022] When the control result for the embedded device is uncompleted control, the control platform determines whether the number of message retransmissions carried in the control command exceeds a first preset number;

[0023] If the number of retransmissions of the message carried in the control command does not exceed a first preset number, the control platform re-encrypts the control command using the first encryption key and sends the re-encrypted control command to the embedded device.

[0024] In one possible design, before the control platform encrypts the control command using the first encryption key and sends it to the embedded device, the method further includes:

[0025] The control platform generates a symmetric key pair corresponding to the address of the embedded device, and the symmetric key pair includes the first encryption key and the first decryption key.

[0026] The control platform encrypts a key update message by a private key and sends the message to the embedded device, wherein the key update message carries the symmetric key pair and a second target sequence code, and the second target sequence code is generated based on a sequence code function corresponding to the embedded device;

[0027] The embedded device decrypts the encrypted key update message using a public key corresponding to the private key;

[0028] After the decryption is successful, the embedded device updates the current key pair using the decrypted symmetric key pair;

[0029] The embedded device generates a second response message indicating success or failure of the key pair update, wherein the second response message carries the second target sequence code;

[0030] The embedded device encrypts the second response message by using the public key and sends the encrypted message to the control platform;

[0031] The control platform searches out the private key corresponding to the public key and the sequence code function corresponding to the embedded device according to the address corresponding to the embedded device;

[0032] The control platform decrypts the encrypted second response message using the private key;

[0033] The control platform verifies whether the sequence code carried in the decrypted second response message is valid based on the found sequence code function;

[0034] When the verification result is that the sequence code carried in the decrypted second response message is valid, it is determined whether the key exchange is successful based on the decrypted second response message.

[0035] In one possible design, the method further includes:

[0036] After the key exchange is successful, the control platform updates the local key pair corresponding to the embedded device through the decrypted symmetric key pair.

[0037] In one possible design, the key update message carries a message retransmission count, and the method further includes:

[0038] When the key exchange is unsuccessful, the control platform determines whether the number of message retransmissions carried in the key update message exceeds a second preset number;

[0039] If the number of message retransmissions carried in the key update message does not exceed a second preset number, the control platform encrypts the key update message using the private key and resends the message to the embedded device.

[0040] In one possible design, before the control platform generates a symmetric key pair corresponding to the address of the embedded device, the method further includes:

[0041] The embedded device encrypts the key request message by using the public key and sends the message to the control platform, wherein the key request message carries the number of request repetitions;

[0042] The control platform searches out the private key corresponding to the public key according to the corresponding address of the embedded device;

[0043] The control platform decrypts the encrypted key request message according to the found private key;

[0044] If the request is repeated for a number of times that does not exceed a third preset number of times, the control platform generates a third response message indicating that the key request is successful, and starts a key update process;

[0045] The control platform encrypts the third response message using the private key and sends the encrypted message to the embedded device.

[0046] In one possible design, the control command and the first response message both include a check code field, and after the control platform decrypts the encrypted first response message using the first decryption key, the method further includes:

[0047] The control platform verifies whether the verification code field carried in the first response message is valid;

[0048] When the verification result is that the sequence code carried in the decrypted first response message is valid, the control platform determines the control result for the embedded device according to the decrypted first response message, including:

[0049] When the check code field carried in the first response message is valid, and the verification result is that the sequence code carried in the decrypted first response message is valid, the control platform determines the control result for the embedded device based on the decrypted first response message.

[0050] In one possible design, the control command carries a control word field, a sequence code field, a status code field, a payload length field and a payload field. The control word field is used to store the control command, the sequence code field is used to store the first target sequence code, the status code field is used to store the status code, the payload field is used to store the data exchanged between the control platform and the embedded device, and the payload length field is used to store the length data of the payload field.

[0051] In a second aspect, the present invention provides an integrated control system for embedded devices, comprising a control platform and an embedded device communicatively connected to the control platform, wherein the control platform is used to encrypt a control command using a first encryption key and then send the encrypted control command to the embedded device, wherein the control command carries a first target sequence code, and the first target sequence code is generated based on a sequence code function corresponding to the embedded device;

[0052] The embedded device is used to decrypt the encrypted control command by using a first decryption key corresponding to the first encryption key to obtain a decrypted control command;

[0053] Execute the decrypted control command; and

[0054] Generate a first response message for indicating success or failure of execution of the control command, and encrypt the first response message by using the first encryption key and send it to the control platform, wherein the first response message carries the first target sequence code;

[0055] The control platform is also used to find out the first decryption key corresponding to the first encryption key and the sequence code function corresponding to the embedded device based on the address corresponding to the embedded device;

[0056] Decrypting the encrypted first response message using the first decryption key;

[0057] Verifying whether the sequence code carried in the decrypted first response message is valid based on the found sequence code function; and

[0058] When the verification result is that the sequence code carried in the decrypted first response message is valid, the control result for the embedded device is determined according to the decrypted first response message.

[0059] At least one of the above technical solutions adopted in one or more embodiments of the present application can achieve the following beneficial effects:

[0060] When the control platform sends a control command to the embedded device, the control command carries a first target sequence code generated based on the sequence code function corresponding to the embedded device. After the embedded device decrypts and executes the control command, it sends a response message carrying the first target sequence code to the control platform. After the control platform decrypts the response message, it verifies whether the sequence code carried in the decrypted response message is valid by using the sequence code function found out by the address corresponding to the embedded device. When the verification result shows that the sequence code carried in the response message is valid, the control result for the embedded device is determined according to the response message. In this way, it is only necessary to set different sequence code functions for different embedded devices to realize unified control of a large number of different embedded devices, without the need for multiple people to manage and operate, thus reducing the waste of human resources and improving production efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0061] Figure 1 A flow chart of the integrated control method for embedded devices provided by the present invention;

[0062] Figure 2 This is a schematic diagram of the structure of the integrated control system of the embedded device provided by the present invention. DETAILED DESCRIPTION

[0063] The present invention will be further described below in conjunction with the accompanying drawings and specific embodiments. It should be noted that although the description of these embodiments is used to help understand the present invention, it does not constitute a limitation of the present invention. The specific structures and functional details disclosed herein are only used to describe the exemplary embodiments of the present invention. However, the present invention can be embodied in many alternative forms, and it should not be understood that the present invention is limited to the embodiments set forth herein.

[0064] It should be understood that although the terms first, second, etc. may be used herein to describe various units, these units should not be limited by these terms. These terms are only used to distinguish one unit from another unit. For example, a first unit can be referred to as a second unit, and similarly, a second unit can be referred to as a first unit without departing from the scope of the exemplary embodiments of the present invention.

[0065] It should be understood that the term "and / or" that may appear in this article is merely a description of the association relationship between associated objects, indicating that three relationships may exist. For example, A and / or B can represent three situations: A exists alone, B exists alone, and A and B exist at the same time. The term " / and" that may appear in this article describes another type of association object relationship, indicating that two relationships may exist. For example, A / and B can represent two situations: A exists alone, and A and B exist alone. In addition, the character " / " that may appear in this article generally indicates that the previous and next associated objects are in an "or" relationship.

[0066] Example

[0067] In order to achieve unified management of a large number of different embedded devices, an embodiment of the present application provides an integrated control method and system for embedded devices, which can achieve unified control of a large number of different embedded devices and reduce waste of human resources.

[0068] like Figure 1 As shown, it is a flow chart of an integrated control method of an embedded device provided by the first aspect of an embodiment of the present application. The integrated control method of the embedded device can be applied to an integrated control system of an embedded device. The integrated control system of the embedded device includes a control platform and an embedded device that is communicatively connected to the control platform. The control platform can be a server for unified management and control of different embedded devices. The integrated control method of the embedded device can include the following steps:

[0069] Step S101: The control platform encrypts the control command using a first encryption key and sends the encrypted command to the embedded device.

[0070] In an embodiment of the present application, a symmetric encryption method is used between the control platform and the embedded device during the interactive control process. When the control platform sends a control command to the embedded device, the control command can be encrypted by a first encryption key and sent to the embedded device.

[0071] The control command carries a first target sequence code, which is generated based on a sequence code function corresponding to the embedded device.

[0072] Specifically, the control platform is provided with different sequence code functions for each embedded device it controls, and is bound to the address of the embedded device (such as IP address or MAC address, etc.). Before sending a control command to the embedded device, the control platform can select the sequence code function corresponding to the embedded device according to the address of the embedded device to generate a first target sequence code.

[0073] More specifically, the control command carries the number of message retransmissions. When generating the first target sequence code, the control platform may first generate a random number, and calculate the function value of the sequence code function corresponding to the embedded device based on the number of message retransmissions carried in the control command and the random number. The calculation formula of the function value of the sequence code function may be expressed as y=f(x,n), where x represents the random number, and n represents the number of message retransmissions carried in the control command. The control platform then generates an initial sequence code based on the random number, the number of message retransmissions carried in the control command, and the function value. Finally, the control platform performs a bit shift processing on each byte in the initial sequence code to obtain the first target sequence code.

[0074] For example, when the control platform generates the initial sequence code according to the random number, the number of message retransmissions carried in the control command and the function value, the random number x can be written into the first and second bytes of the sequence code, the function value y can be written into the third byte, and the number of message retransmissions n can be written into the fourth byte to generate the initial sequence code. Then the generated 4-byte value is shifted 10 bits to the right, and the 10 bits shifted out are placed in the low order of the byte in sequence. Assuming that the generated initial sequence code is 0010100001000011 00000000 00000100, the first target sequence code obtained after the shift processing can be expressed as 00000001 00001010 00010000 11000000.

[0075] In an embodiment of the present application, in addition to the number of message retransmissions carried in the control command, it also includes a control word field ControlWord, a sequence code field SeqCode, a status code field StatusCode, a payload length field Dlength, a payload field Data and a check code field CRC, wherein the control word field ControlWord is used to store the control command, the sequence code field SeqCode is used to store the first target sequence code, the status code field StatusCode is used to store the status code, the payload field Data is used to store the data exchanged between the control platform and the embedded device, the payload length field Dlength is used to store the length data of the payload field, and the check code field CRC is used to store the check code used for CRC check.

[0076] In the embodiment of the present application, when the control platform sends the encrypted control command to the embedded device, the encrypted control command can be submitted to the control command monitoring interface of the embedded device through the POST method.

[0077] Step S102: The embedded device decrypts the encrypted control command using a first decryption key corresponding to the first encryption key to obtain a decrypted control command.

[0078] A symmetric encryption method is used between the control platform and the embedded device during the control exchange process. After obtaining the control command encrypted by the first encryption key, the embedded device can decrypt the encrypted control command by using the first decryption key corresponding to the first encryption key to obtain the decrypted control command.

[0079] In the embodiment of the present application, the embedded device can monitor the control command monitoring interface through the http service, thereby obtaining the control command encrypted by the first encryption key sent by the control platform.

[0080] In a possible design, after the encrypted control command is decrypted by the first decryption key corresponding to the first encryption key and the decrypted control command is obtained, a CRC check can be performed on the control command. After the decryption and the CRC check are successful, the subsequent step S103 is executed, otherwise the entire process is terminated.

[0081] Step S103: the embedded device executes the decrypted control command.

[0082] Step S104: The embedded device generates a first response message for indicating success or failure of execution of the control command, and encrypts the first response message using a first encryption key and sends it to the control platform.

[0083] During the process of the embedded device executing the decrypted control command, the execution may succeed or fail. If the execution succeeds, a first response message indicating the successful execution of the control command is generated. If the execution fails, a first response message indicating the failure of the control command is generated. The first response message indicating the success or failure of the control command is encrypted by the first encryption key and sent to the control platform. The first response message carries the first target sequence code.

[0084] The successful execution of the control command can be reflected by the status code stored in the status code field StatusCode in the first response message. For example, the status code can be set to 1 byte in length, the default value of the value range is 0x00, the status code 0x01 can be used to indicate that the control command is successfully executed, and the status code 0x02 can be used to indicate that the control command fails to execute.

[0085] Step S105: The control platform searches out a first decryption key corresponding to the first encryption key and a sequence code function corresponding to the embedded device based on the address corresponding to the embedded device.

[0086] The control platform stores the first encryption key, the first decryption key and the sequence code function corresponding to each embedded device, and in order to facilitate the unified management of each embedded device, the control platform binds the first encryption key, the first decryption key and the sequence code function corresponding to each embedded device to the address corresponding to the embedded device. After receiving the first response message sent by the embedded device, the control platform can find out the first decryption key corresponding to the first encryption key used for encryption of the embedded device and the sequence code function corresponding to the embedded device according to the address corresponding to the embedded device.

[0087] Step S106: The control platform decrypts the encrypted first response message using the first decryption key.

[0088] If the decryption is successful, the subsequent step S107 is executed, otherwise the whole process ends.

[0089] Step S107: The control platform verifies whether the sequence code carried in the decrypted first response message is valid based on the found sequence code function.

[0090] In an embodiment of the present application, whether the sequence code carried in the decrypted first response message is valid is verified. The specific process is the inverse process of generating the first target sequence code based on the sequence code function corresponding to the embedded device in step S101. First, a shift inverse operation is performed, and then the 1st and 2nd bytes are taken from the sequence code obtained by the shift inverse operation as random numbers, and the 4th byte is taken from the sequence code obtained by the shift inverse operation as the number of message repetitions. Then, the function value of the sequence code function is calculated by the function value calculation formula of the sequence code function. Finally, the calculated function value is compared with the function value y in step S101. If the two are consistent, it means that the data in the message has not been tampered with, and the sequence code carried in the first response message is valid.

[0091] In a possible design, after the control platform decrypts the encrypted first response message using the first decryption key, it can also perform a CRC check on the decrypted first response message to verify whether the check code field carried in the first response message is valid. After the sequence code carried in the first response message is valid and the CRC check passes (that is, the check code field carried in the first response message is valid), the subsequent step S108 is executed, otherwise the entire process is terminated.

[0092] Step S108: When the verification result is that the sequence code carried in the decrypted first response message is valid, the control platform determines the control result for the embedded device according to the decrypted first response message.

[0093] Among them, if the status code stored in the status code field StatusCode in the first response message indicates that the command is executed successfully (that is, the status code stored in the status code field StatusCode is 0x01), it means that the control of the embedded device is completed; if the status code stored in the status code field StatusCode in the first response message indicates that the command fails to execute (that is, the status code stored in the status code field StatusCode is 0x02), it means that the control of the embedded device is not completed.

[0094] In a possible design, the control command sent by the control platform can also carry the number of message retransmissions. When the control result for the embedded device is that the control is not completed, the control platform can also determine whether the number of message retransmissions carried in the control command exceeds a first preset number of times. If the number of message retransmissions carried in the control command does not exceed the first preset number of times, the control platform can re-encrypt the control command with the first encryption key and send it to the embedded device to control the embedded device. If the number of message retransmissions carried in the control command exceeds the first preset number of times, the control command will no longer be resent to the embedded device. In this way, when the control of the embedded device is not completed, the control command can be resent to ensure that the control of the embedded device is completed. At the same time, because when the number of message retransmissions carried in the control command exceeds the first preset number of times, the control command will no longer be resent to the embedded device, thereby avoiding high-frequency access initiated by malware to the interface.

[0095] In summary, the integrated control method of the embedded device provided by the embodiment of the present application is that when the control platform sends a control command to the embedded device, the control command carries the first target sequence code generated based on the sequence code function corresponding to the embedded device, and after the embedded device decrypts and executes the control command, the control platform sends a response message carrying the first target sequence code to the control platform, and after the control platform decrypts the response message, the sequence code function corresponding to the address of the embedded device is found to verify whether the sequence code carried in the decrypted response message is valid, and when the verification result is that the sequence code carried in the response message is valid, the control result for the embedded device is determined according to the response message. In this way, it is only necessary to set different sequence code functions for different embedded devices to achieve unified control of a large number of different embedded devices, without the need for multiple people to manage and operate, reducing the waste of human resources and improving production efficiency. At the same time, if the number of message retransmissions carried in the control command does not exceed the first preset number, the control platform can re-encrypt the control command through the first encryption key and send it to the embedded device to control the embedded device, otherwise the control command will no longer be resent to the embedded device. In this way, when the control of the embedded device is not completed, the control command can be resent to ensure the control of the embedded device, and the high-frequency access to the interface initiated by malicious software can also be avoided. In addition, by encrypting the communication content with a symmetric key, the data exchange between the control platform and the embedded device is fast, efficient, and more practical.

[0096] The embodiment of the present application further provides a possible design 1 for implementing key update between a control platform and an embedded device based on the aforementioned first aspect, which may include but is not limited to the following steps S201-S210.

[0097] Step S201: The control platform generates a symmetric key pair corresponding to the address of the embedded device.

[0098] The control platform pre-defines a key update strategy. The key update strategy can be to perform a key update when the interactive control between the control platform and the embedded device reaches a preset number of times, or to perform a key update at a certain time interval (such as 24 hours). No specific limitation is made in the embodiments of the present application.

[0099] When performing key update with an embedded device, the control platform first generates a symmetric key pair, and then binds the symmetric key pair to the address of the embedded device that needs to update the key pair. The symmetric key pair includes the first encryption key and the first decryption key.

[0100] In addition, it should be noted that when the key (symmetric key pair) between the control platform and the embedded device needs to be updated, the interactive control process that will be carried out between the control platform and the embedded device needs to be stopped first.

[0101] Step S202: The control platform encrypts the key update message using the private key and sends it to the embedded device.

[0102] The control platform pre-configures a public key and a private key for encrypting and decrypting a symmetric key pair for each embedded device, and synchronizes the public key to each embedded device. During the key update process, the control platform can encrypt the key update message using the private key corresponding to the embedded device whose key is to be updated and send it to the embedded device. The key update message carries the symmetric key pair and the second target sequence code, and the second target sequence code is generated based on the sequence code function corresponding to the embedded device.

[0103] For example, in one embodiment, the control platform communicates with embedded device A and embedded device B respectively, wherein corresponding public key a1 and private key a2 are configured for embedded device A, and corresponding public key b1 and private key b2 are configured for embedded device B, and the control platform can synchronize public key a1 to embedded device A, and synchronize public key b1 to embedded device B. Assuming that the symmetric key between the control platform and embedded device A needs to be updated, after the control platform generates a symmetric key pair corresponding to the address of embedded device A, it can encrypt the key update message through the private key a2 corresponding to embedded device A and send it to embedded device A.

[0104] In the embodiment of the present application, the second target sequence code is generated based on the sequence code function corresponding to the embedded device, and its generation process is consistent with the process of generating the first target sequence code in step S101, and will not be described in detail in the embodiment of the present application.

[0105] Step S203: The embedded device decrypts the encrypted key update message using the public key corresponding to the private key.

[0106] Step S204: after the decryption is successful, the embedded device updates the current key pair using the decrypted symmetric key pair.

[0107] After the decryption is successful, the embedded device can replace the current key pair of the embedded device with the decrypted symmetric key pair, thereby completing the key update of the embedded device. It can be understood that if the decryption is not successful, the key update process can be terminated.

[0108] In a possible design, after decryption, the decrypted key update message can also be subjected to a CRC check, and the current key pair is updated with the decrypted symmetric key pair only after the CRC check passes, otherwise the key update process is terminated.

[0109] In a possible design, if there is an unfinished interactive control process between the control platform and the embedded device during the key update process, the embedded device can update the current key pair after waiting for the information processing in the interactive control process to be completed.

[0110] Step S205: The embedded device generates a second response message indicating success or failure of the key pair update, and the second response message carries a second target sequence code.

[0111] Similarly, the success or failure of the key update can be represented by the status code stored in the status code field StatusCode in the second response message, which will not be described in detail here.

[0112] Step S206: The embedded device encrypts the second response message using the public key and sends it to the control platform.

[0113] Step S207: The control platform searches out the private key corresponding to the public key and the serial code function corresponding to the embedded device according to the address corresponding to the embedded device.

[0114] Step S208: The control platform decrypts the encrypted second response message using the private key.

[0115] Step S209: The control platform verifies whether the sequence code carried in the decrypted second response message is valid based on the found sequence code function.

[0116] Among them, the process of verifying whether the sequence code carried in the second response message is valid is consistent with the process of verifying whether the sequence code carried in the decrypted first response message is valid in the aforementioned step S107, and will not be described in detail in the embodiment of the present application.

[0117] In a possible design, after the control platform decrypts the encrypted second response message using the private key, it can also perform a CRC check on the second response message, and the sequence code carried in the decrypted second response message can be valid. After the CRC check passes, the subsequent step S210 is executed, otherwise the key update process is terminated.

[0118] Step S210: When the verification result is that the sequence code carried in the decrypted second response message is valid, determine whether the key exchange is successful based on the decrypted second response message.

[0119] In the embodiment of the present application, if the key exchange is successful, the control platform can update the local key pair corresponding to the embedded device through the decrypted symmetric key pair, thereby completing the key update on the control platform side. After the key update on the control platform side is completed, the interactive control process for the embedded device can be started.

[0120] In the embodiment of the present application, the key update message may also carry the number of message retransmissions. When the key exchange is unsuccessful, the control platform may also determine whether the number of message retransmissions carried in the key update message exceeds a second preset number. If it exceeds the second preset number, the key update process is terminated. If it does not exceed, the control platform may encrypt the key update message with the private key and resend it to the embedded device to perform the key update, thereby ensuring that the key update is successful. At the same time, when the number of message retransmissions carried in the key update message exceeds the second preset number, the key update message is no longer resent to the embedded device, thereby avoiding high-frequency access initiated by malware to the interface.

[0121] Thus, through the above-mentioned possible design 1, the key between the control platform and the embedded device can be automatically updated, ensuring the security of data interaction between the control platform and the embedded device. At the same time, if the number of message retransmissions carried in the key update message exceeds the second preset number, the key update process is terminated. If it does not exceed, the control platform can encrypt the key update message with the private key and resend it to the embedded device to perform the key update. While ensuring that the key can be updated successfully, it can also avoid high-frequency access initiated by malicious software to the interface.

[0122] Based on the aforementioned possible design one, the embodiment of the present application further provides a possible design two for requesting a key update, which may include but is not limited to the following steps S301-S305.

[0123] Step S301: The embedded device encrypts a key request message using a public key and sends the message to the control platform. The key request message carries a request repetition count.

[0124] In an embodiment of the present application, the embedded device may send an encrypted key request message when the embedded device first establishes a connection with the control platform, or when the key on the embedded device side is lost (such as due to software offline or update, etc.), which is not specifically limited in the embodiment of the present application.

[0125] It is understandable that in some other embodiments, the embedded device may not send an encrypted key request message to the control platform, but wait for the center to issue the key. However, in this case, the embedded device will lose connection for a period of time during this period, and the timeliness is poor.

[0126] Step S302: The control platform searches for a private key corresponding to the public key according to the corresponding address of the embedded device.

[0127] Step S303: The control platform decrypts the encrypted key request message according to the found private key.

[0128] In a possible design, after the control platform decrypts the encrypted key request message according to the found private key, it can also perform a CRC check on the decrypted key request message, and execute the subsequent step S304 after the CRC check passes, otherwise the request process ends.

[0129] Step S304: If the number of request repetitions does not exceed the third preset number, the control platform generates a third response message indicating that the key request is successful, and starts the key update process, that is, starts the process of possible design one.

[0130] Step S305: The control platform encrypts the third response message using a private key and sends the encrypted message to the embedded device.

[0131] In an embodiment of the present application, after receiving the encrypted third response message, the embedded device can also decrypt the encrypted third response message using the public key corresponding to the private key, and determine whether the request is approved based on the decrypted third response message.

[0132] In one possible design, after the embedded device decrypts the encrypted third response message using the public key corresponding to the private key, it may also perform a CRC check on the third response message following the third response message.

[0133] Therefore, through the above-mentioned possible design 2, it is possible to automatically request the key when the embedded device and the control platform establish a connection for the first time or the key on the embedded device side is lost, thereby promptly starting the key update process and realizing timely and automatic key update when the connection is established for the first time or the key on the embedded device side is lost, thereby ensuring the real-time interaction between the embedded device and the control platform.

[0134] like Figure 2As shown, the second aspect of the embodiment of the present application provides an integrated control system for an embedded device, the integrated control system for the embedded device includes a control platform and an embedded device communicatively connected to the control platform, the control platform is used to encrypt a control command by a first encryption key and send the encrypted command to the embedded device, the control command carries a first target sequence code, and the first target sequence code is generated based on a sequence code function corresponding to the embedded device;

[0135] The embedded device is used to decrypt the encrypted control command by using a first decryption key corresponding to the first encryption key to obtain a decrypted control command;

[0136] Execute the decrypted control command; and

[0137] Generate a first response message for indicating success or failure of execution of the control command, and encrypt the first response message by using the first encryption key and send it to the control platform, wherein the first response message carries the first target sequence code;

[0138] The control platform is also used to find out the first decryption key corresponding to the first encryption key and the sequence code function corresponding to the embedded device based on the address corresponding to the embedded device;

[0139] Decrypting the encrypted first response message using the first decryption key;

[0140] Verifying whether the sequence code carried in the decrypted first response message is valid based on the found sequence code function; and

[0141] When the verification result is that the sequence code carried in the decrypted first response message is valid, the control result for the embedded device is determined according to the decrypted first response message.

[0142] The working process, working details and technical effects of the system provided in the second aspect of this embodiment can be found in the first aspect of the embodiment and will not be described in detail here.

[0143] Each embodiment in this document is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system 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.

[0144] Finally, it should be noted that the above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. An integrated control method for embedded devices, applied to an integrated control system for embedded devices, wherein the integrated control system for embedded devices comprises a control platform and an embedded device that is communicatively connected to the control platform, characterized in that: include: The control platform encrypts the control command using a first encryption key and sends the encrypted command to the embedded device, wherein the control command carries a first target sequence code, and the first target sequence code is generated based on a sequence code function corresponding to the embedded device; The embedded device decrypts the encrypted control command using a first decryption key corresponding to the first encryption key to obtain a decrypted control command; The embedded device executes the decrypted control command; The embedded device generates a first response message for indicating success or failure of execution of the control command, and encrypts the first response message using the first encryption key and sends the first response message to the control platform, wherein the first response message carries the first target sequence code; The control platform searches out the first decryption key corresponding to the first encryption key and the sequence code function corresponding to the embedded device based on the address corresponding to the embedded device; The control platform decrypts the encrypted first response message using the first decryption key; The control platform verifies whether the sequence code carried in the decrypted first response message is valid based on the found sequence code function; When the verification result is that the sequence code carried in the decrypted first response message is valid, the control platform determines the control result for the embedded device according to the decrypted first response message; Before the control platform encrypts the control command using the first encryption key and sends it to the embedded device, the method further includes: The control platform generates a random number; The control platform calculates the function value of the sequence code function corresponding to the embedded device based on the number of message retransmissions carried in the control command and the random number; The control platform generates an initial sequence code according to the random number, the number of message retransmissions carried in the control command and the function value; The control platform performs shift processing on each byte in the initial sequence code to obtain the first target sequence code; The calculation formula of the function value is y=f(x,n), x represents the random number, and n represents the number of message retransmissions carried in the control command.

2. The method according to claim 1, characterized in that The control command carries the number of message retransmissions, and the method further includes: When the control result for the embedded device is uncompleted control, the control platform determines whether the number of message retransmissions carried in the control command exceeds a first preset number; If the number of retransmissions of the message carried in the control command does not exceed a first preset number, the control platform re-encrypts the control command using the first encryption key and sends the re-encrypted control command to the embedded device.

3. The method according to claim 1, characterized in that Before the control platform encrypts the control command by using the first encryption key and sends it to the embedded device, the method further includes: The control platform generates a symmetric key pair corresponding to the address of the embedded device, the symmetric key pair comprising the first encryption key and the first decryption key; The control platform encrypts a key update message by a private key and sends the message to the embedded device, wherein the key update message carries the symmetric key pair and a second target sequence code, and the second target sequence code is generated based on a sequence code function corresponding to the embedded device; The embedded device decrypts the encrypted key update message using a public key corresponding to the private key; After the decryption is successful, the embedded device updates the current key pair using the decrypted symmetric key pair; The embedded device generates a second response message indicating success or failure of the key pair update, wherein the second response message carries the second target sequence code; The embedded device encrypts the second response message by using the public key and sends the encrypted message to the control platform; The control platform searches out the private key corresponding to the public key and the sequence code function corresponding to the embedded device according to the address corresponding to the embedded device; The control platform decrypts the encrypted second response message using the private key; The control platform verifies whether the sequence code carried in the decrypted second response message is valid based on the found sequence code function; When the verification result is that the sequence code carried in the decrypted second response message is valid, it is determined whether the key exchange is successful based on the decrypted second response message.

4. The method according to claim 3, characterized in that The method further comprises: After the key exchange is successful, the control platform updates the local key pair corresponding to the embedded device through the decrypted symmetric key pair.

5. The method according to claim 3, characterized in that The key update message carries the number of message retransmissions, and the method further includes: When the key exchange is unsuccessful, the control platform determines whether the number of message retransmissions carried in the key update message exceeds a second preset number; If the number of message retransmissions carried in the key update message does not exceed a second preset number, the control platform encrypts the key update message using the private key and resends the message to the embedded device.

6. The method according to claim 3, characterized in that Before the control platform generates a symmetric key pair corresponding to the address of the embedded device, the method further includes: The embedded device encrypts the key request message by using the public key and sends the message to the control platform, wherein the key request message carries the number of request repetitions; The control platform searches out the private key corresponding to the public key according to the corresponding address of the embedded device; The control platform decrypts the encrypted key request message according to the found private key; If the request is repeated for a number of times that does not exceed a third preset number of times, the control platform generates a third response message indicating that the key request is successful, and starts a key update process; The control platform encrypts the third response message using the private key and sends the encrypted message to the embedded device.

7. The method according to claim 1, characterized in that The control command and the first response message both include a verification code field. After the control platform decrypts the encrypted first response message using the first decryption key, the method further includes: The control platform verifies whether the verification code field carried in the first response message is valid; When the verification result is that the sequence code carried in the decrypted first response message is valid, the control platform determines the control result for the embedded device according to the decrypted first response message, including: When the check code field carried in the first response message is valid, and the verification result is that the sequence code carried in the decrypted first response message is valid, the control platform determines the control result for the embedded device based on the decrypted first response message.

8. The method according to claim 1, characterized in that The control command carries a control word field, a sequence code field, a status code field, a payload length field and a payload field. The control word field is used to store the control command, the sequence code field is used to store the first target sequence code, the status code field is used to store the status code, the payload field is used to store the data exchanged between the control platform and the embedded device, and the payload length field is used to store the length data of the payload field.

9. An integrated control system for an embedded device, characterized in that: It includes a control platform and an embedded device that is communicatively connected to the control platform; The control platform is used to encrypt a control command using a first encryption key and then send the encrypted command to the embedded device, wherein the control command carries a first target sequence code, and the first target sequence code is generated based on a sequence code function corresponding to the embedded device; The control platform is also used to generate a random number; Calculate the function value of the sequence code function corresponding to the embedded device based on the number of message retransmissions carried in the control command and the random number; Generate an initial sequence code according to the random number, the number of message retransmissions carried in the control command and the function value; as well as Performing a shift process on each byte in the initial sequence code to obtain the first target sequence code; The calculation formula of the function value is y=f(x,n), x represents the random number, and n represents the number of message retransmissions carried in the control command; The embedded device is used to decrypt the encrypted control command by using a first decryption key corresponding to the first encryption key to obtain a decrypted control command; Execute the decrypted control command; and Generate a first response message for indicating success or failure of execution of the control command, and encrypt the first response message by using the first encryption key and send it to the control platform, wherein the first response message carries the first target sequence code; The control platform is also used to find out the first decryption key corresponding to the first encryption key and the sequence code function corresponding to the embedded device based on the address corresponding to the embedded device; Decrypting the encrypted first response message using the first decryption key; Verifying whether the sequence code carried in the decrypted first response message is valid based on the found sequence code function; and When the verification result is that the sequence code carried in the decrypted first response message is valid, the control result for the embedded device is determined according to the decrypted first response message.