A communication method and related apparatus based on environment perception

By using a consensus round-robin mechanism based on multi-source environmental beacons and interest fragment matching, the problem of signaling storms under high device density is solved, and efficient and privacy-preserving inter-device communication is achieved.

CN122160742APending Publication Date: 2026-06-05HUNAN HAPPLY SUNSHINE INTERACTIVE ENTERTAINMENT MEDIA CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
HUNAN HAPPLY SUNSHINE INTERACTIVE ENTERTAINMENT MEDIA CO LTD
Filing Date
2026-03-12
Publication Date
2026-06-05

Smart Images

  • Figure CN122160742A_ABST
    Figure CN122160742A_ABST
Patent Text Reader

Abstract

The application discloses a kind of communication methods and related devices based on environmental perception, it is related to mobile communication technical field, comprising: in response to the consensus opportunity of reaching target consensus round, the consensus round number of first device is obtained based on multi-source environmental beacon.Based on the interest vector and consensus round number of first device, determine the interest fragment of first device.Responding to the interest fragment broadcasted by second device, determine whether the interest fragment of first device and the interest fragment of second device match successfully, obtain the single round matching result of target consensus round.Based on the single round matching result of target consensus round, determine whether match with second device.If yes, communicate with second device through secure communication link.The scheme introduces consensus round mechanism driven by multi-source environmental beacon, carries out light-weighted pulse matching based on implicit synchronization round, improves effective interaction rate and matching success rate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of mobile communication technology, and in particular to a communication method and related apparatus based on environment awareness. Background Technology

[0002] Current distributed device discovery and matching mechanisms typically rely on explicit signaling interactions. This means devices must continuously or periodically broadcast signaling frames containing their own identifiers (such as MAC addresses and UUIDs) and service / interest tags on the communication channel to be discovered and identified by neighboring devices. However, the continuous asynchronous broadcasting and listening of explicit signaling can easily lead to severe channel congestion and signaling storms in high-device-density scenarios, causing a sharp drop in matching success rates. Furthermore, matching attempts between devices are random and asynchronous, resulting in a low effective interaction rate. Summary of the Invention

[0003] In view of the above problems, this application provides a communication method and related apparatus based on environment perception, the specific solution of which is as follows:

[0004] The first aspect of this application provides an environment-aware communication method applied to a first device, comprising:

[0005] In response to the consensus timing of reaching the target consensus round, the consensus round number of the first device is obtained based on the multi-source environmental beacon; wherein, the consensus round number of the first device is the quantized feature value of the multi-source environmental beacon;

[0006] Based on the interest vector and consensus round number of the first device, the interest fragments of the first device are determined;

[0007] In response to the detection of interest fragments broadcast by the second device, determine whether the interest fragments of the first device and the interest fragments of the second device are successfully matched, and obtain the single-round matching result of the target consensus round;

[0008] Based on the single-round matching result of the target consensus round, determine whether it matches the second device;

[0009] If so, communicate with the second device via a secure communication link.

[0010] In one possible implementation, the consensus round number of the first device is obtained based on multi-source environmental beacons, including:

[0011] The multi-source environmental beacons are collected, including multiple preset types of environmental beacons;

[0012] The weights of each environmental beacon are determined based on stability and uniqueness indicators.

[0013] Based on the weights of each environmental beacon, a weighted hash operation is performed on the multi-source environmental beacons to obtain the consensus round number of the first device.

[0014] In one possible implementation, the interest fragments of the first device are determined based on the interest vector and consensus round number of the first device, including:

[0015] Local data is input into a preset neural network model to obtain the interest vector of the first device. The local data includes audio data and / or video data.

[0016] The interest vector of the first device is concatenated with the consensus round number to obtain the device features of the first device;

[0017] After processing the device features of the first device using a hash function, a continuous binary segment of the first length is extracted from the first bit as the interest fragment of the first device.

[0018] In one possible implementation, the environment-aware communication method also includes:

[0019] Based on the consensus round number of the first device, a frequency hopping sequence is generated, the frequency hopping sequence including broadcast channels arranged in sequence;

[0020] Within the time window corresponding to the target consensus round, the broadcast channel is switched according to the frequency hopping sequence to broadcast the interest fragments of the first device.

[0021] In one possible implementation, determining whether the interest fragments of the first device and the second device are successfully matched, and obtaining the single-round matching result of the target consensus round, includes:

[0022] Establish a listening mechanism for broadcast channels within the frequency hopping sequence, and in response to receiving interest fragments broadcast by the second device on the first channel, calculate the fragment similarity between the interest fragments of the first device and the interest fragments of the second device, wherein the first channel is any broadcast channel within the frequency hopping sequence;

[0023] If the fragment similarity is greater than the preset similarity threshold, then the single-round matching result of the target consensus round is determined to be a successful match.

[0024] In one possible implementation, determining whether a match is made with the second device based on the single-round matching result of the target consensus round includes:

[0025] Based on the matching result data, it is determined whether the single-round matching result of the second device in a consecutive target number of consensus rounds is a successful match, wherein the target number is greater than 1, and the matching result data includes single-round matching information of historical consensus rounds, wherein the single-round matching information includes consensus round number and matching result identifier used to indicate success or failure.

[0026] If so, confirm that it is compatible with the second device.

[0027] In one possible implementation, communication with the second device via a secure communication link includes:

[0028] Based on the consensus round number and interest fragment of each matching consensus round, a temporary session key is generated using a preset key derivation function. The matching consensus round is a consensus round in which the single round matching result is a successful match.

[0029] Establish a secure communication link using the temporary session key;

[0030] A session is established with the second device based on the secure communication link, and the session interaction data of the session is recorded in the memory of the first device;

[0031] In response to the end of the session, the temporary session key and the session interaction data of the session are cleared.

[0032] A second aspect of this application provides an environment-aware communication device, comprising:

[0033] A round number generation unit is used to obtain the consensus round number of the first device based on a multi-source environmental beacon in response to the consensus timing of reaching the target consensus round; wherein, the consensus round number of the first device is a quantized feature value of the multi-source environmental beacon;

[0034] The fragment generation unit is used to determine the interest fragments of the first device based on the interest vector and consensus round number of the first device;

[0035] A single-round matching unit is used to respond to the interest fragment broadcast by the second device, determine whether the interest fragments of the first device and the interest fragments of the second device are successfully matched, and obtain the single-round matching result of the target consensus round;

