Communication method, communication system, first terminal, and storage medium

By using a communication protocol to splice and transmit information in smart device communication, the redundancy problem caused by fixed-length transmission is solved, flexible data transmission formats and device adaptability are achieved, and transmission efficiency is enhanced.

CN115701062BActive Publication Date: 2025-11-07WUHU MIDEA KITCHEN & BATH APPLIANCES MFG CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202110847898.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-07-27
Publication Date
2025-11-07
Estimated Expiration
2041-07-27

AI Technical Summary

Technical Problem

In existing technologies, the communication transmission of smart devices is limited by fixed length and fixed content, resulting in useless information occupying transmission space and making it impossible to adjust the size of the transmitted content according to the differentiated needs of devices.

Method used

In the communication method between the first terminal and the second terminal, the transmitted information is spliced ​​together according to the communication protocol to form transmitted data, including a first-level index and a second-level index. The inclusion method of the index is determined according to the terminal type to avoid useless data occupying space and to achieve a flexible transmitted data format.

Benefits of technology

It achieves flexibility and scalability in data transmission, avoids redundant data, and can adjust the length and content of transmitted data as needed to adapt to the differentiated needs of different devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115701062B_ABST
    Figure CN115701062B_ABST
Patent Text Reader

Abstract

The application discloses a communication method, a communication system, a first terminal and a storage medium. The communication method comprises the following steps: a first terminal determines transmission information according to a trigger instruction, splices the transmission information according to a communication protocol to form transmission data, and sends the transmission data to a second terminal; the second terminal receives the transmission data, parses the transmission data to obtain the transmission information of the first terminal, and responds to the transmission information of the first terminal. According to the communication method, the first terminal splices the transmission information required by the first terminal to generate transmission data, so that the problem that the effective bytes are not many due to the transmission of useless information is avoided, and the flexibility and expansibility of the transmission data are increased.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of data communication, and in particular to a communication method, a communication system, a first terminal and a storage medium. BACKGROUND

[0002] Currently, the communication transmission content of smart phones and smart devices has size limitations. In the existing technology, fixed length and fixed content are used for transmission. The disadvantage is that each time the content is transmitted together, in fact, there are differences between different devices, and part of the content is not needed for some devices, but it is also transmitted together, occupying transmission space, and also directly limiting the length of the protocol. SUMMARY

[0003] The embodiments of the present application provide a communication method, a communication system, a first terminal and a storage medium.

[0004] The communication method of the embodiments of the present application is used for communication between a first terminal and a second terminal, and is characterized in that the communication method comprises:

[0005] The first terminal determines transmission information according to a trigger instruction, splices the transmission information according to a communication protocol to form transmission data, and sends the transmission data to the second terminal.

[0006] The second terminal receives the transmission data, parses the transmission data to obtain the transmission information of the first terminal, and responds to the transmission information of the first terminal.

[0007] In some embodiments, the trigger instruction is generated by the first terminal according to an instruction sent by the second terminal, or

[0008] The trigger instruction is generated by the first terminal itself.

[0009] In some embodiments, the communication protocol includes a first index and a second index, the first index includes a category of the first terminal, and the second index includes an attribute of the first terminal. The splicing of the transmission information according to the communication protocol to form the transmission data comprises:

[0010] According to the type of the first terminal, it is determined whether the transmission data includes the second index or includes the first index and the second index.

[0011] In some embodiments, the parsing of the transmission data to obtain the transmission information of the first terminal comprises:

[0012] Obtaining the total length of the content of the transmission data.

[0013] obtaining the content length of the parsed index;

[0014] obtaining the parsing result in a case where the content length of the parsed index is equal to the total content length of the transmission data;

[0015] continuing the parsing in a case where the content length of the parsed index is less than the total content length of the transmission data.

[0016] In some embodiments, the transmission data comprises the secondary index, and the secondary index comprises an attribute flag,

[0017] The obtaining the content length of the parsed index comprises:

[0018] parsing the secondary index to obtain the attribute flag;

[0019] obtaining the content length of the secondary index according to the attribute flag, so as to obtain the content length of the parsed index.

[0020] In some embodiments, the transmission data comprises an index group, and the index group comprises a primary index and a secondary index, and the primary index comprises an index length, and the index length represents the length of the index group,

[0021] The obtaining the content length of the parsed index comprises:

[0022] parsing the primary index to obtain the index length;

[0023] obtaining the content length of the parsed index according to the index length.

[0024] In some embodiments, the parsing the transmission data to obtain the transmission information of the first terminal comprises:

[0025] obtaining the content length of the parsed secondary index and the content length of the parsed primary index in the index group;

[0026] obtaining the parsing result of the index group in a case where the content length of the parsed secondary index plus the content length of the parsed primary index is equal to the index length, and then obtaining the transmission information of the first terminal;

[0027] continuing the parsing in a case where the content length of the parsed secondary index plus the content length of the parsed primary index is less than the index length.

[0028] In some embodiments, the communication protocol comprises a plurality of protocol groups, each of the protocol groups comprises the primary index and the secondary index, and in each of the protocol groups, the primary index is located before the secondary index.

