Message forwarding method and device, electronic equipment and readable storage medium

By using the message forwarding method in a network-free environment, using the first device as a relay device, receiving and updating the message queue, and broadcasting the message when receiving the heartbeat signal of the third device, the short communication distance in the Bluetooth long distance mode is solved. The problem of this problem improves the transmission and diffusion range of messages and reduces the power consumption of the relay device.

CN119325124APending Publication Date: 2025-01-17VIVO MOBILE COMM CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411435502.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-15
Publication Date
2025-01-17

AI Technical Summary

Technical Problem

In a networkless environment, in the long-distance mode of Bluetooth, the communication distance between devices is short, especially when there are obstacles, it is difficult to achieve long-distance message transmission and diffusion.

Method used

By receiving the message sent by the second device in the first device and updating the message queue to be forwarded, the message in the message queue is broadcast when the heartbeat signal of the third device is received, so as to realize the relay forwarding of the message, and improve the transmission distance and diffusion. and broadcast only when other devices are sensed to reduce power consumption of relay devices.

Benefits of technology

It effectively improves the transmission distance and diffusion range of messages in an internet-free environment, while reducing the power consumption of relay devices, extending their battery life, allowing relay devices to forward messages to more devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119325124A_ABST
    Figure CN119325124A_ABST
Patent Text Reader

Abstract

The invention discloses a message forwarding method and device, electronic equipment and a readable storage medium, and belongs to the technical field of communication. The message forwarding method is applied to a first device and comprises the following steps: receiving a first message sent by a second device; under the condition that the first device does not process the first message, updating the to-be-forwarded message queue according to the first message to obtain at least one second message; and broadcasting at least one second message in the to-be-forwarded message queue under the condition that the heartbeat signal of at least one third device is received.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of communication technology, and specifically relates to a message forwarding method and device, an electronic device, and a readable storage medium. Background Art

[0002] Currently, in a network-free environment, a solution has been proposed to perform short-range communication between two devices through the long range mode of Bluetooth.

[0003] However, if the communication is only carried out through the long range mode of Bluetooth, the communication distance is too short, especially when there are obstacles between the two devices, the communication distance will be greatly reduced, making it difficult to send messages over long distances, reducing the transmission distance and diffusion range of messages in a networkless environment. Summary of the invention

[0004] The purpose of the embodiments of the present application is to provide a message forwarding method and device, an electronic device and a readable storage medium, which can improve the transmission distance and diffusion range of messages in a network-free environment.

[0005] In the first aspect, an embodiment of the present application provides a message forwarding method, which is applied to a first device. The message forwarding method includes: receiving a first message sent by a second device; when the first device has not processed the first message, updating a queue of messages to be forwarded according to the first message to obtain at least one second message; when a heartbeat signal of at least one third device is received, broadcasting at least one second message in the queue of messages to be forwarded.

[0006] In the second aspect, an embodiment of the present application provides a message forwarding device, which is applied to a first device, and the message forwarding device includes: a communication unit, which is used to receive a first message sent by a second device; a processing unit, which is used to update a queue of messages to be forwarded according to the first message to obtain at least one second message when the first device has not processed the first message; the communication unit is also used to broadcast at least one second message in the queue of messages to be forwarded when a heartbeat signal from at least one third device is received.

[0007] In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the programs or instructions are executed by the processor, the steps of the message forwarding method of the first aspect are implemented.

[0008] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps of the message forwarding method of the first aspect are implemented.

[0009] In a fifth aspect, an embodiment of the present application provides a chip, which includes a processor and a communication interface, wherein the communication interface and the processor are coupled, and the processor is used to run programs or instructions to implement the steps of the message forwarding method of the first aspect.

[0010] In a sixth aspect, an embodiment of the present application provides a computer program product, which is stored in a storage medium and is executed by at least one processor to implement the steps of the message forwarding method of the first aspect.

[0011] In the message forwarding method provided in the embodiment of the present application, the first device receives the first message sent by the second device; when the first device has not processed the first message, the queue of messages to be forwarded is updated according to the first message to obtain at least one second message; when the heartbeat signal of at least one third device is received, at least one second message in the queue of messages to be forwarded is broadcast. Through the above-mentioned message forwarding method, the first device is used as a relay device, and after receiving the first message of the second device, when it is perceived that there is a third device other than the second device in the surrounding environment, the first message is forwarded to the third device in the form of broadcasting. In this way, on the one hand, a message sent by a device can be forwarded to another device through a relay device in a networkless environment, thereby improving the transmission distance and diffusion range of the message in the networkless environment; on the other hand, broadcasting the message only when it is perceived that there are other devices in the surrounding environment can also reduce the power consumption of the relay device, improve the endurance of the relay device, and enable the relay device to forward the message to more devices, further improving the diffusion range of the message in the networkless environment. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] Figure 1 One of the flow charts of the message forwarding method provided in the embodiment of the present application;

[0013] Figure 2 A second flowchart of the message forwarding method provided in an embodiment of the present application;

[0014] Figure 3 A structural block diagram of a message forwarding device provided in an embodiment of the present application;

[0015] Figure 4 A structural block diagram of an electronic device provided in an embodiment of the present application;

[0016] Figure 5 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0017] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.

[0018] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the terms used in this way are interchangeable where appropriate, so that the embodiments of the present application can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.

[0019] The message forwarding method and device, electronic device, and readable storage medium provided in the embodiments of the present application are described in detail below with reference to the accompanying drawings through specific embodiments and their application scenarios.

[0020] like Figure 1 As shown, an embodiment of the present application provides a message forwarding method, which is applied to a first device. The method may include the following S102 to S106:

[0021] S102: Receive a first message sent by a second device.

[0022] The message forwarding method proposed in the embodiment of the present application is applied to a first device, which may specifically be a smart electronic device with Bluetooth function, such as a smart phone, a tablet computer, a laptop computer, and a smart watch, and is not specifically limited here.

[0023] The second device may be an electronic device that initially generates and sends the first message, or may be an electronic device that relays and forwards the first message, and no specific limitation is made here.