[0036] The device matching unit is used to determine whether it matches the second device based on the single-round matching result of the target consensus round;

[0037] A secure communication unit is used, if so, to communicate with the second device via a secure communication link.

[0038] A third aspect of this application provides a computer program product including computer-readable instructions that, when executed on an electronic device, cause the electronic device to implement the environment-aware communication method described in the first aspect or any implementation thereof.

[0039] A fourth aspect of this application provides an electronic device, including at least one processor and a memory connected to the processor, wherein:

[0040] The memory is used to store computer programs;

[0041] The processor is used to execute the computer program to enable the electronic device to implement the environment-aware communication method of the first aspect or any implementation thereof.

[0042] By employing the above technical solutions, this application provides an environment-aware communication method and related apparatus. In response to reaching a consensus time in a target consensus round, the consensus round number of a first device is obtained based on multi-source environmental beacons. Based on the interest vector and consensus round number of the first device, interest fragments of the first device are determined. In response to detecting interest fragments broadcast by a second device, it is determined whether the interest fragments of the first and second devices match successfully, obtaining a single-round matching result for the target consensus round. Based on the single-round matching result of the target consensus round, it is determined whether there is a match with the second device. If so, communication with the second device is established via a secure communication link. In summary, this application uses short, synchronized pulses based on interest fragments instead of continuous long broadcasts for single-round matching within aligned consensus rounds. Therefore, by introducing a consensus round mechanism driven by multi-source environmental beacons and performing lightweight pulse matching based on implicit synchronized rounds, the effective interaction rate and matching success rate are improved. Attached Figure Description

[0043] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic, and the originals and elements are not necessarily drawn to scale.

[0044] Figure 1 A flowchart illustrating an environment-aware communication method provided in this application;

[0045] Figure 2 A flowchart illustrating yet another environment-aware communication method provided in this application;

[0046] Figure 3 A flowchart illustrating yet another environment-aware communication method provided in this application;

[0047] Figure 4 A flowchart illustrating yet another environment-aware communication method provided in this application;

[0048] Figure 5 A flowchart illustrating yet another environment-aware communication method provided in this application;

[0049] Figure 6 A flowchart illustrating yet another environment-aware communication method provided in this application;

[0050] Figure 7a A schematic diagram illustrating the specific implementation process of an environment-aware communication method provided in this application;

[0051] Figure 7b A schematic diagram illustrating the specific implementation process of multi-consensus matching provided in this application;

[0052] Figure 8 A schematic diagram of the structure of a communication device based on environmental perception provided in this application;

[0053] Figure 9 This is a schematic diagram of the structure of an electronic device provided in this application. Detailed Implementation

[0054] The embodiments of this application are described below with reference to the accompanying drawings. The terminology used in the implementation section of this application is for explaining specific embodiments only and is not intended to limit the scope of this application.

[0055] The embodiments of this application will now be described with reference to the accompanying drawings. Those skilled in the art will recognize that, with technological advancements and the emergence of new scenarios, the technical solutions provided in the embodiments of this application are equally applicable to similar technical problems.

[0056] The terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar elements and are not necessarily used to describe a specific order or sequence. It should be understood that such terms are interchangeable where appropriate; this is merely a way of distinguishing elements with the same properties in the description of embodiments of this application. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion, so that a process, method, system, product, or apparatus that comprises a series of units is not necessarily limited to those units, but may include other units not explicitly listed or inherent to those processes, methods, products, or apparatuses.

[0057] This application provides an environment-aware communication method that can be applied to distributed device discovery and matching scenarios in the mobile communication field. For any mobile electronic device (denoted as the first device), by introducing a consensus round mechanism driven by environmental beacons, lightweight pulse matching is performed based on implicit synchronization rounds to achieve near-field communication with other electronic devices (denoted as the second device). Here, the first device and the second device can be any two electronic devices. (Refer to...) Figure 1 , Figure 1 A flowchart illustrating an environment-aware communication method provided in this application embodiment is shown below. Figure 1 As shown in the figure, the communication method based on environment awareness provided in this application embodiment may include steps S101 to S105, which are described in detail below.

[0058] S101. In response to the consensus timing of reaching the target consensus round, obtain the consensus round number of the first device based on the multi-source environmental beacon.

[0059] In this embodiment, the consensus timing for reaching the target consensus round includes the start time of reaching the target time window or the existence of at least one environmental beacon whose change value is greater than a preset change threshold, that is, the existence of a significantly changed environmental beacon.

[0060] In this embodiment, the multi-source environmental beacon includes various types of environmental beacons that can be collected by local sensors. Optionally, the multi-source environmental beacon includes cellular network beacons, wireless network beacons, ambient light beacons, and ambient sound beacons.

[0061] In this embodiment, the consensus round number of the first device is a quantized feature value of a multi-source environmental beacon. A consensus round number matching the environment (i.e., the current environment) of the first device in the target consensus round can be calculated from the multi-source environmental beacon. It is understood that under the same environment, different devices can independently calculate the same consensus round number, thereby achieving synchronization without interaction.

[0062] Optionally, the methods for generating quantized feature values ​​can include a variety of approaches. For example, a weighted hash fusion method can be used to fuse multiple types of environmental beacons based on their weights to obtain a fixed-length fused fingerprint, which serves as the quantized feature value. Another approach is to perform threshold-level quantization on each type of environmental beacon, then assign weights according to bit fields and concatenate them using bit operations to generate a structured integer code, which serves as the quantized feature value.

[0063] S102. Based on the interest vector and consensus round number of the first device, determine the interest fragments of the first device.

[0064] In this embodiment, the interest vector of the first device is used to characterize the behavior or interest preferences of the user of the first device. For example, if a user is listening to an audiobook or watching an animated film, the corresponding audio or video frame, after being encoded by the model, yields a vector that is semantically related to the content being played on the device.

[0065] In this embodiment, the interest vector and consensus round number of the first device can be bound together to generate a lightweight, temporary and irreversible identifier fragment, thus obtaining the interest fragment of the first device. This interest fragment uniquely identifies the current environment of the first device and the user's interests.

[0066] S103. In response to the interest fragment broadcast by the second device, determine whether the interest fragment of the first device and the interest fragment of the second device are successfully matched, and obtain the single-round matching result of the target consensus round.