[0029] A communication system according to an embodiment of the present application comprises a first terminal and a second terminal,

[0030] The first terminal is configured to determine transmission information according to a trigger instruction, splice the transmission information according to a communication protocol to form transmission data, and send the transmission data to the second terminal.

[0031] The second terminal is configured to receive the transmission data, parse the transmission data to obtain the transmission information of the first terminal, and respond to the transmission information of the first terminal.

[0032] A first terminal according to an embodiment of the present application comprises a processor configured to:

[0033] determine transmission information according to a trigger instruction, splice the transmission information according to a communication protocol to form transmission data, and send the transmission data to a second terminal, so that the second terminal parses the transmission data to obtain the transmission information of the first terminal and responds to the transmission information of the first terminal.

[0034] The present application also provides a computer readable storage medium having a computer program stored thereon, wherein the program, when executed by a processor, implements the steps of the communication method according to any one of the above embodiments.

[0035] The communication method, the communication system and the storage medium avoid the problem of too few valid bytes caused by transmitting useless information together, and increase the flexibility and expansibility of the transmission data.

[0036] Additional aspects and advantages of the present application will be made apparent by the following description and the accompanying drawings. BRIEF DESCRIPTION OF DRAWINGS

[0037] The above and / or additional aspects and advantages of the present application will become apparent and be readily understood from the following description, taken in conjunction with the accompanying drawings, in which:

[0038] Figure 1 is a flowchart of a communication method according to an embodiment of the present application;

[0039] Figure 2 is another flowchart of a communication method according to an embodiment of the present application;

[0040] Figure 3 is another flowchart diagram of a communication method according to an embodiment of the present application;

[0041] Figure 4 is another flowchart diagram of a communication method according to an embodiment of the present application;

[0042] Figure 5 is another flowchart diagram of a communication method according to an embodiment of the present application;

[0043] Figure 6 is another flowchart diagram of a communication method according to an embodiment of the present application;

[0044] Figure 7 is a module diagram of a communication system according to an embodiment of the present application. DETAILED DESCRIPTION

[0045] Embodiments of the present application are described below by way of example with reference to the accompanying drawings. The same or similar components are denoted by the same or similar reference numerals throughout the drawings, and repeated description thereof is omitted. The embodiments described below are examples for explaining the present application and are not intended to be limiting of the present application.

[0046] In the description of embodiments of the present application, the terms "first", "second", etc. are used only for the purpose of description, and are not to be construed as indicating or implying relative importance or implying the number of the technical features indicated. Thus, the features defined with "first", "second", etc. can explicitly or implicitly include one or more of the features. In the description of embodiments of the present application, the meaning of "plurality" is two or more.

[0047] Referring to Figure 1 , the communication method provided by the embodiments of the present application is used for communication between a first terminal 100 and a second terminal 200, and includes:

[0048] S10, the first terminal 100 determines the transmission information according to the trigger instruction, splices the transmission information according to the communication protocol to form transmission data, and sends the transmission data to the second terminal 200;

[0049] S20, the second terminal 200 receives the transmission data, parses the transmission data to obtain the transmission information of the first terminal 100, and responds to the transmission information of the first terminal 100.

[0050] In the above communication method, the first terminal 100 splices the transmission information required by itself to generate transmission data, which avoids the problem that the effective bytes are not much due to the transmission of useless information, and increases the flexibility and expansibility of the transmission data.

[0051] Specifically, the communication between the first terminal and the second terminal on the market currently adopts a fixed length and fixed content form, that is, the length of the transmission data is fixed, and the position of each content in the transmission data is fixed, so that the transmission data can be parsed according to the position of the content, which makes the transmission data occupy the position of the content even if it does not include some content, which not only causes data redundancy, but also makes it difficult to adjust the length and content of the transmission data as needed.

[0052] The communication method of the embodiment of the application splices the transmission information according to the communication protocol to form the transmission data. The transmission data does not need a fixed position, and only needs to splice the content of the transmission information as needed, without using useless data to occupy the position, so that the redundant data is eliminated.

[0053] For the convenience of understanding, the following will be described. Take the first terminal 100 as an air conditioner and the second terminal 200 as a mobile phone as an example. In the air conditioner, every 4 hours, the current temperature state needs to be uploaded to the mobile phone. Every 4 hours, the air conditioner generates a trigger instruction, determines the transmission information "the current temperature of the air conditioner is 24°", splices the transmission information "the current temperature of the air conditioner is 24°" according to the communication protocol, forms the transmission data "the current temperature of the air conditioner is 24°", and sends the transmission data "the current temperature of the air conditioner is 24°" to the mobile phone.

[0054] It is worth noting that the transmission data can be quaternary, octal, hexadecimal, thirty-two, etc., which is not specifically limited here. In one example, the transmission data can be expressed in hexadecimal.

