Message control method and related device
By generating a message sequence number based on message parameters in the gateway device and performing corresponding processing on the cloud server, the message deduplication problem when multiple gateway devices in the same Bluetooth mesh network report the same message to the cloud server is solved, and the message deduplication and management efficiency are improved.
Patent Information
- Application Number
- CN202110749312.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-07-01
- Publication Date
- 2025-06-17
- Estimated Expiration
- 2041-07-01
AI Technical Summary
When multiple gateway devices exist in the same Bluetooth mesh network, the cloud server cannot effectively deduplicate messages sent by the same node device, resulting in duplicate messages processing.
By generating a message sequence number in the gateway device, the message sequence number is generated based on the message parameters sent by the node device, and when the cloud server receives the message, the message sequence number is used to perform preset operations to realize message deduplication.
It effectively solves the problem of message deduplication when multiple gateway devices in the same network report the same message to the cloud server, and improves the efficiency and accuracy of message management.
Smart Images

Figure CN115567882B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technologies, and in particular, to a message control method and related devices. Background Art
[0002] Bluetooth mesh technology is currently widely used. A relatively common use scenario is to use a Bluetooth mesh gateway device in combination with other mesh network node devices. The node device sends its own status data to the gateway, and the gateway device adds a time stamp of the current time to the data and reports it to the cloud. In the prior art, the gateway device often uses the time stamp as the message sequence number. In this way, when there are multiple gateway devices in the same Bluetooth mesh network and all gateway devices are divided into a group, when the node device in the network sends data to the gateway device group, all gateway devices will receive this message. However, the time when the gateway devices receive the message is different, and there are also errors in the local time of each gateway device. When the time stamp is added to the message and sent to the cloud, the cloud cannot perform duplicate removal. Therefore, how to generate a message sequence number to solve the problem of duplicate removal by the cloud server when multiple gateway devices in the same network report messages sent by the same node device to the cloud server urgently needs to be solved. Summary of the Invention
[0003] Embodiments of this application provide a message control method and related devices, which can generate a message sequence number for the cloud server to achieve duplicate removal of messages when multiple gateway devices in the same network report messages sent by the same node device to the cloud server.
[0004] In a first aspect, an embodiment of this application provides a message control method applied to a gateway device. The method includes:
[0005] Receiving a first message sent by a node device;
[0006] Generating a second message according to the first message, where the message sequence number of the second message is generated according to the message parameter carried by the first message.
[0007] In a second aspect, an embodiment of this application provides a message control method applied to a cloud server. The method includes:
[0008] Receiving a second message sent by a gateway device, where the second message carries a message sequence number, the message sequence number is generated according to the message parameter carried by the first message, and the first message is sent by a node device to the gateway device;
[0009] Performing a preset operation on the message received by the cloud server based on the message sequence number.
[0010] In a third aspect, an embodiment of the present application provides a message control device applied to a gateway device. The device includes a receiving unit and a generating unit, where,
[0011] The receiving unit is configured to receive a first message sent by a node device;
[0012] The generating unit is configured to generate a second message according to the first message, where the message sequence number of the second message is generated according to the message parameters carried in the first message.
[0013] In a fourth aspect, an embodiment of the present application provides a message control device applied to a cloud server. The device includes a receiving unit and an execution unit, where,
[0014] The receiving unit is configured to receive a second message sent by the gateway device. The second message carries a message sequence number, and the message sequence number is generated according to the message parameters carried in the first message. The first message is sent by the node device to the gateway device;
[0015] The execution unit is configured to perform a preset operation on the messages received by the cloud server based on the message sequence number.
[0016] In a fifth aspect, an embodiment of the present application provides a gateway device. The gateway device includes a processor, a memory, a communication interface, and one or more programs. The one or more programs are stored in the memory and are configured to be executed by the processor. The programs include instructions for performing some or all of the steps described in the method according to the first aspect of the embodiments of the present application.
[0017] In a sixth aspect, an embodiment of the present application provides a cloud server. The cloud server includes a processor, a memory, a communication interface, and one or more programs. The one or more programs are stored in the memory and are configured to be executed by the processor. The programs include instructions for performing some or all of the steps described in the method according to the second aspect of the embodiments of the present application.
[0018] In a seventh aspect, an embodiment of the present application provides a message control system. The message control system includes the gateway device described in the fifth aspect, the cloud server described in the sixth aspect, and the node device.
[0019] In an eighth aspect, an embodiment of the present application provides a computer-readable storage medium. The computer-readable storage medium is used to store a computer program. The computer program is executed by a processor to implement some or all of the steps described in the method according to the first aspect or the second aspect of the embodiments of the present application.
[0020] In a ninth aspect, an embodiment of the present application provides a computer-readable storage medium, where the computer-readable storage medium is used to store a computer program, and the computer program is executed by a processor to implement some or all of the steps described in the method according to the second aspect of the embodiment of the present application.
[0021] In a tenth aspect, an embodiment of the present application provides a computer program product, where the computer program product includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to cause a computer to execute some or all of the steps described in the method according to the first aspect of the embodiment of the present application. The computer program product may be a software installation package.
[0022] In an eleventh aspect, an embodiment of the present application provides a computer program product, where the computer program product includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to cause a computer to execute some or all of the steps described in the method according to the second aspect of the embodiment of the present application. The computer program product may be a software installation package.
[0023] Implementing the embodiments of the present application has the following beneficial effects:
[0024] It can be seen that in the message control method and related devices described in the embodiments of the present application, which are applied to a gateway device, a first message sent by a node device is received, and a second message is generated according to the first message. Among them, the message sequence number of the second message is generated according to the message parameters carried in the first message. Since the field used to represent the sequence number in the message parameters can be used to uniquely and orderly represent the device reporting status, the generated message sequence number also has this characteristic. Furthermore, it can be used to enable the cloud server to deduplicate messages in the case where multiple gateway devices in the same network all report messages sent by the same node device to the cloud server.
[0025] These aspects or other aspects of the present application will be more clearly understood in the following description of the embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0027] Figure 1 It is a system architecture diagram of a message control system provided by an embodiment of the present application;
[0028] Figure 2A It is a schematic flowchart of a message control method provided by an embodiment of the present application;
[0029] Figure 2B It is a schematic structural diagram of a message sequence number provided by an embodiment of the present application;
[0030] Figure 2C It is another schematic structural diagram of a message sequence number provided by an embodiment of the present application;
[0031] Figure 3 It is a schematic flowchart of another message control method provided by an embodiment of the present application;
[0032] Figure 4 It is a schematic flowchart of another message control method provided by an embodiment of the present application;
[0033] Figure 5 It is a schematic hardware structure diagram of a gateway device provided by an embodiment of the present application;
[0034] Figure 6 It is a schematic hardware structure diagram of a cloud server provided by an embodiment of the present application;
[0035] Figure 7 It is a schematic structural diagram of a message control device provided by an embodiment of the present application;
[0036] Figure 8 It is a schematic structural diagram of another message control device provided by an embodiment of the present application. Detailed implementation manners
[0037] In order to enable those skilled in the art to better understand the solutions of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.
[0038] Terms such as "first" and "second" in the specification, claims and above-mentioned drawings of the present application are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally further includes steps or units not listed, or optionally further includes other steps or units inherent to these processes, methods, products or devices.
[0039] References to "embodiments" in this application mean that the specific features, structures, or characteristics described in connection with the embodiments can be included in at least one embodiment of the present application. The phrase appears in various places in the specification and does not necessarily refer to the same embodiment each time, nor is it an independent or alternative embodiment mutually exclusive with other embodiments. Those skilled in the art will explicitly and implicitly understand that the embodiments described herein can be combined with other embodiments.
[0040] "At least one" in this application refers to one or more, and "multiple" refers to two or more. In this application, "and / or" describes the association relationship between associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone, where A and B can be singular or plural. The character " / " generally represents an "or" relationship between the associated objects before and after. "At least one (item) of the following" or similar expressions refer to any combination of these items, including any combination of single items (individuals) or multiple items (individuals). For example, at least one (item) of a, b, or c can represent: a, b, c, a and b, a and c, b and c, or a, b, and c, where each of a, b, and c itself can be an element or a set containing one or more elements.
[0041] It should be noted that in the embodiments of this application, "equal to" involved can be used in conjunction with "greater than", applicable to the technical solutions adopted when greater than, and can also be used in conjunction with "less than", applicable to the technical solutions adopted when less than. It should be noted that when "equal to" is used in conjunction with "greater than", it is not used in conjunction with "less than"; when "equal to" is used in conjunction with "less than", it is not used in conjunction with "greater than". In the embodiments of this application, "(of)", "corresponding", and "corresponding" can sometimes be used interchangeably. It should be pointed out that when their differences are not emphasized, the meanings they express are the same.
[0042] The embodiments of this application provide a message control method and related devices, which will be described below with reference to the accompanying drawings.
[0043] Please refer to Figure 1 , Figure 1 FIG. is a schematic diagram of the system architecture of a message control system provided by the embodiments of this application. The message control system includes node devices, a preset gateway group, and a cloud server. The preset gateway group can include at least one gateway device. Messages are transmitted between the node devices and the gateway devices, and between the gateway devices and the cloud server through wireless communication (such as Bluetooth communication, Wi-Fi communication, etc.) or wired communication (such as cables, etc.).
[0044] Please refer to Figure 2A , Figure 2AIt is a schematic flow chart of a message control method provided by an embodiment of the present application, which is applied to a gateway device; as shown in the figure, the present message control method includes the following steps.
[0045] 201. Receive a first message sent by a node device.
[0046] Among them, the node device and the gateway device can communicate through a preset communication protocol, and the preset communication protocol can be a protocol for implementing communication functions. For example, the preset communication protocol can be at least one of the following: Bluetooth mesh networking protocol, infrared communication protocol, ultra-wideband (UWB) communication protocol, LoRa communication protocol, etc., which is not limited here. The node device can send the first message to the gateway device in a broadcast form, and the gateway device can receive the first message.
[0047] 202. Generate a second message according to the first message, where the message sequence number of the second message is generated according to the message parameters carried in the first message.
[0048] In a specific implementation, the message sequence number is used to uniquely and orderly represent the device reporting status. The first message can carry not only message parameters but also message content, and the message content can be the status data of the node device or the message content that the user wants to upload.
[0049] In a specific application, when the gateway device obtains the first message sent by the node device, it can extract the message parameters carried in the first message to generate a message sequence number, and then combine the message content of the first message and the message sequence number into a second message.
[0050] Optionally, the message parameters include at least one of an IV index and a sequence number SEQ.
[0051] In a specific implementation, the message parameters can be at least one of the following: IV index, sequence number (SEQ), timestamp, keywords extracted from the message content, etc., which is not limited here. For example, the message parameter can be the IV index alone, or for another example, the message parameter can be the sequence number SEQ alone, or for another example, the message parameter can be the IV index and the sequence number SEQ.
[0052] Among them, the node device and the gateway device can communicate through the Bluetooth mesh networking protocol. Then the message parameter can be the protocol parameter of the Bluetooth mesh networking protocol, and the protocol parameter can include the IV index or the sequence number SEQ. The first message is the message sent by the node device to the gateway device under the Bluetooth mesh networking protocol, and this message carries the message content and the message parameter. The second message is the message formed by the gateway device generating a message sequence number according to the message parameter in the first message and combining the message sequence number with the message content of the first message.
[0053] Optionally, the message sequence number consists of an IV index field; or, the message sequence number consists of a SEQ field; or, the message sequence number consists of an IV index field and a SEQ field; the IV index field includes part or all of the IV index, and the SEQ field includes part or all of the sequence number SEQ.
[0054] In the embodiments of the present application, the IV index field can include the IV index, and the SEQ field can include the sequence number SEQ. In practical applications, part or all of the fields of the IV index can be taken alone to form the message sequence number, or part or all of the fields of the sequence number SEQ can be taken alone to form the message sequence number, or part of the fields of the IV index and part of the fields of the sequence number SEQ can be taken to form the message sequence number, or all of the fields of the IV index and all of the fields of the sequence number SEQ can be taken to form the message sequence number.
[0055] For example, the message sequence number can be composed of an IV index field and a SEQ field. The IV index field can include 1 byte, and the SEQ field can include 3 bytes. Then the message sequence number can include 4 bytes. The IV index field can be located in front of the SEQ field, or the IV index field can also be located behind the SEQ field. As Figure 2B shown, the message sequence number is composed of an IV index field and a SEQ field.
[0056] Furthermore, as Figure 2C shown, the message sequence number can not only include an IV index field and a SEQ field, but also include other specified fields. The specified field can be set by the user himself or default by the system. For example, the specified field can be a string, the length of the specified field can be at least 1 bit, the specified field can be a fixed string or a dynamic string. For example, the specified field can be a space, or for another example, the specified field can be a timestamp. The position of the specified field in the message sequence number is not limited, and the number of the specified fields can also be not limited. For example, the message sequence number can include 2 specified fields, which are located at the head and the tail of the message sequence number respectively.
[0057] Optionally, the message sequence number of the second message is generated according to the message parameters carried in the first message, and the following steps may be included:
[0058] A1. Extract the IV index and the sequence number SEQ in the message parameters;
[0059] A2. Generate the message sequence number according to the IV index and the sequence number SEQ.
[0060] In a specific implementation, the gateway device may extract the IV index and the sequence number SEQ in the message parameters, and then combine the IV index and the sequence number SEQ into a message sequence number. The message sequence number may be carried in the second message as a part of the second message.
[0061] Optionally, after step 202, the following steps may further be included:
[0062] Send the second message to the cloud server. The second message carries the message sequence number, and the cloud server performs a preset operation on the message received by the cloud server based on the message sequence number.
[0063] Among them, the preset operation may be the system default or may also be set by the user, and may also be triggered by the message content carried in the second message. For example, if the message content carried in the second message is used to test message deduplication, the cloud server is triggered to perform a message deduplication operation.
[0064] In a specific implementation, the cloud server may receive the second message, then obtain the message sequence number in the second message, and complete the preset operation on the message based on the message sequence number.
[0065] Optionally, the preset operation includes at least one of the following: message deduplication operation, message sorting operation, message anti-replay attack operation.
[0066] Among them, the message deduplication operation may be understood as removing messages with duplicate message content. The message sorting operation may be understood as sorting messages, usually in the order of time stamps, or may be sorted in the order of receiving messages. The message anti-replay attack operation may be understood as performing a retain or discard operation on the message by comparing the SEQ value in the message sequence number.
[0067] For example, in practical applications, the message sequence number is always incremented and cannot wrap around (i.e., there cannot be duplicate message sequence numbers). Therefore, the message sequence number space needs to be large enough. If four bytes are used to store the message sequence number, the maximum number of messages that can be represented is 4,294,967,296. Assuming that the node device continuously sends messages at 20 ms intervals, in extreme cases, message sequence number wrapping may occur in just over two years. Therefore, four bytes of message sequence numbers do not meet the actual application requirements. Additionally, if the node device attaches the message sequence number extra, there will be no problem of wrapping around, but an additional 4 or 8 bytes of content will be added to each message. Considering that each broadcast packet payload of the Bluetooth mesh networking protocol is only 11 or 12 bytes, adding the message sequence number extra will very likely cause an additional broadcast packet to be sent when the mesh sends data in order to finish sending the message, reducing the message transmission efficiency and increasing the message sending time. In the application scenario considering message deduplication, the memory space of the message sequence number can be greater than or equal to five bytes, and the memory space should not be too large either. For example, the memory space of the message sequence number can be 5 to 8 bytes to avoid the need to send an additional broadcast packet to finish sending the message.
[0068] For another example, in specific implementations, considering the principle that the Bluetooth mesh protocol has replay attack prevention, in the embodiments of the present application, the IV index and SEQ can be used as the message sequence number. The Bluetooth mesh networking protocol can protect the network from relay attacks, and this protection is implemented based on two network protocol data unit (PDU) fields of the sequence number SEQ and the IV index. That is, each time a message is sent, the SEQ value is incremented. When the node device receives a message, if the SEQ value contained in the message is less than or equal to the SEQ value in the previous valid message, the node device will discard the message because this message may be related to a relay attack. In this way, replay attack prevention can be avoided.
[0069] For another example, the node device broadcasts a first message to a preset gateway group based on a preset communication protocol. After any gateway device in the preset gateway group receives the first message, a second message can be generated based on the first message. The message sequence number of the second message is generated according to the message parameters of the first message, and then the second message is forwarded to the cloud server. The cloud server performs deduplication operations on the second messages received by the cloud server based on the message sequence number. Of course, the cloud server can also perform message sorting on the received messages.
[0070] Taking the Bluetooth mesh networking protocol as an example, when a node device sends a first message and the message parameters of the first message include an IV index and a sequence number SEQ, a 1-bit (bit) IV index, that is, the least significant bit of the IV index, is carried in the first message. The network PDU format is as shown in the following table:
[0071] Field Name Bit IVI 1 NID 7 CTL 1 TTL 7 SEQ 24 SRC 16 DST 16 TransportPUD 8~128 NetMIC 32 or 64
[0072] Among them, IVI represents the least significant bit of the IV index; NID is the value of the network key derived from the encryption key and the privacy key used to protect this PDU; CTL is the network control; TTL is the time to live; SEQ is the sequence number; SRC is the source address; DST is the destination address; TransportPUD is the transport protocol data unit; NetMIC is the network message integrity check.
[0073] When the gateway device receives the first message, it will perform an update operation on the 1-bit IV index through a Secure Network beacon to obtain a 4-byte (32-bit) IV index field. The Secure Network beacon format is as shown in the following table:
[0074] Field Name Byte Beacon Type 1 Flags 7 Network ID 1 IV index 7 Authentication Value 24
[0075] Among them, Beacon Type represents the Secure Network beacon (0x01); Flags is used to indicate the inclusion of key refresh flags and IV update flags; Network ID represents the value of the network ID; IV index represents the current IV index; AuthenticationValue represents the authentication of the Secure Network beacon.
[0076] In a specific implementation, taking the Bluetooth mesh networking protocol as an example, when the message sequence number is composed of all fields of the IV index and all fields of the sequence number SEQ, the specific expression of the message sequence number can be as follows:
[0077] msgnumber = (IV << 24) | SEQ
[0078] Among them, msgnumber represents the message sequence number, IV represents the IV index field, and SEQ represents the SEQ field. The message sequence number can uniquely identify the order of messages sent by each device. The message sequence number can include a 4-byte IV index and a 3-byte SEQ, for a total of 7 bytes. Since SEQ is 3 bytes, that is, 24 bits, when the IV index is placed before SEQ, the IV index needs to be shifted left (<<) by 24 bits. Additionally, based on this message sequence number, a total of 72,057,594,037,927,936 messages can be represented. Assuming that messages are sent continuously at the fastest rate with a 20-ms interval, it takes 45,698,626 years for the message sequence number to wrap around. In this way, during the entire life cycle of the device, there will be no wrapping phenomenon.
[0079] In the embodiments of the present application, the IV index and SEQ in the Bluetooth mesh protocol are used as the message sequence number for the gateway device to report to the cloud server, which can efficiently solve the problem of the cloud server's processing of duplicate messages when multiple gateway devices in the same mesh network report messages sent by the same node device to the cloud. Using msgnumber = (IV << 24) | SEQ as the basis for the cloud server to judge and sort messages, the message sequence number is determined by the gateway device, and the message order can be uniquely marked through this message sequence number.
[0080] It can be seen that the message control method described in the embodiments of the present application is applied to the gateway device, which receives the first message sent by the node device and generates a second message according to the first message. Among them, the message sequence number of the second message is generated according to the message parameters carried in the first message. Since the field used to represent the sequence number in the message parameters can be used to uniquely and orderly represent the device reporting status, the generated message sequence number also has this characteristic. Furthermore, it can be used to enable the cloud server to de-duplicate messages when multiple gateway devices in the same network report messages sent by the same node device to the cloud server.
[0081] Please refer to Figure 3 , Figure 3 which is a schematic flowchart of a message control method provided by the embodiments of the present application and is applied to the cloud server; as shown in the figure, this message control method includes the following steps.
[0082] 301. Receive the second message sent by the gateway device. The second message carries a message sequence number, and the message sequence number is generated according to the message parameters carried in the first message. The first message is sent by the node device to the gateway device.
[0083] Optionally, the message parameters include at least one of the IV index and the sequence number SEQ.
[0084] Optionally, the message sequence number is indexed by the IV field; alternatively, the message sequence number is composed of the SEQ field; alternatively, the message sequence number is composed of the IV index field and the SEQ field; the IV index field includes part or all of the IV index, and the SEQ field includes part or all of the SEQ.
[0085] 302. Perform a preset operation on the message received by the cloud server based on the message sequence number.
[0086] Optionally, the preset operation includes at least one of the following: message deduplication operation, message sorting operation, and message anti-replay attack operation.
[0087] Among them, some related descriptions of the above steps 301, 302, message parameters, message sequence numbers, and preset operations can refer to Figure 2A the corresponding descriptions of the described message control method, which will not be elaborated here.
[0088] Optionally, the preset operation is the message deduplication operation. For the above step 302, performing a preset operation on the message received by the cloud server based on the message sequence number can be implemented as follows:
[0089] Obtain all messages with the message sequence number being the message sequence number, retain the message with the earliest reception time among all the messages, and delete other messages among all the messages except the message with the earliest reception time.
[0090] In specific implementation, the cloud server can extract all messages from the received messages whose message sequence numbers are the same as that of the second message, then retain the message with the earliest reception time among all these messages, and delete other messages among all the messages except the message with the earliest reception time. Thus, the message deduplication operation is completed, that is, duplicate messages are removed, which helps to improve message management efficiency and save memory.
[0091] It can be seen that in the message control method described in the embodiments of the present application, which is applied to a cloud server, receives a second message sent by a gateway device. The second message carries a message sequence number, which is generated according to the message parameters carried by a first message. The first message is sent by a node device to the gateway device. A preset operation is performed on the message received by the cloud server based on the message sequence number. Since the field in the message parameters used to represent the sequence number can be used to uniquely and orderly represent the device reporting status, the generated message sequence number also has this feature. It can not only enable the cloud server to perform message deduplication when multiple gateway devices in the same network report messages sent by the same node device to the cloud server, but also implement message deduplication or message anti-replay attack.
[0092] Please refer to Figure 4 ,Figure 4 is a schematic flowchart of a message control method provided by an embodiment of the present application, which is applied to a message control system as shown in Figure 1 As shown in the figure, the present message control method includes the following steps.
[0093] 401. The node device sends a first message.
[0094] 402. The gateway device receives the first message sent by the node device.
[0095] 403. The gateway device generates a second message according to the first message, wherein the message sequence number of the second message is generated according to the message parameters carried by the first message.
[0096] 404. The gateway device sends the second message to the cloud server, and the second message carries the message sequence number.
[0097] 405. The cloud server receives the second message.
[0098] 406. The cloud server performs a preset operation on the messages received by the cloud server based on the message sequence number.
[0099] Among them, the specific descriptions of the above steps 401 - 406 can refer to the corresponding descriptions of the message control method described in Figure 2A or Figure 3 and will not be elaborated here.
[0100] Please refer to Figure 5 , Figure 5 is a schematic diagram of a gateway device provided by an embodiment of the present application. The gateway device includes a processor, a memory, a communication module, and one or more programs. The processor is communicatively connected to the memory and the communication module through an internal communication bus.
[0101] In specific implementation, one or more programs are stored in the above-mentioned memory and are configured to be executed by the above-mentioned processor. One or more programs include instructions for executing some or all of the steps performed by the message control method described in the above Figure 2A of the present application embodiment.
[0102] Among them, the communication module includes a local area network wireless communication module and a wired communication module, and the communication module realizes the communication function through a communication interface.
[0103] Among them, the processor may include one or more processing units. For example, the processor may include an application processor AP, a modem processor, a graphics processing unit GPU, an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural network processor NPU, etc. Among them, different processing units may be independent components or integrated in one or more processors.
[0104] The memory may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable ROM (PROM), an erasable programmable ROM (EPROM), an electrically erasable programmable ROM (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example but not limitation, many forms of random access memory (RAM) are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchlink dynamic random access memory (SLDRAM), and direct rambus random access memory (DR RAM).
[0105] In a specific implementation, the above program includes instructions for performing the following steps:
[0106] Receive a first message sent by a node device;
[0107] Generate a second message according to the first message, wherein the message sequence number of the second message is generated according to the message parameters carried in the first message.
[0108] Optionally, the message parameters include at least one of an IV index and a sequence number SEQ.
[0109] Optionally, the message sequence number is indexed by the IV field; alternatively, the message sequence number consists of the SEQ field; alternatively, the message sequence number consists of the IV index field and the SEQ field; the IV index field includes part or all of the IV index, and the SEQ field includes part or all of the sequence number SEQ.
[0110] Optionally, the message sequence number of the second message is generated according to the message parameters carried in the first message, including:
[0111] Extract the IV index and the sequence number SEQ in the message parameters;
[0112] Generate the message sequence number according to the IV index and the sequence number SEQ.
[0113] Optionally, the above program further includes instructions for performing the following steps:
[0114] Send the second message to the cloud server, where the second message carries the message sequence number, and the cloud server performs a preset operation on the messages received by the cloud server based on the message sequence number.
[0115] Optionally, the preset operation includes at least one of the following: message deduplication operation, message sorting operation, message anti-replay attack operation.
[0116] Please refer to Figure 6 , Figure 6 which is a schematic diagram of a cloud server provided by an embodiment of the present application. The cloud server includes a processor, a memory, a communication module, and one or more programs. The processor is communicatively connected to the memory and the communication module through an internal communication bus.
[0117] In a specific implementation, one or more programs are stored in the above-mentioned memory and are configured to be executed by the above-mentioned processor. One or more programs include instructions for performing some or all of the steps executed by the message control method described above in the embodiments of the present application. Figure 3 The instructions for performing part or all of the steps of the message control method described above in the embodiments of the present application.
[0118] Among them, the communication module includes a local area network wireless communication module and a wired communication module, and the communication module realizes the communication function through a communication interface.
[0119] Among them, the processor may include one or more processing units. For example, the processor may include an application processor AP, a modem processor, a graphics processor GPU, an image signal processor, a controller, a video codec, a digital signal processor, a baseband processor, and / or a neural network processor NPU, etc. Among them, different processing units may be independent components or integrated in one or more processors.
[0120] The memory can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory, a programmable read-only memory, an erasable programmable read-only memory, an electrically erasable programmable read-only memory, or a flash memory. The volatile memory can be a random access memory, which is used as an external cache. By way of example but not limitation, many forms of random access memory are available, such as static random access memory, dynamic random access memory (DRAM), synchronous dynamic random access memory, double data rate synchronous dynamic random access memory, enhanced synchronous dynamic random access memory, synchronous link dynamic random access memory, and direct memory bus random access memory.
[0121] In a specific implementation, the above program includes instructions for performing the following steps:
[0122] Receiving a second message sent by a gateway device, the second message carrying a message sequence number, the message sequence number being generated according to message parameters carried in the first message, the first message being sent by a node device to the gateway device;
[0123] Performing a preset operation on the messages received by the cloud server based on the message sequence number.
[0124] Optionally, the message parameters include at least one of an IV index and a sequence number SEQ.
[0125] Optionally, the message sequence number consists of an IV index field; or, the message sequence number consists of a SEQ field; or, the message sequence number consists of an IV index field and a SEQ field; the IV index field includes part or all of the IV index, and the SEQ field includes part or all of the SEQ.
[0126] Optionally, the preset operation includes at least one of the following: message deduplication operation, message sorting operation, message anti-replay attack operation.
[0127] Optionally, the preset operation is the message deduplication operation. In terms of performing the preset operation on the messages received by the cloud server based on the message sequence number, the above program includes instructions for performing the following steps:
[0128] Obtaining all messages with the message sequence number being the message sequence number, and retaining the message with the earliest reception time among all the messages and deleting other messages among all the messages except the message with the earliest reception time.
[0129] Figure 7It is a functional unit composition block diagram of the message control device 700 involved in the embodiments of the present application. The message control device 700 is applied to a gateway device. The device 700 includes: a receiving unit 701 and a generating unit 702, where,
[0130] The receiving unit 701 is configured to receive a first message sent by a node device;
[0131] The generating unit 702 is configured to generate a second message according to the first message, where the message sequence number of the second message is generated according to the message parameters carried in the first message.
[0132] Optionally, the message parameters include at least one of an IV index and a sequence number SEQ.
[0133] Optionally, the message sequence number consists of an IV index field; or, the message sequence number consists of a SEQ field; or, the message sequence number consists of an IV index field and a SEQ field; the IV index field includes part or all of the IV index, and the SEQ field includes part or all of the sequence number SEQ.
[0134] Optionally, that the message sequence number of the second message is generated according to the message parameters carried in the first message includes:
[0135] Extracting the IV index and the sequence number SEQ in the message parameters;
[0136] Generating the message sequence number according to the IV index and the sequence number SEQ.
[0137] Optionally, the device 700 is further specifically configured to:
[0138] Send the second message to a cloud server. The second message carries the message sequence number, and the cloud server performs a preset operation on the messages received by the cloud server based on the message sequence number.
[0139] Optionally, the preset operation includes at least one of the following: message deduplication operation, message sorting operation, message anti-replay attack operation.
[0140] It can be understood that the functions of the respective program modules of the message control device in this embodiment can be specifically implemented according to the methods in the method embodiments described above as Figure 2A described. The specific implementation process can refer to the relevant descriptions of the above method embodiments and will not be elaborated here.
[0141] Figure 8It is a block diagram of the functional units of the message control device 800 involved in the embodiments of the present application. The message control device 800 is applied to a cloud server. The device 800 includes: a receiving unit 801 and an execution unit 802, where,
[0142] The receiving unit 801 is configured to receive a second message sent by a gateway device. The second message carries a message sequence number, and the message sequence number is generated according to the message parameters carried in the first message. The first message is sent by a node device to the gateway device;
[0143] The execution unit 802 is configured to perform a preset operation on the messages received by the cloud server based on the message sequence number.
[0144] Optionally, the message parameters include at least one of an IV index and a sequence number SEQ.
[0145] Optionally, the message sequence number consists of an IV index field; or, the message sequence number consists of a SEQ field; or, the message sequence number consists of an IV index field and a SEQ field; the IV index field includes part or all of the IV index, and the SEQ field includes part or all of the SEQ.
[0146] Optionally, the preset operation includes at least one of the following: message deduplication operation, message sorting operation, and message anti-replay attack operation.
[0147] Optionally, the preset operation is the message deduplication operation. In terms of performing the preset operation on the messages received by the cloud server based on the message sequence number, the execution unit 802 is specifically configured to:
[0148] Obtain all messages with the message sequence number being the message sequence number, and retain the message with the earliest reception time among all the messages and delete other messages except the message with the earliest reception time among all the messages.
[0149] It can be understood that the functions of the respective program modules of the message control device in this embodiment can be specifically implemented according to the methods in the method embodiments described above as Figure 3 described. The specific implementation process can refer to the relevant descriptions of the above method embodiments and will not be elaborated here.
[0150] The embodiments of the present application further provide a computer storage medium. The computer storage medium stores a computer program for electronic data exchange, and the computer program enables a computer to execute some or all of the steps of any of the methods recorded in the above method embodiments.
[0151] An embodiment of the present application also provides a computer program product. The computer program product includes a non-transitory computer-readable storage medium storing a computer program. The computer program is operable to cause a computer to execute some or all of the steps of any one of the methods described in the foregoing method embodiments. The computer program product may be a software installation package.
[0152] It should be noted that, for the foregoing method embodiments, for the sake of simple description, they are all expressed as a series of action combinations. However, those skilled in the art should know that the present application is not limited by the described action sequence, because according to the present application, some steps may be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to the present application.
[0153] In the above embodiments, the descriptions of the respective embodiments have their own focuses. For the parts not detailed in a certain embodiment, reference may be made to the relevant descriptions of other embodiments.
[0154] In several embodiments provided by the present application, it should be understood that the disclosed device can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the above division of units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed coupling or direct coupling or communication connection to each other can be through some interfaces. The indirect coupling or communication connection of the device or unit can be in an electrical or other form.
[0155] The units described as separate components may or may not be physically separated. The components displayed as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0156] In addition, the functional units in each embodiment of the present application can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
[0157] If the above integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a memory and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the above methods in various embodiments of this application. The aforementioned memory includes various media that can store program codes, such as USB flash drives, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), mobile hard disks, magnetic disks, or optical discs.
[0158] Those of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing relevant hardware through a program. This program can be stored in a computer-readable memory, and the memory can include: flash drives, read-only memories (abbreviation: ROM, English: Read-Only Memory), random access memories (abbreviation: RAM, English: Random Access Memory), magnetic disks, or optical discs, etc.
[0159] The above has introduced the embodiments of this application in detail. Specific examples are used in this article to elaborate on the principle and implementation manner of this application. The description of the above embodiments is only used to help understand the method and its core idea of this application; at the same time, for those of ordinary skill in the art, according to the idea of this application, there will be changes in the specific implementation manner and application scope. In summary, the content of this specification should not be construed as a limitation to this application.
Claims
1. A message control method, characterized in that, Applied to a gateway device, the method includes: Receiving a first message sent by a node device; Generating a second message according to the first message, wherein the message sequence number of the second message is generated according to the message parameters carried in the first message. Specifically, the message sequence number is generated by extracting the message parameters carried in the first message, and the message content of the first message and the message sequence number are combined into the second message; the message sequence number is used to uniquely and orderly represent the device reporting status; the message content includes the status data of the node device or the message content that the user wants to upload; the message parameters include an IV index and a sequence number SEQ; the message sequence number is composed of an IV index field and a SEQ field; the IV index field includes all of the IV index, and the SEQ field includes all of the sequence number SEQ; Among them, the message sequence number of the second message is generated according to the message parameters carried in the first message, including: Extracting the IV index and the sequence number SEQ from the message parameters; Generating the message sequence number according to the IV index and the sequence number SEQ; The specific expression of the message sequence number is as follows: msg number = (IV << 24) | SEQ Wherein, msg number represents the message sequence number, IV represents the IV index field, and SEQ represents the SEQ field; the message sequence number is used to uniquely identify the message order sent by each device.
2. The method according to claim 1, characterized in that, The method further includes: Sending the second message to a cloud server, the second message carrying the message sequence number, and the cloud server performing a preset operation on the messages received by the cloud server based on the message sequence number.
3. The method according to claim 2, characterized in that, The preset operation includes at least one of the following: message deduplication operation, message sorting operation, message anti-replay attack operation.
4. A message control method, characterized in that, Applied to a cloud server, the method includes: Receiving a second message sent by a gateway device, the second message carrying a message sequence number, the message sequence number being generated according to the message parameters carried in a first message, the first message being sent by a node device to the gateway device; the second message is composed of the gateway device combining the message content of the first message and the message sequence number; the message sequence number is used to uniquely and orderly represent the device reporting status; the message content includes the status data of the node device or the message content that the user wants to upload; the message parameters include an IV index and a sequence number SEQ; the message sequence number is composed of an IV index field and a SEQ field; the IV index field includes all of the IV index, and the SEQ field includes all of the sequence number SEQ; Performing a preset operation on the messages received by the cloud server based on the message sequence number; The specific expression of the message sequence number is as follows: msg number = (IV << 24) | SEQ Wherein, msg number represents the message sequence number, IV represents the IV index field, and SEQ represents the SEQ field; the message sequence number is used to uniquely identify the message order sent by each device.
5. The method according to claim 4, characterized in that, The preset operation includes at least one of the following: message deduplication operation, message sorting operation, and message anti-replay attack operation.
6. The method according to claim 5, characterized in that, The preset operation is the message deduplication operation. The preset operation performed on the messages received by the cloud server based on the message sequence number includes: Obtaining all messages with the message sequence number, retaining the message with the earliest reception time among all the messages, and deleting other messages in all the messages except the message with the earliest reception time.
7. A gateway device, characterized in that, It includes a processor, a memory, a communication interface, and one or more programs. The one or more programs are stored in the memory and are configured to be executed by the processor. The programs include instructions for performing the steps in the method according to any one of claims 1-3.
8. A cloud server, characterized in that, It includes a processor, a memory, a communication interface, and one or more programs. The one or more programs are stored in the memory and are configured to be executed by the processor. The programs include instructions for performing the steps in the method according to any one of claims 4-6.
9. A message control system, characterized in that, The message control system includes a node device, at least one gateway device according to claim 7, and a cloud server according to claim 8.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, and the computer program is executed by a processor to implement the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Security Credentials Recovery in Bluetooth Mesh Network
CN112423277A
Transmission system for avionics application data
US20160347267A1