[0067] In this embodiment, if the first device detects an interest fragment broadcast by the second device, it means that the second device generated and broadcast an interest fragment that uniquely identifies the current environment and user interests of the second device in the current consensus round. Then, the first device begins to match the interest fragments of the first device and the second device and determines whether the match is successful.

[0068] In one optional embodiment, the similarity between two interest fragments (such as Hamming distance, Jaccard coefficient, etc.) is calculated and compared with a preset similarity threshold. If the similarity is higher than the threshold, it is determined that the single-round matching is successful.

[0069] S104. Based on the single-round matching result of the target consensus round, determine whether it matches the second device.

[0070] In this embodiment, the single-round matching result includes a match or a non-match. If the single-round matching result is a match, it means that the first device and the second device are in the same environment and have similar user interests in the target consensus round. If the single-round matching result is a non-match, it means that the first device and the second device are not in the same environment or do not have similar user interests in the target consensus round.

[0071] In one optional embodiment, if the single-round matching result of the target consensus round is a match, then it is determined whether the first device and the second device are a match.

[0072] In another optional embodiment, if the single-round matching result of the target consensus round is a match and the single-round matching results of multiple consecutive historical consensus rounds are all matches, that is, the single-round matching results of multiple consecutive consensus rounds are all matches, then it is determined whether the first device and the second device are a match.

[0073] S105. If so, communicate with the second device via a secure communication link.

[0074] As can be seen from the above technical solutions, the environment-aware communication method provided in this application, in response to the consensus timing of reaching the target consensus round, obtains the consensus round number of the first device based on multi-source environmental beacons. Based on the interest vector and consensus round number of the first device, the interest fragments of the first device are determined. In response to listening to the interest fragments broadcast by the second device, it is determined whether the interest fragments of the first device and the interest fragments of the second device are successfully matched, obtaining the single-round matching result of the target consensus round. Based on the single-round matching result of the target consensus round, it is determined whether there is a match with the second device. If so, communication with the second device is conducted through a secure communication link. In summary, this application uses short synchronous pulses based on interest fragments instead of continuous long broadcasts for single-round matching within aligned consensus rounds. Therefore, by introducing a consensus round mechanism driven by multi-source environmental beacons and performing lightweight pulse matching based on implicit synchronous rounds, the effective interaction rate and matching success rate are improved.

[0075] Based on the above embodiments, see Figure 2 , Figure 2 This application provides yet another environment-aware communication method. Figure 2 The following illustrates the specific implementation process of S101, which is the process of obtaining the consensus round number of the first device based on multi-source environmental beacons, as follows: Figure 2 As shown in the figure, the communication method based on environment awareness provided in this application embodiment may include steps S201 to S203, which are described in detail below.

[0076] S201. Collect multi-source environmental beacons.

[0077] In this embodiment, the multi-source environmental beacons include cellular network beacons, wireless network beacons, ambient light beacons, and ambient sound beacons. Specifically, cellular network beacons include cellular base station identifiers, wireless network beacons include public Wi-Fi network identifiers, ambient light beacons include ambient light sensor data, and ambient sound beacons include ambient sound characteristic values.

[0078] In this embodiment, the local clocks of all electronic devices need to be coarsely synchronized via a network time protocol to ensure that their absolute time error is within a small range (e.g., on the order of 100ms). The preset period refers to a fixed-length sliding time window (e.g., every 10 seconds). The fixed length refers to the duration of the preset period, and the start time of each sliding time window is the start time of the preset period, defined as an integer multiple of the absolute time. Therefore, all electronic devices simultaneously begin collecting multi-source environmental beacons at the same absolute time points (e.g., 09:15:00, 09:15:10, 09:15:20).

[0079] In one specific embodiment, the cellular base station identifier is read via the device baseband or operating system API. Using the device's Wi-Fi chip, a public Wi-Fi network identifier is obtained through scanning without requiring a connection. Ambient light sensor data is collected, and audio is obtained by short-term sampling using the device's microphone. Finally, environmental sound feature values ​​are extracted from the audio.

[0080] It should be noted that cellular base station identifiers have wide coverage, strong penetration, and high stability. They are the core anchor points for outdoor and coarse-grained indoor positioning. Public Wi-Fi network identifiers have extremely high density indoors and in densely populated urban areas. BSSID is globally unique and is the most important beacon for building high-precision indoor fingerprint maps. Ambient light sensor data is simple but highly scene-discriminative, effectively distinguishing different lighting environments to assist in context judgment. Ambient sound feature values ​​can provide rich semantic environment information, distinguishing different acoustic environments such as offices, cafes, subway stations, and homes.

[0081] It should be further noted that the collection of multi-source environmental beacons all comply with the principle of privacy protection. For example, when using the device's microphone for short-term sampling, the original audio is discarded after calculating the feature value in real time.

[0082] S202. Determine the weight of each environmental beacon based on stability and uniqueness indicators.

[0083] In this embodiment, the weight of each environmental beacon is related to its stability and uniqueness. Therefore, the weight of each environmental beacon is dynamically adjusted based on the real-time values ​​of both stability and uniqueness indicators. Stability refers to the frequency of change of the beacon's indication over time. For example, cellular base station IDs may switch frequently in mobile scenarios, while public Wi-Fi SSID lists or ambient light intensity are relatively stable in the short term. Higher stability results in a higher weight. Uniqueness refers to the distinguishability of the beacon's indication over space. For example, the ambient sound characteristics inside a subway car are more unique than general ambient light values; higher uniqueness results in a higher weight.

[0084] In this embodiment, the stability metric includes the variance within a time sliding window, and the uniqueness metric includes the information entropy within a time sliding window. Specifically, for each environmental beacon, the variance and information entropy within a time sliding window are calculated. A normalization function is used to combine the variance and information entropy into a weight.

[0085] It should be noted that the electronic device dynamically updates the weights during each consensus round initialization to ensure that synchronization reliability remains even when the environment changes.

[0086] S203. Based on the weights of each environmental beacon, perform a weighted hash operation on the multi-source environmental beacons to obtain the consensus round number of the first device.

[0087] In this embodiment, the specific method for performing weighted hash operations on multi-source environmental beacons includes:

[0088] Arrange all environmental beacons in descending order of weight to obtain the environmental beacon sequence. If the weights are the same, sort by the beacon identifier by default, for example, by the first character (letter or number) of the beacon identifier.