[0055] The first terminal 100 can be a control terminal, which can be a mobile phone, a computer, a console, etc. At this time, the second terminal 200 can be a device terminal, which can be an air conditioner, a water purifier, an oil smoke extractor, a dishwasher, etc. The first terminal 100 can also be a device terminal, and at this time, the second terminal 200 can be a control terminal. The control terminal can be installed with an application program (APP) for controlling the device terminal. The user can control or query the state of the device terminal by starting the application program on the control terminal and operating the graphical user interface of the application program.

[0056] It is worth supplementing that according to the general standard of the communication protocol, the first twelve bits of all transmission data are the message header, the last bit is the checksum, and the middle part is the message body. Among them, the first bit of the message header is the header code, the second bit is the message length, the third bit is the type of household appliance, the fourth to ninth bits are the household appliance ID, the tenth bit is the message type, the eleventh bit is the message body command, and the twelfth bit is the command execution. The communication method of the embodiment of the application mainly aims at the message body part. Different communication methods can be represented by the tenth bit message type, so as to distinguish the transmission data formed according to different communication protocols, and facilitate the second terminal 200 to parse.

[0057] In some embodiments, the trigger instruction is generated by the first terminal 100 according to an instruction sent by the second terminal 200, or

[0058] The trigger instruction is generated by the first terminal 100 itself.

[0059] In this way, the trigger instruction is generated, which provides a basis for determining the transmission information.

[0060] There are many cases where the trigger instruction is generated by the first terminal 100 according to an instruction sent by the second terminal 200, for example, the first terminal 100 is a device terminal, and the second terminal 200 is a control terminal. The control terminal sends an instruction to the device terminal to upload the status of the device terminal, and the device terminal generates a trigger instruction according to the instruction sent by the control terminal to upload the current status to the control terminal. For another example, the first terminal 100 is a device terminal, and the second terminal 200 is a control terminal. The control terminal sends an instruction to the device terminal to perform an operation and upload the operation completion status, and the device terminal performs the operation according to the instruction. After the operation is completed, the device terminal generates a trigger instruction according to the instruction to upload the operation completion status to the control terminal to upload the operation completion information to the control terminal.

[0061] There are many cases where the trigger instruction is generated by the first terminal 100 itself, for example, the first terminal 100 is a device terminal, and the state of the device terminal changes, then a trigger instruction is automatically generated to upload the change of the state of the device terminal to the control terminal in time. For another example, the first terminal 100 is a control terminal, and the control terminal generates a trigger instruction to control the device terminal to perform an operation.

[0062] In some embodiments, the communication protocol includes a first index and a second index, the first index includes the type of the first terminal 100, and the second index includes the attribute of the first terminal 100. The step S10 includes:

[0063] S11, determining whether the transmission data includes the second index or includes the first index and the second index according to the type of the first terminal 100.

[0064] In this way, when the first terminal 100 is a control terminal, the transmission data does not need to include the first index, so that the transmission data is more concise, and when the first terminal 100 is a device terminal, the transmission data includes the first index and the second index, which facilitates the second terminal 200 to analyze the transmission data.

[0065] Specifically, the splicing of the transmission information according to the communication protocol can be understood as follows: according to the communication protocol and the categories and attributes of the transmission information, the content of the transmission information is split according to different categories, and the content of the transmission information of the same category is split according to the attributes, the content of the transmission information is spliced according to the categories and the attributes to form transmission data, or the content of the transmission information is split according to different attributes, and the content of the transmission information is spliced according to the attributes to form transmission data.

[0066] In this way, the transmission data does not need to have a fixed position, and only needs to be spliced according to the content of the transmission information, without using useless data to occupy space, thereby eliminating redundant data; the transmission data can include multiple category data and multiple attribute data, so that one transmission data can include attribute data of multiple categories, that is, the transmission data formed according to the communication method of the embodiment of the application can load different categories of transmission information together, thereby solving the problem that one transmission data can only contain one category, and in the case that the device end is a device component composed of multiple categories, only one transmission data is needed to control multiple categories of devices, thereby enriching the content of the interaction between the first terminal 100 and the second terminal 200. The communication method of the embodiment of the application can also adjust the length of the transmission data as needed, without being limited by the template length.

[0067] The category means the type of the device, such as air conditioner, water purifier, and oil smoke extractor, and the attribute means the attribute of the content of the transmission information, such as temperature and switch state. For the convenience of understanding, the following examples are given: for example, the transmission information includes "air conditioner is turned on" and "air conditioner temperature is adjusted to 25°", the category of the transmission information is "air conditioner", and the attribute of the transmission information is "turn on" and "temperature is adjusted to 25°" under the category "air conditioner"; for another example, the transmission information includes "washing machine reports running state", the category of the transmission information is "washing machine", and the attribute of the transmission information is "reports running state"; for another example, the transmission information includes "water purifier state is on", the category of the transmission information is "water purifier", and the attribute of the transmission information is "state is on".

[0068] Each category includes multiple attributes, which can be understood as that the secondary index is attached to the primary index. It is worth noting that the data representing the attribute content of the secondary index can represent different attribute contents when attached to different categories of the primary index, for example, when the data representing the attribute content of the secondary index is "0001", it can represent "turn on" when attached to the category "air conditioner", and it can represent "turn off" when attached to the category "oil smoke extractor"; for another example, when the data representing the attribute content of the secondary index is "0101", it can represent "adjust temperature to 25°" when attached to the category "air conditioner", and it can represent "boil water" when attached to the category "water purifier".

