Communication method and system, electronic equipment, readable storage medium and program product
By using a private communication protocol between the atomizer and the host computer to encapsulate the data frame, the problems of security and difficulty in debugging and repair of the atomizer communication interface in the prior art are solved, and secure, private and controllable communication is achieved.
Patent Information
- Application Number
- CN202411481386.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-22
- Publication Date
- 2025-04-18
AI Technical Summary
The communication interface of existing atomizers has problems such as security and difficulty in debugging and repair. Disabling interfaces limits debugging and control, while general interfaces have uncontrollable risks.
The private communication protocol is used to encapsulate the data frames between the atomizer and the host computer to ensure that all communication data frames are encapsulated using the private communication protocol, thereby ensuring the privacy and security of the atomizer.
While ensuring the safety of the atomizer, it realizes secure and private communication with the host computer, avoids the difficulties in debugging and repair, and reduces uncontrollable risks.
Smart Images

Figure CN119854378A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to communication methods, systems, electronic devices, readable storage media, and program products. Background Art
[0002] A nebulizer is a device for converting liquid into tiny droplets, and is widely used in the fields of medical, industrial and consumer electronics. In order to achieve more functions and to improve user experience, a nebulizer is usually provided with a communication interface.
[0003] At present, in order to improve safety, the communication interface of some atomizers is a disabled interface, and such atomizers will not output any information to the outside. Although this ensures the safety of the atomizer, it is not conducive to the debugging and maintenance of the atomizer, and it is impossible to use external devices to achieve diversified control of the atomizer.
[0004] The communication interfaces of other atomizers are existing universal interfaces. For such atomizers, internal parameters can be modified through existing tools and plain text instructions, so such atomizers have uncontrollable risks. Summary of the invention
[0005] The present application provides a communication method, system, electronic device, readable storage medium and program product, which are used to provide a technical solution that can ensure the privacy and security of atomizer communication.
[0006] In a first aspect, the present application provides a communication method, which is applied to an atomizer, and the method comprises:
[0007] A first data frame encapsulated by a private communication protocol is received from a host computer, where the first data frame carries a read instruction of target data.
[0008] Based on the read instruction, a second data frame encapsulated by a private communication protocol is sent to the host computer, and the second data frame carries the target data.
[0009] According to the communication method provided by the present application, the first data frame received by the atomizer from the host computer and encapsulated by the private communication protocol, and the second data frame sent to the host computer are all encapsulated by the private communication protocol. Therefore, all data frames in the communication between the atomizer and the host computer are encapsulated by the private communication protocol, ensuring the privacy and security of the atomizer.
[0010] In a possible implementation, the first data frame and the second data frame include a first field and a second field;
[0011] The first field is used to indicate a protocol header of the first data frame or the second data frame;
[0012] The second field is used to indicate the protocol tail of the first data frame or the second data frame.
[0013] In a possible implementation, based on the read instruction, sending the second data frame encapsulated by the private communication protocol to the host computer includes:
[0014] Performing a correctness check on the first data frame based at least on the first field and the second field of the first data frame;
[0015] After the correctness check is passed, based on the read instruction in the first data frame, a second data frame encapsulated by a private communication protocol is sent to the host computer.
[0016] In a possible implementation, performing correctness checking on the first data frame based at least on the first field and the second field of the first data frame includes:
[0017] Performing a first correctness check on the first data frame based on the protocol header and the first field of the private communication protocol;
[0018] After the first correctness check is passed, a second correctness check is performed on the first data frame based on the protocol tail and the second field of the private communication protocol.
[0019] In a possible implementation manner, the first data frame and the second data frame further include at least one third field;
[0020] The third field is used to indicate the protocol version of the first data frame or the second data frame, and / or the data transmission direction of the first data frame or the second data frame, and / or the check code.
[0021] In a possible implementation, after the first correctness check passes, performing a second correctness check on the first data frame based on the protocol tail and the second field of the private communication protocol includes:
[0022] After the first correctness check is passed, performing a third correctness check on the third field based on the protocol version of the private communication protocol, and / or the data transmission direction of the private communication protocol, and / or the check code;
[0023] After the third correctness check is passed, a second correctness check is performed on the first data frame based on the protocol tail and the second field of the private communication protocol.
[0024] In a possible implementation manner, at least one third field is located between the first field and the second field.
[0025] In a possible implementation, the target data includes real-time log data or event log data.
[0026] In a possible implementation, the method further includes:
[0027] Receiving a third data frame encapsulated by a private communication protocol from the host computer, the third data frame carrying an execution instruction of a target operation;
[0028] Performing a correctness check on the third data frame based on a private communication protocol;
[0029] After the correctness check is passed, the corresponding target operation is performed based on the execution instruction.
[0030] In a possible implementation, the execution instruction includes a target parameter adjustment instruction or a target function upgrade instruction.
[0031] In a second aspect, the present application further provides a communication method, which is applied to a host computer, and the method includes:
[0032] Sending a first data frame encapsulated by a private communication protocol to the atomizer, the first data frame carrying a read instruction of the target data;
[0033] A second data frame encapsulated by a private communication protocol is received from the atomizer, where the second data frame carries target data.
[0034] According to the communication method provided by the present application, in the host computer, a first data frame encapsulated by a private communication protocol is generated and sent to the atomizer, so that communication with the atomizer can be achieved under the premise of ensuring the security of the atomizer. A second data frame encapsulated by a private communication protocol is received from the atomizer. Since the second data frame is also encapsulated by a private communication protocol, the privacy and security of the atomizer can be guaranteed.
[0035] In a possible implementation, the first data frame and the second data frame include a first field and a second field;
[0036] The first field is used to indicate a protocol header of the first data frame or the second data frame;
[0037] The second field is used to indicate the protocol tail of the first data frame or the second data frame.
[0038] In a possible implementation, obtaining target data includes:
[0039] Performing a correctness check on the second data frame based at least on the first field and the second field of the second data frame;
[0040] After the correctness check is passed, the second data frame is parsed and the target data is extracted from the second data frame.
[0041] In a possible implementation, performing correctness checking on the second data frame based at least on the first field and the second field of the second data frame includes:
[0042] Performing a first correctness check on the second data frame based on the protocol header and the first field of the private communication protocol;
[0043] After the first correctness check is passed, a second correctness check is performed on the second data frame based on the protocol tail and the second field of the private communication protocol.
[0044] In a possible implementation manner, the first data frame and the second data frame further include at least one third field;
[0045] The third field is used to indicate the protocol version of the first data frame or the second data frame, and / or the transmission direction of the first data frame or the second data frame, and / or the check code.
[0046] In a possible implementation, after the first correctness check passes, performing a second correctness check on the second data frame based on the protocol tail and the second field of the private communication protocol includes:
[0047] After the first correctness check is passed, performing a third correctness check on the third field based on the protocol version of the private communication protocol, and / or the protocol transmission direction of the private communication protocol, and / or the check code;
[0048] After the third correctness check is passed, a second correctness check is performed on the second data frame based on the protocol tail and the second field of the private communication protocol.
[0049] In a possible implementation manner, at least one third field is located between the first field and the second field.
[0050] In a possible implementation, the target data includes real-time log data or event log data of the atomizer.
[0051] In a possible implementation, the method further includes:
[0052] A third data frame encapsulated by a private communication protocol is sent to the atomizer, where the third data frame carries an execution instruction of the target operation.
[0053] In a possible implementation, the execution instruction includes a target parameter adjustment instruction or a target function upgrade instruction.
[0054] In a third aspect, the present application also provides a communication system, including:
[0055] Nebulizer;
[0056] Host computer;
[0057] The atomizer and the host computer are used to communicate with each other according to the method of any one of the first aspect and the second aspect.
[0058] In a fourth aspect, an electronic device includes: a communication interface, a processor, and a memory communicatively connected to the processor;
[0059] The communication interface is used to communicate with external devices;
[0060] Memory stores computer-executable instructions;
[0061] The processor executes the computer-executable instructions stored in the memory to implement any method of the first aspect, or to implement any method of the second aspect.
[0062] In a fifth aspect, the present application also provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement a method as described in any one of the first aspects, or to implement a method as described in any one of the second aspects.
[0063] In a sixth aspect, the present application further provides a computer program product, comprising a computer program, which, when executed by a processor, implements any method as in the first aspect, or implements any method as in the first aspect.
[0064] In the communication method, system, electronic device, computer-readable storage medium and program product provided by the embodiments of the present application, the first data frame received by the atomizer from the host computer and encapsulated using the private communication protocol, and the second data frame sent to the host computer are all encapsulated using the private communication protocol. Therefore, all data frames in the communication between the atomizer and the host computer are encapsulated using the private communication protocol, ensuring the privacy and security of the atomizer. BRIEF DESCRIPTION OF THE DRAWINGS
[0065] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0066] Figure 1 A schematic diagram of the structure of a communication system provided in an embodiment of the present application;
[0067] Figure 2 A communication method according to an embodiment of the present invention is provided. Figure 1 ;
[0068] Figure 3 A schematic diagram of a private communication protocol provided in an embodiment of the present application Figure 1 ;
[0069] Figure 4 A communication method according to an embodiment of the present invention is provided. Figure 2 ;
[0070] Figure 5A schematic diagram of a private communication protocol provided in an embodiment of the present application Figure 2 ;
[0071] Figure 6 A communication method according to an embodiment of the present invention is provided. Figure 3 ;
[0072] Figure 7 A schematic diagram of the hardware structure of a communication device provided in an embodiment of the present application.
[0073] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0074] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0075] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those generally understood by those skilled in the art to which the present application belongs. The terms used herein in the specification of the present application are only for the purpose of describing specific embodiments and are not intended to limit the present application. It is understood that the terms "first", "second", etc. used in the present application can be used to describe various information or data in this article, but these elements are not limited by these terms. These terms are only used to distinguish the first information from another information. For example, without departing from the scope of the present application, the first action information can be referred to as the second action information, and similarly, the second action information can be referred to as the first action information. Both the first action information and the second action information are action information, but they are not the same action information.
[0076] A nebulizer is a device for converting liquid into tiny droplets, and is widely used in the fields of medical, industrial and consumer electronics. In order to achieve more functions and to improve user experience, a nebulizer is usually provided with a communication interface.
[0077] At present, in order to improve safety, the communication interface of some atomizers is a disabled interface, and such atomizers will not output any information to the outside. Although this ensures the safety of the atomizer, it is not conducive to the debugging and maintenance of the atomizer, and it is impossible to use external devices to achieve diversified control of the atomizer.
[0078] The communication interfaces of other atomizers are existing universal interfaces. For such atomizers, internal parameters can be modified through existing tools and plain text instructions, so such atomizers have uncontrollable risks.
[0079] The application scenario of the embodiment of the present application is the communication between the atomizer and the host computer, and the communication method between the two can adopt a wired communication connection method or a wireless communication connection method. Among them, the wired communication connection method can include a serial port connection method, and the wireless communication connection method can adopt Bluetooth, WiFi, etc., which is not specifically limited in the embodiment of the present application. And when the two communicate, the embodiment of the present application adopts a private communication protocol to encapsulate the communication data.
[0080] For example, the atomizer and the host computer can be connected by Bluetooth. Both the atomizer and the host computer are equipped with Bluetooth modules, which are used to realize wireless communication between the atomizer and the host computer and support data transmission between the two.
[0081] For another example, the atomizer is connected to the host computer via a serial port. The atomizer has a USB interface, which is used for data transmission. When communicating with the host computer, a suitable USB cable can be used to connect the atomizer to the host computer, and the USB cable needs to support data transmission.
[0082] Reference Figure 1 , is a schematic diagram of a connection between an atomizer 10 and a host computer 20 provided in an embodiment of the present application. The atomizer 10 communicates with the host computer 20 via a USB cable 30 .
[0083] The communication method of the embodiment of the present application is described below with reference to the accompanying drawings.
[0084] Reference Figure 2 A communication method according to an embodiment of the present application may include the following steps:
[0085] S101, the host computer sends a first data frame encapsulated by a private communication protocol to the atomizer, wherein the first data frame carries a read instruction of target data.
[0086] It should be understood that before sending the first data frame encapsulated by the private communication protocol to the upper computer, Figure 1 The atomizer and the host computer are connected by wired communication connection method, or other wired or wireless communication connection methods.
[0087] It should be understood that since the first data frame is encapsulated by the host computer using a private communication protocol, the privacy and security of the data frame can be guaranteed.
[0088] Correspondingly, the atomizer receives the first data frame.
[0089] After receiving the first data frame encapsulated by the private communication protocol from the host computer, the atomizer can parse the first data frame to obtain a read instruction with the target data. It should be understood that based on the privacy and security of the first data frame, the read instruction obtained by parsing is also private and secure, and will not threaten the security of the atomizer.
[0090] Based on the above description, the security and privacy of the atomizer when receiving the first data frame can be guaranteed.
[0091] S102, the atomizer sends a second data frame encapsulated by a private communication protocol to the host computer based on the read instruction, wherein the second data frame carries the target data.
[0092] After receiving the read instruction, the atomizer obtains the target data according to the read instruction, and encapsulates the target data based on the private communication protocol to obtain a second data frame.
[0093] Likewise, since the second data frame is encapsulated by the atomizer using a private communication protocol, the privacy and security of the data frame can be guaranteed.
[0094] Correspondingly, the host computer receives the second data frame.
[0095] Based on the privacy and security of the second data frame, the security of the host computer receiving the second data frame can be guaranteed.
[0096] According to the above communication method, since the first data frame sent by the host computer and encapsulated by the private communication protocol, and the second data frame sent by the atomizer are both encapsulated by the private communication protocol, the communication data frames between the atomizer and the host computer are all encapsulated by the private communication protocol, thereby ensuring the privacy and security of the atomizer.
[0097] In some examples, reference Figure 3 The private communication protocol provided in the embodiment of the present application may include a protocol header, a protocol tail, and a data portion located between the protocol header and the protocol tail.
[0098] Among them, the protocol header is located at the beginning of the data frame, which can usually include control information and metadata to guide the transmission and processing of data. The protocol tail is located at the end of the data frame and can usually be used for data integrity and error detection.
[0099] Optionally, the first data frame and the second data frame may include a first field and a second field, wherein the first field is used to indicate a protocol header of the first data frame or the second data frame, and the second field is used to indicate a protocol tail of the first data frame or the second data frame.
[0100] In an embodiment of the present application, in order to ensure the privacy and security of the atomizer, the atomizer can use a private communication protocol to perform a correctness check on the first field and the second field of the first data frame to achieve a correctness check on the first data frame. After the correctness check passes, the atomizer obtains a read instruction for the target data and performs a corresponding read operation to obtain the target data.
[0101] In an optional embodiment, referring to Figure 4 A communication method according to an embodiment of the present application may include the following steps:
[0102] S201, the host computer sends a first data frame encapsulated by a private communication protocol to the atomizer, wherein the first data frame carries a read instruction of target data.
[0103] This step is the same as the above step S101 and will not be described again here.
[0104] S202: The atomizer performs a correctness check on the first data frame.
[0105] Optionally, the atomizer performing correctness checking on the first data frame may include:
[0106] The atomizer performs a correctness check on the first data frame based at least on the first field and the second field of the first data frame.
[0107] In this embodiment, after receiving the first data frame, the atomizer first parses the first data frame to obtain the first field and the second field. Afterwards, the atomizer can use the first field and the second field to perform a correctness check on the first data frame. It should be understood that the correctness check is to verify that the first data frame is encapsulated using a private communication protocol.
[0108] Optionally, the verification process of the first data frame by the atomizer may include:
[0109] First, the atomizer performs a first correctness check on the first data frame based on the protocol header and the first field of the private communication protocol.
[0110] It should be understood that the first correctness check can be used to check whether the first field in the first data frame and the protocol header in the private communication protocol are the same. Only when they are the same can it be determined that the first correctness check has passed.
[0111] The above operation can ensure that the protocol header of the first data frame uses the protocol header of the private communication protocol.
[0112] Second, after the first correctness check passes, the atomizer performs a second correctness check on the first data frame based on the protocol tail and the second field of the private communication protocol.
[0113] After the atomizer determines that the protocol header of the first data frame uses the protocol header of the private communication protocol, it passes the first correctness check. To further ensure security, the atomizer can perform a second correctness check on the first data frame based on the protocol tail of the private communication protocol and the second field.
[0114] Similarly, the second correctness check can be used to check whether the second field in the first data frame and the protocol tail in the private communication protocol are the same. Only when they are the same can it be determined that the second correctness check has passed.
[0115] Based on the above verification process, the atomizer first performs a first correctness check on the first data frame, and only after the first correctness check, the first data frame will be subjected to a second correctness check. If the first correctness check fails, the second correctness check will not be performed. Therefore, such an operation can not only ensure the security and privacy of the atomizer, but also save the energy consumption of the atomizer.
[0116] In some examples, reference Figure 5 In order to further ensure the security and privacy of the atomizer, the private communication protocol may further include at least one of the protocol version, the transmission direction of the data in the protocol, and the check code. Based on this, the first data frame encapsulated by the private communication protocol should include at least one of the protocol version, the transmission direction of the data in the protocol, and the check code.
[0117] Optionally, the above-mentioned first data frame may also include at least one third field, and the at least one third field is used to indicate the protocol version of the first data frame, and / or the data transmission direction of the first data frame or the second data frame, and / or a check code.
[0118] Exemplarily, when the first data frame includes a protocol version, it can be considered that the first data frame includes one third field. When the first data frame includes a protocol version, a data transmission direction, and a verification code, it can be considered that the first data frame includes three third fields.
[0119] In the case where the first data frame has the above structure, after the first correctness check passes, the atomizer may perform a second correctness check on the first data frame based on the protocol tail of the private communication protocol and the second field, which may include:
[0120] After the first correctness check passes, the atomizer performs a third correctness check on the third field based on the protocol version of the private communication protocol, and / or the data transmission direction of the private communication protocol, and / or the check code.
[0121] After the third correctness check is passed, the atomizer performs a second correctness check on the first data frame based on the protocol tail and the second field of the private communication protocol.
[0122] The above-mentioned third correctness check may include: the atomizer uses the protocol version of the private communication protocol to perform a correctness check on the communication version in the third field, uses the data transmission direction of the private communication protocol to perform a correctness check on the data transmission direction in the third field, and uses the check code of the private communication protocol to perform a correctness check on the check code in the third field.
[0123] It should be understood that whichever of the above fields is included in at least one third field in the first data frame, the embodiment of the present application will perform correctness verification on the corresponding field.
[0124] In some embodiments, the embodiments of the present application add a correctness check of the third field by the atomizer between the correctness check of the first field and the correctness check of the second field to further improve the security of atomizer communication.
[0125] As a specific example, the at least one third field includes a protocol version of the first data frame. Based on the protocol version of the private communication protocol, and / or the data transmission direction of the private communication protocol, and / or the check code, the atomizer performs a third correctness check on the third field as follows:
[0126] The atomizer verifies the protocol version of the first data frame based on the protocol version of the private communication protocol. When the protocol version of the first data frame is the same as the protocol version of the private communication protocol, the atomizer determines that the third correctness check passes.
[0127] As another specific example, the at least one third field includes the protocol version and data transmission direction of the first data frame. Based on the protocol version of the private communication protocol, and / or the data transmission direction of the private communication protocol, and / or the check code, the atomizer performs a third correctness check on the third field as follows:
[0128] The atomizer verifies the protocol version of the first data frame based on the protocol version of the private communication protocol. After determining that the protocol version of the first data frame is the same as the protocol version of the private communication protocol, the atomizer further determines whether the data transmission direction of the first data frame is the same as the data transmission direction of the private communication protocol. After determining that the data transmission direction of the first data frame is the same as the data transmission direction of the private communication protocol, the atomizer determines that the third correctness check has passed.
[0129] As another specific example, the at least one third field includes a protocol version, a data transmission direction, and a check code of the first data frame. Based on the protocol version of the private communication protocol, and / or the data transmission direction of the private communication protocol, and / or the check code, the atomizer performs a third correctness check on the third field as follows:
[0130] The atomizer verifies the protocol version of the first data frame based on the protocol version of the private communication protocol. After determining that the protocol version of the first data frame is the same as the protocol version of the private communication protocol, the atomizer further determines whether the data transmission direction of the first data frame is the same as the data transmission direction of the private communication protocol. After determining that the data transmission direction of the first data frame is the same as the data transmission direction of the private communication protocol, the atomizer further determines whether the check code of the first data frame is the same as the check code of the private communication protocol. After determining that the check code of the first data frame is the same as the check code of the private communication protocol, the atomizer determines that the third correctness check has passed.
[0131] It should be understood that as a preferred technical solution, the private communication protocol includes a protocol version, a transmission direction of data in the protocol, and a check code. At this time, the third field includes the protocol version, data transmission direction, and a check code of the first data frame or the second data frame.
[0132] It should be further understood that in some examples, the security requirements of the atomizer and the energy consumption of the atomizer may be comprehensively considered, and at least one of the protocol version, data transmission direction, and check code may be set in the private communication protocol.
[0133] Optional, see Figure 5 The protocol version, data transmission direction and checksum in the private communication protocol are located between the protocol header and the protocol tail, so the third field is located between the first field and the second field. Based on this, it can not only meet the structural requirements of the protocol, but also improve the security and privacy of the atomizer communication.
[0134] Reference Figure 5The protocol version and data transmission direction in the private communication protocol are located before the data part, and the check code is located after the data part. Based on this structure, when the atomizer performs a correctness check on the first data frame, it can first check the correctness of the protocol version and data transmission direction, obtain the data part, and then perform a corresponding correctness check on the check code to further ensure security.
[0135] As a specific example, the verification of the first data frame by the atomizer based on the private communication protocol may include:
[0136] First, the atomizer determines whether the first field in the first data frame is correct according to the protocol header. After determining that the first field is correct, the atomizer receives the protocol version and data transmission direction in the third field of the first data frame.
[0137] Second, the atomizer determines whether the protocol version in the third field is correct according to the protocol version of the private communication protocol, and after determining that the protocol version in the third field is correct, continues to perform correctness check on the first data frame.
[0138] Third, the atomizer determines whether the data transmission direction in the third field is from the host computer to the atomizer according to the data transmission direction of the private communication protocol. It should be understood that different data transmission directions are used to distinguish between the sender and the receiver.
[0139] Fourth, the atomizer determines a read instruction, which is used to read corresponding target data.
[0140] Fifth, the atomizer receives the check code: the check code uses CRC check, and the previous data is accumulated to get the CRC value. The atomizer uses CRC check to ensure the accuracy of all data.
[0141] Sixth, the atomizer determines whether the third field is correct based on the protocol version of the private communication protocol: successful reception of the third field indicates that the first data frame has been successfully received and parsed.
[0142] Optionally, the data portion may include target data. In the communication between the atomizer and the host computer, the data portion in the first data frame sent by the host computer to the atomizer includes a read instruction.
[0143] S203, after the correctness check of the first data frame is passed, the atomizer uses a private communication protocol to encapsulate the target data to obtain a second data frame.
[0144] After the atomizer passes the correctness check on the first data frame, the atomizer obtains the read instruction and reads the target data based on the read instruction. Afterwards, the atomizer encapsulates the target data using the private communication protocol to obtain a second data frame. It should be understood that the second data frame is encapsulated using the private communication protocol, so that the privacy of the communication process can be guaranteed while ensuring security.
[0145] Exemplarily, the atomizer encapsulates the target data using a private communication protocol, which may include: the atomizer encapsulates the target data according to the protocol header, protocol version (the protocol version of the atomizer for the current host computer), data transmission direction (from the atomizer to the host computer), check code and protocol tail in the private communication protocol to obtain a second data frame.
[0146] Optionally, the target data in the second data frame may include real-time log data or event log data.
[0147] Among them, the real-time log data may include real-time status data of the atomizer when it is heated or charged (including temperature, voltage, current, etc.). This type of log data is used to enable users to judge the status of the atomizer in real time.
[0148] Event log data may include data generated when the atomizer is operated, such as: start heating, stop heating, start charging, stop charging, error code, sleep wake-up, lock, unlock, etc.
[0149] S204, the atomizer sends a second data frame packaged using a private communication protocol to the host computer.
[0150] Correspondingly, the host computer receives the second data frame.
[0151] It can be known from the above description that the second data frame also includes a first field and a second field.
[0152] In some examples, the second data frame also includes a third field, where the third field is used to indicate a protocol version of the second data frame, and / or a data transmission direction of the second data frame, and / or a check code.
[0153] S205: The host computer performs a correctness check on the second data frame.
[0154] In this embodiment, the way in which the host computer verifies the correctness of the second data frame can refer to the way in which the atomizer verifies the correctness of the first data frame, which will not be repeated here.
[0155] S206, the host computer obtains the target data after the correctness check of the second data frame passes.
[0156] After obtaining the target data, the host computer can display the target data, which helps users better understand the real-time data of the atomizer and the event data that occurs throughout the life cycle.
[0157] Optional, see Figure 6 , the above communication method may further include the following steps:
[0158] S301, the machine sends a third data frame encapsulated by a private communication protocol to the atomizer, wherein the third data frame carries an execution instruction of a target operation.
[0159] Correspondingly, the atomizer receives the third data frame encapsulated by the private communication protocol from the host computer.
[0160] It should be understood that, since the third data frame is encapsulated by the host computer using a private communication protocol, the privacy and security of the data frame can be guaranteed.
[0161] After receiving the third data frame encapsulated by the private communication protocol from the host computer, the atomizer performs a correctness check on the third data frame based on the private communication protocol. After the correctness check passes, the atomizer obtains the execution instruction with the target operation. It should be understood that based on the privacy and security of the third data frame, the execution instruction obtained by the atomizer is also private and secure, and will not threaten the security of the atomizer.
[0162] In this embodiment, the atomizer performs the correctness check on the third data frame based on the private communication protocol in the same way as the atomizer verifies the first data frame, which will not be described in detail here. After the atomizer performs the correctness check on the third data frame, it obtains the execution instruction, which can ensure the security of the atomizer and avoid the execution instruction from causing unsafe threats to the atomizer.
[0163] After the correctness check of the third data frame is passed, the atomizer performs a corresponding target operation based on the execution instruction.
[0164] The execution instruction may include a target parameter adjustment instruction or a target function upgrade instruction. It should be understood that the execution instruction exemplified in this embodiment is used to adjust the target parameter of the atomizer or upgrade the target function, but in different application scenarios, according to different needs, the execution instruction may also include other functional instructions, which is not specifically limited in this embodiment of the present application.
[0165] Exemplarily, the target parameter adjustment instruction can be used to obtain, modify, and reset the parameters stored inside the atomizer so as to diversify the use of the atomizer. For example, the heating curve, UI display parameters, error code threshold, etc. of the atomizer can be adjusted. Adjusting the corresponding target parameters through the target parameter adjustment instruction can make it more convenient to operate the atomizer without having to adjust it by updating the firmware.
[0166] After obtaining the target function upgrade instruction, the atomizer can upgrade the functional modules of the corresponding area according to the target function upgrade instruction. The upgrade data content involved in the target function upgrade instruction can be encapsulated into the third data frame using a bin file.
[0167] In some possible implementations, a private host computer tool is installed in the host computer, and the host computer tool is used to receive the second data frame sent by the atomizer. The host computer tool has an encryption function, and even if the administrator's verification authority is mistakenly obtained, the host computer tool cannot be used.
[0168] In this embodiment, when installing the private host computer tool in the host computer, it is necessary to log in after verification, and the host computer tool can be used only after passing the verification. The steps are as follows:
[0169] Step 101: When the host computer tool is installed for the first time, the host computer MAC address and user name obtained by operating the Get Machine Code button of the host computer tool are displayed in the host computer. The host computer MAC address and user name are unique and will not be duplicated.
[0170] Step 102: Send the host computer MAC address and user name to the administrator to apply for permission. The administrator reconfirms the host computer MAC address based on the user name to ensure that the user name and the host computer MAC address are consistent.
[0171] Step 103: The administrator obtains the encrypted password through the encryption algorithm and the user name, and sends it back to the host computer. The encryption algorithm used by the administrator uses a true random number, which cannot be unilaterally cracked at present.
[0172] Step 104: After the host computer obtains the password, it can unlock the host computer tool by using the host computer tool to enter the operation interface of the host computer tool. The host computer tool will remember the password to achieve automatic login in the future.
[0173] Based on the above description, in the communication method of the embodiment of the present application, a private communication protocol is used between the atomizer and the host computer. When the data of the atomizer is viewed using an ordinary serial port tool, all the data will be garbled and cannot be parsed and identified.
[0174] The private communication protocol of the embodiment of the present application has a strict structure and verification mechanism, which ensures the confidentiality of data transmission while also ensuring the security of the atomizer and the host computer.
[0175] Reference Figure 1 The embodiment of the present application also provides a communication system, including an atomizer 10 and a host computer 20. Among them, the atomizer 10 can be connected to the host computer 20 for communication through a USB cable 30. It should be understood that the communication method between the atomizer 10 and the host computer 20 can also adopt other wired communication connection methods or wireless communication connection methods. Among them, the wireless communication connection method can adopt Bluetooth, WiFi, etc., and the embodiment of the present application does not specifically limit this.
[0176] The atomizer 10 and the host computer 20 are used to communicate according to the communication method of the above embodiment.
[0177] According to the description of the communication method in the above embodiment, since the first data frame sent by the host computer and encapsulated by the private communication protocol, and the second data frame sent by the atomizer are both encapsulated by the private communication protocol, the communication data frames between the atomizer and the host computer are all encapsulated by the private communication protocol, so the system can ensure the privacy and security of the atomizer.
[0178] Reference Figure 7 , is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application. The electronic device 200 provided in an embodiment of the present application includes: a processor 2001, a memory 2002 and a communication interface 2003.
[0179] The memory 2002 is used to store a computer program, which includes program instructions.
[0180] The communication interface 2003 is used to receive signals from other communication devices and transmit them to the processor 2001 , or to send signals from the processor 2001 to other communication devices.
[0181] The processor 2001 is used to execute the above program instructions so that the communication device 200 implements the communication method provided in the above embodiment. Its implementation principle and technical effect are similar to those of the above related embodiments, and will not be repeated here.
[0182] Optionally, the processor 2001 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), etc. A general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc. The steps of the method disclosed in the present application may be directly implemented as being executed by a hardware processor, or may be implemented by a combination of hardware and software modules in the processor.
[0183] The memory 2002 may include a random access memory (RAM), or a non-volatile memory (NVM), etc.
[0184] The communication interface 2003 may be a serial interface, a parallel interface, a network interface, or other special interfaces, etc., which is not limited in the embodiments of the present application.
[0185] The embodiment of the present application also provides a computer-readable storage medium. The computer-readable storage medium stores computer-executable instructions. When the computer-executable instructions are executed by a processor, the above communication method is implemented.
[0186] The communication methods described in the above embodiments may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. If implemented in software, the functions may be stored as one or more instructions or codes on a computer-readable medium or transmitted on a computer-readable medium. Computer-readable media may include computer storage media and communication media, and may also include any medium that can transfer a computer program from one place to another. The storage medium may be any target medium that can be accessed by a computer.
[0187] In one possible implementation, computer readable media may include RAM, ROM, compact disc read-only memory (CD-ROM) or other optical disk storage, magnetic disk storage or other magnetic storage devices, or any other medium that is intended to carry or store the desired program code in the form of instructions or data structures and can be accessed by the computer. Moreover, any connection is appropriately referred to as a computer readable medium. For example, if the software is transmitted from a website, server or other remote source using a coaxial cable, fiber optic cable, twisted pair, digital subscriber line (DSL) or wireless technology (such as infrared, radio and microwave), the coaxial cable, fiber optic cable, twisted pair, DSL or wireless technology such as infrared, radio and microwave are included in the definition of medium. Disks and optical disks as used herein include optical disks, laser disks, optical disks, digital versatile disks (DVD), floppy disks and Blu-ray disks, where disks usually reproduce data magnetically, while optical disks reproduce data using laser optical principles. Combinations of the above should also be included in the scope of computer readable media.
[0188] An embodiment of the present application provides a computer program product, which includes a computer program. When the computer program is executed, the computer executes the above communication method.
[0189] The above specific implementation methods further illustrate the purpose, technical solutions and beneficial effects of the present application in detail. It should be understood that the above are only specific implementation methods of the present application and are not used to limit the protection scope of the present application. Any modifications, equivalent substitutions, improvements, etc. made on the basis of the technical solutions of the present application should be included in the protection scope of the present application.
Claims
1. A communication method, characterized in that: Applied to an atomizer, the method comprises: Receiving a first data frame encapsulated by a private communication protocol from a host computer, wherein the first data frame carries a read instruction of target data; Based on the read instruction, a second data frame encapsulated by the private communication protocol is sent to the host computer, where the second data frame carries the target data.
2. The method according to claim 1, characterized in that The first data frame and the second data frame include a first field and a second field; The first field is used to indicate a protocol header of the first data frame or the second data frame; The second field is used to indicate a protocol tail of the first data frame or the second data frame.
3. The method according to claim 2, characterized in that The sending, based on the read instruction, to the host computer, a second data frame encapsulated by the private communication protocol comprises: Performing a correctness check on the first data frame based at least on the first field and the second field of the first data frame; After the correctness check is passed, based on the read instruction in the first data frame, a second data frame encapsulated by the private communication protocol is sent to the host computer.
4. The method according to claim 3, characterized in that The performing correctness checking on the first data frame based at least on the first field and the second field of the first data frame comprises: Performing a first correctness check on the first data frame based on the protocol header of the private communication protocol and the first field; After the first correctness check passes, a second correctness check is performed on the first data frame based on the protocol tail of the private communication protocol and the second field.
5. The method according to claim 4, characterized in that The first data frame and the second data frame further include at least one third field; The at least one third field is used to indicate a protocol version of the first data frame or the second data frame, and / or a data transmission direction of the first data frame or the second data frame, and / or a check code.
6. The method according to claim 5, characterized in that After the first correctness check passes, performing a second correctness check on the first data frame based on the protocol tail of the private communication protocol and the second field includes: After the first correctness check passes, performing a third correctness check on the third field based on the protocol version of the private communication protocol, and / or the data transmission direction of the private communication protocol, and / or the check code; After the third correctness check passes, a second correctness check is performed on the first data frame based on the protocol tail of the private communication protocol and the second field.
7. The method according to claim 5, characterized in that The at least one third field is located between the first field and the second field.
8. The method according to any one of claims 1 to 6, characterized in that: The target data includes real-time log data or event log data.
9. The method according to any one of claims 1 to 6, characterized in that: The method further comprises: Receiving a third data frame encapsulated by the host computer using a private communication protocol, wherein the third data frame carries an execution instruction of a target operation; Performing a correctness check on the third data frame based on the private communication protocol; After the correctness check is passed, a corresponding target operation is performed based on the execution instruction.
10. The method according to claim 9, characterized in that The execution instruction includes a target parameter adjustment instruction or a target function upgrade instruction.
11. A communication method, characterized in that: Applied to a host computer, the method includes: Sending a first data frame encapsulated by a private communication protocol to the atomizer, wherein the first data frame carries a read instruction of the target data; A second data frame encapsulated by the private communication protocol is received from the atomizer, where the second data frame carries the target data.
12. The method according to claim 11, characterized in that The first data frame and the second data frame include a first field and a second field; The first field is used to indicate a protocol header of the first data frame or the second data frame; The second field is used to indicate a protocol tail of the first data frame or the second data frame.
13. The method according to claim 12, characterized in that The acquiring of the target data comprises: Performing a correctness check on the second data frame based at least on the first field and the second field of the second data frame; After the correctness check is passed, the second data frame is parsed and the target data is extracted from the second data frame.
14. The method according to claim 13, characterized in that The performing correctness checking on the second data frame based at least on the first field and the second field of the second data frame comprises: Performing a first correctness check on the second data frame based on the protocol header of the private communication protocol and the first field; After the first correctness check passes, a second correctness check is performed on the second data frame based on the protocol tail of the private communication protocol and the second field.
15. The method according to claim 14, characterized in that The first data frame and the second data frame further include at least one third field; The third field is used to indicate the protocol version of the first data frame or the second data frame, and / or the transmission direction of the first data frame or the second data frame, and / or the check code.
16. The method according to claim 15, characterized in that After the first correctness check passes, performing a second correctness check on the second data frame based on the protocol tail of the private communication protocol and the second field includes: After the first correctness check passes, performing a third correctness check on the third field based on the protocol version of the private communication protocol, and / or the protocol transmission direction of the private communication protocol, and / or the check code; After the third correctness check is passed, a second correctness check is performed on the second data frame based on the protocol tail of the private communication protocol and the second field.
17. The method according to claim 15, characterized in that The at least one third field is located between the first field and the second field.
18. The method according to any one of claims 11 to 17, characterized in that: The target data includes real-time log data or event log data of the atomizer.
19. The method according to any one of claims 11 to 17, characterized in that: The method further comprises: A third data frame encapsulated by the private communication protocol is sent to the atomizer, wherein the third data frame carries an execution instruction of the target operation.
20. The method according to claim 19, characterized in that The execution instruction includes a target parameter adjustment instruction or a target function upgrade instruction.
21. A communication system, characterized in that: include: Nebulizer; Host computer; The atomizer and the host computer are used to communicate with each other according to the method described in any one of claims 1-20.
22. An electronic device, characterized in that: include: A communication interface, a processor, and a memory communicatively connected to the processor; The communication interface is used to communicate with external equipment; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the method according to any one of claims 1-10, or implements the method according to any one of claims 10-20.
23. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method according to any one of claims 1 to 10, or to implement the method according to any one of claims 11 to 20.
24. A computer program product, characterized in that The invention comprises a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 10, or implements the method according to any one of claims 11 to 20.