[0089] Calculate the first hash value for each environmental beacon based on its weight and environmental beacon values;

[0090] Arrange the first hash value of each environmental beacon in ascending order of its position in the environmental beacon sequence to obtain the hash value sequence.

[0091] Calculate the hash value of the hash value sequence to obtain the sequence hash value.

[0092] The sequence hash value is converted into a consensus round number. Optionally, the sequence hash value is used as a seed to generate a random number through a verifiable random function to obtain the consensus round number, thereby further enhancing its cryptographic security.

[0093] As can be seen from the above technical solution, the environment-aware communication method provided in this application obtains multi-source environmental beacons according to a preset period, and performs a weighted hash operation on the multi-source environmental beacons based on the weight of each environmental beacon to obtain a consensus round number. Under the premise of global alignment of time windows, different electronic devices use the same weighted hash algorithm and weight allocation method to independently calculate a consensus round number that indicates the current environment. Therefore, if the current environment is the same, the consensus round numbers of different electronic devices are the same. It can be seen that based on this weighted hash operation, different devices in the same physical environment can independently generate the same consensus round number, realizing state synchronization without interaction. Furthermore, based on the same absolute start time and the same consensus round number, all electronic devices achieve precise alignment of time windows. Moreover, devices in the same environment can independently and synchronously generate the same consensus round number (synchronization error <10ms). Each consensus round number corresponds to a fixed matching time window. Without any signaling interaction between electronic devices or between electronic devices and the central server, signaling-free global synchronization can be achieved, that is, environmental beacon synchronization and consensus round initialization.

[0094] Based on the above embodiments, see Figure 3 , Figure 3 This application provides yet another environment-aware communication method. Figure 3 The following illustrates S102, which details the implementation process of determining the interest fragments of the first device and broadcasting these interest fragments based on the first device's interest vector and consensus round number. Figure 3As shown in the figure, the communication method based on environment awareness provided in this application embodiment may include steps S301 to S305, which are described in detail below.

[0095] S301. Input local data into a preset neural network model to obtain the interest vector of the first device.

[0096] In this embodiment, local data includes multimedia data, such as audio and video data. An interest vector is obtained by encoding the multimedia data using a neural network model, serving as a representation of user interests.

[0097] S302. Concatenate the interest vector of the first device with the consensus round number to obtain the device features of the first device.

[0098] S303. After processing the device features using a hash function, extract a continuous binary segment of the first length starting from the first bit as the interest fragment of the first device.

[0099] For example, a lightweight neural network model runs locally on the first electronic device to perform real-time inference on audio clips of audiobooks from local data target works. After generating a 128-dimensional interest vector Vec_A, the interest fragment Frag_A = First_20_Bits( SHA256( Vec_A || NA) ), where NA represents the consensus round number of the current time window, SHA256() represents the hash function, and First_20_Bits represents the first consecutive binary fragment of length 20 bits extracted from the first bit.

[0100] It is evident that interest fragments are updated with the change of consensus round number, and the interest vector cannot be restored by reverse calculation.

[0101] S304. Generate a frequency hopping sequence based on the consensus round number of the first device.

[0102] In this embodiment, the consensus round number is used as the random number seed and input into a pseudo-random channel selection algorithm (e.g., hash-based channel mapping) to obtain the output channel sequence, which is the frequency hopping sequence, for example: [Channel 37, Channel 12, Channel 30].

[0103] S305. Within the time window corresponding to the target consensus round, switch the broadcast channel according to the frequency hopping sequence and broadcast interest fragments.

[0104] For example, the first device derives a frequency hopping sequence [Channel 37, Channel 12, Channel 30, ...] from the Bluetooth broadcast channel based on the NA, and broadcasts Frag_A multiple times on the Bluetooth broadcast channel with extremely low power and extremely short duration within 10 seconds of the current time window.

[0105] As can be seen from the above technical solutions, the environment-aware communication method provided in this application uses interest fragments as fixed-length binary segments extracted after hashing the device features fused with the interest vector and consensus round number using a hash function. The one-way nature of the hash function ensures that the original interest vector cannot be deduced from the interest fragments, thus ensuring that the interest fragments are semantically neutral and strongly correlated with the current time window, protecting privacy and security. Furthermore, a dynamic frequency hopping sequence is derived based on the consensus round number, and interest fragments are broadcast with extremely low power and extremely short duration according to the frequency hopping sequence. The broadcast has no explicit receiving target, resulting in low total signal overhead per round and avoiding channel congestion.

[0106] Based on the above embodiments, see Figure 4 , Figure 4 This application provides yet another environment-aware communication method. Figure 4 The following illustrates the specific implementation process of S103, which involves responding to the detection of interest fragments broadcast by the second device, determining whether the interest fragments of the first and second devices match successfully, and obtaining the single-round matching result of the target consensus round. Figure 4 As shown in the figure, the communication method based on environment awareness provided in this application embodiment may include steps S401 to S404, which are described in detail below.

[0107] S401. Establish monitoring of the broadcast channel within the frequency hopping sequence, and in response to receiving the interest fragments broadcast by the second device on the first channel, calculate the fragment similarity between the interest fragments of the first device and the interest fragments of the second device.

[0108] In this embodiment, the first channel is any channel within the frequency hopping sequence. The similarity is determined based on Hamming distance, Jaccard coefficient, etc. For example, when the first device receives the interest fragment broadcast by the second device, it calculates the Hamming distance between the interest fragment of the first device and the interest fragment of the second device, and maps the Hamming distance to the fragment similarity. The larger the Hamming distance, the lower the fragment similarity.

[0109] S402. If the fragment similarity is greater than the preset similarity threshold, then the single-round matching result of the target consensus round is determined to be a successful match.

[0110] S403. If the fragment similarity is not greater than the similarity threshold, then the single-round matching result of the target consensus round is determined to be a matching failure.

[0111] S404. Record the single-round matching information of the target consensus round to the matching result data.

[0112] In other words, the matching result data includes matching information for each consensus round, which includes consensus round number, matching result identifier (success identifier or failure identifier), and interest fragments.

[0113] For example, when the fragment similarity between the first device and the second device is greater than the similarity threshold, a successful match message is recorded. The successful match message includes the consensus round number, the success identifier, and the interest fragment, indicating that the single-round match result with the second device in the current time window is a successful match.