[0069] When the first terminal 100 is the control terminal and the second terminal 200 is the device terminal, the transmission data can include the category of the transmission information and the attribute of the transmission information; the transmission data can also include the attribute of the transmission information, because the control terminal generally selects the device of which category to operate when controlling. There are many cases where the control terminal sends the transmission data to the device terminal, for example, when the device terminal is an air conditioner, the control terminal controls the air conditioner to open; for another example, when the device terminal is a water dispenser, the control terminal controls the water dispenser to heat.

[0070] When the first terminal 100 is the device terminal and the second terminal 200 is the control terminal, the transmission data can include the category of the transmission information and the attribute of the transmission information, so that the control terminal can distinguish from which category of the first terminal 100 the transmission data is transmitted, thereby facilitating the control terminal to respond to the transmission data. There are many cases where the device terminal sends the transmission data to the control terminal, for example, when the device terminal is an air conditioner, the device terminal reports the current temperature to the control terminal; for another example, when the device terminal is a water dispenser, the device terminal reports the current water shortage of the water dispenser to the control terminal.

[0071] Further, please refer to Figure 2 , step S20 includes:

[0072] Step S21, obtaining the total length of the content of the transmission data;

[0073] Step S23, obtaining the content length of the parsed index;

[0074] Step S24, obtaining the parsing result in the case where the content length of the parsed index is equal to the total length of the content of the transmission data;

[0075] Step S25, continuing to parse in the case where the content length of the parsed index is less than the total length of the content of the transmission data.

[0076] In this way, it is convenient to judge whether the content of the transmission data is all parsed or not, avoiding the content of the transmission data being missed.

[0077] Specifically, the total length of the content of the transmission data can be obtained through the content of the message header. It is worth noting that the total length of the content of the transmission data here refers to the length of the content of the message body of the transmission data.

[0078] In step S23, according to whether the transmission data includes a two-level index or the transmission data includes a one-level index and a two-level index, there are different methods to obtain the content length of the index, which will be discussed below.

[0079] In some embodiments, please refer to Figure 3, the transmission data includes a secondary index, the secondary index includes an attribute flag,

[0080] Step S23 includes:

[0081] Step S231, parsing the secondary index to obtain the attribute flag;

[0082] Step S232, obtaining the content length of the secondary index according to the attribute flag, to obtain the content length of the parsed index.

[0083] In this way, the content length of the parsed index can be obtained, providing a basis for determining whether the transmission data is parsed.

[0084] Specifically, the first terminal 100 and the second terminal 200 both store a correspondence between the attribute flag and the content length of the secondary index. According to the attribute flag of the secondary index, the content length of the secondary index can be queried. The number of secondary indexes included in the transmission data can be one, two, three, four, etc. When the transmission data includes one secondary index, the content length obtained according to the attribute flag is the content length of the parsed index. When the transmission data includes two or more secondary indexes, the content lengths of the secondary indexes obtained according to the attribute flags are added together to obtain the content length of the parsed index.

[0085] In some embodiments, referring to Figure 4 , the transmission data includes an index group, the index group includes a primary index and a secondary index, the primary index includes an index length, and the index length represents the length of the index group,

[0086] Step S23 includes:

[0087] Step S234, parsing the primary index to obtain the index length;

[0088] Step S235, obtaining the content length of the parsed index according to the index length.

[0089] In this way, the content length of the parsed index can be obtained, providing a basis for determining whether the transmission data is parsed.

[0090] Specifically, the number of index groups included in the transmission data can be one, two, three, four, etc. It is worth noting that the index group includes only one primary index, and the index group can include one or more secondary indexes.

[0091] When the transmission data includes one index group, the index length obtained by parsing the primary index is the content length of the parsed index. When the transmission data includes two or more primary indexes, the index lengths obtained by parsing the primary indexes are added together to obtain the content length of the parsed index.

[0092] Further, please refer to Figure 5 , step S20, comprising:

[0093] Step S27, obtaining the content length of the parsed secondary index and the content length of the parsed primary index in the index group;

[0094] Step S28, in the case where the content length of the parsed secondary index plus the content length of the primary index is equal to the index length, obtaining the parsing result of the index group, and further obtaining the transmission information of the first terminal 100;

[0095] Step S29, in the case where the content length of the parsed secondary index plus the content length of the primary index is less than the index length, continuing parsing.

[0096] In this way, it can be determined whether the content of the index group is completely parsed, and the omission of the content of the index group is avoided.

[0097] Specifically, the method for obtaining the content length of the parsed secondary index can refer to the above steps S231 and S232. The index group includes only one primary index, and the content of the primary index can include a category mark and an index length. The category mark is used to represent a category, such as a refrigerator, an air conditioner, a water purifier, etc.

[0098] Generally, the length of the content of the primary index in the index group is fixed, so the content length of the primary index can be stored in the first terminal 100 and the second terminal 200 in advance. The index group can include one or more secondary indexes.