[0024] Furthermore, the first message is a message sent by the second device via Bluetooth broadcast.

[0025] In actual application, the first message may specifically be a distress message, a help message, a location message, or other message sent in a network-free environment, and no specific limitation is made herein.

[0026] S104: When the first device has not processed the first message, update the queue of messages to be forwarded according to the first message to obtain at least one second message.

[0027] The message queue to be forwarded is established in the first device, and is used to store messages that need to be forwarded by the first device.

[0028] Specifically, in the message forwarding method provided in the embodiment of the present application, the first device can receive the first message sent by the second device via Bluetooth broadcast, and the first device further determines whether the first message has been processed before, that is, whether the first message has been received before. In the case where the first device determines that it has not processed the first message, the first device updates its own queue of messages to be forwarded based on the first message, so as to save the latest received messages to be forwarded in the queue of messages to be forwarded, and obtain at least one second message to be forwarded.

[0029] S106: When a heartbeat signal from at least one third device is received, broadcast at least one second message in the queue of messages to be forwarded.

[0030] The third device is an electronic device that can forward messages as a relay device in a networkless environment, and the third device is different from the first device and the second device.

[0031] In the message forwarding method provided in the embodiment of the present application, electronic devices that can forward messages as relay devices in a networkless environment will continue to send heartbeat signals to the outside so that other electronic devices can sense their own existence.

[0032] On this basis, in the message forwarding method provided in the embodiment of the present application, after updating its own queue of messages to be forwarded, the first device will judge whether there is a third device other than itself and the second device in its surrounding environment based on the heartbeat signals of other electronic devices received by itself. In the case where the first device receives the heartbeat signal of at least one third device, that is, in the case where the first device perceives that there is at least one third device in its surrounding environment, the first device broadcasts at least one second message stored in the queue of messages to be forwarded to send the second message in the queue of messages to be forwarded to the third device, so that the third device can continue to forward the second message to other electronic devices. In this way, on the one hand, a message sent by an electronic device can be forwarded to another electronic device through a relay device in a networkless environment, thereby improving the transmission distance and diffusion range of the message in a networkless environment; on the other hand, the message is broadcast only when it is perceived that there are other electronic devices in the surrounding environment that can relay and forward messages, which can avoid the relay device from doing useless work, reduce the power consumption of the relay device, and improve the endurance of the relay device, so that the relay device can forward the message to more devices, further improving the diffusion range of the message in a networkless environment.

[0033] The above-mentioned message forwarding method provided in the embodiment of the present application is applied to the first device, and the first device receives the first message sent by the second device; when the first device has not processed the first message, the queue of messages to be forwarded is updated according to the first message to obtain at least one second message; when the heartbeat signal of at least one third device is received, at least one second message in the queue of messages to be forwarded is broadcast. Through the above-mentioned message forwarding method, the first device is used as a relay device, and after receiving the first message of the second device, when it is perceived that there is a third device other than the second device in the surrounding environment, the first message is forwarded to the third device in the form of broadcasting. In this way, on the one hand, the message sent by one device can be forwarded to another device through the relay device in a networkless environment, thereby improving the transmission distance and diffusion range of the message in the networkless environment; on the other hand, the message is broadcast only when other devices are perceived in the surrounding environment, which can also reduce the power consumption of the relay device and improve the endurance of the relay device, so that the relay device can forward the message to more devices, further improving the diffusion range of the message in the networkless environment.

[0034] In the embodiment of the present application, after the above S102, the above message forwarding method further includes the following S108 to S112:

[0035] S108: Obtain a first field in the first message.

[0036] Among them, the first field is used to indicate the number of devices that can forward the first message. Each time the first message is forwarded by a different device, the value of the first field in the first message is reduced by 1. When the value of the first field in the first message is less than or equal to a preset value, the first message will no longer be forwarded.

[0037] In actual application, the above preset values ​​may be specifically values ​​such as 0 and 1. Those skilled in the art may set specific values ​​of the above preset values ​​according to actual conditions, and no specific limitation is made here.

[0038] S110: When the value of the first field is greater than a preset value, determine the processing status of the first message.

[0039] The processing status of the first message is used to indicate whether the first device has processed the first message.

[0040] Specifically, in the message forwarding method provided in the embodiment of the present application, after receiving the first message broadcasted by the second device, the first device will also extract the first field in the first message and determine whether the value of the first field is greater than the preset value. In the case where the value of the first field is greater than the preset value, it means that the number of electronic devices that have forwarded the first message does not exceed the upper limit of the number of devices that can forward the first message, which means that the first message can still be forwarded by the first device. At this time, the first device continues to perform subsequent processing on the first message to determine whether the first message has been processed before, that is, to determine whether the first message has been received before.

[0041] S112: When the value of the first field is less than or equal to a preset value, the first message is no longer forwarded.

[0042] Specifically, in the message forwarding method provided in the embodiment of the present application, when the value of the first field in the first message is less than or equal to the preset value, it means that the number of electronic devices that have forwarded the first message has exceeded the upper limit of the number of devices that can forward the first message. At this time, the first device directly regards the first message as a redundant message and no longer performs subsequent processing on the first message, that is, the first message is no longer forwarded. In this way, by adding the first field in the first message and limiting the number of devices that can forward the first message, the first message can be prevented from being relayed and forwarded without restriction.

[0043] In the above embodiment provided by the present application, after receiving the first message sent by the second device, the first field in the first message is obtained; when the value of the first field is greater than the preset value, the processing status of the first message is determined, and the processing status is used to indicate whether the first device has processed the first message; when the value of the first field is less than or equal to the preset value, the first message is no longer forwarded; wherein, the first field is used to indicate the number of devices that can forward the first message, and each time the first message is forwarded by a different device, the value of the first field in the first message is reduced by 1. In this way, by adding the first field to the first message, the number of devices that can forward the first message is limited, and the first message can be prevented from being relayed and forwarded without restriction.

[0044] In the embodiment of the present application, the step of determining the processing status of the first message may specifically include the following S114 to S118:

[0045] S114: Remove the first field in the first message to obtain a third message.

[0046] The first field is used to indicate the number of devices that can forward the first message. As different electronic devices forward the first message, the value of the first field in the first message gradually decreases.

[0047] Furthermore, the third message is obtained by removing the first field from the first message.

[0048] S116: When there is a historical message that is consistent with the third message, it is determined that the first message has been processed.

[0049] The historical message is a message previously received by the first device from the second device or other electronic devices broadcast via Bluetooth.

[0050] Furthermore, the historical message does not include the first field, and the historical message may be obtained by removing the first field from the message previously received by the first device.

[0051] It is understandable that electronic devices send messages via Bluetooth broadcasting, and message communication has no directionality, so surrounding devices can all receive Bluetooth broadcast messages. Therefore, an electronic device will receive more redundant messages.

[0052] On this basis, in the message forwarding method provided in the embodiment of the present application, in the process of determining the processing status of the first message by the first device, after the first device receives the first message, since the first field in the first message will decrease as the number of forwarding devices increases, the first device will remove the first field in the first message, and obtain a third message that does not contain the first field, and then compare the third message with the previously received historical message that does not contain the first field. Further, in the case where there is a historical message in the first device that is consistent with the third message, it means that the first device has previously received the first message, that is, it is determined that the first device has processed the first message. At this time, the first device directly regards the first message as a redundant message and no longer performs subsequent processing on the first message.

[0053] S118: When there is no historical message that is consistent with the third message, it is determined that the first message has not been processed.

[0054] Specifically, in the message forwarding method provided in the embodiment of the present application, after the electronic device compares the third message with the previously received historical message that does not contain the first field, if there is no historical message in the first device that is consistent with the third message, it means that the first device has not received the first message before, that is, it is determined that the first device has not processed the first message. At this time, the first device continues to perform subsequent processing on the first message and continues to perform the relay forwarding operation on the first message. In this way, it can avoid the first device from repeatedly processing the first message and avoid the first device from processing redundant messages, thereby reducing the power consumption of the relay device and improving the battery life of the relay device.

[0055] In the above embodiment provided by the present application, in the process of determining the processing status of the first message, the first field in the first message is removed to obtain the third message; when there is a historical message that is consistent with the third message, it is determined that the first message has been processed; when there is no historical message that is consistent with the third message, it is determined that the first message has not been processed. In this way, it is possible to avoid the first device from repeatedly processing the first message and avoid the first device from processing redundant messages, thereby reducing the power consumption of the relay device and improving the battery life of the relay device.

[0056] In the embodiment of the present application, the message source of the first message is the target device, the first message includes a second field, and the step of updating the queue of messages to be forwarded according to the first message may specifically include the following S120 to S124:

[0057] S120: Obtain the message source of the historical message in the message queue to be forwarded.

[0058] The message source of the historical message is used to indicate the electronic device that initially generates and sends the historical message.

[0059] S122: If there is no historical message whose source is the target device, after reducing the value of the first field in the first message by 1, the first message is saved as the second message in the queue of messages to be forwarded.

[0060] The target device is the message source of the first message, that is, the target device is the electronic device that initially generates and sends the first message.

[0061] Further, the target device is different from the first device and the third device. The target device and the second device may be the same device, or may be different devices, which is not specifically limited here.

[0062] Specifically, in the message forwarding method provided in the embodiment of the present application, in the process of the first device updating its own queue of messages to be forwarded based on the first message, the first device will obtain the message source of each historical message saved in the queue of messages to be forwarded. If there is no historical message with the same message source as the first message in the queue of messages to be forwarded, that is, if there is no historical message with the message source of the target device in the queue of messages to be forwarded, it means that the first device has never received a message sent by the target device, and the first message is the latest message of the target device received by the first device. At this time, the first device directly subtracts 1 from the value of the first field in the first message, and saves the processed first message as the second message to the queue of messages to be forwarded.

[0063] S124: In the case that there is a historical message whose source is the target device, the one with the larger value of the second field in the first message and the historical message is determined as the second message, the value of the first field in the second message is reduced by 1, and the second message is saved in the queue of messages to be forwarded.

[0064] Among them, the second field is used to indicate the update status of the message content carried by the first message. When the message content of the first message is updated compared to the fourth message previously sent by the target device, the value of the second field of the first message is increased by 1 compared to the second field of the fourth message.

[0065] For example, in the case where the first message is a distress message generated and broadcast by the target device, when the user location information, user physical condition information, etc. contained in the distress message changes compared to the historical distress message sent last time, the target device will, when broadcasting the distress message, add 1 to the value of the second field in the current distress message based on the value of the second field of the historical distress message sent last time, so that the electronic device receiving the distress message can distinguish between the latest updated distress message and the historical distress message, thereby avoiding the electronic device from continuing to forward messages whose content is invalid, thereby ensuring the accuracy of forwarding the message content.

[0066] On the contrary, when the message content of the distress message currently sent by the target device has not changed compared to the historical distress message it sent last time, the target device does not change the value of the second field of the current distress message, and the current distress message has the same value as the second field of the historical distress message sent last time. At this time, excluding the first field, the message content of the current distress message is the same as that of the historical distress message sent last time.

[0067] Specifically, in the message forwarding method provided in the embodiment of the present application, after the first device obtains the message source of each historical message saved in the message queue to be forwarded, if there is a historical message with the same message source as the first message in the message queue to be forwarded, that is, if there is a historical message with the message source of the target device in the message queue to be forwarded, it means that the first device has received the message sent by the target device. At this time, the first device compares the numerical value of the second field of the historical message with the message source of the target device in the message queue to be forwarded and the first message. In the case where the numerical value of the second field of the historical message is greater than or equal to the numerical value of the second field of the first message, the first device determines that the historical message is the latest message of the target device received by the first device, and still retains the historical message as the second message in the message queue to be forwarded. In the case where the numerical value of the second field of the historical message is less than the numerical value of the second field of the first message, the first device determines that the first message is the latest message of the target device received by the first device, and after subtracting 1 from the numerical value of the first field in the first message, the processed first message is used as the second message, and the historical message with the message source of the target device in the message queue to be forwarded is replaced by the second message, and the second message is saved in the message queue to be forwarded. In this way, only the latest update messages of different electronic devices are saved in the message queue to be forwarded, which can prevent the first device from forwarding messages whose message contents are invalid, thereby ensuring the accuracy of forwarding the message contents.