[0114] Based on the above embodiments, see Figure 5 , Figure 5 This application provides yet another environment-aware communication method. Figure 5 The following is an example of S104, which describes the specific implementation process for determining whether a device matches the second device based on the single-round matching result of the target consensus round. Figure 5 As shown in the figure, the communication method based on environment awareness provided in this application embodiment may include steps S501 to S502, which are described in detail below.

[0115] S501. Based on the matching result data, determine whether the single-round matching result of the second device in the consensus rounds of the consecutive target number is a successful match.

[0116] In this embodiment, the target number is greater than 1. That is, based on the matching result data, it is determined whether the device has been successfully matched with the second device in multiple consecutive consensus rounds. Preferably, the target number is 2 or 3, that is, it is confirmed whether the single-round matching result of 2 or 3 consecutive consensus rounds is a successful match.

[0117] S502. If so, then the matching result with the second device is determined to be a successful match.

[0118] As can be seen from the above technical solutions, the communication method based on environment awareness provided in this application ensures matching accuracy with low complexity through directional listening and multi-round confirmation mechanisms. Specifically, the electronic device only listens on the frequency hopping sequence channel corresponding to the current consensus round number. After receiving the interest fragment, it directly performs similarity calculation with its own interest fragment to determine the single-round matching result. Only when the device achieves a temporary match with the same device in multiple consecutive consensus rounds is it determined to be a valid interest match, thereby introducing a multi-round consensus verification mechanism to improve matching accuracy.

[0119] Based on the above embodiments, see Figure 6 , Figure 6 This application provides yet another environment-aware communication method. Figure 6 The diagram illustrates S105, which details the specific implementation process of communicating with the second device via a secure communication link. Figure 6 As shown in the figure, the communication method based on environment awareness provided in this application embodiment may include steps S601 to S604, which are described in detail below.

[0120] S601. Based on the consensus round number and interest fragment of each matching consensus round, a temporary session key is generated using a preset key derivation function.

[0121] In this embodiment, the consensus round is a consensus round in which the single-round matching result is a successful match.

[0122] S602. Establish a secure communication link using a temporary session key.

[0123] In this embodiment, multiple short-range wireless communication technologies are compatible. Optionally, the communication link is an end-to-end encrypted Bluetooth Low Energy (BLE) secure link.

[0124] S603, Conduct a session with the second device based on a secure communication link.

[0125] In this embodiment, the session interaction data is recorded in the memory of the first device.

[0126] S604. In response to the end of the session, clear the temporary session key and session interaction data.

[0127] As can be seen from the above technical solutions, the environment-aware communication method provided in this application provides that for valid matching pairs that have passed multiple rounds of verification, both parties derive temporary session keys based on shared consensus round numbers and interest fragment digests, thereby establishing an end-to-end encrypted communication link. This eliminates the need for traditional explicit handshake signaling interaction, and all interaction data is only temporarily stored during the session, achieving full-link privacy protection.

[0128] Furthermore, taking a cross-media interest matching scenario in a subway car as an example, user A is listening to an audiobook of the target work through headphones on a first device (e.g., a mobile phone), while user B is watching an animated clip of the target work on a second device (e.g., a mobile phone). Neither user's device is connected to the internet, and they have never communicated before.

[0129] See Figure 7a Figure 7 is a schematic diagram illustrating the specific implementation flow of an environment-aware communication method provided in an embodiment of this application. Figure 7aAs shown, the environment-aware communication method includes four stages.

[0130] Phase 1: Environment synchronization and consensus round initialization, the specific process is as follows:

[0131] Device A and Device B simultaneously detect multi-source environmental beacons in the public environment: Cellular network beacon: Base station identifier ID. Wireless network Wi-Fi beacon: Scanned public Wi-Fi SSID list, with the first n hashes taken. Ambient light beacon: Fluorescent lighting inside the carriage, with a continuous brightness of 425 lux. Ambient sound beacon: Mixed characteristic value of 0x7D4A of the carriage background noise and train operation sound.

[0132] Device A and Device B both use the same dynamic weight allocation method and weighted hash algorithm to process multi-source environmental beacons, and independently generate the same consensus round number N = 0x8E3A51F2.

[0133] Taking a consensus round with a time window length of 10 seconds as an example, each consensus round number is valid for 10 seconds (e.g., the target consensus round is 09:15:00 - 09:15:10, and the target consensus round number is valid for 09:15:00 - 09:15:10).

[0134] Phase Two: Interest Fragment Generation Phase, the specific process is as follows:

[0135] Both Device A and Device B generate interest vectors based on local data from the first work being played (or displayed).

[0136] Specifically, device A runs a lightweight model to perform real-time inference on audio clips from the target audiobook, generating a 128-dimensional interest vector Vec_A. Device B runs a lightweight model to perform inference on animated video frames of the local target work, generating an interest vector Vec_B. Since Vec_A and Vec_B originate from the same target work, they have a high cosine similarity in the latent space.

[0137] Both device A and device B generate interest fragments based on interest vectors.

[0138] Specifically, device A calculates: Frag_A = First_20_Bits( SHA256( Vec_A || N) ); device B calculates: Frag_B = First_20_Bits( SHA256( Vec_B || N) ).

[0139] The third stage: the monitoring and frequency-hopping broadcasting stage, the specific process of which is as follows:

[0140] Both Device A and Device B derive a frequency hopping sequence [Channel 37, Channel 12, Channel 30, ...] based on consensus round number N. Within 10 seconds of the current consensus round, they broadcast interest fragments multiple times in sequence on these Bluetooth broadcast channels with extremely low power and extremely short duration.

[0141] That is, device A and device B broadcast interest fragments Frag_A and Frag_B respectively according to the frequency hopping sequence.

[0142] Phase Four: Interest Fragment Reception and Multi-Round Consensus Verification Phase, the specific process is as follows:

[0143] 1. Fragment reception steps:

[0144] Taking device B as an example, since device A and device B generated the same frequency hopping sequence, after device B started listening, it received Frag_A broadcast by device A on the first channel (taking channel 37 as an example).

[0145] 2. Single-round matchmaking steps:

[0146] Device B immediately calculates the Hamming distance between the received Frag_A and its own generated Frag_B, and the result is 1 (meaning only 1 bit out of 20 bits is different). Since the Hamming distance of 1 is less than the preset threshold of 2, Device B anonymously records the target consensus round number N locally, indicating a successful single-round match with the anonymous electronic device.