[0099] Please refer to Figure 6 , Figure 6 is a flowchart for parsing transmission data in the communication method of the embodiment of the present application, Figure 6 Taking the transmission data including a primary index and a secondary index as an example. An empty parsing result object is established to store the parsed transmission information. The figure includes two loops, the large loop in the figure is used to determine whether all the index groups included in the transmission data are parsed, and the small loop in the figure is used to determine whether the content in each index group is parsed.

[0100] In some embodiments, the communication protocol includes a plurality of protocol groups, each protocol group including a primary index and a secondary index, and in each protocol group, the primary index is located before the secondary index.

[0101] In this way, the second terminal 200 can conveniently parse in order, that is, the category represented by the primary index can be parsed first, and then the attribute represented by the secondary index can be parsed according to the category.

[0102] Specifically, the data representing attribute contents of the secondary index can represent different attribute contents when attached to different categories of the primary index. For example, when the data representing attribute contents of the secondary index is “0001”, it can represent “on” when attached to the category “air conditioner”, and it can represent “off” when attached to the category “range hood”. For another example, when the data representing attribute contents of the secondary index is “0101”, it can represent “set temperature to 25°” when attached to the category “air conditioner”, and it can represent “boil water” when attached to the category “water purifier”.

[0103] There are many use scenarios of the communication method of the embodiments of the present application. For example, the communication method can be applied in a scenario in which a control end controls a device end. For another example, the communication method can be applied in a scenario in which the device end actively reports a state. For yet another example, the communication method can be applied in a scenario in which the control end actively queries a state of the device end. The following will provide detailed descriptions.

[0104] Taking the scenario in which the control end controls the device end as an example, in some embodiments, the first terminal 100 is the control end, and the second terminal 200 is the device end. The communication method includes the following steps.

[0105] In step S10, the control end determines transmission information according to an operation trigger instruction. The transmission information includes an instruction for the device end to perform an operation. The transmission information is spliced according to a communication protocol to form transmission data, and the transmission data is sent to the device end.

[0106] In step S20, the device end receives the transmission data, parses the transmission data to obtain the transmission information of the first terminal, and the transmission information includes the instruction.

[0107] Specifically, taking the control end as a mobile phone and the device end as a water purifier as an example, the communication method includes the following steps.

[0108] In step S10, the mobile phone determines transmission information according to a trigger instruction. The trigger instruction can be generated by a user operation on the mobile phone or automatically generated when the mobile phone reaches a certain condition. The transmission information includes an instruction for the water purifier to open a faucet. The communication protocol includes a primary index and a secondary index. The primary index includes the category of the transmission information, and the secondary index includes the attribute of the transmission information. The transmission information is spliced according to the communication protocol to form transmission data. The primary index of the transmission data includes “water purifier”, and the secondary index of the transmission data includes “open faucet”. Because the first terminal 100 is the control end, the transmission data can only include the secondary index “open faucet”. The transmission data “open faucet” is sent to the water purifier.

[0109] Step S20, the water purifier receives the transmission data "open faucet", parses the transmission data "open faucet" to obtain the transmission information "open faucet" of the mobile phone, and responds to the transmission information "open faucet", that is, the water purifier opens the faucet.

[0110] It is worth noting that the transmission information "open faucet" is expressed in a format that can be understood by both the control end and the device end, while the transmission data "open faucet" needs to be parsed into transmission information by both the control end and the device end to be understood, that is, the format of the transmission information "open faucet" is different from that of the transmission data "open faucet", and only represents the meaning of "open faucet".

[0111] For example, in some embodiments, the first terminal 100 is the device end, the second terminal 200 is the control end, and the communication method includes:

[0112] Step S10, the device end determines the transmission information according to the reporting state trigger instruction, the transmission information includes the state information of the device end, the transmission information is spliced according to the communication protocol to form the transmission data, and the transmission data is sent to the control end;

[0113] Step S20, the control end receives the transmission data, parses the transmission data to obtain the transmission information of the device end, and updates the state information of the device end.

[0114] Specifically, taking the control end as a mobile phone and the device end as a water purifier as an example, the communication method includes:

[0115] Step S10, the water purifier determines the transmission information according to the trigger instruction, which can be generated according to the state of the water purifier detected by the detector of the water purifier, the transmission information can be "water purifier water shortage", the communication protocol includes a first index and a second index, the first index includes the category of the transmission information, and the second index includes the attribute of the transmission information, the transmission information is spliced according to the communication protocol to form the transmission data, the first index of the transmission data includes "water purifier", the second index of the transmission data includes "water shortage", and the transmission data "water purifier water shortage" is sent to the mobile phone;

[0116] Step S20, the mobile phone receives the transmission data "water purifier water shortage", parses the transmission data "water purifier water shortage" to obtain the transmission information "water purifier water shortage" of the water purifier, and responds to the transmission information "water purifier water shortage", displays the water purifier water shortage information on the mobile phone to remind the customer to add water to the water purifier.

[0117] For example, in some embodiments, the first terminal 100 is the device end, the second terminal 200 is the control end, and the communication method includes:

[0118] Step S10, the control end determines the transmission information according to the query trigger instruction, the transmission information includes the instruction of querying the state information of the equipment end and the trigger instruction of reporting the state information to the control end, the transmission information is spliced according to the communication protocol to form transmission data, and the transmission data is sent to the control end;

[0119] Step S20, the equipment end receives the transmission data, parses the transmission data to obtain the transmission information of the first terminal, queries the state information of the equipment end, and determines the transmission information according to the trigger instruction of reporting the state information to the control end,

[0120] Step S10', the equipment end determines the transmission information according to the trigger instruction of reporting the state information to the control end, the transmission information includes the state information of the equipment end, and the transmission data is sent to the control end;

[0121] Step S20', the control end receives the transmission data, parses the transmission data to obtain the transmission information of the equipment end, and updates the state information of the equipment end.

[0122] Specifically, taking the control end as a mobile phone and the equipment end as a water purifier as an example, the communication method includes:

[0123] Step S10, the mobile phone determines the transmission information according to the trigger instruction, the trigger instruction can be generated by user operation of the mobile phone or automatically generated when the mobile phone reaches a certain condition, the transmission information includes an instruction for the water purifier to query the water level and report to the mobile phone, the communication protocol includes a first index and a second index, the first index includes the category of the transmission information, and the second index includes the attribute of the transmission information, the transmission information is spliced according to the communication protocol to form transmission data, the first index of the transmission data includes “water purifier”, the second index of the transmission data includes “query water level” and “report water level”, because the first terminal 100 is the control end, the transmission data can only include the second index “query water level” and “report water level”, and the transmission data “query water level” and “report water level” is sent to the water purifier;

[0124] Step S20, the water purifier receives the transmission data “query water level” and “report water level”, parses the transmission data “query water level” and “report water level” to obtain the transmission information “query water level” and “report water level” of the mobile phone, the water purifier queries the water level, and obtains that the water level state of the water purifier is full;

[0125] Step S10', the water purifier transmits the information "water level reported" as a trigger instruction, determines the transmission information according to the trigger instruction, the transmission information is "the water level queried by the water purifier is full", the communication protocol includes a first index and a second index, the first index includes the category of the transmission information, the second index includes the attribute of the transmission information, according to the communication protocol, the transmission information is spliced to form transmission data, the first index of the transmission data includes "water purifier", the second index of the transmission data includes "water level is full", and the transmission data "water purifier water level is full" is sent to the mobile phone;

[0126] Step S20', the mobile phone receives the transmission data "water purifier water level is full", analyzes the transmission data "water purifier water level is full" to obtain the transmission information "water purifier water level is full" of the water purifier, and displays the water purifier water level full information on the mobile phone in response to the transmission information "water purifier water level is full".

[0127] Please refer to Figure 7 The communication system 1000 of the embodiment of the present application includes a first terminal 100 and a second terminal 200. The first terminal 100 is used to determine transmission information according to a trigger instruction, splice the transmission information according to a communication protocol to form transmission data, and send the transmission data to the second terminal 200. The second terminal 200 is used to receive the transmission data, analyze the transmission data to obtain the transmission information of the first terminal 100, and respond to the transmission information of the first terminal 100.

[0128] The above communication system 1000, the first terminal 100 splices the transmission information required by itself to generate transmission data, avoids the problem that the effective bytes are not much due to the transmission of useless information, and increases the flexibility and expansibility of the transmission data.

[0129] Specifically, taking the communication protocol including a first index and a second index as an example, the communication method of the embodiment of the present application splices the transmission information according to the communication protocol to form transmission data, which means that according to the communication protocol and the category and attribute of the transmission information, the content of the transmission information is split according to different categories, and then the content of the transmission information of the same category is split according to the attribute, the content of the transmission information is spliced according to the category and the attribute to form transmission data, or the content of the transmission information is split according to different attributes, and the content of the transmission information is spliced according to the attribute to form transmission data.

[0130] Thus, the transmission data does not need a fixed position, and only needs to splice the content of the transmission information as needed, without using useless data for placeholder, eliminating redundant data; in addition, the transmission data can include multiple categories of data and multiple attribute data, so that a transmission data can include attribute data of multiple categories, that is, the transmission data formed according to the communication method of the embodiment of the application can load different categories of transmission information together, solving the problem that a transmission data can only contain one category; in the case that the device end is composed of multiple categories of device components, only one transmission data needs to be transmitted to control multiple categories of devices, enriching the content of the interaction between the first terminal 100 and the second terminal 200. The communication method of the embodiment of the application can also adjust the length of the transmission data as needed, and no longer be limited by the template length.

[0131] The first terminal 100 can be a control end, which can be a mobile phone, a computer, a console, etc. At this time, the second terminal 200 can be a device end, which can be an air conditioner, a water purifier, an extractor hood, a dishwasher, etc. The first terminal 100 can also be a device end, and at this time, the second terminal 200 can be a control end.