[0068] In the above embodiment provided by the present application, the source of the first message is the target device, the first message includes a second field, and in the process of updating the queue of messages to be forwarded according to the first message, the source of the historical message in the queue of messages to be forwarded is obtained; in the case where there is no historical message whose source is the target device, the value of the first field in the first message is reduced by 1, and the first message is saved as the second message to the queue of messages to be forwarded; in the case where there is a historical message whose source is the target device, the one with the larger value of the second field in the first message and the historical message is determined as the second message, and the value of the first field in the second message is reduced by 1, and the second message is saved to the queue of messages to be forwarded; wherein the second field is used to indicate the update status of the message content carried by the first message, and when the message content of the first message is updated compared with the fourth message sent by the target device last time, the value of the second field of the first message is increased by 1 compared with the value of the second field of the fourth message. In this way, only the latest update messages of different electronic devices are saved in the queue of messages to be forwarded, which can avoid the first device forwarding messages whose message content is invalid, and ensure the accuracy of message content forwarding.

[0069] In the embodiment of the present application, the step of broadcasting at least one second message in the queue of messages to be forwarded may specifically include the following S126 and S128:

[0070] S126: Broadcast at least one second message in the queue of messages to be forwarded and continue for a first duration.

[0071] In actual application, the specific value of the first duration can be set by technicians in this field according to actual conditions. For example, the first duration can be 1 minute, 2 minutes, 3 minutes, etc., and no specific limitation is made here.

[0072] S128: Broadcast at least one second message again after a second time interval.

[0073] In actual application, the specific value of the second duration can be set by technicians in this field according to actual conditions. For example, the second duration can be 2 minutes, 3 minutes, 5 minutes, etc., and no specific limitation is made here.

[0074] Specifically, in the message forwarding method provided in the embodiment of the present application, when the first device receives the heartbeat signal of at least one third device, that is, when the first device perceives that there is at least one third device in its surrounding environment, the first device broadcasts at least one second message in the queue of messages to be forwarded and continues for the first duration. After the first duration, the first device stops broadcasting at least one second message in the queue of messages to be forwarded, and starts a timer of the second duration, and after the interval of the second duration, that is, after the timer is timed out, if there is still at least one third device in the surrounding environment, the first device broadcasts at least one second message in the queue of messages to be forwarded again and continues for the first duration. This cycle is repeated, so that the first device can intermittently broadcast at least one second message in the queue of messages to be forwarded according to a period, wherein the first duration corresponds to the time period for sending messages in each cycle, and the second duration corresponds to the time period for stopping sending messages in each cycle. In this way, controlling the relay device to intermittently broadcast forwarding messages can reduce the power consumption of the relay device and improve the endurance of the relay device, so that the relay device can forward messages to more devices and increase the diffusion range of messages in a networkless environment.

[0075] In the above-mentioned embodiment provided by the present application, in the process of broadcasting at least one second message in the queue of messages to be forwarded, at least one second message in the queue of messages to be forwarded is broadcast for a first duration; at least one second message is broadcast again after an interval of a second duration, so as to intermittently broadcast at least one second message in the queue of messages to be forwarded according to a period; wherein the first duration corresponds to the time period for sending messages in each cycle, and the second duration corresponds to the time period for stopping sending messages in each cycle. In this way, controlling the relay device to intermittently broadcast forwarding messages can reduce the power consumption of the relay device and improve the endurance of the relay device, thereby enabling the relay device to forward messages to more devices and improve the diffusion range of messages in a network-free environment.

[0076] In the embodiment of the present application, the heartbeat signal includes the screen display status of the third device, and the message forwarding method may further include the following S130 and / or S132:

[0077] S130: When the heartbeat signal of the third device indicates that the screen display state of the third device is switched from the screen-off state to the screen-on state, broadcast at least one second message in the queue of messages to be forwarded.

[0078] The heartbeat signal includes the screen display status of the third device.

[0079] Specifically, in the message forwarding method provided in an embodiment of the present application, when the heartbeat signal received by the first device indicates that the screen display state of the third device has switched from the off state to the on state, it means that the third device is being operated. At this time, the first device immediately broadcasts at least one second message in the message queue to be forwarded to send at least one second message to the third device, so that the person operating the third device can read the second message in time.

[0080] S132: When a heartbeat signal from a fourth device is received, broadcast at least one second message in the queue of messages to be forwarded.

[0081] The fourth device is different from the first device, the second device and the third device. The fourth device is an electronic device that can forward messages as a relay device in a networkless environment.

[0082] Specifically, in the message forwarding method provided in the embodiment of the present application, when the first device receives the heartbeat signal of the fourth device other than the first device, the second device and the third device, it indicates that a new electronic device, namely the fourth device, has entered the communication range of the first device. At this time, the first device immediately broadcasts at least one second message in the queue of messages to be forwarded, so as to send at least one second message to the fourth device in time before the fourth device leaves the communication range of the first device, thereby increasing the diffusion range of the second message and improving the probability of the second message being read.

[0083] In the above embodiment provided by the present application, the heartbeat signal includes the screen display state of the third device. When the heartbeat signal of the third device indicates that the screen display state of the third device is switched from the off-screen state to the on-screen state, at least one second message in the queue of messages to be forwarded is broadcast; and / or, when the heartbeat signal of the fourth device is received, at least one second message in the queue of messages to be forwarded is broadcast. In this way, the probability of the message to be forwarded being read is increased, and the diffusion range of the message to be forwarded is increased.

[0084] In summary, if Figure 2As shown, taking the preset value of 1 as an example, the message forwarding method provided in the embodiment of the present application may specifically include the following S202 to S224:

[0085] S202: Receive a first message from a second device.

[0086] S204: Determine: the first message after removing the first field has been received. If so, end the process. If not, execute S206.

[0087] S206: Determine: whether the value of the first field of the first message is greater than 1, if so, execute S208, if not, end the process.

[0088] S208: Determine: if there are historical messages sent by the target device in the message queue to be forwarded, if so, execute S210, if not, execute S212.

[0089] S210: Determine the one with the larger value of the second field in the first message and the historical message as the second message, reduce the value of the first field of the second message by 1, and save the second message to the queue of messages to be forwarded.

[0090] S212: After reducing the value of the first field of the first message by 1, the first message is saved as the second message in the queue of messages to be forwarded.

[0091] S214: Determine: There is a third device nearby, if yes, execute S216, if not, end the process.

[0092] S216: Forward at least one second message in the to-be-forwarded message queue, and continue for a first duration.

[0093] S218: After the first duration, stop forwarding the second message and set a timer for a second duration.

[0094] S220: The timer expires.

[0095] S222: Receive the heartbeat signal of the fourth device.

[0096] S224: It is detected that the third device changes from a screen-off state to a screen-on state.

[0097] After S220 is executed, if there is still a third device around, S216 is continued to be executed, and S216 is also executed after S222 and S224.

[0098] In this way, the embodiment of the present application provides a message forwarding method, which can relay messages from other devices with the help of surrounding devices (such as electronic devices of people in need, passers-by, and rescuers) in a network-free environment, and can also take into account the battery life of the relay device, avoid invalid forwarding of messages, increase the transmission distance and expansion range of messages in a network-free environment, and improve the probability of message reading.

[0099] The message forwarding method provided in the embodiment of the present application can be executed by a message forwarding device. In the embodiment of the present application, the message forwarding device provided in the embodiment of the present application is described by taking the message forwarding device executing the above message forwarding method as an example.

[0100] like Figure 3 As shown, an embodiment of the present application provides a message forwarding device 300, which is applied to a first device. The message forwarding device 300 may include the following communication unit 302 and processing unit 304.

[0101] The communication unit 302 is configured to receive a first message sent by a second device;

[0102] The processing unit 304 is configured to update the queue of messages to be forwarded according to the first message to obtain at least one second message when the first device has not processed the first message;

[0103] The communication unit 302 is further configured to broadcast at least one second message in the queue of messages to be forwarded upon receiving a heartbeat signal from at least one third device.

[0104] The message forwarding device 300 provided in the embodiment of the present application is applied to the first device, and the first device receives the first message sent by the second device; when the first device has not processed the first message, the queue of messages to be forwarded is updated according to the first message to obtain at least one second message; when the heartbeat signal of at least one third device is received, at least one second message in the queue of messages to be forwarded is broadcast. Through the above-mentioned message forwarding device 300, the first device is used as a relay device, and after receiving the first message of the second device, when it is perceived that there is a third device other than the second device in the surrounding environment, the first message is forwarded to the third device in the form of broadcasting. In this way, on the one hand, in a networkless environment, a message sent by one device can be forwarded to another device through a relay device, thereby improving the transmission distance and diffusion range of the message in the networkless environment; on the other hand, broadcasting the message only when it is perceived that there are other devices in the surrounding environment can also reduce the power consumption of the relay device, improve the endurance of the relay device, and enable the relay device to forward the message to more devices, further improving the diffusion range of the message in the networkless environment.

[0105] In an embodiment of the present application, after receiving the first message sent by the second device, the processing unit 304 is also used to: obtain the first field in the first message; when the value of the first field is greater than a preset value, determine the processing status of the first message, and the processing status is used to indicate whether the first device has processed the first message; when the value of the first field is less than or equal to the preset value, the first message is no longer forwarded; wherein the first field is used to indicate the number of devices that can forward the first message, and each time the first message is forwarded by a different device, the value of the first field in the first message is reduced by 1.

[0106] In the above embodiment provided by the present application, after receiving the first message sent by the second device, the first field in the first message is obtained; when the value of the first field is greater than the preset value, the processing status of the first message is determined, and the processing status is used to indicate whether the first device has processed the first message; when the value of the first field is less than or equal to the preset value, the first message is no longer forwarded; wherein, the first field is used to indicate the number of devices that can forward the first message, and each time the first message is forwarded by a different device, the value of the first field in the first message is reduced by 1. In this way, by adding the first field to the first message, the number of devices that can forward the first message is limited, and the first message can be prevented from being relayed and forwarded without restriction.

[0107] In an embodiment of the present application, the processing unit 304 is specifically used to: remove the first field in the first message to obtain a third message; if there is a historical message that is consistent with the third message, determine that the first message has been processed; if there is no historical message that is consistent with the third message, determine that the first message has not been processed.

[0108] In the above embodiment provided by the present application, in the process of determining the processing status of the first message, the first field in the first message is removed to obtain the third message; when there is a historical message that is consistent with the third message, it is determined that the first message has been processed; when there is no historical message that is consistent with the third message, it is determined that the first message has not been processed. In this way, it is possible to avoid the first device from repeatedly processing the first message and avoid the first device from processing redundant messages, thereby reducing the power consumption of the relay device and improving the battery life of the relay device.

[0109] In an embodiment of the present application, the message source of the first message is the target device, and the first message includes a second field. The processing unit 304 is specifically used to: obtain the message source of the historical message in the message queue to be forwarded; in the case that there is no historical message whose message source is the target device, after reducing the value of the first field in the first message by 1, save the first message as the second message to the message queue to be forwarded; in the case that there is a historical message whose message source is the target device, determine the larger value of the second field in the first message and the historical message as the second message, after reducing the value of the first field in the second message by 1, save the second message to the message queue to be forwarded; wherein, the second field is used to indicate the update status of the message content carried by the first message, and when the message content of the first message is updated compared with the fourth message sent by the target device last time, the value of the second field of the first message is increased by 1 compared with the value of the second field of the fourth message.