[0147] 3. Multi-round matching steps:

[0148] Specifically, the local anonymous records are queried to determine if there are two consecutive rounds of successful matching. If so, device B determines that the single-round consensus result of this consensus round is a valid interest match. That is, since the single-round consensus results of two consecutive consensus rounds are both matches, it is confirmed that device A and device B have successfully matched for multiple rounds.

[0149] For example, the anonymous record contains a record of a successful single-round match in the previous consensus round. That is, in the previous consensus round, both devices independently generated the next consensus round number N-1 = 0x9F4B62E3. After the second and third phases, in the consensus round corresponding to consensus round number N-1, device B receives an interest fragment with the same characteristics as the anonymous device, and the Hamming distance is 1.

[0150] As can be seen, this solution automatically filters out trusted electronic devices through multi-round behavioral consistency verification. Figure 7b This application provides a schematic diagram of a multi-round matching process, as shown in the embodiments below. Figure 7bAs shown, taking a threshold of 2 as an example, the specific methods for multi-round matching include:

[0151] At the start of consensus round 1, device A calculates the interest fragment Frag_A1 and broadcasts it on the first wireless channel. Device B receives Frag_A1 and calculates its Hamming distance to its own fragment Frag_B1. The Hamming distance is 3, which is greater than the distance threshold of 2. Matching fails in this round, and both devices' counters are set to 0.

[0152] Consensus Round 2 begins (approximately 10 seconds after the start of Consensus Round 1): Device A calculates the interest fragment Frag_A2 and broadcasts Frag_A2 on the first wireless channel. Device B receives Frag_A2, calculates its Hamming distance to its own fragment Frag_B2, which is 1, less than the distance threshold of 2. A single-round match is successful; both devices' counters are set to 1, recording the temporary match, i.e., recording the single-round match result of the current consensus round.

[0153] Consensus Round 3 begins (approximately 10 seconds after the start of Consensus Round 2): Device A calculates the interest fragment Frag_A3 and broadcasts Frag_A3 on the first wireless channel. Device B receives Frag_A3, calculates its Hamming distance to its own fragment Frag_B3, which is 1, less than the distance threshold of 2. A single-round match is successful; both parties' counters are set to 2, recording the temporary match, i.e., recording the single-round match result of the current consensus round.

[0154] Since device A and device B successfully matched in two consecutive rounds (consensus round 2 and consensus round 3), the multi-round consensus was determined to be successful. Therefore, the connection was triggered. For device A, device B was confirmed as a legitimate peer device, and for device B, device A was confirmed as a legitimate peer device.

[0155] In summary, this mechanism ensures the consistency of device pairing behavior through the synchronization of time and space (channel / fragment) combined with multiple consecutive micro-verifications, and can effectively resist accidental interference (such as word matching failure due to interference in consensus round 1) or malicious imitation.

[0156] It should be noted that the matching logic is based solely on whether the devices appear on the same dynamic trajectory and the fragment distance is acceptable across multiple consecutive rounds. Once interrupted, the matching is considered invalid, the counter is reset and re-accumulated, and the electronic device that ultimately matches the first device in a single round across multiple consecutive consensus rounds is considered a legitimate peer device that has passed the behavioral consistency verification. Taking a threshold of 3 rounds as an example, in one optional embodiment, the multi-round consensus matching process is as follows:

[0157] First consensus round: In the first channel, 10 devices match with the first device in a single round, and the first device's counter is incremented by 1, at which point the counter = 1.

[0158] Second consensus round: Switching to the second channel, 5 devices match with the first device again in a single round. The counter is incremented by 1, and the counter now equals 2.

[0159] Third consensus round: Switch to the third channel. Due to environmental interference, no device matches the first device in a single round, and the counter is reset to 0.

[0160] Fourth consensus round: Switch to the fourth channel, 5 electronic devices match the first device again in a single round, at which point the counter = 1.

[0161] Fifth consensus round: Switch to channel 5. Three devices match with the first device in a single round. Counter +1 (counter = 2).

[0162] Sixth consensus round: Switch to channel six. Two devices continuously match with the first device in a single round. Counter +1 (counter = 2).

[0163] Seventh consensus round: Switch to channel seven. The two devices still match with the first device in a single round. The counter increments by 1, and the counter reaches the threshold of the number of times. Since the two electronic devices can accurately follow the synchronization trajectory of the first device for three consecutive rounds and maintain consistent interests, the first device determines that the two electronic devices are the target electronic devices that match with the first device for multiple rounds.

[0164] Phase 4: Implicit secure connection establishment phase, the specific process is as follows:

[0165] 1. Key derivation steps:

[0166] Device B initiates a connection. Both devices use a key derivation function to calculate the same temporary session key, Session_Key, based on consensus round numbers N and N+1 and the hash digest of the matching interest fragments.

[0167] In other words, no explicit signaling is required; the generation of the session key is implicitly triggered by the consensus round protocol. Specifically, after device B confirms a successful match with device A through multi-round consensus verification, it will, in the next consensus round, broadcast an interest fragment along with a minimal, encrypted connection request flag. This flag is encrypted using the current round number and contains no identity information. Device A will also receive this flag while listening. Since both parties share the same consensus round number and environmental context, they can recognize this request. Subsequently, based on the previously shared consensus round numbers (e.g., N and N+1) and the matched interest fragment, both devices independently generate the same temporary session key using a pre-defined key derivation function. The entire process requires no additional signaling interaction.

[0168] 2. Steps for establishing a secure communication link:

[0169] Both devices use the Session_Key to directly establish an end-to-end encrypted BLE secure link, completely skipping the traditional pairing handshake signaling.

[0170] 3. Anonymous interaction steps:

[0171] For example, device B sends an encrypted anonymous text message to device A: "Do you also like the target work?" The anonymous text message is only decrypted and displayed in the device's memory. User A can choose whether to reply. After the session ends, the key and chat history are automatically destroyed.

[0172] It is important to note that only devices that generate the same interest fragments in multiple consecutive consensus rounds under the same environment can derive the same temporary session key, thus achieving a form of implicit authentication. Furthermore, the temporary session key is only valid for the current session and is destroyed afterward, preventing long-term risks from key leakage. The consensus round number changes over time, and each session key is unique. Interest fragments have no semantic meaning; even if intercepted, it is impossible to deduce the user's identity or interests.

