Early warning method and device, electronic equipment and storage medium
By establishing short-range communication connections between smart home devices and spreading early warning information packets, the problem of traditional early warning systems failing when network interruptions are solved, timely alarm transmission is achieved when disasters occur, and disaster risk is reduced.
Patent Information
- Application Number
- CN202510341456.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-21
- Publication Date
- 2025-06-27
AI Technical Summary
When a disaster occurs, the traditional early warning system fails due to interruption of the communication network, making it difficult for residents to obtain alarm information in a timely manner and increase disaster risk.
The wireless communication module establishes a short-range communication connection between smart home devices, receives and disseminates early warning information packets, expands the coverage of early warning, and ensures that information is spread in a timely manner without a network.
It realizes the timely dissemination of early warning information packets in the event of network interruption, expands the coverage of early warning, and reduces disaster risks.
Smart Images

Figure CN120224153A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the technical field of smart furniture, and particularly relates to a warning method, device, electronic device, and storage medium. Background Art
[0002] With the progress of technology, smart home devices have become increasingly popular, and their wireless communication functions (such as Wireless Fidelity (WiFi), Bluetooth) have greatly improved the convenience of life. However, during disasters, the communication network may be interrupted, resulting in the failure of traditional warning systems, making it difficult for residents to obtain warning information in a timely manner, thus increasing the disaster risk.
[0003] Currently, there is a lack of communication capabilities between smart home devices, and they are unable to transmit data packets or share information. When the network is interrupted, disaster warning information cannot be disseminated, resulting in a reduced warning coverage area and lower timeliness. Summary of the Invention
[0004] The purpose of the embodiments of this application is to provide a warning method, device, electronic device, and storage medium, which can solve the problem in the related art that when there is no network, disaster warning information cannot be disseminated, resulting in a reduced warning coverage area and lower timeliness.
[0005] In a first aspect, the embodiments of this application provide a warning method, which is applied to a first device. The method includes:
[0006] Establish a short-range communication connection with a second device through a wireless communication module;
[0007] Receive a warning information packet sent by the second device through the short-range communication connection; the warning information packet is generated by the second device according to the detected disaster information;
[0008] Detect a third device within the coverage area of the wireless communication module, and establish the short-range communication connection with the third device;
[0009] Send the warning information packet to the third device through the short-range communication connection.
[0010] In a second aspect, the embodiments of this application provide a warning device, which includes:
[0011] A connection module, configured to establish a short-range communication connection with a second device through a wireless communication module;
[0012] A receiving module, configured to receive a warning information packet sent by the second device through the short-range communication connection; the warning information packet is generated by the second device according to the detected disaster information;
[0013] A detection module, configured to detect a third device within the coverage range of the wireless communication module;
[0014] The connection module is further configured to establish the short-range communication connection with the third device;
[0015] A sending module, configured to send the warning information packet to the third device through the short-range communication connection.
[0016] Optionally, the warning device further includes:
[0017] A first determination module, configured to determine the location information of the first device;
[0018] A first sending sub-module, configured to send the location information to the cloud server;
[0019] The first determination module is further configured to enable the cloud server to determine the warning coverage area according to the location information of each device that receives the warning information packet.
[0020] Optionally, the detection module includes:
[0021] A second determination module, configured to determine a preset propagation number according to the disaster level parameter in the warning information packet;
[0022] A second sending sub-module, configured to increment the propagation number of the warning information packet by 1 each time the warning information packet is sent to a third device; the initial value of the propagation number is 0;
[0023] A stop module, configured to stop sending the warning information packet when the propagation number is greater than or equal to the preset propagation number.
[0024] Optionally, the detection module further includes:
[0025] A third determination module, configured to determine a preset propagation number according to the disaster level parameter in the warning information packet;
[0026] A reading module, configured to read a preset parameter from the warning information packet; the preset parameter is used to indicate the propagation number of the warning information packet;
[0027] An adding module, configured to increment the preset parameter by 1 when receiving the warning information packet, and add the updated preset parameter to the warning information packet;
[0028] A stop module, configured to stop sending the warning information packet when the updated preset parameter is greater than or equal to the preset propagation number.
[0029] Optionally, the detection module further includes:
[0030] A first search module, configured to search, centered on the first device, for a third device with a wireless communication function enabled within the coverage of the wireless communication module; or, search for a third device that is connected to the same wireless communication network as the first device.
[0031] Optionally, the detection module further includes:
[0032] A judgment module, configured to judge whether the content of the warning information packet is the same as that of at least one historical warning information packet locally stored in the first device;
[0033] A detection sub-module, configured to detect a third device within the coverage of the wireless communication module when the content of the warning information packet is different from that of at least one historical warning information packet locally stored in the first device.
[0034] Optionally, the warning device further includes:
[0035] An analysis module, configured to analyze the warning content in the warning information packet;
[0036] A display module, configured to display the warning content through the display module;
[0037] A prompt module, configured to perform voice prompts through the broadcast module.
[0038] Optionally, the warning device further includes:
[0039] A generation module, configured to generate a warning information packet according to the detected disaster information;
[0040] A connection sub-module, configured to establish a short-range communication connection with the first device through the wireless communication module;
[0041] A sending sub-module, configured to send the warning information packet to the first device through the short-range communication connection.
[0042] Optionally, the warning device further includes:
[0043] A second search module, configured to search, centered on the second device, for a first device with a wireless communication function enabled within the coverage of the wireless communication module; or, search for a first device that is connected to the same wireless communication network as the second device.
[0044] Optionally, the connection sub-module further includes:
[0045] A display sub-module, configured to generate and display a warning request; the warning request is used to request confirmation of whether to send the warning information packet;
[0046] A connection sub-module, configured to establish a short-range communication connection with a first device through a wireless communication module when it is confirmed to send a warning information packet.
[0047] In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor, a memory, a communication interface, and a communication bus. The processor, the memory, and the communication interface complete communication with each other through the communication bus; the memory is used to store executable instructions, and the executable instructions cause the processor to execute the warning method described in any one of the above.
[0048] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the warning method described in any one of the above is implemented.
[0049] In an embodiment of the present application, a warning method is provided. A first device can establish a short-range communication connection with a second device through a wireless communication module; receive a warning information packet sent by the second device through the short-range communication connection; the warning information packet is generated by the second device according to detected disaster information; detect a third device within the coverage of the wireless communication module and establish a short-range communication connection with the third device; send the warning information packet to the third device through the short-range communication connection. During the warning process, short-range communication connections between multiple devices are established through the wireless communication module, that is, the first device establishes a short-range communication connection with the second device through the wireless communication module; after detecting a third device within the coverage of the wireless communication module and establishing a short-range communication connection with the third device, the warning coverage range can be expanded through multiple short-range communication connections, so that the timely dissemination of the warning information packet can be realized without a network. Description of the Drawings
[0050] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments of the present invention will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention, and those of ordinary skill in the art can also obtain other drawings based on these drawings without creative efforts.
[0051] Figure 1 is the step flow of a warning method provided by an embodiment of the present application Figure 1 ;
[0052] Figure 2 is a schematic diagram of the process of warning information packet transmission provided by an embodiment of the present application;
[0053] Figure 3 is the step flow of a warning method provided by an embodiment of the present application Figure 2 ;
[0054] Figure 4 is a logic block diagram of an early warning device provided by an embodiment of the present application;
[0055] Figure 5 is a schematic structural diagram of an electronic device provided by an embodiment of the present application. Specific embodiments
[0056] Next, the technical solutions in the embodiments of the present application will be clearly described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art belong to the scope of protection of the present application.
[0057] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, rather than to describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances 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. generally belong to the same category, 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 means at least one of the connected objects, and the character " / " generally means an "or" relationship between the associated objects before and after.
[0058] Method embodiments
[0059] Next, the early warning method provided by the embodiments of the present application will be described in detail in conjunction with the accompanying drawings through specific embodiments and their application scenarios.
[0060] Refer to Figure 1 , which shows the step flow of an early warning method provided by an embodiment of the present application Figure 1 , as Figure 1 shown, the method specifically includes steps S101 to S104:
[0061] Step S101, establish a short-range communication connection with a second device through a wireless communication module;
[0062] Step S102, receive an early warning information packet sent by the second device through the short-range communication connection; the early warning information packet is generated by the second device according to the detected disaster information;
[0063] Step S103, detect a third device within the coverage range of the wireless communication module, and establish a short-range communication connection with the third device;
[0064] Step S104: Send the warning information packet to the third device through short-range communication connection.
[0065] The warning method provided by the embodiment of the present invention can be applied to the first device. Refer to Figure 2 , which shows a schematic flowchart of the transmission of a warning information packet provided by the embodiment of the present invention. As Figure 2 shown, the first device is used to receive the warning information packet sent by the second device. The first device can establish a short-range communication connection with the second device through a wireless communication module. The third device is any device within the coverage range of the wireless communication module of the first device. The short-range communication connection in the present invention can include a WiFi connection or a Bluetooth connection.
[0066] In the embodiment of the present invention, during the warning process, a short-range communication connection is established between multiple devices through the wireless communication module, that is, the first device establishes a short-range communication connection with the second device through the wireless communication module; after detecting the third device within the coverage range of the wireless communication module, a short-range communication connection is established with the third device, and then the warning coverage range can be expanded through multiple short-range communication connections, so that the timely dissemination of the warning information packet can be realized without a network.
[0067] Exemplarily, the first device in the embodiment of the present invention can first establish a short-range communication connection with the second device through the wireless communication module.
[0068] Among them, the first device can be any device that receives the warning information packet. The first device is configured with a wireless communication module.
[0069] Exemplarily, the first device can be a device of the intelligent control type, such as a smart speaker, a smart central control screen, a smart camera, a smart door lock, a smart sensor, etc.
[0070] Exemplarily, the smart sensor can include a door and window sensor, a smoke sensor, a water immersion sensor, etc., which can monitor the opening and closing state of doors and windows, the smoke concentration, the water leakage situation, etc. For example, a certain brand of door and window sensor will send a notification to the mobile phone in time when the door or window is opened.
[0071] The wireless communication module can include a Bluetooth module or a WiFi module, etc., which are electronic components that can realize wireless data transmission and communication functions.
[0072] The composition of the wireless communication module can include a radio frequency chip, an antenna, a microcontroller (Microcontroller Unit, MCU), a memory, and a power management module.
[0073] Among them, the RF chip is responsible for the transmission and reception of wireless signals. The antenna is used for transmitting and receiving wireless signals. The MCU is responsible for processing data and executing communication protocols. The memory is used for storing firmware and configuration information. The power management module is used for managing the power consumption of the module.
[0074] Exemplarily, the functions of the wireless communication module may include, but are not limited to, device interconnection, remote control, data transmission, status monitoring, etc.
[0075] Among them, device interconnection refers to realizing communication between smart home devices; remote control refers to remotely controlling devices through a mobile phone APP or a cloud platform; data transmission refers to transmitting sensor data, control instructions, etc. Status monitoring refers to real-time monitoring of device status (such as temperature, humidity, switch status).
[0076] The wireless communication module is a core component of smart home devices, responsible for realizing wireless connection and data transmission between devices. According to the requirements and application scenarios of the devices, appropriate wireless communication technologies (such as Wi-Fi, Zigbee, Z-Wave, etc.) can be selected. Understanding the working principle and characteristics of the wireless communication module helps to better design and optimize smart home systems.
[0077] The second device can be any sending device on the warning information packet transmission link, not limited to the first sending device. The second device can also be a certain sending device in the middle of the transmission link.
[0078] As an example, in the case of the A->B->C->D transmission link, the second device can be device A, or it can be device B or device C.
[0079] Short-range communication connection refers to a communication method that realizes data transmission and information interaction between devices within a relatively short distance range.
[0080] Exemplarily, short-range communication connections may include Bluetooth, Wi-Fi, Zigbee, Near Field Communication (NFC), Dedicated Short Range Communication (DSRC), etc.
[0081] Among them, Bluetooth is a radio technology that supports short-distance communication between devices. It operates in the 2.4GHz frequency band. Generally, the transmission distance is about 10 meters. It can realize the connection between devices such as mobile phones, headphones, speakers, smart watches, etc., and is used for transmitting information such as audio and data. For example, using a Bluetooth headset to connect to a mobile phone to answer calls or play music.
[0082] Wi-Fi is commonly used in places such as homes, offices, shopping malls, etc., enabling devices to connect to the Internet or local area network wirelessly. Generally, the indoor coverage range is within dozens of meters. For example, mobile phones and computers can connect to a wireless router via Wi-Fi to achieve high-speed Internet access.
[0083] Zigbee is mainly used for low-rate, low-power, and low-cost wireless communication applications, such as the connection between devices like light controls, temperature sensors, and door and window sensors in smart homes. The transmission distance is generally between 10 and 100 meters, and it can form star, tree, or mesh networks.
[0084] NFC operates at a frequency of 13.56 MHz, and the communication distance is generally within a few centimeters. It is often used in mobile payment, bus card swiping, quick pairing between devices, etc. For example, a mobile phone supporting NFC can be brought close to a bus card reader or payment terminal to complete the payment.
[0085] DSRC is mainly used in the field of intelligent transportation, such as communication between vehicle-to-vehicle (V2V) and vehicle-to-infrastructure (V2I). It can achieve functions such as toll-free passing without stopping and vehicle safety warning. The working frequency band is generally 5.8 GHz, and the communication distance can reach hundreds of meters.
[0086] Exemplarily, short-range communication connections can be achieved through technologies such as Bluetooth or WiFi.
[0087] After establishing a short-range communication connection with the second device through the wireless communication module, the first device can also receive a warning information packet sent by the second device through the short-range communication connection; the warning information packet is generated by the second device based on the detected disaster information.
[0088] Among them, the warning information packet can be generated based on the detected disaster information.
[0089] Exemplarily, a detection module can be installed on smart home devices, such as a fire detector (such as a smoke sensor), a gas leakage detector, an earthquake sensor, etc.
[0090] Exemplarily, in the case where the smoke sensor detects smoke, it can be pre-judged whether it is caused by a fire. In the case of an alarm that is not caused by a fire, information about the misjudgment can be fed back.
[0091] Exemplarily, the warning information packet can include the detected disaster content, disaster level, location information, number of transmissions, etc.
[0092] Exemplarily, the disaster content can include natural disasters such as earthquake disasters, fires, floods, etc.
[0093] The disaster level can be the obtained earthquake magnitude. The positioning information can include the longitude and latitude information of the occurrence of the disaster. The way to obtain the longitude and latitude information is through positioning by the Global Positioning System (GPS) or by obtaining the Internet Protocol Address (IP). The number of transmissions is used to indicate the number of times the warning information packet is transmitted.
[0094] Exemplarily, basic parameters of seismic waves, seismic source information, etc. can be obtained through seismic sensors.
[0095] The basic parameters of seismic waves can include information such as vibration amplitude, frequency, direction, etc.
[0096] The vibration amplitude is used to reflect the magnitude of earthquake energy. The larger the vibration amplitude, the greater the energy released by the earthquake usually is, and there is a certain correlation with the earthquake magnitude. Seismic waves of different frequencies carry different information. Low-frequency seismic waves may be related to deep crustal activities, and high-frequency seismic waves may be related to the vibration characteristics of shallow strata. According to the propagation direction and vibration direction of seismic waves, it helps to judge the azimuth of the seismic source and the propagation direction of earthquake rupture.
[0097] The seismic source information can include magnitude, seismic source location, etc. Among them, the magnitude can be calculated based on parameters such as the amplitude and frequency of seismic waves, combined with seismological formulas and algorithms, to measure the size and intensity of the earthquake. The seismic source location can determine the three-dimensional coordinates of the seismic source, that is, longitude, latitude, and depth, by using information such as the time difference and propagation speed of seismic waves received by multiple seismic sensors and the principle of triangulation positioning.
[0098] After receiving the warning information packet sent by the second device through a short-range communication connection, the first device can also detect a third device within the coverage of the wireless communication module and establish a short-range communication connection with the third device.
[0099] Among them, the third device within the coverage of the wireless communication module can be any device that is connected to the same WiFi as the first device, or any device that can establish a Bluetooth connection with the first device.
[0100] After detecting the third device within the coverage of the wireless communication module and establishing a short-range communication connection with the third device, the first device can also send the warning information packet to the third device through the short-range communication connection.
[0101] Exemplarily, in the case of the transmission link of A->B->C->D, the third device can be device C or device D.
[0102] Exemplarily, during the transmission from Device A to Devices B, C, and D, the third device can be Device B or Device C, or it can also be Device D.
[0103] An embodiment of the present invention provides an early warning method. The first device can establish a short-range communication connection with the second device through a wireless communication module; receive an early warning information packet sent by the second device through the short-range communication connection; the early warning information packet is generated by the second device according to the detected disaster information; detect a third device within the coverage range of the wireless communication module and establish a short-range communication connection with the third device; and send the early warning information packet to the third device through the short-range communication connection. During the early warning process, short-range communication connections are established among multiple devices through the wireless communication module, that is, the first device establishes a short-range communication connection with the second device through the wireless communication module; after detecting a third device within the coverage range of the wireless communication module and establishing a short-range communication connection with the third device, the early warning coverage range can be expanded through multiple short-range communication connections, so that the timely dissemination of the early warning information packet can be achieved without a network.
[0104] In the embodiment of the present invention, after sending the early warning information packet to the third device through the short-range communication connection, the following steps can be specifically included:
[0105] Step S105: Determine the location information of the first device;
[0106] Step S106: Send the location information to the cloud server so that the cloud server can determine the early warning coverage range according to the location information of each device that has received the early warning information packet.
[0107] For the early warning method provided by the embodiment of the present invention, after sending the early warning information packet to the third device through the short-range communication connection, the location information of each device can be sent to the cloud server, so that the cloud server can determine the early warning coverage range according to the location information of each device.
[0108] Determine the location information of the first device.
[0109] Among them, the location information can be the longitude and latitude information of the first device, which can be obtained through GPS positioning or through the IP address.
[0110] After determining the location information of the first device, the first device can also send the location information to the cloud server so that the cloud server can determine the early warning coverage range according to the location information of each device that has received the early warning information packet.
[0111] Among them, the cloud server is used to process the location information of each device and then determine the early warning coverage range.
[0112] Exemplarily, a cloud server is a virtual server based on cloud computing technology, also known as a cloud computing server or a cloud host.
[0113] A cloud server (Elastic Compute Service, ECS) is a simple, efficient, secure, and reliable computing service with elastic scalability in processing power. Users can quickly create or release any number of cloud servers without having to purchase hardware in advance, and can access computing resources on demand like using resources such as water and electricity. The management method is simpler and more efficient than that of physical servers.
[0114] Through virtualization technology, a cloud server integrates a large number of physical server resources to form a huge resource pool. Then, according to the needs of users, virtual servers of different specifications are divided from this resource pool and allocated to each user for use. Each virtual server can independently run an operating system and application programs, and is isolated from each other, just like an independent physical server.
[0115] Cloud servers can be deployed in data centers around the world. Users can choose to deploy cloud servers in different regions according to their business needs and user distribution to achieve global coverage of their business and reduce the latency of user access.
[0116] The early warning coverage area refers to the area covered after the early warning information packet is propagated through a short-range communication connection.
[0117] Exemplarily, the early warning coverage area can be a coverage area with a radius of one kilometer centered on the disaster occurrence location, or a coverage area with a straight-line transmission distance of two kilometers centered on the disaster occurrence location, etc.
[0118] In the embodiment of the present invention, detecting a third device within the coverage area of the detection wireless communication module specifically may include the following steps:
[0119] Step S1031: Determine a preset number of propagation times according to the disaster level parameter in the early warning information packet;
[0120] Step S1032: Each time the early warning information packet is sent to a third device, increment the propagation times of the early warning information packet by 1; the initial value of the propagation times is 0;
[0121] Step S1033: Stop sending the early warning information packet when the propagation times is greater than or equal to the preset number of propagation times.
[0122] Determine a preset number of propagation times according to the disaster level parameter in the early warning information packet.
[0123] Among them, the disaster level parameter in the early warning information packet can be a first-level fire, or a second-level fire, etc.
[0124] The preset number of transmissions can be dynamically adjusted according to the disaster level parameter. When the disaster level parameter is relatively low, the determined preset number of transmissions is correspondingly small; when the disaster level parameter is relatively high, the preset number of transmissions is correspondingly large.
[0125] Exemplarily, when the disaster level parameter is a first-level fire, the determined preset number of transmissions can be 5 times; when the disaster level parameter is a second-level fire, the determined preset number of transmissions can be 10 times, etc.
[0126] After determining the preset number of transmissions according to the disaster level parameter in the warning information packet, each time the first device sends the warning information packet to a third device, the transmission count of the warning information packet is incremented by 1; the initial value of the transmission count is 0.
[0127] Exemplarily, in a scenario where a device transmits warning data packets to multiple devices, the initial value of the transmission count is set to 0. For example, if device A transmits warning information packets to devices B, C, and D, the transmission count of the warning information packet can be obtained as 3.
[0128] After incrementing the transmission count of the warning information packet by 1 each time the warning information packet is sent to a third device and the initial value of the transmission count is 0, the first device can also stop sending the warning information packet when the transmission count is greater than or equal to the preset number of transmissions.
[0129] Exemplarily, in a scenario where a device transmits warning data packets to multiple devices, when the disaster level parameter is a second-level fire, the determined preset number of transmissions is 10 times, and the transmission count of the obtained warning information packet is 11, that is, the transmission count is greater than the preset number of transmissions, then the sending of the warning information packet can be stopped.
[0130] In the embodiments of the present invention, detecting third devices within the coverage of the detection wireless communication module may specifically include the following steps:
[0131] Step S1034: Determine the preset number of transmissions according to the disaster level parameter in the warning information packet;
[0132] Step S1035: Read the preset parameter from the warning information packet; the preset parameter is used to indicate the transmission count of the warning information packet;
[0133] Step S1036: When receiving the warning information packet, increment the preset parameter by 1 and add the updated preset parameter to the warning information packet;
[0134] Step S1037: Stop sending the warning information packet when the updated preset parameter is greater than or equal to the preset number of transmissions.
[0135] Determine a preset number of transmissions according to the disaster level parameter in the warning information packet; read a preset parameter from the warning information packet; the preset parameter is used to indicate the number of transmissions of the warning information packet.
[0136] Wherein, the preset parameter refers to the actual number of transmissions of the warning information packet.
[0137] After reading the preset parameter from the warning information packet, when the first device receives the warning information packet, it can also increment the preset parameter by 1 and add the updated preset parameter to the warning information packet.
[0138] Exemplarily, in the case of the A->B->C->D transmission link, after A->B, the preset parameter will be incremented by 1, that is, the preset parameter at this time is 1, and the preset parameter = 1 is added to the warning information packet. Then, after B->C, on the basis of the preset parameter = 1, it will be incremented by 1 again, that is, the preset parameter at this time is 2. After C->D, on the basis of the preset parameter = 2, the preset parameter will be incremented by 1 again, that is, the preset parameter at this time is 3.
[0139] When the first device receives the warning information packet, after incrementing the preset parameter by 1 and adding the updated preset parameter to the warning information packet, the first device can stop sending the warning information packet when the updated preset parameter is greater than or equal to the preset number of transmissions.
[0140] Exemplarily, in the case of the A->B->C->D transmission link, when the preset number of transmissions is 3 and the updated preset parameter is 3, stop sending the warning information packet.
[0141] In the embodiment of the present invention, detecting a third device within the coverage of the wireless communication module specifically may include the following steps:
[0142] Step S1038: Centering on the first device, search for a third device with the wireless communication function enabled within the coverage of the wireless communication module; or,
[0143] Step S1039: Search for a third device that accesses the same wireless communication network as the first device.
[0144] Centering on the first device, search for a third device with the wireless communication function enabled within the coverage of the wireless communication module.
[0145] Wherein, the third device with the wireless communication function enabled refers to any device with the Bluetooth function enabled within the coverage of the wireless communication module.
[0146] Exemplarily, the third device with the wireless communication function enabled may include one device or multiple devices.
[0147] During the process of detecting a third device within the coverage range of the wireless communication module, the first device may also search for a third device that is connected to the same wireless communication network as the first device.
[0148] Among them, the third device that is connected to the same wireless communication network as the first device refers to any device that is connected to the same WiFi as the first device.
[0149] In the embodiment of the present invention, detecting a third device within the coverage range of the wireless communication module may specifically include the following steps:
[0150] Step S1040: Determine whether the warning information packet is the same as the content of at least one historical warning information packet stored locally in the first device;
[0151] Step S1041: When the warning information packet is different from the content of at least one historical warning information packet stored locally in the first device, detect a third device within the coverage range of the wireless communication module.
[0152] Determine whether the warning information packet is the same as the content of at least one historical warning information packet stored locally in the first device.
[0153] Exemplarily, when the warning information packet is exactly the same as at least one historical warning information packet stored locally in the first device, the warning information packet will be discarded. When the warning information packet is different from at least one historical warning information packet stored locally in the first device, it is necessary to detect a third device within the coverage range of the wireless communication module.
[0154] It should be noted that the first device can compare the warning information packet with at least one historical warning information packet stored locally in the first device one by one, and then can determine whether to discard the warning data packet or detect a third device within the coverage range of the wireless communication module.
[0155] In the embodiment of the present invention, the warning method may specifically include the following steps:
[0156] Step S105: Analyze the warning content in the warning information packet;
[0157] Step S106: Display the warning content through a display module and give a voice prompt through a broadcast module.
[0158] Analyze the warning content in the warning information packet.
[0159] Exemplarily, the first device can analyze the warning content in the warning information packet, that is, determine the disaster content, disaster level, location information, number of transmissions, etc. according to the warning information packet.
[0160] After parsing the warning content in the warning information packet, the first device can also display the warning content through a display module and give a voice prompt through a broadcast module.
[0161] Exemplarily, displaying the warning content can include displaying it in text or displaying it through a video, etc.
[0162] Exemplarily, during the warning prompt, it can be a text prompt or a voice prompt, etc.
[0163] In another embodiment of the present invention, the warning method can also be applied to a second device, which specifically may include the following steps:
[0164] Step S107: Generate a warning information packet according to the detected disaster information;
[0165] Step S108: Establish a short-range communication connection with the first device through a wireless communication module;
[0166] Step S109: Send the warning information packet to the first device through the short-range communication connection.
[0167] In the embodiment of the present invention, during the warning process, a short-range communication connection is established between multiple devices through a wireless communication module, that is, a short-range communication connection is established between the first device and the second device through the wireless communication module; after detecting a third device within the coverage of the wireless communication module, a short-range communication connection is established with the third device, and thus the warning coverage range can be expanded through multiple short-range communication connections, so that the timely dissemination of the warning information packet can be achieved without a network.
[0168] Generate a warning information packet according to the detected disaster information.
[0169] Among them, the warning information packet is generated by the second device according to the detected disaster information.
[0170] After generating the warning information packet according to the detected disaster information, the second device can establish a short-range communication connection with the first device through a wireless communication module.
[0171] Exemplarily, the second device in the embodiment of the present invention can first establish a short-range communication connection with the first device through a wireless communication module.
[0172] The second device can be any sending device on the warning information packet transmission link, not limited to the first sending device, and the second device can also be a certain sending device in the middle of the transmission link.
[0173] Among them, the first device can be any device that receives the warning information packet. A wireless communication module is configured in the first device.
[0174] The wireless communication module can include a Bluetooth module or a WiFi module, etc., which are electronic components that can implement wireless data transmission and communication functions.
[0175] As an example, in the case of the transmission link of A->B->C->D, the second device can be device A, or device B or device C.
[0176] After establishing a short-range communication connection with the first device through the wireless communication module, the second device can send the warning information packet to the first device through the short-range communication connection.
[0177] Among them, the short-range communication connection refers to a communication method that realizes data transmission and information interaction between devices within a relatively short distance range.
[0178] Exemplarily, the short-range communication connection can be realized through Bluetooth technology or WiFi, etc.
[0179] Send the warning information packet to the first device through the short-range communication connection.
[0180] In another embodiment of the present invention, the warning method may specifically include the following steps:
[0181] Step S110: Search for the first device with the wireless communication function enabled within the coverage of the wireless communication module with the second device as the center; or,
[0182] Step S111: Search for the first device that is connected to the same wireless communication network as the second device.
[0183] Search for the first device with the wireless communication function enabled within the coverage of the wireless communication module with the second device as the center.
[0184] Among them, the first device with the wireless communication function enabled refers to any device that enables the Bluetooth function within the coverage of the wireless communication module.
[0185] Exemplarily, the first device with the wireless communication function enabled can include one device or multiple devices.
[0186] During the process of determining the first device, the second device can also search for the first device that is connected to the same wireless communication network as the second device.
[0187] Among them, the first device that is connected to the same wireless communication network as the second device refers to any device that is connected to the same WiFi as the second device.
[0188] In an embodiment of the present invention, establishing a short-range communication connection with a first device through a wireless communication module may specifically include the following steps:
[0189] Step S1081: Generate a warning request and display it; the warning request is used to request confirmation of whether to send a warning information packet.
[0190] Step S1082: In the case of confirming the sending of the warning information packet, establish a short-range communication connection with the first device through the wireless communication module.
[0191] Generate a warning request and display it; the warning request is used to request confirmation of whether to send a warning information packet.
[0192] Among them, the warning request is used to request confirmation of whether to send a warning information packet, that is, for preliminary warning.
[0193] After generating a warning request and displaying it; the warning request is used to request confirmation of whether to send a warning information packet, the second device may also, in the case of confirming the sending of the warning information packet, establish a short-range communication connection with the first device through the wireless communication module.
[0194] Exemplarily, in the case of confirming the sending of the warning information packet, the second device may establish a short-range communication connection with the first device.
[0195] After the smart home device (second device) detects disaster information, it sends a warning message (warning information packet) to surrounding devices through WiFi or Bluetooth, and the devices that receive the warning then spread it to other devices to form network relay propagation.
[0196] The warning information can be broadcast by voice or displayed on devices such as mobile phones and smart bracelets.
[0197] Estimate the disaster occurrence location based on the location of the device that issues the warning.
[0198] Estimate the coverage area of the warning information based on the hop count (propagation times) of the warning information propagation and the device density.
[0199] Exemplarily, referring to Figure 3 , shows the step flow of a warning method provided by an embodiment of the present application Figure 2 , as Figure 3 shown, this method specifically includes steps S201 to S211:
[0200] Step S201: Install a disaster detection module on the smart home device.
[0201] Install a disaster detection module on the smart home device, such as a fire detector (such as a smoke sensor), a gas leakage detector, an earthquake sensor, etc., and connect these sensors to the smart home device for real-time monitoring of environmental changes.
[0202] Step S202: Detect a disaster and generate a warning information packet.
[0203] When the sensor detects an abnormality, an alarm signal is immediately sent to the device; (the second device) the device generates a warning information packet based on the alarm signal, including the disaster type, the location of the sending device, etc.
[0204] Step S203: Broadcast and send the warning information packet via WiFi / Bluetooth.
[0205] When broadcasting and sending, the MAC address of the sending device will be recorded to avoid retransmission.
[0206] Step S204: Receive the warning information packet and check whether it contains a duplicate information packet.
[0207] It is judged by comparing the unique identifier (such as a random code) in the warning information packet.
[0208] Exemplarily, in the process of judging according to the unique identifier (such as a random code) in the warning information packet, local comparison, database comparison, comparison in network communication, etc. can be carried out.
[0209] Among them, the local comparison can include hash value comparison. The hash value comparison refers to calculating the hash value of the content in the information packet (including the unique identifier) and comparing it with the expected hash value of the information packet stored locally. If the hash values are the same, it means that the content of the information packet (including the unique identifier) has not been tampered with and is the expected information packet.
[0210] Among them, the database comparison can include query matching, which means using the received unique identifier as a query condition to query in the database.
[0211] Among them, the comparison in network communication can include protocol - specified comparison. That is, in the network communication protocol, it usually stipulates how to process and verify the unique identifier. For example, in the TCP / IP protocol, data packets have specific sequence numbers and acknowledgment numbers and other identifiers. The receiving party will compare these identifiers according to the protocol rules to ensure the correctness and integrity of data transmission. When the sending party sends data, it will assign a sequence number to each data packet. After receiving the data packet, the receiving party will judge whether there is data loss or out - of - order according to the sequence number and inform the sending party of the correctly received data packets through the acknowledgment number.
[0212] Step S205: Discard the duplicate information packet.
[0213] If it is a duplicate received warning information packet, it will be discarded.
[0214] Step S206: Continue to broadcast and send the warning information packet.
[0215] If it is a new warning message, continue to broadcast and send the warning message packet.
[0216] Step S207: Within a preset range, receive the warning message packet through the devices around (the first device or the third device).
[0217] The surrounding devices keep WiFi or Bluetooth turned on and are in the broadcast listening mode; in the case of a new warning message packet, it can be broadcast and sent through WiFi or Bluetooth; the wireless module of the surrounding devices can then receive the warning message packet.
[0218] Step S208: Estimate the location where the disaster occurs.
[0219] The receiving device of (the first device or the third device) estimates the possible location where the disaster may occur based on the location of the sending device.
[0220] Step S209: Estimate the warning coverage area.
[0221] Estimate the radius of the warning coverage area based on the number of hops of warning propagation and the device density.
[0222] Step S210: Display the warning content.
[0223] The receiving device of (the first device or the third device) parses the content in the warning message packet; and displays the warning content on devices such as mobile phones, tablets, and smart bracelets.
[0224] Step S211: Play a voice warning.
[0225] Broadcast a warning voice prompt through a speaker or a voice broadcast module.
[0226] Exemplarily, two-factor authentication can also be used to avoid false alarms. First, send a preliminary warning and require the user to confirm or cancel; after the user confirms, then conduct a full warning sending and display.
[0227] Device Embodiment
[0228] As Figure 4 shown, Figure 4 The logic block diagram of a warning device provided by an embodiment of the present application is shown. The device includes:
[0229] A connection module 1001, configured to establish a short-range communication connection with a second device through a wireless communication module;
[0230] A receiving module 1002, configured to receive the warning message packet sent by the second device through the short-range communication connection; the warning message packet is generated by the second device according to the detected disaster information;
[0231] The detection module 1003 is used to detect a third device within the coverage range of the wireless communication module;
[0232] The connection module 1001 is further used to establish the short-range communication connection with the third device;
[0233] The sending module 1004 is used to send the warning information packet to the third device through the short-range communication connection.
[0234] Optionally, the warning device further includes:
[0235] The first determination module is used to determine the location information of the first device;
[0236] The first sending sub-module is used to send the location information to the cloud server;
[0237] The first determination module is further used to enable the cloud server to determine the warning coverage range according to the location information of each device that receives the warning information packet.
[0238] Optionally, the detection module includes:
[0239] The second determination module is used to determine the preset propagation times according to the disaster level parameter in the warning information packet;
[0240] The second sending sub-module is used to increment the propagation times of the warning information packet by 1 each time the warning information packet is sent to a third device; the initial value of the propagation times is 0;
[0241] The stop module is used to stop sending the warning information packet when the propagation times is greater than or equal to the preset propagation times.
[0242] Optionally, the detection module further includes:
[0243] The third determination module is used to determine the preset propagation times according to the disaster level parameter in the warning information packet;
[0244] The reading module is used to read the preset parameter from the warning information packet; the preset parameter is used to indicate the propagation times of the warning information packet;
[0245] The adding module is used to increment the preset parameter by 1 when receiving the warning information packet, and add the updated preset parameter to the warning information packet;
[0246] The stop module is used to stop sending the warning information packet when the updated preset parameter is greater than or equal to the preset propagation times.
[0247] Optionally, the detection module further includes:
[0248] A first search module, configured to search, centered on the first device, for a third device with a wireless communication function enabled within the coverage of the wireless communication module; or search for a third device that is connected to the same wireless communication network as the first device.
[0249] Optionally, the detection module further includes:
[0250] A judgment module, configured to judge whether the content of the early warning information packet is the same as that of at least one historical early warning information packet locally stored in the first device;
[0251] A detection sub-module, configured to detect a third device within the coverage of the wireless communication module when the content of the early warning information packet is different from that of at least one historical early warning information packet locally stored in the first device.
[0252] Optionally, the early warning device further includes:
[0253] An analysis module, configured to analyze the early warning content in the early warning information packet;
[0254] A display module, configured to display the early warning content through the display module;
[0255] A prompt module, configured to perform voice prompts through the broadcast module.
[0256] Optionally, the early warning device further includes:
[0257] A generation module, configured to generate an early warning information packet according to the detected disaster information;
[0258] A connection sub-module, configured to establish a short-range communication connection with the first device through the wireless communication module;
[0259] A sending sub-module, configured to send the early warning information packet to the first device through the short-range communication connection.
[0260] Optionally, the early warning device further includes:
[0261] A second search module, configured to search, centered on the second device, for a first device with a wireless communication function enabled within the coverage of the wireless communication module; or search for a first device that is connected to the same wireless communication network as the second device.
[0262] Optionally, the connection sub-module further includes:
[0263] A display sub-module, configured to generate and display an early warning request; the early warning request is used to request confirmation of whether to send the early warning information packet;
[0264] A connection sub-module, configured to establish a short-range communication connection with a first device through a wireless communication module when it is confirmed that a warning information packet is to be sent.
[0265] For the device embodiments, since they are basically similar to the method embodiments, the description is relatively simple. For related parts, refer to the partial description of the method embodiments.
[0266] Each embodiment in this specification is described in a progressive manner. Each embodiment focuses on the differences from other embodiments. For the same or similar parts among the embodiments, reference can be made to each other.
[0267] The warning device in the embodiments of the present application can be an electronic device or a component in an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal or other devices other than terminals. Exemplarily, the electronic device can be a GPU BOX, a mobile phone, a tablet computer, a laptop computer, a handheld computer, a vehicle-mounted electronic device, a Mobile Internet Device (MID), an augmented reality (AR) / virtual reality (VR) device, a robot, a wearable device, an ultra-mobile personal computer (UMPC), a netbook, or a personal digital assistant (PDA), etc. It can also be a server, a Network Attached Storage (NAS), a personal computer (PC), a television (TV), a teller machine, or a self-service machine, etc. The embodiments of the present application do not make specific limitations.
[0268] The warning device in the embodiments of the present application can be a device with an operating system. The operating system can be an Android operating system, a Linux, a Windows operating system, etc., or other possible operating systems. The embodiments of the present application do not make specific limitations.
[0269] The warning device provided in the embodiments of the present application can implement Figure 1 each process implemented by the method embodiments. To avoid repetition, it will not be elaborated here.
[0270] Optionally, as Figure 5As shown in the figure, an embodiment of the present application further provides an electronic device 1100, including a processor 1101 and a memory 1102. A program or instruction that can run on the processor 1101 is stored on the memory 1102. When the program or instruction is executed by the processor 1101, each step of the above-mentioned warning method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be elaborated here.
[0271] In an embodiment of the present application, the memory 1102 can be used to store software programs and various data. The memory 1102 mainly includes a first storage area for storing programs or instructions and a second storage area for storing data. Among them, the first storage area can store an operating system, application programs or instructions required for at least one function (such as a sound playback function, an image playback function, etc.). In addition, the memory 1102 can include a volatile memory or a non-volatile memory, or the memory 1102 can include both a volatile memory and a non-volatile memory. Among them, the non-volatile memory can 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 can 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 (DDR SDRAM), an enhanced synchronous dynamic random access memory (ESDRAM), a synchronous link dynamic random access memory (SLDRAM), and a direct rambus random access memory (DRRAM). The memory 1102 in the embodiment of the present application includes, but is not limited to, these and any other suitable types of memories.
[0272] The processor 1101 may include one or more processing units; optionally, the processor 1101 integrates an application processor and a modem processor. Among them, the application processor mainly processes operations related to the operating system, user interface, and application programs, etc., and the modem processor mainly processes wireless communication signals, such as a baseband processor. It can be understood that the above-mentioned modem processor may not be integrated into the processor 1101.
[0273] An embodiment of the present application further provides an electronic device, which includes a processor, a memory, a communication interface, and a communication bus. The processor, the memory, and the communication interface complete communication with each other through the communication bus; the memory is used to store executable instructions, and the executable instructions cause the processor to execute each process of the warning method embodiment as described above, and can achieve the same technical effect. To avoid repetition, it will not be elaborated here.
[0274] An embodiment of the present application further provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, it implements each process of the warning method embodiment as described above, and can achieve the same technical effect. To avoid repetition, it will not be elaborated here.
[0275] Among them, the processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes computer-readable storage media, such as computer read-only memory ROM, random access memory RAM, magnetic disks, or optical discs, etc.
[0276] Another embodiment of the present application provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor, and the processor is used to run a program or instruction to implement each process of the warning method embodiment as described above, and can achieve the same technical effect. To avoid repetition, it will not be elaborated here.
[0277] It should be understood that the chip involved in the embodiment of the present application can also be referred to as a system-on-chip, system chip, chip system, or system-on-chip, etc.
[0278] 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 each process of the warning method embodiment as described above, and can achieve the same technical effect. To avoid repetition, it will not be elaborated here.
[0279] It should be noted that in this text, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, such that a process, method, article or device comprising a series of elements not only includes those elements but also other elements not explicitly listed, or elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "comprising an..." does not exclude the existence of additional identical elements in the process, method, article or device comprising that 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 the reverse order according to the functions involved. For example, the described methods may be performed in an order different from that described, and various steps may be added, omitted, or combined. Additionally, the features described with reference to certain examples may be combined in other examples.
[0280] Through the description of the above embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus a necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases the former is a better implementation. Based on such an understanding, the technical solution of the present application, in essence or the part that contributes to the related art, can be embodied in the form of a computer software product. The computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to enable a terminal (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in various embodiments of the present application.
[0281] The embodiments of the present application have been described above in conjunction with the accompanying drawings. However, the present application is not limited to the above specific embodiments. The above specific embodiments are merely illustrative and not restrictive. Those of ordinary skill in the art, under the inspiration of the present application and without departing from the spirit of the present application and the scope protected by the claims, can also make many forms, all of which fall within the protection scope of the present application.
Claims
1. An early warning method, characterized in that: Applied to a first device, the method includes: Establishing a short-range communication connection with a second device through a wireless communication module; Receiving, via the short-range communication connection, a warning information packet sent by the second device; the warning information packet is generated by the second device according to the detected disaster information; Detecting a third device within the coverage of the wireless communication module, and establishing the short-range communication connection with the third device; The warning information packet is sent to the third device via the short-range communication connection.
2. The method according to claim 1, characterized in that After sending the warning information packet to the third device through the short-range communication connection, the method further includes: Determining location information of the first device; The location information is sent to a cloud server, so that the cloud server determines the warning coverage range according to the location information of each device that receives the warning information package.
3. The method according to claim 1, characterized in that The detecting of a third device within the coverage range of the wireless communication module comprises: Determining a preset number of transmission times according to the disaster level parameter in the warning information package; Each time the warning information packet is sent to a third device, the number of transmissions of the warning information packet is increased by 1; the initial value of the number of transmissions is 0; When the number of transmissions is greater than or equal to the preset number of transmissions, the sending of the warning information packet is stopped.
4. The method according to claim 1, characterized in that: The detecting of a third device within the coverage range of the wireless communication module comprises: Determining a preset number of transmission times according to the disaster level parameter in the warning information package; Reading a preset parameter from the warning information package; the preset parameter is used to indicate the number of times the warning information package is propagated; When receiving the warning information package, the preset parameter is incremented by 1, and the updated preset parameter is added to the warning information package; When the updated preset parameter is greater than or equal to the preset propagation times, the sending of the warning information packet is stopped.
5. The method according to claim 1, characterized in that: The detecting of a third device within the coverage range of the wireless communication module comprises: Taking the first device as the center, searching for a third device with wireless communication function enabled within the coverage of the wireless communication module; or, Search for a third device connected to the same wireless communication network as the first device.
6. The method according to claim 1, characterized in that The detecting of a third device within the coverage range of the wireless communication module comprises: Determining whether the warning information package has the same content as at least one historical warning information package stored locally on the first device; In a case where the content of the warning information packet is different from the content of at least one historical warning information packet locally stored in the first device, a third device within the coverage range of the wireless communication module is detected.
7. The method according to claim 1, characterized in that The method further comprises: Parsing the warning content in the warning information package; The warning content is displayed through the display module, and voice prompts are given through the broadcast module.
8. An early warning method, characterized in that: Applied to the second device, the method includes: Generate warning information packages based on detected disaster information; Establishing a short-range communication connection with the first device through the wireless communication module; The warning information packet is sent to the first device via the short-range communication connection.
9. The method according to claim 8, characterized in that The method further comprises: Taking the second device as the center, searching for a first device with a wireless communication function enabled within the coverage of the wireless communication module; or, Searching for a first device connected to the same wireless communication network as the second device.
10. The method according to claim 8, characterized in that The establishing of a short-range communication connection with the first device through the wireless communication module includes: Generate and display an early warning request; the early warning request is used to request confirmation whether to send an early warning information package; When it is confirmed that the early warning information packet has been sent, a short-range communication connection is established with the first device through the wireless communication module.
11. An early warning device, characterized in that: The device comprises: A connection module, used to establish a short-range communication connection with a second device through the wireless communication module; A receiving module, configured to receive a warning information packet sent by the second device through the short-range communication connection; the warning information packet is generated by the second device according to the detected disaster information; A detection module, used to detect a third device within the coverage area of the wireless communication module; The connection module is further used to establish the short-range communication connection with the third device; A sending module is used to send the warning information package to the third device via the short-range communication connection.
12. An electronic device, characterized in that: The electronic device comprises a processor, a memory, a communication interface and a communication bus, and the processor, the memory and the communication interface communicate with each other via the communication bus; The memory is used to store executable instructions, and the executable instructions enable the processor to execute the early warning method according to any one of claims 1 to 7, or implement the early warning method according to any one of claims 8 to 10.
13. 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 early warning method according to any one of claims 1 to 7 is implemented, or the early warning method according to any one of claims 8 to 10 is implemented.