[0110] In the above embodiment provided by the present application, the source of the first message is the target device, the first message includes a second field, and in the process of updating the queue of messages to be forwarded according to the first message, the source of the historical message in the queue of messages to be forwarded is obtained; in the case where there is no historical message whose source is the target device, the value of the first field in the first message is reduced by 1, and the first message is saved as the second message to the queue of messages to be forwarded; in the case where there is a historical message whose source is the target device, the one with the larger value of the second field in the first message and the historical message is determined as the second message, and the value of the first field in the second message is reduced by 1, and the second message is saved to the queue of messages to be forwarded; wherein the second field is used to indicate the update status of the message content carried by the first message, and when the message content of the first message is updated compared with the fourth message sent by the target device last time, the value of the second field of the first message is increased by 1 compared with the value of the second field of the fourth message. In this way, only the latest update messages of different electronic devices are saved in the queue of messages to be forwarded, which can avoid the first device forwarding messages whose message content is invalid, and ensure the accuracy of message content forwarding.

[0111] In an embodiment of the present application, the communication unit 302 is specifically used to: broadcast at least one second message in the queue of messages to be forwarded for a first time period; broadcast at least one second message after an interval of a second time period, so as to intermittently broadcast at least one second message in the queue of messages to be forwarded according to a period; wherein the first time period corresponds to a time period for sending messages in each cycle, and the second time period corresponds to a time period for stopping sending messages in each cycle.

[0112] In the above-mentioned embodiment provided by the present application, in the process of broadcasting at least one second message in the queue of messages to be forwarded, at least one second message in the queue of messages to be forwarded is broadcast for a first duration; at least one second message is broadcast again after an interval of a second duration, so as to intermittently broadcast at least one second message in the queue of messages to be forwarded according to a period; wherein the first duration corresponds to the time period for sending messages in each cycle, and the second duration corresponds to the time period for stopping sending messages in each cycle. In this way, controlling the relay device to intermittently broadcast forwarding messages can reduce the power consumption of the relay device and improve the endurance of the relay device, thereby enabling the relay device to forward messages to more devices and improve the diffusion range of messages in a network-free environment.

[0113] In an embodiment of the present application, the heartbeat signal includes the screen display status of the third device, and the communication unit 302 is also used to: when the heartbeat signal of the third device indicates that the screen display status of the third device is switched from the off state to the on state, broadcast at least one second message in the message queue to be forwarded; and / or, when the heartbeat signal of the fourth device is received, broadcast at least one second message in the message queue to be forwarded.

[0114] In the above embodiment provided by the present application, the heartbeat signal includes the screen display state of the third device. When the heartbeat signal of the third device indicates that the screen display state of the third device is switched from the off-screen state to the on-screen state, at least one second message in the queue of messages to be forwarded is broadcast; and / or, when the heartbeat signal of the fourth device is received, at least one second message in the queue of messages to be forwarded is broadcast. In this way, the probability of the message to be forwarded being read is increased, and the diffusion range of the message to be forwarded is increased.

[0115] The message forwarding device 300 in the embodiment of the present application can be an electronic device, or a component in the electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal, or other devices other than a terminal. Exemplarily, the electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, a vehicle-mounted electronic device, a mobile Internet device (Mobile Internet Device, MID), an augmented reality (augmented reality, AR) / virtual reality (virtual reality, VR) device, a robot, a wearable device, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook or a personal digital assistant (personal digital assistant, PDA), etc., and can also be a server, a network attached storage (Network Attached Storage, NAS), a personal computer (personal computer, PC), a television (television, TV), a teller machine or a self-service machine, etc., which is not specifically limited in the embodiment of the present application.

[0116] The message forwarding device 300 in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.

[0117] The message forwarding device 300 provided in the embodiment of the present application can realize Figure 1 and Figure 2 To avoid repetition, the various processes implemented by the method embodiment are not described here.

[0118] Alternatively, if Figure 4 As shown, an embodiment of the present application also provides an electronic device 400, including a processor 402 and a memory 404, wherein the memory 404 stores programs or instructions that can be executed on the processor 402, and when the program or instructions are executed by the processor 402, the various steps of the above-mentioned message forwarding method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, they are not described here.

[0119] It should be noted that the electronic devices in the embodiments of the present application include the above-mentioned mobile electronic devices and non-mobile electronic devices.

[0120] Figure 5 A schematic diagram of the hardware structure of an electronic device to implement an embodiment of the present application.

[0121] The electronic device 500 includes but is not limited to: a radio frequency unit 501, a network module 502, an audio output unit 503, an input unit 504, a sensor 505, a display unit 506, a user input unit 507, an interface unit 508, a memory 509 and a processor 510.

[0122] Those skilled in the art will appreciate that the electronic device 500 may also include a power source (such as a battery) for supplying power to various components, and the power source may be logically connected to the processor 510 through a power management system, thereby implementing functions such as managing charging, discharging, and power consumption management through the power management system. Figure 5 The electronic device structure shown in the figure does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently, which will not be described in detail here.

[0123] Among them, the electronic device 500 is the above-mentioned first device.

[0124] The radio frequency unit 501 is configured to receive a first message sent by a second device.

[0125] The processor 510 is configured to update the queue of messages to be forwarded according to the first message to obtain at least one second message when the first device has not processed the first message.

[0126] The radio frequency unit 501 is further configured to broadcast at least one second message in the queue of messages to be forwarded upon receiving a heartbeat signal from at least one third device.

[0127] In an embodiment of the present application, a first device receives a first message sent by a second device; when the first device has not processed the first message, the queue of messages to be forwarded is updated according to the first message to obtain at least one second message; when a heartbeat signal of at least one third device is received, at least one second message in the queue of messages to be forwarded is broadcast. In an embodiment of the present application, the first device acts as a relay device. After receiving the first message from the second device, when it senses that there is a third device other than the second device in the surrounding environment, the first message is relayed to the third device in the form of broadcast. In this way, on the one hand, a message sent by one device can be forwarded to another device through a relay device in a networkless environment, thereby improving the transmission distance and diffusion range of the message in a networkless environment; on the other hand, broadcasting the message only when it senses that there are other devices in the surrounding environment can also reduce the power consumption of the relay device and improve the battery life of the relay device, so that the relay device can forward the message to more devices, further improving the diffusion range of the message in a networkless environment.