[0173] Based on the above embodiments, the communication method based on environment awareness provided in this application lies in connecting the entire link with environmental consensus and innovatively realizing implicit interest matching, specifically embodied in:

[0174] First, environmental beacon synchronization and consensus round initialization transform public environmental beacons (such as base stations and Wi-Fi) into trusted anchors for distributed synchronization, achieving signalless global synchronization.

[0175] Second, interest fragment generation and implicit broadcasting strongly bind interest information with consensus rounds, transforming it into implicit fragments without semantics or identifiers, thereby achieving private and low-overhead signal transmission.

[0176] Thirdly, fragment reception and multi-round consensus verification, through targeted listening and continuous matching confirmation mechanisms, ensure matching accuracy with low complexity even under high-density interference.

[0177] In summary, for valid matches that have passed multiple rounds of verification, temporary session keys are derived based on shared consensus round numbers and interest fragment digests, directly establishing an end-to-end encrypted communication link without the need for traditional handshake signaling. All interactive data is only temporarily stored during the session, achieving end-to-end privacy protection.

[0178] The above describes an environment-aware communication method provided by the embodiments of this application. The following will describe the related apparatus for performing the above-described environment-aware communication method.

[0179] Please see Figure 8 , Figure 8 This is a schematic diagram of a communication device provided in an embodiment of this application. Figure 8 As shown, the environment-aware communication device 800 includes:

[0180] The round number generation unit 801 is used to obtain the consensus round number of the first device based on the multi-source environmental beacon in response to the consensus timing of reaching the target consensus round; wherein, the consensus round number of the first device is the quantized feature value of the multi-source environmental beacon;

[0181] Fragment generation unit 802 is used to determine the interest fragments of the first device based on the interest vector and consensus round number of the first device;

[0182] The single-round matching unit 803 is used to respond to the interest fragment broadcast by the second device, determine whether the interest fragment of the first device and the interest fragment of the second device are successfully matched, and obtain the single-round matching result of the target consensus round;

[0183] The device matching unit 804 is used to determine whether it matches the second device based on the single-round matching result of the target consensus round;

[0184] The secure communication unit 805 is used to communicate with the second device via a secure communication link if necessary.

[0185] In one possible implementation, when the round number generation unit obtains the consensus round number of the first device based on multi-source environmental beacons, it is specifically used for:

[0186] The multi-source environmental beacons are collected, including multiple preset types of environmental beacons;

[0187] The weights of each environmental beacon are determined based on stability and uniqueness indicators.

[0188] Based on the weights of each environmental beacon, a weighted hash operation is performed on the multi-source environmental beacons to obtain the consensus round number of the first device.

[0189] In one possible implementation, when the fragment generation unit determines the interest fragments of the first device based on the interest vector and consensus round number of the first device, it specifically performs the following functions:

[0190] Local data is input into a preset neural network model to obtain the interest vector of the first device. The local data includes audio data and / or video data.

[0191] The interest vector of the first device is concatenated with the consensus round number to obtain the device features of the first device;

[0192] After processing the device features of the first device using a hash function, a continuous binary segment of the first length is extracted from the first bit as the interest fragment of the first device.

[0193] In one possible implementation, the environment-aware communication device further includes a broadcast unit for:

[0194] Based on the consensus round number of the first device, a frequency hopping sequence is generated, the frequency hopping sequence including broadcast channels arranged in sequence;

[0195] Within the time window corresponding to the target consensus round, the broadcast channel is switched according to the frequency hopping sequence to broadcast the interest fragments of the first device.

[0196] In one possible implementation, the single-round matching unit is used to determine whether the interest fragments of the first device and the interest fragments of the second device are successfully matched. When obtaining the single-round matching result of the target consensus round, it is specifically used for:

[0197] Establish a listening mechanism for broadcast channels within the frequency hopping sequence, and in response to receiving interest fragments broadcast by the second device on the first channel, calculate the fragment similarity between the interest fragments of the first device and the interest fragments of the second device, wherein the first channel is any broadcast channel within the frequency hopping sequence;

[0198] If the fragment similarity is greater than the preset similarity threshold, then the single-round matching result of the target consensus round is determined to be a successful match.

[0199] In one possible implementation, when the device matching unit determines whether it matches the second device based on the single-round matching result of the target consensus round, it specifically performs the following functions:

[0200] Based on the matching result data, it is determined whether the single-round matching result of the second device in a consecutive target number of consensus rounds is a successful match, wherein the target number is greater than 1, and the matching result data includes single-round matching information of historical consensus rounds, wherein the single-round matching information includes consensus round number and matching result identifier used to indicate success or failure.

[0201] If so, confirm that it is compatible with the second device.

[0202] In one possible implementation, when the secure communication unit communicates with the second device via a secure communication link, it is specifically used for:

[0203] Based on the consensus round number and interest fragment of each matching consensus round, a temporary session key is generated using a preset key derivation function. The matching consensus round is a consensus round in which the single round matching result is a successful match.

[0204] Establish a secure communication link using the temporary session key;

[0205] A session is established with the second device based on the secure communication link, and the session interaction data of the session is recorded in the memory of the first device;

[0206] In response to the end of the session, the temporary session key and the session interaction data of the session are cleared.

[0207] This application also provides an electronic device, for reference. Figure 9 As shown, Figure 9 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. The electronic device in this embodiment may include, but is not limited to, mobile terminals such as mobile phones, laptops, PDAs (personal digital assistants), PADs (tablet computers), etc. Figure 9 The electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.

[0208] like Figure 9 As shown, the electronic device may include a processing unit (e.g., a central processing unit, a graphics processing unit, etc.) 901, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 902 or a program loaded from a storage device 908 into a random access memory (RAM) 903. When the electronic device is powered on, the RAM 903 also stores various programs and data required for the operation of the electronic device. The processing unit 901, ROM 902, and RAM 903 are interconnected via a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.

[0209] Typically, the following devices can be connected to I / O interface 905: input devices 906 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 907 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 908 including, for example, memory cards, hard drives, etc.; and communication devices 909. Communication device 909 allows electronic devices to exchange data via wireless or wired communication with other devices. Although Figure 9 Electronic devices with various devices are shown, but it should be understood that it is not required to implement or have all of the devices shown. More or fewer devices may be implemented or have alternatively.