[0132] The first terminal 100 according to the embodiment of the application comprises a processor. The processor is configured to determine transmission information according to a trigger instruction, splice the transmission information according to a communication protocol to form transmission data, and send the transmission data to a second terminal 200, so that the second terminal 200 parses the transmission data to obtain the transmission information of the first terminal 100 and responds to the transmission information of the first terminal 100.

[0133] The first terminal 100 splices the transmission information required by itself to generate transmission data, avoiding the problem that the effective bytes are not much due to the transmission of useless information, and increasing the flexibility and expansibility of the transmission data.

[0134] Specifically, the first terminal 100 can be a control end, which can be a mobile phone, a computer, a console, etc. At this time, the second terminal 200 can be a device end, which can be an air conditioner, a water purifier, an extractor hood, a dishwasher, etc. The first terminal 100 can also be a device end, and at this time, the second terminal 200 can be a control end.

[0135] In the case that the first terminal 100 is the control terminal and the second terminal 200 is the device terminal, the first terminal 100 of the embodiment of the present application can be applied to various scenarios, for example, the control terminal is a mobile phone and the device terminal is an air conditioner, the mobile phone controls the air conditioner to adjust temperature; for another example, the control terminal is a control console and the device terminal is a water dispenser, the control console controls the water dispenser to boil water; in the case that the first terminal 100 is the device terminal and the second terminal 200 is the control terminal, the first terminal 100 of the embodiment of the present application can be applied to various scenarios, for example, the device terminal is an extractor hood and the control terminal is a mobile phone, the extractor hood detects that the current environment has too much smoke, and the mobile phone is informed that the extractor hood detects that the current environment has too much smoke; for another example, the device terminal is a water dispenser and the control terminal is a computer, the water dispenser detects that the water in the machine is insufficient, and the computer is informed that the water in the water dispenser is insufficient.

[0136] The embodiment of the present application provides a computer readable storage medium, which stores a computer program, and the program is executed by a processor to realize the steps of the communication method of any one of the above embodiments.

[0137] The storage medium avoids the problem that the effective bytes are not much due to the transmission of useless information, and increases the flexibility and expansibility of the transmission data.

[0138] The computer readable medium can be arranged in the first terminal 100, can be arranged in the second terminal 200, and can also be arranged in a cloud server. The first terminal 100 and the second terminal 200 can communicate with the cloud server to obtain the corresponding program. It can be understood that the computer program includes computer program code. The computer program code can be in the form of source code, object code, executable files or some intermediate forms. The computer readable storage medium can include any entity or device capable of carrying computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM) and software distribution medium.

[0139] A computer readable storage medium can be any apparatus that can include, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device. Computer readable storage medium can further include any medium that can be used to store or transfer information for use by or in connection with an instruction execution system, apparatus, or device, in a non-transitory way. The non-transitory computer readable storage medium can include, by way of example, and not limitation, any of the following: an electronic connection having one or more wires (electronic devices), a portable computer diskette (magnetic devices), a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, the computer readable storage medium can also be paper or another suitable medium upon which the program is printed, as the program can be electronically captured, via, for instance, optical scanning of the paper or other medium, then compiled, interpreted, or otherwise processed in a suitable manner, if necessary, and then stored in a computer storage medium.

[0140] It should be noted that the above description of the embodiments of the communication method and the advantages thereof also applies to the communication system 1000, the first terminal 100 and the computer readable medium of the embodiments of the present application, and for the sake of brevity, will not be repeated here.

[0141] In the description of the present specification, the description of the terms "one embodiment", "some embodiments", "an example", "a specific example", or "some examples" and the like means that the specific features, structures, materials or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present application. In the present specification, the illustrative description of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any appropriate manner in any one or more embodiments or examples. In addition, the person skilled in the art can combine and combine the different embodiments or examples described in the present specification and the features of the different embodiments or examples, without contradiction.

[0142] Any process or method descriptions or descriptions of the flow diagrams in the present specification can be understood as representing code modules, segments, or portions of code which include one or more executable instructions for performing specific logic functions or steps in the process, and the various embodiments of the present application include additional implementations, in which the order of steps can differ from those shown or discussed, including a step can occur at the same time as other steps or can be performed in reverse order or can be performed in an order different from that shown or discussed, without departing from the scope of the application, as will be understood by those skilled in the art.

[0143] Although the embodiments of the present application have been shown and described above, it is understood that the above-described embodiments are exemplary and are not to be construed as limiting the present application, and that changes, modifications, substitutions and variations can be made by those skilled in the art without departing from the scope of the present application.

Claims