[0128] Optionally, after receiving the first message sent by the second device, the processor 510 is also used to: obtain the first field in the first message; when the value of the first field is greater than a preset value, determine the processing status of the first message, and the processing status is used to indicate whether the first device has processed the first message; when the value of the first field is less than or equal to a preset value, the first message is no longer forwarded; wherein the first field is used to indicate the number of devices that can forward the first message, and each time the first message is forwarded by a different device, the value of the first field in the first message is reduced by 1.

[0129] In the above embodiment provided by the present application, after receiving the first message sent by the second device, the first field in the first message is obtained; when the value of the first field is greater than the preset value, the processing status of the first message is determined, and the processing status is used to indicate whether the first device has processed the first message; when the value of the first field is less than or equal to the preset value, the first message is no longer forwarded; wherein, the first field is used to indicate the number of devices that can forward the first message, and each time the first message is forwarded by a different device, the value of the first field in the first message is reduced by 1. In this way, by adding the first field to the first message, the number of devices that can forward the first message is limited, and the first message can be prevented from being relayed and forwarded without restriction.

[0130] Optionally, the processor 510 is specifically used to: remove the first field in the first message to obtain a third message; if there is a historical message consistent with the third message, determine that the first message has been processed; if there is no historical message consistent with the third message, determine that the first message has not been processed.

[0131] In the above embodiment provided by the present application, in the process of determining the processing status of the first message, the first field in the first message is removed to obtain the third message; when there is a historical message that is consistent with the third message, it is determined that the first message has been processed; when there is no historical message that is consistent with the third message, it is determined that the first message has not been processed. In this way, it is possible to avoid the first device from repeatedly processing the first message and avoid the first device from processing redundant messages, thereby reducing the power consumption of the relay device and improving the battery life of the relay device.

[0132] Optionally, the message source of the first message is the target device, and the first message includes a second field. The processor 510 is specifically used to: obtain the message source of the historical message in the message queue to be forwarded; in the case that there is no historical message whose message source is the target device, after reducing the value of the first field in the first message by 1, save the first message as the second message to the message queue to be forwarded; in the case that there is a historical message whose message source is the target device, determine the larger value of the second field in the first message and the historical message as the second message, after reducing the value of the first field in the second message by 1, save the second message to the message queue to be forwarded; wherein, the second field is used to indicate the update status of the message content carried by the first message, and when the message content of the first message is updated compared to the fourth message sent by the target device last time, the value of the second field of the first message is increased by 1 compared to the value of the second field of the fourth message.

[0133] In the above embodiment provided by the present application, the source of the first message is the target device, the first message includes a second field, and in the process of updating the queue of messages to be forwarded according to the first message, the source of the historical message in the queue of messages to be forwarded is obtained; in the case where there is no historical message whose source is the target device, the value of the first field in the first message is reduced by 1, and the first message is saved as the second message to the queue of messages to be forwarded; in the case where there is a historical message whose source is the target device, the one with the larger value of the second field in the first message and the historical message is determined as the second message, and the value of the first field in the second message is reduced by 1, and the second message is saved to the queue of messages to be forwarded; wherein the second field is used to indicate the update status of the message content carried by the first message, and when the message content of the first message is updated compared with the fourth message sent by the target device last time, the value of the second field of the first message is increased by 1 compared with the value of the second field of the fourth message. In this way, only the latest update messages of different electronic devices are saved in the queue of messages to be forwarded, which can avoid the first device forwarding messages whose message content is invalid, and ensure the accuracy of message content forwarding.

[0134] Optionally, the radio frequency unit 501 is specifically used to: broadcast at least one second message in the queue of messages to be forwarded for a first duration; broadcast at least one second message after an interval of a second duration, so as to intermittently broadcast at least one second message in the queue of messages to be forwarded according to a period; wherein the first duration corresponds to a time period for sending messages in each cycle, and the second duration corresponds to a time period for stopping sending messages in each cycle.

[0135] In the above-mentioned embodiment provided by the present application, in the process of broadcasting at least one second message in the queue of messages to be forwarded, at least one second message in the queue of messages to be forwarded is broadcast for a first duration; at least one second message is broadcast again after an interval of a second duration, so as to intermittently broadcast at least one second message in the queue of messages to be forwarded according to a period; wherein the first duration corresponds to the time period for sending messages in each cycle, and the second duration corresponds to the time period for stopping sending messages in each cycle. In this way, controlling the relay device to intermittently broadcast forwarding messages can reduce the power consumption of the relay device and improve the endurance of the relay device, thereby enabling the relay device to forward messages to more devices and improve the diffusion range of messages in a network-free environment.

[0136] Optionally, the heartbeat signal includes the screen display status of the third device, and the radio frequency unit 501 is also used to: broadcast at least one second message in the message queue to be forwarded when the heartbeat signal of the third device indicates that the screen display status of the third device is switched from an off state to a bright screen state; and / or, when the heartbeat signal of the fourth device is received, broadcast at least one second message in the message queue to be forwarded.

[0137] In the above embodiment provided by the present application, the heartbeat signal includes the screen display state of the third device. When the heartbeat signal of the third device indicates that the screen display state of the third device is switched from the off-screen state to the on-screen state, at least one second message in the queue of messages to be forwarded is broadcast; and / or, when the heartbeat signal of the fourth device is received, at least one second message in the queue of messages to be forwarded is broadcast. In this way, the probability of the message to be forwarded being read is increased, and the diffusion range of the message to be forwarded is increased.