[0210] This application also provides a computer program product including computer-readable instructions, which, when executed on an electronic device, cause the electronic device to implement any of the environment-aware communication methods provided in this application.

[0211] This application also provides a computer-readable storage medium that carries one or more computer programs. When the one or more computer programs are executed by an electronic device, the electronic device can implement any of the environment-aware communication methods provided in this application.

[0212] It should also be noted that the embodiments of the related devices described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. In addition, in the accompanying drawings of the device embodiments provided in this application, the connection relationship between modules indicates that they have a communication connection, which can be implemented as one or more communication buses or signal lines.

[0213] Through the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary general-purpose hardware, or it can be implemented by special-purpose hardware including application-specific integrated circuits, special-purpose CPUs, special-purpose memory, special-purpose components, etc. Generally, any function performed by a computer program can be easily implemented by corresponding hardware, and the specific hardware structure used to implement the same function can also be diverse, such as analog circuits, digital circuits, or special-purpose circuits. However, for this application, software program implementation is more often the preferred implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a readable storage medium, such as a computer floppy disk, USB flash drive, mobile hard disk, ROM, RAM, magnetic disk, or optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, training equipment, or network device, etc.) to execute the methods described in the various embodiments of this application.

[0214] In the above embodiments, the implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, in the form of a computer program product.

[0215] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions may be transmitted from one website, computer, training device, or data center to another website, computer, training device, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a training device or data center that integrates one or more available media. The available media may be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., DVDs), or semiconductor media (e.g., solid-state drives (SSDs)).

Claims

1. A method for environment-aware communication, the method comprising: Applied to the first device, including: In response to the consensus timing of reaching the target consensus round, the consensus round number of the first device is obtained based on the multi-source environmental beacon; wherein, the consensus round number of the first device is the quantized feature value of the multi-source environmental beacon; Based on the interest vector and consensus round number of the first device, the interest fragments of the first device are determined; In response to the detection of interest fragments broadcast by the second device, determine whether the interest fragments of the first device and the interest fragments of the second device are successfully matched, and obtain the single-round matching result of the target consensus round; Based on the single-round matching result of the target consensus round, determine whether it matches the second device; If so, communicate with the second device via a secure communication link.

2. The environment-aware communication method of claim 1, wherein, The process of obtaining the consensus round number of the first device based on multi-source environmental beacons includes: The multi-source environmental beacons are collected, including multiple preset types of environmental beacons; The weights of each environmental beacon are determined based on stability and uniqueness indicators. Based on the weights of each environmental beacon, a weighted hash operation is performed on the multi-source environmental beacons to obtain the consensus round number of the first device. 3.The environment-aware based communication method of claim 1, wherein, The step of determining the interest fragments of the first device based on the interest vector and consensus round number of the first device includes: Local data is input into a preset neural network model to obtain the interest vector of the first device. The local data includes audio data and / or video data. The interest vector of the first device is concatenated with the consensus round number to obtain the device features of the first device; After processing the device features of the first device using a hash function, a continuous binary segment of the first length is extracted from the first bit as the interest fragment of the first device. 4.The environment-aware communication method of claim 1, wherein, The environment-aware communication method further includes: Based on the consensus round number of the first device, a frequency hopping sequence is generated, the frequency hopping sequence including broadcast channels arranged in sequence; Within the time window corresponding to the target consensus round, the broadcast channel is switched according to the frequency hopping sequence to broadcast the interest fragments of the first device.

5. The environment-aware communication method according to claim 4, characterized in that, The step of determining whether the interest fragments of the first device and the interest fragments of the second device are successfully matched, and obtaining the single-round matching result of the target consensus round, includes: Establish a listening mechanism for broadcast channels within the frequency hopping sequence, and in response to receiving interest fragments broadcast by the second device on the first channel, calculate the fragment similarity between the interest fragments of the first device and the interest fragments of the second device, wherein the first channel is any broadcast channel within the frequency hopping sequence; If the fragment similarity is greater than the preset similarity threshold, then the single-round matching result of the target consensus round is determined to be a successful match.

6. The communication method based on environment awareness according to claim 1, characterized in that, The determination of whether a device matches the second device based on the single-round matching result of the target consensus round includes: Based on the matching result data, it is determined whether the single-round matching result of the second device in a consecutive target number of consensus rounds is a successful match, wherein the target number is greater than 1, and the matching result data includes single-round matching information of historical consensus rounds, wherein the single-round matching information includes consensus round number and matching result identifier used to indicate success or failure. If so, confirm that it is compatible with the second device.

7. The environment-aware communication method according to claim 6, characterized in that, The communication with the second device via a secure communication link includes: Based on the consensus round number and interest fragment of each matching consensus round, a temporary session key is generated using a preset key derivation function. The matching consensus round is a consensus round in which the single round matching result is a successful match. Establish a secure communication link using the temporary session key; A session is established with the second device based on the secure communication link, and the session interaction data of the session is recorded in the memory of the first device; In response to the end of the session, the temporary session key and the session interaction data of the session are cleared.

8. A communication device based on environmental perception, characterized in that, Applied to the first device, including: A round number generation unit is used to obtain the consensus round number of the first device based on a multi-source environmental beacon in response to the consensus timing of reaching the target consensus round; wherein, the consensus round number of the first device is a quantized feature value of the multi-source environmental beacon; The fragment generation unit is used to determine the interest fragments of the first device based on the interest vector and consensus round number of the first device; A single-round matching unit is used to respond to the interest fragment broadcast by the second device, determine whether the interest fragments of the first device and the interest fragments of the second device are successfully matched, and obtain the single-round matching result of the target consensus round; The device matching unit is used to determine whether it matches the second device based on the single-round matching result of the target consensus round; A secure communication unit is used, if so, to communicate with the second device via a secure communication link.

9. A computer program product, characterized in that, It includes computer-readable instructions that, when executed on an electronic device, cause the electronic device to implement the environment-aware communication method as described in any one of claims 1 to 7.

10. An electronic device, characterized in that, It includes at least one processor and a memory connected to the processor, wherein: The memory is used to store computer programs; The processor is used to execute the computer program to enable the electronic device to implement the environment-aware communication method as described in any one of claims 1 to 7.