1. A communication method for communication between a first terminal and a second terminal, characterized by, The communication method includes: The first terminal determines transmission information according to a trigger command, and concatenates the transmission information according to a communication protocol to form transmission data. When the transmission data includes at least one index group, the index group includes a primary index and multiple secondary indexes. The communication protocol includes multiple protocol groups, each of which includes the primary index and the secondary index. The primary index includes the category of the first terminal and includes an index length for indicating the length of the index group. The category is the type of device. The secondary index includes the attributes of the first terminal and is attached to the primary index. Data representing the same attribute content in the secondary index represents different attribute content according to the category attached to different primary indices. The transmission data can include attribute information of multiple categories, and each category can include multiple attributes. The attributes are attributes of the content of the transmission information. The step of splicing the transmission information according to the communication protocol to form transmission data further includes: determining whether the transmission data includes the secondary index or the primary index and the secondary index according to the type of the first terminal, wherein when the first terminal is a control terminal, the transmission data does not need to include the primary index, and when the first terminal is a device terminal, the transmission data includes the primary index and the secondary index; and sending the transmission data to the second terminal. The second terminal receives the transmitted data, parses the transmitted data to obtain the transmission information of the first terminal, and responds to the transmission information of the first terminal.

2. The communication method according to claim 1, characterized by, The triggering command is generated by the first terminal based on the command sent by the second terminal, or The trigger command is generated by the first terminal itself.

3. The communication method according to claim 1, wherein, The step of parsing the transmitted data to obtain the transmission information of the first terminal includes: Obtain the total length of the transmitted data; Get the length of the parsed index content; The parsing result is obtained when the length of the parsed index is equal to the total length of the transmitted data. If the length of the parsed index is less than the total length of the transmitted data, continue parsing.

4. The communication method according to claim 3, wherein, The transmitted data includes the secondary index, which includes attribute flags. The step of obtaining the length of the parsed index content includes: Parse the secondary index to obtain the attribute flag; The content length of the secondary index is obtained based on the attribute flag, so as to obtain the content length of the parsed index.

5. The communication method according to claim 3, wherein, The step of obtaining the length of the parsed index content includes: Parse the first-level index to obtain the index length; Based on the index length, obtain the content length of the parsed index.

6. The communication method according to claim 5, wherein, The step of parsing the transmitted data to obtain the transmission information of the first terminal includes: Obtain the content length of the parsed secondary index and the content length of the parsed primary index in the index group; In a case that the content length of the second index plus the content length of the first index is equal to the index length, the parsing result of the index group is obtained, and the transmission information of the first terminal is acquired; In a case that the content length of the second index plus the content length of the first index is less than the index length, the parsing is continued.

7. The communication method of claim 1, wherein, In each protocol group, the first index is located before the second index.

8. A communication system, characterized by The communication system comprises a first terminal and a second terminal, The first terminal is configured to determine transmission information according to a trigger instruction, splice the transmission information according to a communication protocol to form transmission data, and send the transmission data to the second terminal; When the transmission data comprises at least one index group, the index group comprises one first index and a plurality of second indexes, the communication protocol comprises a plurality of protocol groups, each protocol group comprises the first index and the second index, the first index comprises a category of the first terminal and comprises an index length for indicating a length of the index group, the category is a kind of device, the second index comprises an attribute of the first terminal, and the second index is attached to the first index, the same data representing attribute contents in the second index represent different attribute contents according to the categories attached to different first indexes, and the transmission data can comprise attribute information of a plurality of categories, each category can comprise a plurality of attributes, and the attribute is an attribute of the content of the transmission information, The splicing of the transmission information according to the communication protocol to form the transmission data further comprises determining whether the transmission data comprises the second index or the first index and the second index according to a type of the first terminal, wherein when the first terminal is a control terminal, the transmission data does not need to comprise the first index, and when the first terminal is a device terminal, the transmission data comprises the first index and the second index. The second terminal is configured to receive the transmission data, parse the transmission data to acquire the transmission information of the first terminal, and respond to the transmission information of the first terminal.

9. A first terminal, characterized by The processor is configured to: determine transmission information according to a trigger instruction, splice the transmission information according to a communication protocol to form transmission data, and send the transmission data to a second terminal, so that the second terminal parses the transmission data to acquire the transmission information of the first terminal and responds to the transmission information of the first terminal. When the transmission data includes at least one index group, the index group includes one primary index and multiple secondary indexes, the communication protocol includes multiple protocol groups, each of the protocol groups includes the primary index and the secondary indexes, the primary index includes a category of the first terminal and an index length for representing a length of the index group, the category is a kind of device, the secondary indexes include attributes of the first terminal, and the secondary indexes are attached to the primary index, same data representing attribute contents in the secondary indexes represent different attribute contents according to the categories attached to different primary indexes, and the transmission data can include attribute information of multiple categories, each of the categories can include multiple attributes, and the attributes are attributes of contents of transmission information. The communication method further includes: determining, according to a type of the first terminal, whether the transmission data includes the secondary indexes or includes the primary index and the secondary indexes, wherein when the first terminal is a control terminal, the transmission data does not need to include the primary index, and when the first terminal is a device terminal, the transmission data includes the primary index and the secondary indexes.

10. A computer-readable storage medium having stored thereon a computer program, characterized in that, The program is executed by the processor to implement the steps of the communication method of any one of claims 1-7.

Citation Information

Patent Citations

  • Internet of Things-used wireless communication method and Internet of Things-used wireless communication apparatus

    CN103716129A

  • Device control method, terminal and computer readable storage medium

    CN108833233A

  • Remote control method and system for multi-terminal Internet of Things and readable medium

    CN110351392A