Method and device for relay communication, electronic device, and storage medium
By determining the communication path in the smart home system and selecting the relay device, the problem of inefficient relay communication is solved, and faster and more efficient information transmission is achieved.
Patent Information
- Application Number
- CN202310079171.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-01-17
- Publication Date
- 2025-02-14
- Estimated Expiration
- 2043-01-17
AI Technical Summary
In a smart home system, the information to be sent during relay communication may be repeatedly transmitted between multiple relay devices, resulting in inefficient communication.
By acquiring the information to be sent and the target device, the communication path to which the information to be sent reaches the target device, and the relay device is determined based on the path, and the information to be sent is sent to the relay device until the target device is reached.
Reduce the repeated transmission of information to be sent between multiple relay devices, shorten the time when information reaches the target device, and improves communication efficiency.
Smart Images

Figure CN116112305B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of relay communication, for example, to a method and device for relay communication, electronic equipment, and storage medium. Background Art
[0002] At present, with the development of Internet of Things technology, the technology of smart home system is becoming more and more mature, and its application is becoming more and more extensive. In the smart home system, near-field wireless communication is required between different devices to realize the linkage of the smart home system. In the smart home system, the relay communication method is usually used for communication between various devices. In the related art, when the various devices in the smart home system perform relay communication, the device with the best communication quality is usually directly selected as the relay device. The information to be sent is then sent to the relay device until the information to be sent reaches the target device. However, this may cause the information to be sent to be repeatedly transmitted between multiple relay devices, so that the information to be sent takes a long time to reach the target device, resulting in low communication efficiency.
[0003] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present application, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention
[0004] In order to provide a basic understanding of some aspects of the disclosed embodiments, a brief summary is given below. The summary is not an extensive review, nor is it intended to identify key / critical components or delineate the scope of protection of these embodiments, but rather serves as a prelude to the detailed description that follows.
[0005] The embodiments of the present disclosure provide a method and device, an electronic device, and a storage medium for relay communication to improve the efficiency of communication.
[0006] In some embodiments, the method for relay communication is applied to an electronic device, and the method includes: obtaining information to be sent and a target device corresponding to the information to be sent; determining a communication path for the information to be sent to reach the target device; determining a relay device based on the communication path; the electronic device, the relay device and the target device are all in the same smart home system; sending the information to be sent and the target device to the relay device until the information to be sent reaches the target device.
[0007] In some embodiments, determining the communication path for the information to be sent to reach the target device includes: obtaining a first attenuation coefficient between the communication devices in the smart home system; determining an alternative communication path from the electronic device to the target device; determining a second attenuation coefficient corresponding to the alternative communication path based on the first attenuation coefficient; and determining the communication path based on the second attenuation coefficient and the alternative communication path.
[0008] In some embodiments, obtaining the first attenuation coefficient between each communication device in the smart home system includes: using a preset attenuation coefficient database to perform a table lookup operation to obtain the first attenuation coefficient between each communication device in the smart home system; the attenuation coefficient database stores the first attenuation coefficient between any two communication devices in the smart home system.
[0009] In some embodiments, obtaining the first attenuation coefficient between the communication devices in the smart home system includes: obtaining actual signal quality values between the communication devices in the smart home system; and obtaining the first attenuation coefficient according to the actual signal quality values.
[0010] In some embodiments, determining the second attenuation coefficient corresponding to the alternative communication path based on the first attenuation coefficient includes: determining the first attenuation coefficient between two communication devices connected in the alternative communication path as a third attenuation coefficient; and obtaining the second attenuation coefficient corresponding to the alternative communication path based on the third attenuation coefficient.
[0011] In some embodiments, determining the communication path according to the second attenuation coefficient and the alternative communication path includes: when the second attenuation coefficient is the largest, determining the alternative communication path as the communication path.
[0012] In some embodiments, determining a relay device based on the communication path includes: determining a communication device connected to the electronic device in the communication path, and determining the communication device as a relay device; the communication device is in the smart home system.
[0013] In some embodiments, the apparatus for relaying communication includes a processor and a memory storing program instructions, and the processor is configured to execute the above-mentioned method for relaying communication when running the program instructions.
[0014] In some embodiments, the electronic device includes: an electronic device body; and the device for relaying communication as described above is installed in the electronic device body.
[0015] In some embodiments, the storage medium stores program instructions, and when the program instructions are run, the above-mentioned method for relay communication is executed.
[0016] The method and device, electronic device, and storage medium for relay communication provided by the embodiments of the present disclosure can achieve the following technical effects: by obtaining the information to be sent and the target device corresponding to the information to be sent, the communication path for the information to be sent to reach the target device is determined. Then the relay device is determined according to the communication path, and the information to be sent and the target device are sent to the relay device until the information to be sent reaches the target device. In this way, the communication path for the information to be sent to reach the target device is first determined, and then the relay device is determined. The message to be sent can be relayed according to the communication path, so that the information to be sent will not be repeatedly transmitted between multiple relay devices. The time it takes for the information to be sent to reach the target device is reduced, thereby improving the efficiency of communication.
[0017] The above general description and the following description are exemplary and explanatory only and are not intended to limit the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] One or more embodiments are exemplarily described by corresponding drawings, which do not limit the embodiments. Elements with the same reference numerals in the drawings are shown as similar elements, and the drawings do not constitute a scale limitation, and wherein:
[0019] Figure 1 is a schematic diagram of a smart home system provided by an embodiment of the present disclosure;
[0020] Figure 2 is a schematic diagram of a method for relay communication provided by an embodiment of the present disclosure;
[0021] Figure 3-1 It is a schematic diagram of a link type relayed by a communication device provided by an embodiment of the present disclosure;
[0022] Figure 3-2 is a schematic diagram of a link type relayed by another communication device provided in an embodiment of the present disclosure;
[0023] Figure 3-3 is a schematic diagram of a link type relayed by another communication device provided in an embodiment of the present disclosure;
[0024] Figure 3-4 is a schematic diagram of a link type relayed by another communication device provided in an embodiment of the present disclosure;
[0025] Figure 4 is a schematic diagram of the configuration of each communication device in a smart home system according to an embodiment of the present disclosure;
[0026] Figure 5 is a schematic diagram of another method for relay communication provided by an embodiment of the present disclosure;
[0027] Figure 6 is a schematic diagram of a device for relay communication provided by an embodiment of the present disclosure;
[0028] Figure 7 It is a schematic diagram of an electronic device provided by an embodiment of the present disclosure.
[0029] Reference numerals:
[0030] 1: Smart home system; 2: Internet of Things cloud platform; 3: Router; 4: User terminal; 5: Wireless communication network; 6: Communication device a; 7: Communication device b; 8: Communication device c; 9: Communication device d; 10: Communication device e; 11: Communication device f; 12: Communication device g; 13: Communication device h; 14: Communication device A; 15: Communication device B; 16: Communication device C; 17: Communication device D; 18: Communication device E. DETAILED DESCRIPTION
[0031] In order to be able to understand the features and technical contents of the embodiments of the present disclosure in more detail, the implementation of the embodiments of the present disclosure is described in detail below in conjunction with the accompanying drawings. The attached drawings are for reference only and are not used to limit the embodiments of the present disclosure. In the following technical description, for the convenience of explanation, a full understanding of the disclosed embodiments is provided through multiple details. However, one or more embodiments can still be implemented without these details. In other cases, to simplify the drawings, well-known structures and devices can be simplified for display.
[0032] The terms "first", "second", etc. in the specification and claims of the embodiments of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the terms used in this way can be interchanged where appropriate, so that the embodiments of the embodiments of the present disclosure described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions.
[0033] Unless otherwise stated, the term "plurality" means two or more.
[0034] In the embodiment of the present disclosure, the character " / " indicates that the preceding and following objects are in an "or" relationship. For example, A / B indicates: A or B.
[0035] The term "and / or" is a description of the association relationship between objects, indicating that three relationships can exist. For example, A and / or B means: A or B, or, A and B.
[0036] The term "correspondence" may refer to an association relationship or a binding relationship. The correspondence between A and B means that there is an association relationship or a binding relationship between A and B.
[0037] The method for relay communication provided by the embodiment of the present disclosure is applied to an electronic device. The electronic device obtains the information to be sent and the target device corresponding to the information to be sent, and determines the communication path for the information to be sent to reach the target device. Then, the relay device is determined according to the communication path, and the information to be sent and the target device are sent to the relay device until the information to be sent reaches the target device. In this way, the communication path for the information to be sent to reach the target device is first determined, and then the relay device is determined. The message to be sent can be relayed according to the communication path, so that the information to be sent will not be repeatedly transmitted between multiple relay devices. The time it takes for the information to be sent to reach the target device is reduced, thereby improving the efficiency of communication.
[0038] Furthermore, the electronic device is a device in a wireless communication network of a smart home system. Figure 1 As shown, the smart home system 1 includes an IoT (Internet of Things) cloud platform 2, a router 3, a user terminal 4 and a wireless communication network 5. Among them, the wireless communication network includes multiple communication devices, such as a gateway device and multiple sub-devices, and the electronic device is a gateway device or a sub-device in the wireless communication network. The gateway device communicates with each sub-device and each sub-device communicates with each other through wireless communication. The user terminal includes a mobile phone, a notebook, a computer and / or a smart watch. An application corresponding to the smart home system is installed in the user terminal. The application is used to control each sub-device in the smart home system and display the working status of each sub-device. In some embodiments, the sub-device is a smart home appliance in the smart home system.
[0039] In some embodiments, the user sends control information to the IoT cloud platform through an application installed in the user terminal. The control information includes control instructions and control devices. After receiving the control information, the IoT cloud platform forwards the control information to the gateway device in the wireless communication network. The gateway device receives the control information. The control instruction is determined as the information to be sent, and the control device is determined as the target device corresponding to the information to be sent. The communication path for the information to be sent to reach the target device is determined. The relay device is determined according to the communication path. The relay device is a sub-device in the wireless communication network. The information to be sent and the target device are sent to the relay device until the information to be sent reaches the target device. In this way, the communication path for the information to be sent to reach the target device is first determined, and then the relay device is determined. The message to be sent can be relayed according to the communication path, so that the information to be sent will not be repeatedly transmitted between multiple relay devices. The time it takes for the information to be sent to reach the target device is reduced, thereby improving the efficiency of communication.
[0040] Combination Figure 2 As shown, the embodiment of the present disclosure provides a method for relay communication, including:
[0041] Step S101: the electronic device obtains information to be sent and a target device corresponding to the information to be sent.
[0042] Step S102, the electronic device determines a communication path for the information to be sent to reach the target device.
[0043] Step S103, the electronic device determines the relay device according to the communication path. The electronic device, the relay device and the target device are all in the same smart home system.
[0044] Step S104, the electronic device sends the information to be sent and the target device to the relay device until the information to be sent reaches the target device.
[0045] The method for relay communication provided by the embodiment of the present disclosure is adopted to determine the communication path for the information to be sent to reach the target device by obtaining the information to be sent and the target device corresponding to the information to be sent. Then, the relay device is determined according to the communication path, and the information to be sent and the target device are sent to the relay device until the information to be sent reaches the target device. In this way, the communication path for the information to be sent to reach the target device is first determined, and then the relay device is determined. The message to be sent can be relayed according to the communication path, so that the information to be sent will not be repeatedly transmitted between multiple relay devices. The time for the information to be sent to reach the target device is reduced, thereby improving the efficiency of communication.
[0046] Furthermore, the electronic device obtains the information to be sent and the target device corresponding to the information to be sent, including: when the electronic device is a gateway device, receiving control information sent by a router. The control information includes a control instruction and a control device. The control instruction is determined as the information to be sent. The control device is determined as the target device corresponding to the information to be sent.
[0047] Furthermore, the electronic device obtains the information to be sent and the target device corresponding to the information to be sent, including: when the electronic device is a sub-device, receiving the information to be sent and the target device corresponding to the information to be sent.
[0048] Furthermore, the electronic device, the relay device and the target device are all communication devices in the wireless communication network of the smart home system. In some embodiments, after the electronic device sends the information to be sent and the target device to the relay device, if the information to be sent does not reach the target device, the relay device determines the communication path for the information to be sent to reach the target device as a new electronic device. Then the next relay device is determined according to the communication path. The information to be sent and the target device are sent to the relay device until the information to be sent reaches the target device.
[0049] Optionally, determining the communication path for the information to be sent to reach the target device includes: obtaining a first attenuation coefficient between each communication device in the smart home system. Determining an alternative communication path from the electronic device to the target device. Determining a second attenuation coefficient corresponding to the alternative communication path according to the first attenuation coefficient. Determining the communication path according to the second attenuation coefficient and the alternative communication path. Among them, the first attenuation coefficient is used to characterize the energy attenuation of the transmitted signal when communicating between each communication device. In this way, by obtaining the first attenuation coefficient between each communication device in the smart home system, the alternative communication path from the electronic device to the target device is determined. Then, the second attenuation coefficient corresponding to the alternative communication path is determined according to the first attenuation coefficient, and the communication path is determined according to the second attenuation coefficient and the alternative communication path. So as to determine the relay device according to the communication path. Enable the message to be sent to perform relay communication according to the communication path, so that the information to be sent will not be repeatedly transmitted between multiple relay devices. Reduce the time it takes for the information to be sent to reach the target device, thereby improving the efficiency of communication.
[0050] Furthermore, the larger the first attenuation coefficient is, the smaller the attenuation of the signal communicated between the communication devices is.
[0051] Furthermore, determining the candidate communication paths from the electronic device to the target device includes: obtaining a network topology diagram for communication between the communication devices in the smart home system, and obtaining multiple candidate communication paths from the electronic device to the target device in the network topology diagram.
[0052] Optionally, obtaining the first attenuation coefficient between each communication device in the smart home system includes: using a preset attenuation coefficient database to perform a table lookup operation to obtain the first attenuation coefficient between each communication device in the smart home system. The attenuation coefficient database stores the first attenuation coefficient between any two communication devices in the smart home system. In this way, the first attenuation coefficient between each communication device in the smart home system can be obtained through the attenuation coefficient database, so that the communication path can be determined according to the first attenuation coefficient, so that the message to be sent can be relayed according to the communication path, so that the information to be sent will not be repeatedly transmitted between multiple relay devices. The time it takes for the information to be sent to reach the target device is reduced, thereby improving the efficiency of communication.
[0053] Optionally, obtaining the first attenuation coefficient between each communication device in the smart home system includes: obtaining an actual signal quality value between each communication device in the smart home system. Obtaining the first attenuation coefficient according to the actual signal quality value. In this way, the first attenuation coefficient between each communication device in the smart home system can be obtained through the actual signal quality value between each communication device in the smart home system, so that the first attenuation coefficient can characterize the attenuation of the transmitted signal when the communication devices communicate with each other. In order to determine the communication path with the least attenuation according to the attenuation condition.
[0054] Further, obtaining the actual signal quality value between each communication device in the smart home system includes: using a preset signal quality database to perform a table lookup operation to obtain the actual signal quality value between each communication device in the smart home system. The signal quality database stores the actual signal quality value between any two communication devices in the smart home system.
[0055] In some embodiments, when the wireless communication method between each communication device is ZigBee, the actual signal quality value is the LQI (Link Quality Indicator) value in the IEEE802.15.4 standard. In the case where the power-on state of a communication device in the smart home system changes, each communication device sends a preset measurement signal to other communication devices. And receive the measurement signal sent by other devices. Then, the LQI value between other communication devices and the communication device is obtained based on the signal strength and signal-to-noise ratio of the received measurement signal. Then, the LQI value is sent to other communication devices. And receive the LQI value sent by other communication devices. So that the signal quality database of each communication device stores the actual signal quality value between any two communication devices in the smart home system.
[0056] Further, obtaining a first attenuation coefficient according to an actual signal quality value includes: obtaining an ideal signal quality value between each communication device in the smart home system. Obtaining a first attenuation coefficient according to the actual signal quality value and the ideal signal quality value. The first attenuation coefficient is used to characterize the energy attenuation of the transmitted signal when communicating between each communication device. The ideal signal quality value is used to characterize the signal quality of each communication device communicating in an air environment when the distance between each communication device remains unchanged. In some embodiments, the ideal signal quality value between each communication device is pre-stored in the electronic device by the user. In this way, the first attenuation coefficient of the ideal signal quality value and the actual signal quality value can characterize the energy attenuation of the transmitted signal when communicating between each communication device.
[0057] In some embodiments, Figure 3-1 to Figure 3-4 As shown, Figure 3-1 to Figure 3-4These are schematic diagrams of link types relayed by communication devices. The dotted lines are used to represent the communication paths between communication devices. Figure 3-1 As shown, there is no shielding between communication device a6 and communication device b7, and they communicate directly in the air. There is only attenuation caused by the air between communication device a6 and communication device b7. Figure 3-2 As shown in the figure, the communication device c8 and the communication device d9 are embedded in the same shielding object, and are located in the antenna radiation blind area between each other. They can only communicate through refracted waves, and part of the signal energy will be absorbed by the shielding object or lost due to diffuse reflection during communication. That is, there is attenuation caused by the wall and diffuse reflection between the communication device c8 and the communication device d9. The shaded part is used to represent the shielding object. Figure 3-3 As shown, the communication device e10 and the communication device f11 are completely blocked by the shielding object, and can only communicate through the shielding object. During communication, part of the signal energy will be absorbed by the shielding object. Therefore, there is attenuation caused by the shielding object between the communication device e10 and the communication device f11. The shaded part is used to represent the shielding object. Figure 3-4 As shown, the communication device g12 and the communication device h13 are completely blocked by the corner of the shielding object, and can only communicate through the shielding object. During communication, part of the signal energy will be absorbed by the shielding object. Therefore, there is attenuation caused by the shielding object between the communication device g12 and the communication device h13. Among them, the shaded part is used to represent the shielding object.
[0058] Further, obtaining a first attenuation coefficient according to the actual signal quality value and the ideal signal quality value includes: when the actual signal quality value is proportional to the signal quality, obtaining the first attenuation coefficient by calculating k=|q1| / |q2|, wherein k is the first attenuation coefficient, q1 is the actual signal quality value, and q2 is the ideal signal quality value.
[0059] Further, obtaining a first attenuation coefficient according to the actual signal quality value and the ideal signal quality value includes: obtaining a preset parameter threshold when the actual signal quality value is inversely proportional to the signal quality. The first attenuation coefficient is obtained by calculating k=(M-|q1|) / (M-|q2|). Wherein, M is a preset parameter threshold. In some embodiments, in the case of an actual signal quality value LQI value, the preset parameter threshold is 256.
[0060] Optionally, determining the second attenuation coefficient corresponding to the alternative communication path according to the first attenuation coefficient includes: determining the first attenuation coefficient between two communication devices connected in the alternative communication path as a third attenuation coefficient. Obtaining the second attenuation coefficient corresponding to the alternative communication path according to the third attenuation coefficient. The second attenuation coefficient is used to characterize the total attenuation corresponding to the alternative communication path. In this way, the second attenuation coefficient for characterizing the total attenuation corresponding to the alternative communication path can be obtained, so as to determine the communication path according to the second attenuation coefficient.
[0061] Further, obtaining the second attenuation coefficient corresponding to the alternative communication path according to the third attenuation coefficient includes: when there is a minimum value in the third attenuation coefficients, determining the minimum value in the third attenuation coefficients as the second attenuation coefficient corresponding to the alternative communication path. When the third attenuation coefficients are all equal, determining the third attenuation coefficient as the second attenuation coefficient corresponding to the alternative communication path.
[0062] Optionally, determining the communication path according to the second attenuation coefficient and the alternative communication path includes: when the second attenuation coefficient is the largest, determining the alternative communication path as the communication path. In this way, the communication path is determined by the second attenuation coefficient, so that the attenuation of the communication path is less, thereby reducing the attenuation of the information to be sent during the communication process and improving the communication quality.
[0063] Optionally, determining the relay device according to the communication path includes: determining a communication device connected to the electronic device in the communication path, and determining the communication device as the relay device.
[0064] In some embodiments, Figure 4 As shown, Figure 4It is a schematic diagram of the configuration of each communication device in the smart home system. Among them, the shaded part is used to represent the obstruction, including: L-shaped wall and I-shaped wall. The dotted line is used to represent the path of the communication device when communicating. Communication device A14 can communicate with communication device B15 and communication device D17. Communication device B15 can communicate with communication device A14, communication device C16 and communication device D17. Communication device C16 can communicate with communication device B15, communication device E18 and communication device D17. Communication device D17 can communicate with communication device A14, communication device B15, communication device C16 and communication device E18. Communication device E18 can communicate with communication device C16 and communication device D17. There is no obstruction between communication device A and communication device B, and communication is carried out through path ① in the air. The first attenuation coefficient between communication device A and communication device B is 0.9. The communication device A and the communication device D are completely blocked by the L-shaped wall, and can only communicate through the L-shaped wall through path ②. The first attenuation coefficient between the communication device A and the communication device D is 0.5. There is no obstruction between the communication device B and the communication device C, and communication is carried out through path ③ in the air. The first attenuation coefficient between the communication device B and the communication device C is 0.9. The communication device B and the communication device D are completely blocked by the corner of the L-shaped wall, and can only communicate through the L-shaped wall through path ④. The first attenuation coefficient between the communication device B and the communication device D is 0.2. There is no obstruction between the communication device C and the communication device D, and communication is carried out through path ⑤ in the air. The first attenuation coefficient between the communication device C and the communication device D is 0.9. There is no obstruction between the communication device C and the communication device E, and direct communication is carried out in the air through path ⑥. The first attenuation coefficient between the communication device C and the communication device E is 0.9. Communication device D and communication device E are embedded in the same I-shaped wall, and are already in the antenna radiation blind zone between each other, and can only communicate through path ⑦ using refracted waves. The first attenuation coefficient between communication device D and communication device E is 0.3. In the case where the electronic device is communication device A, electronic device A has information to be sent and the target device corresponding to the information to be sent. Among them, the target device corresponding to the information to be sent is communication device D. Electronic device A obtains the first attenuation coefficient between each communication device in the smart home system. Determine the alternative communication path from electronic device A to target device D. For example: the first alternative communication path: A→B→C→D. The second alternative communication path: A→B→D. The third alternative communication path: A→B→C→E→D. For the first alternative communication path "A→B→C→D", the first attenuation coefficient of 0.9 between communication device A and communication device B, the first attenuation coefficient of 0.9 between communication device B and communication device C, and the first attenuation coefficient between communication device C and communication device D are determined as the third attenuation coefficient.If the third attenuation coefficients are all equal, the third attenuation coefficient of 0.9 is determined as the second attenuation coefficient of 0.9 corresponding to the first alternative communication path. For the second alternative communication path "A→B→D", the first attenuation coefficient of 0.9 between communication device A and communication device B and the first attenuation coefficient of 0.2 between communication device B and communication device D are determined as the third attenuation coefficient. There is a minimum value of 0.2 in the third attenuation coefficients, and the minimum value of 0.2 in the third attenuation coefficients is determined as the second attenuation coefficient of 0.2 corresponding to the second alternative communication path. For the third alternative communication path "A→B→C→E→D", the first attenuation coefficient of 0.9 between communication device A and communication device B, the first attenuation coefficient of 0.9 between communication device B and communication device C, the first attenuation coefficient of 0.9 between communication device C and communication device E, and the first attenuation coefficient of 0.3 between communication device E and communication device D are determined as the third attenuation coefficient. There is a minimum value of 0.3 in the third attenuation coefficients, and the minimum value of 0.3 in the third attenuation coefficients is determined as the second attenuation coefficient of 0.3 corresponding to the third alternative communication path. Among the second attenuation coefficients corresponding to the three alternative communication paths, the second attenuation coefficient 0.9 corresponding to the first alternative communication path is the largest, and the first alternative communication path "A→B→C→D" is determined as the communication path. In the communication path, the communication device B is connected to the electronic device A. Then the communication device B is determined as the relay device. By the same method, when the electronic device is the communication device A and the target device is the communication device D, the communication path is determined to be "A→B→C→E". The relay device is the communication device B. When the electronic device is the communication device B and the target device is the communication device D, the communication path is determined to be "B→C→D". The relay device is the communication device C. When the electronic device is the communication device D and the target device is the communication device E, the communication path is determined to be "D→C→E". The relay device is the communication device C. Then the information to be sent and the target device are sent to the relay device until the information to be sent reaches the target device.
[0065] Combination Figure 5 As shown, the embodiment of the present disclosure provides a method for relay communication, including:
[0066] Step S201: the electronic device obtains information to be sent and a target device corresponding to the information to be sent.
[0067] Step S202: The electronic device obtains a first attenuation coefficient between communication devices in the smart home system.
[0068] Step S203: the electronic device determines an alternative communication path from the electronic device to the target device.
[0069] Step S204: The electronic device determines a second attenuation coefficient corresponding to the alternative communication path according to the first attenuation coefficient.
[0070] Step S205: The electronic device determines a communication path according to the second attenuation coefficient and the candidate communication path.
[0071] Step S206, the electronic device determines a communication device connected to the electronic device in the communication path, and determines the communication device as a relay device; the electronic device, the relay device, the communication device and the target device are all in the same smart home system.
[0072] Step S207, the electronic device sends the information to be sent and the target device to the relay device until the information to be sent reaches the target device.
[0073] The method for relay communication provided by the embodiment of the present disclosure is adopted, and the first attenuation coefficient between each communication device in the smart home system is obtained by obtaining the information to be sent and the target device corresponding to the information to be sent. The alternative communication path from the electronic device to the target device is determined, and then the second attenuation coefficient corresponding to the alternative communication path is determined according to the first attenuation coefficient. The communication path is determined according to the second attenuation coefficient and the alternative communication path. The communication device connected to the electronic device is determined in the communication path, and the communication device is determined as a relay device, and the information to be sent and the target device are sent to the relay device until the information to be sent reaches the target device. In this way, by first obtaining the second attenuation coefficient corresponding to the alternative communication path according to the first attenuation coefficient, and determining the communication path according to the second attenuation coefficient and the alternative communication path, and then determining the communication device connected to the electronic device in the communication path, and determining the communication device as a relay device, the message to be sent can be relayed according to the communication path, so that the information to be sent will not be repeatedly transmitted between multiple relay devices. The time for the information to be sent to reach the target device is reduced, thereby improving the efficiency of communication. At the same time, due to the reduction of the communication time, the situation of packet loss of the information to be sent during the communication process is reduced, and the quality of communication is improved.
[0074] Combination Figure 6 As shown, the embodiment of the present disclosure provides a device 19 for relay communication, including a processor 20 and a memory 21. Optionally, the device may also include a communication interface 22 and a bus 23. The processor 20, the communication interface 22, and the processor 21 may communicate with each other through the bus 23. The communication interface 22 may be used for information transmission. The processor 20 may call the logic instructions in the processor 21 to execute the method for relay communication of the above embodiment.
[0075] In addition, the logic instructions in the processor 21 described above may be implemented in the form of software functional units and when sold or used as independent products, may be stored in a computer-readable storage medium.
[0076] The processor 21, as a computer-readable storage medium, can be used to store software programs, computer executable programs, such as program instructions / modules corresponding to the method in the embodiment of the present disclosure. The processor 20 executes the functional application and data processing by running the program instructions / modules stored in the processor 21, that is, the method for relay communication in the above embodiment is implemented.
[0077] The processor 21 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and an application required for at least one function; the data storage area may store data created according to the use of the terminal device, etc. In addition, the processor 21 may include a high-speed random access memory and may also include a non-volatile memory.
[0078] By using the device for relay communication provided by the embodiment of the present disclosure, the communication path for the information to be sent to reach the target device is determined by obtaining the information to be sent and the target device corresponding to the information to be sent. Then the relay device is determined according to the communication path, and the information to be sent and the target device are sent to the relay device until the information to be sent reaches the target device. In this way, by first determining the communication path for the information to be sent to reach the target device, and then determining the relay device. The message to be sent can be relayed according to the communication path, so that the information to be sent will not be repeatedly transmitted between multiple relay devices. The time it takes for the information to be sent to reach the target device is reduced, thereby improving the efficiency of communication.
[0079] Combination Figure 7 As shown, an embodiment of the present disclosure provides an electronic device 24, including: an electronic device body, and the above-mentioned device 19 for relaying communication. The device 19 for relaying communication is installed in the electronic device body. The installation relationship described here is not limited to placement inside the electronic device, but also includes installation connections with other components of the electronic device, including but not limited to physical connections, electrical connections, or signal transmission connections. It can be understood by those skilled in the art that the device 19 for relaying communication can be adapted to a feasible electronic device body, thereby realizing other feasible embodiments.
[0080] An embodiment of the present disclosure provides a computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions are configured to execute the above-mentioned method for relay communication.
[0081] The computer-readable storage medium mentioned above may be a transient computer-readable storage medium or a non-transitory computer-readable storage medium.
[0082] The technical solution of the embodiment of the present disclosure can be embodied in the form of a software product, which is stored in a storage medium and includes one or more instructions for enabling a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in the embodiment of the present disclosure. The aforementioned storage medium may be a non-transient storage medium, including: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes, or a transient storage medium.
[0083] The above description and the accompanying drawings fully illustrate the embodiments of the present disclosure so that those skilled in the art can practice them. Other embodiments may include structural, logical, electrical, process and other changes. The embodiments represent only possible changes. Unless explicitly required, separate components and functions are optional, and the order of operation may vary. The parts and features of some embodiments may be included in or replace the parts and features of other embodiments. Moreover, the words used in this application are only used to describe the embodiments and are not used to limit the claims. As used in the description of the embodiments and the claims, unless the context clearly indicates, the singular forms of "a", "an" and "the" are intended to include plural forms as well. Similarly, the term "and / or" as used in this application refers to any and all possible combinations of listings containing one or more associated ones. In addition, when used in the present application, the term "comprise" and its variants "comprises" and / or comprising refer to the presence of stated features, wholes, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or groups thereof. In the absence of further restrictions, the elements defined by the sentence "comprising a ..." do not exclude the presence of other identical elements in the process, method or device comprising the elements. In this article, each embodiment may focus on the differences from other embodiments, and the same and similar parts between the various embodiments may refer to each other. For the methods, products, etc. disclosed in the embodiments, if they correspond to the method part disclosed in the embodiments, then the relevant parts can refer to the description of the method part.
[0084] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software may depend on the specific application and design constraints of the technical solution. The technicians may use different methods for each specific application to implement the described functions, but such implementations should not be considered to exceed the scope of the embodiments of the present disclosure. The technicians may clearly understand that, for the convenience and simplicity of description, the specific working processes of the systems, devices and units described above may refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here.
[0085] In the embodiments disclosed herein, the disclosed methods and products (including but not limited to devices, equipment, etc.) can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units can be only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between each other shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms. The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to implement this embodiment. In addition, each functional unit in the embodiment of the present disclosure may be integrated in a processing unit, or each unit may exist physically alone, or two or more units may be integrated in one unit.
[0086] The flowchart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to the embodiment of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of the code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. In some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, which can depend on the functions involved. In the description corresponding to the flowchart and the block diagram in the accompanying drawings, the operations or steps corresponding to different boxes can also occur in a different order from the order disclosed in the description, and sometimes there is no specific order between different operations or steps. For example, two consecutive operations or steps can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, which can depend on the functions involved. Each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented by a dedicated hardware-based system that performs the specified functions or actions, or may be implemented by a combination of dedicated hardware and computer instructions.
Claims
1. A method for relay communication, characterized in that: Applied to electronic equipment; the method comprises: Acquire information to be sent and a target device corresponding to the information to be sent; Determine a communication path for the information to be sent to reach the target device; Determine a relay device according to the communication path; the electronic device, the relay device and the target device are all in the same smart home system; Sending the information to be sent and the target device to the relay device until the information to be sent reaches the target device; Determining a communication path for the information to be sent to reach the target device includes: acquiring a first attenuation coefficient between each communication device in the smart home system; determining an alternative communication path from the electronic device to the target device; determining a second attenuation coefficient corresponding to the alternative communication path according to the first attenuation coefficient; and determining the communication path according to the second attenuation coefficient and the alternative communication path; Obtaining a first attenuation coefficient between each communication device in the smart home system includes: obtaining an actual signal quality value and an ideal signal quality value between each communication device; obtaining the first attenuation coefficient according to the actual signal quality value and the ideal signal quality value; the actual signal quality value is a link quality indication value; the ideal signal quality value is used to characterize the signal quality of each communication device communicating in an air environment when the distance between the communication devices remains unchanged.
2. The method according to claim 1, characterized in that: Obtaining a first attenuation coefficient between communication devices in the smart home system includes: A preset attenuation coefficient database is used to perform a table lookup operation to obtain a first attenuation coefficient between each communication device in the smart home system; the attenuation coefficient database stores the first attenuation coefficient between any two communication devices in the smart home system.
3. The method according to claim 1, characterized in that: Determining a second attenuation coefficient corresponding to the alternative communication path according to the first attenuation coefficient includes: Determine a first attenuation coefficient between two communication devices connected in the alternative communication path as a third attenuation coefficient; A second attenuation coefficient corresponding to the alternative communication path is acquired according to the third attenuation coefficient.
4. The method according to claim 1, characterized in that: Determining the communication path according to the second attenuation coefficient and the alternative communication path includes: In a case where the second attenuation coefficient is the largest, the candidate communication path is determined as the communication path.
5. The method according to claim 1, characterized in that Determining a relay device according to the communication path includes: A communication device connected to the electronic device is determined in the communication path, and the communication device is determined as a relay device; the communication device is in the smart home system.
6. A device for relay communication, comprising a processor and a memory storing program instructions, characterized in that: The processor is configured to execute the method for relaying communication according to any one of claims 1 to 5 when running the program instructions.
7. An electronic device, characterized in that: include: Electronic device body; The device for relaying communication according to claim 6 is installed in the electronic device body.
8. A storage medium storing program instructions, characterized in that: When the program instructions are executed, the method for relay communication according to any one of claims 1 to 5 is executed.
Citation Information
Patent Citations
Mesh network data transmission method and device, gateway and storage medium
CN111614557A