[0138] It should be understood that in the embodiment of the present application, the input unit 504 may include a graphics processor (GPU) 5041 and a microphone 5042, and the graphics processor 5041 processes the image data of a static picture or video obtained by an image capture device (such as a camera) in a video capture mode or an image capture mode. The display unit 506 may include a display panel 5061, and the display panel 5061 may be configured in the form of a liquid crystal display, an organic light emitting diode, etc. The user input unit 507 includes a touch panel 5071 and at least one of other input devices 5072. The touch panel 5071 is also called a touch screen. The touch panel 5071 may include two parts: a touch detection device and a touch controller. Other input devices 5072 may include, but are not limited to, a physical keyboard, function keys (such as a volume control button, a switch button, etc.), a trackball, a mouse, and a joystick, which will not be repeated here.

[0139] The memory 509 can be used to store software programs and various data. The memory 509 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area may store an operating system, an application program or instructions required for at least one function (such as a sound playback function, an image playback function, etc.), etc. In addition, the memory 509 may include a volatile memory or a non-volatile memory, or the memory 509 may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate synchronous dynamic random access memory (DDRSDRAM), an enhanced synchronous dynamic random access memory (ESDRAM), a synchronous link dynamic random access memory (SLDRAM) and a direct memory bus random access memory (DRRAM). The memory 509 in the embodiment of the present application includes but is not limited to these and any other suitable types of memory.

[0140] The processor 510 may include one or more processing units; optionally, the processor 510 integrates an application processor and a modem processor, wherein the application processor mainly processes operations related to an operating system, a user interface, and application programs, and the modem processor mainly processes wireless communication signals, such as a baseband processor. It is understandable that the modem processor may not be integrated into the processor 510.

[0141] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the various processes of the above-mentioned message forwarding method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0142] The processor is the processor in the electronic device in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk.

[0143] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface and the processor are coupled, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned message forwarding method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0144] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.

[0145] An embodiment of the present application provides a computer program product, which is stored in a storage medium. The program product is executed by at least one processor to implement the various processes of the above-mentioned message forwarding method embodiment and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0146] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.

[0147] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods of each embodiment of the present application.

[0148] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.

Claims

1. A message forwarding method, characterized in that: Applied to a first device, the message forwarding method includes: receiving a first message sent by a second device; If the first device has not processed the first message, update the queue of messages to be forwarded according to the first message to obtain at least one second message; In case of receiving a heartbeat signal from at least one third device, at least one of the second messages in the queue of messages to be forwarded is broadcasted.

2. The message forwarding method according to claim 1, characterized in that: After receiving the first message sent by the second device, the message forwarding method further includes: Obtaining a first field in the first message; When the value of the first field is greater than a preset value, determining a processing status of the first message, where the processing status is used to indicate whether the first device has processed the first message; When the value of the first field is less than or equal to the preset value, the first message is no longer forwarded; The first field is used to indicate the number of devices that can forward the first message, and each time the first message is forwarded by a different device, the value of the first field in the first message is reduced by 1.

3. The message forwarding method according to claim 2, characterized in that: The determining a processing status of the first message includes: Removing the first field from the first message to obtain a third message; If there is a historical message that is consistent with the third message, determining that the first device has processed the first message; In a case where there is no historical message that is consistent with the third message, it is determined that the first device has not processed the first message.

4. The message forwarding method according to claim 2, characterized in that: The message source of the first message is a target device, the first message includes a second field, and the updating of the to-be-forwarded message queue according to the first message includes: Obtain the message source of the historical message in the message queue to be forwarded; In the case that there is no historical message whose source is the target device, after reducing the value of the first field in the first message by 1, the first message is saved as the second message in the queue of messages to be forwarded; In the case that there is the historical message whose source is the target device, determining the one with the larger value of the second field in the first message and the historical message as the second message, decrementing the value of the first field in the second message by 1, and saving the second message to the queue of messages to be forwarded; Among them, the second field is used to indicate the update status of the message content carried by the first message. When the message content of the first message is updated compared to the fourth message previously sent by the target device, the value of the second field of the first message is increased by 1 compared to the second field of the fourth message.

5. The message forwarding method according to any one of claims 1 to 4, characterized in that: The broadcasting of at least one of the second messages in the queue of messages to be forwarded includes: Broadcasting at least one of the second messages in the queue of messages to be forwarded for a first duration; broadcasting at least one of the second messages again after a second time interval, so as to intermittently broadcast at least one of the second messages in the queue of messages to be forwarded according to a period; The first duration corresponds to a time period for sending messages in each cycle, and the second duration corresponds to a time period for stopping sending messages in each cycle.

6. The message forwarding method according to any one of claims 1 to 4, characterized in that: The heartbeat signal includes a screen display state of the third device, and the message forwarding method further includes: When the heartbeat signal of the third device indicates that the screen display state of the third device is switched from the off-screen state to the on-screen state, broadcasting at least one of the second messages in the queue of messages to be forwarded; and / or, In case of receiving the heartbeat signal of the fourth device, at least one of the second messages in the queue of messages to be forwarded is broadcast.

7. A message forwarding device, characterized in that: Applied to the first device, the message forwarding device includes: A communication unit, configured to receive a first message sent by a second device; a processing unit, configured to update a queue of messages to be forwarded according to the first message to obtain at least one second message when the first device has not processed the first message; The communication unit is further configured to broadcast at least one of the second messages in the queue of messages to be forwarded upon receiving a heartbeat signal from at least one third device.

8. The message forwarding device according to claim 7, characterized in that: After receiving the first message sent by the second device, the processing unit is further used for: Obtaining a first field in the first message; When the value of the first field is greater than a preset value, determining a processing status of the first message, where the processing status is used to indicate whether the first device has processed the first message; When the value of the first field is less than or equal to the preset value, the first message is no longer forwarded; The first field is used to indicate the number of devices that can forward the first message, and each time the first message is forwarded by a different device, the value of the first field in the first message is reduced by 1.

9. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores a program or instruction that can be run on the processor, and when the program or instruction is executed by the processor, the steps of the message forwarding method according to any one of claims 1 to 6 are implemented.

10. A readable storage medium, characterized in that: The readable storage medium stores a program or instruction, and when the program or instruction is executed by a processor, the steps of the message forwarding method according to any one of claims 1 to 6 are implemented.