Message forwarding method and electronic equipment

By introducing the first field and a consistent hashing algorithm in the 0-RTT mechanism of HTTP/3, the problem of messages being easily attacked when the sending device and the receiving device are not established, and the recognition of playback attacks is realized and prevention, improving the security and processing efficiency of receiving messages.

CN119182543APending Publication Date: 2024-12-24HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310745892.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-06-21
Publication Date
2024-12-24

AI Technical Summary

Technical Problem

Under the 0-RTT mechanism of HTTP/3, when the sending device and the receiving device do not establish a communication connection, the message is easily copied and tampered by the attacking device, making it difficult for the receiving device to recognize the playback attack, and there are security problems.

Method used

By introducing a first field into the message for shunting and identifying a playback attack, the second device processes the message based on the field value of the first field, and determines the processing device of the message through a preset position and consistency hashing algorithm, Improve safety and processing efficiency.

Benefits of technology

Effectively identify and prevent replay attacks, improve the security of electronic devices when receiving messages, reduce memory pressure, and speed up message processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119182543A_ABST
    Figure CN119182543A_ABST
Patent Text Reader

Abstract

A message forwarding method and an electronic device, relating to the technical field of terminals, in the method, when a sending end device sends a first message to a receiving end device based on a 0-RTT mechanism, a first device can receive the first message and obtain a first field in the first message. Wherein the first field is located at a preset position in the message, and the same field value of the first field corresponds to one or more messages. According to the embodiment of the invention, the first device can send the first message to the second device corresponding to the field value of the first field in the first message, so that the second device processes the first message, and shunting of the first message is realized. Moreover, since the messages including the same field value of the first fields are always distributed to the same second device for processing, the second device can identify whether the received messages are replay attacked messages, and the security of the electronic device when receiving the messages can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of terminal technology, and in particular to a message forwarding method and electronic device. Background Art

[0002] Hypertext Transfer Protocol 3 (HTTP / 3) provides a zero round-trip time mechanism (0-RTT mechanism). The 0-RTT mechanism means that the sending device can send messages to the receiving device without establishing a communication connection with the receiving device, thereby saving the time of establishing a communication connection between the sending device and the receiving device during data transmission and improving transmission efficiency.

[0003] However, since there is no communication connection between the sending device and the receiving device, the attacking device in the network can copy the message sent by the sending device to the receiving device and send the copied message to the receiving device. In the case where the receiving device includes multiple electronic devices, if the original message and the copied message are not sent to the same electronic device, the electronic device that receives the copied message will not be able to identify whether the message is a replay attack message. In other words, there is a security problem when the electronic device receives the message. Summary of the invention

[0004] The embodiments of the present application provide a message forwarding method and an electronic device, which can improve the security of the electronic device when receiving messages.

[0005] In order to achieve the above purpose, the embodiment of the present application adopts the following technical solution:

[0006] In a first aspect, an embodiment of the present application provides a message forwarding method, which can be applied to a first device. In the method,

[0007] The first device receives a first message and obtains a first field in the first message. The first field is located at a preset position in the message, and the same field value of the first field corresponds to one or more messages. The first device sends the first message to the second device corresponding to the field value of the first field in the first message. The first message includes data signaling, and the first message is sent by the sending device after the sending device receives the second message sent by the receiving device without establishing a communication connection with the receiving device. The second message represents that the sending device and the receiving device establish a communication connection. The second message includes a key, and the first message is encrypted based on the key. Each second device corresponds to one or more field values ​​of the first field.

[0008] In the method of the present application, after receiving a message, the first device can divert the message to distribute each message to different second devices for processing based on the field value of the first field in each message, thereby speeding up the processing speed. In addition, since messages including the same field value of the first field will always be distributed to the same second device for processing, each second device can identify whether the received message is a message of a replay attack without sharing messages. This can not only improve the security of each second device when receiving messages, but also reduce the memory pressure of each second device.

[0009] In combination with the first aspect, in one possible design, the first device uses the field value of the first field in the first message as an input of a consistent hash algorithm to obtain an output value of the consistent hash algorithm. The first device determines a second device corresponding to the field value of the first field in the first message based on the output value.

[0010] In this solution, a possible implementation method of determining the second device corresponding to the field value of the first field in the first message is given.

[0011] In combination with the first aspect, in one possible design, the preset position includes the position where the destination connection identifier field in the message is located.

[0012] In this solution, a possible setting method for the preset position is given.

[0013] In a second aspect, an embodiment of the present application provides a message forwarding method that can be applied to a second device, in which the second device obtains a first message sent by a sending device to a receiving device. The first message includes data signaling, and the first message is sent by the sending device after the sending device receives a second message sent by the receiving device without establishing a communication connection with the receiving device. The first message carries a first time point, and the first time point indicates the time point when the sending device sends the second message. The second message indicates that the sending device establishes a communication connection with the receiving device. The second message includes a key, and the first message is encrypted based on the key.

[0014] The second device predicts the time of receiving the first message based on the first time point, the first time period and the transmission time to obtain the first expected time. The first time period represents the time from when the sending end device receives the second message to when the sending end device sends the first message. The transmission time is obtained based on the time when the message is transmitted from the receiving end device to the sending end device and the time when the message is transmitted from the sending end device to the second device. The second device can process the first message based on the time when the first message is actually obtained and the first expected time.

[0015] In the method of the present application, in the 0-RTT mode, since the first expected time is the time when the first message reaches the second device when it is predicted by the second device and is not intercepted and tampered by the attacking device, the second device can determine whether the first message is a message of a replay attack based on the time when the first message is actually obtained and the first expected time. And if it is determined that the first message is not a message of a replay attack, the first message is processed, thereby improving the security of the electronic device when receiving messages.

[0016] In conjunction with the second aspect, in a possible design, the transmission time may be predefined. The time for a message to be transmitted from a receiving device to a transmitting device and the time for a message to be transmitted from the transmitting device to a second device may be detected multiple times, and the transmission time may be obtained based on the sum of an average value of the time for a message to be transmitted from the receiving device to the transmitting device and an average value of the time for a message to be transmitted from the transmitting device to the second device obtained from multiple detections.

[0017] In conjunction with the second aspect, in a possible design, if the time of the second device, the transmitting device, and the receiving device are all consistent, the first message may also carry a second time point. The second time point is the time point when the transmitting device sends the first message. After the second device receives the first message, it can predict the time of receiving the first message based on the second time point and the second transmission time to obtain the first expected time. The second transmission time is the time when the message is transmitted from the transmitting device to the target second device.

[0018] In this solution, the second device can obtain the first expected time only based on the second time point and the second transmission time. The method for obtaining the first expected time is simpler, and the first message carries less information.

[0019] In combination with the second aspect, in a possible design, if the time when the second device actually obtains the first message is earlier than the first expected time, the first message is processed. Alternatively, if the time when the second device actually obtains the first message is later than the first expected time, and the difference between the time when the first message is actually obtained and the first expected time is less than or equal to the first time threshold, the first message is processed.

[0020] In this scheme, since the first expected time is the time predicted by the second device to reach the second device when the first message is not intercepted and tampered by the attacking device. Therefore, if the time when the second device actually obtains the first message is earlier than the first expected time, the second device can determine that the first message is directly sent from the sending end device to the second device, and is not attacked during the transmission process, and the second device can process the first message. In addition, considering the impact of the unstable transmission network on the time when the second device actually obtains the first message, and the impact of the possible error in the transmission time on the first expected time, a first time threshold can be set. If the time when the second device actually obtains the first message is later than the first expected time, but the difference between the actual time when the first message is obtained and the first expected time is less than or equal to the first time threshold, the second device can also determine that the first message is directly sent from the sending end device to the second device, the first message is not a message of a replay attack, and the second device can process the first message. This scheme can improve the security of electronic devices when receiving messages.

[0021] In conjunction with the second aspect, in a possible design, a second device receives a first message sent by a first device. The first device is different from the sending device, the first message includes a first field, the first field is located at a preset position in the message, and the same field value of the first field corresponds to one or more messages. Each second device corresponds to one or more field values ​​of the first field.

[0022] In this solution, the second device corresponds to the field value of the first field included in the first message. The first device is used to shunt the first message, thereby sending the first message to the corresponding second device. Different second devices can process the received messages respectively, which can speed up the processing speed.

[0023] In combination with the second aspect, in one possible design, the preset position includes the position where the destination connection identifier field in the message is located.

[0024] In this solution, a possible setting method for the preset position is given.

[0025] In combination with the second aspect, in a possible design, the second device may obtain a field value of a second field included in the first message. The field values ​​of the second field included in different messages are different. If the second device detects that there is a historical field value that is the same as the field value of the second field in the first message, the first message is not processed. The historical field value is the field value of the second field included in the historically acquired message. If the second device detects that the historical field value is different from the field value of the second field in the first message, the first message is processed based on the time when the first message is actually acquired and the first expected time.

[0026] In this solution, if the second device detects that there is a history field value that is the same as the field value of the second field in the first message, it means that the second device has received the first message in the past, that is, the latest received first message is a duplicate version of the first message received in the past. Therefore, the second device can determine that the first message is a replay attack message, and the second device can not process the first message, thereby improving the security of the electronic device when receiving messages.

[0027] If the second device detects that the historical field value is different from the field value of the second field in the first message, the second device can determine whether the first message is a message of a replay attack based on the time when the first message is actually acquired and the first expected time. If the first message is determined to be a message of a replay attack, the second device processes the first message, thereby improving the security of the electronic device when receiving messages.

[0028] In combination with the second aspect, in one possible design, if the second device detects that the historical field value is different from the field value of the second field in the first message, the second device may add the field value of the second field in the first message to the historical field value.

[0029] In this solution, after the field value of the second field in the first message is added to the historical field value, it can be compared with the new second field subsequently obtained by the second device to determine whether the message including the new second field is a replay attack message.

[0030] In conjunction with the second aspect, in a possible design, the second field is a random number field included in the message. Alternatively, the second field is a binding code field included in the message.

[0031] In this solution, possible settings for the second field are given.

[0032] In combination with the second aspect, in one possible design, the second device processing the first message may include the second device sending the first message to a receiving device.

[0033] In this solution, the second device can be different from the receiving device. After determining that the first message is not a message of a replay attack, the second device can process the first message to send the first message to the receiving device. After receiving the first message, the receiving device does not need to verify whether the first message is a message of a replay attack, but can process the first message. The security of the electronic device when receiving messages can be improved, and the efficiency of the electronic device in processing messages can be improved.

[0034] In a third aspect, an embodiment of the present application provides an electronic device, comprising a memory and one or more processors, wherein the memory and the processor are coupled; the memory is used to store computer program code, and the computer program code comprises computer instructions, and when the processor executes the computer instructions, the electronic device executes the method described in the first aspect and any possible design thereof, or the electronic device executes the method described in the second aspect and any possible design thereof.

[0035] In a fourth aspect, an embodiment of the present application provides a chip system. The chip system includes one or more interface circuits and one or more processors. The interface circuit and the processor are interconnected by a line, and the interface circuit is used to receive a signal from a memory of an electronic device and send a signal to the processor, the signal including a computer instruction stored in the memory, and when the processor executes the computer instruction, the electronic device executes the method described in the first aspect and any possible design thereof, or causes the electronic device to execute the method described in the second aspect and any possible design thereof.

[0036] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium, including computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes the method described in the first aspect and any possible design thereof, or the electronic device executes the method described in the second aspect and any possible design thereof.

[0037] In a sixth aspect, an embodiment of the present application provides a computer program product. When the computer program product is run on a computer, the computer is caused to execute the method described in the first aspect and any possible design thereof, or the computer is caused to execute the method described in the second aspect and any possible design thereof.

[0038] In a seventh aspect, an embodiment of the present application provides a message forwarding system, which includes a first device and at least one second device. The first device is used to execute the method described in the first aspect and any possible design thereof, and the second device is used to execute the method described in the second aspect and any possible design thereof. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] Figure 1 A schematic diagram of a communication mechanism in the prior art;

[0040] Figure 2 A schematic diagram of a replay attack scenario;

[0041] Figure 3 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;

[0042] Figure 4A schematic diagram of the structure of a message forwarding system provided in an embodiment of the present application;

[0043] Figure 5 A schematic diagram of the structure of a transfer device provided in an embodiment of the present application;

[0044] Figure 6 An interactive schematic diagram of a message forwarding method provided in an embodiment of the present application;

[0045] Figure 7 A schematic diagram of an application scenario of a message forwarding method provided in an embodiment of the present application;

[0046] Figure 8 A flowchart of another message forwarding method provided in an embodiment of the present application;

[0047] Fig. 9A A schematic diagram of an application scenario of another message forwarding method provided in an embodiment of the present application;

[0048] Fig. 9B A schematic diagram of another application scenario of another message forwarding method provided in an embodiment of the present application;

[0049] Fig.10 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0050] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application. In the description of the embodiments of the present application, unless otherwise specified, " / " means or, for example, A / B can mean A or B; "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, "multiple" means two or more than two.

[0051] In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of this embodiment, unless otherwise specified, "plurality" means two or more.

[0052] For example, the sending device is a mobile phone and the receiving device is a server. Figure 1After the mobile phone 101 establishes a communication connection with the server 102, the mobile phone 101 can send a handshake message to the server 102 to request to establish a handshake protocol with the server 102. Among them, the handshake protocol is a protocol for negotiating the security parameters of the connection. The handshake message may include the version number of the communication protocol supported by the mobile phone 101, a list of cipher suites, a list of available compression methods, etc. After the server 102 receives the handshake message sent by the mobile phone 101, it can generate a pre-shared key (PSK) based on the handshake message and send the PSK to the mobile phone 101. After receiving the PSK, the mobile phone 101 can store the PSK and complete the establishment of the handshake protocol with the server 102.

[0053] When the mobile phone 101 needs to send a message to the server 102, even if a communication connection is not established between the mobile phone 101 and the server 102, the mobile phone can encrypt the message to be sent based on the stored PSK, and send the PSK and the encrypted message to the server 102 (for example, send the PSK and the encrypted message to the server 102 via the wide area network). The server can decrypt the encrypted message based on the PSK, and send the corresponding processed message back to the mobile phone 101. Among them, this kind of mobile phone 101 only needs to establish a communication connection with the server 102 once to obtain the PSK, and there is no need to establish a communication connection with the server 102 later. The mechanism that can directly communicate with the server 102 based on the PSK can also be called a 0-RTT mechanism.

[0054] Still taking the sending device as a mobile phone and the receiving device as a server as an example, see Figure 2 When the mobile phone 201 sends PSK and messages encrypted by PSK to the server 202 based on the 0-RTT mechanism, since there is no exclusive communication connection channel between the mobile phone 201 and the server 202, the attack device 203 can copy the message sent by the mobile phone 201 to the server 202, and send the copied message to the server, thereby disrupting the state of the server and achieving the purpose of the attack (also known as a replay attack).

[0055] For example, if a mobile phone sends an encrypted message for requesting a transfer and a PSK for decrypting the encrypted message to a server based on the 0-RTT mechanism, and the attacking device copies the encrypted message three times and sends it to the server, the server can decrypt the original encrypted message and the three copies of the encrypted message based on the PSK after receiving the original encrypted message, the three copies of the encrypted message, and the PSK. After that, the server will process the four transfer applications, resulting in three more transfers.

[0056] In order to prevent the receiving device from being attacked and improve the security of the receiving device when processing the received message, the receiving device can record the target field included in the received message after receiving the message. Each target field corresponds to a message, that is, the target field is unique.

[0057] For example, the target field may include a random number field generated by the transmitting device, and the message sent by the transmitting device includes the random number field, and different messages include different random number fields. The message sent by the transmitting device may include the following content:

[0058]

[0059] The random number field is a 5-line Random field, which can be composed of multiple numbers and letters.

[0060] For another example, when each PSK is set to correspond to a hash algorithm, the target field may include a binding code (also referred to as PSK binders in the embodiment of the present application). PSK binders is a collection of keyed-hashing for message authentication (HMAC) related to PSK. The PSK binders corresponding to each message sent by the sending device are unique, that is, even if the message sent by the sending device is the same each time, the PSK binders corresponding to each message sent by the sending device are different. Among them, the message sent by the sending device may also include the following content:

[0061]

[0062] PSK binders are 11 lines of PSK binders fields. PSK binders can consist of multiple numbers.

[0063] Among them, the fields such as Random field and / or PSK binders field recorded by the receiving device can also be called history fields. Each time the receiving device receives a message, it can compare the target field and the history field in the message. If there is a history field that is the same as the target field, the message is determined to be a copied message. In other words, the message is determined to be a replay attack message. The receiving device can refuse to process the message, thereby preventing the receiving device from being attacked.

[0064] However, for the sake of load sharing and capacity scalability, the receiving device usually includes multiple electronic devices. If the attacking device copies the message sent by the sending device and sends the copied message to one of the electronic devices included in the receiving device, if the electronic device is not the electronic device that received the original message, the electronic device that received the copied message cannot recognize that the message is a replay attack message, which poses a security problem.

[0065] For example, the receiving device includes electronic device A and electronic device B. The sending device can send message A to electronic device A. The attacking device can copy message A and send the copied message to electronic device B. Since electronic device B has never received message A, it will not store the target field included in message A. Electronic device B cannot determine that the received copied message is a message of a replay attack.

[0066] In this case, in order to improve the security of the receiving device when processing the received message, the multiple electronic devices included in the receiving device need to store the history field. For example, after electronic device A stores the history field, it needs to send the history field to electronic device B, and electronic device B also needs to store the history field.

[0067] However, the method in which all electronic devices included in the receiving device store the history field will occupy the memory of each electronic device included in the receiving device. In addition, if electronic device B receives a replay attack message during the process of electronic device A sending the history field to electronic device B, electronic device B still cannot determine that the received message is a replay attack message, which poses a security problem.

[0068] Based on the above problems, an embodiment of the present application provides a message forwarding method and an electronic device. In the method, when a transmitting device sends a first message to a receiving device based on a 0-RTT mechanism, the first device can receive the first message and obtain the first field in the first message. Among them, the first field is located at a preset position in the message, and the same field value of the first field corresponds to one or more messages. The first device can send the first message to a second device corresponding to the field value of the first field in the first message, so that the second device processes the first message, thereby realizing the diversion of the first message. In addition, since messages including the same field value of the first field will always be distributed to the same second device for processing, the second device can identify whether the received message is a message of a replay attack, which can improve the security of the electronic device when receiving messages.

[0069] The transmitting end device, the receiving end device, the second device and the first device in the embodiment of the present application can all be as follows Figure 3 An electronic device 100 is shown.

[0070] See also Figure 3 The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc.

[0071] It is to be understood that the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figure, or combine some components, or separate some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0072] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.

[0073] The controller may be the nerve center and command center of the electronic device 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.

[0074] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0075] In some embodiments, the processor 110 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.

[0076] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.

[0077] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.

[0078] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.

[0079] The modem processor may include a modulator and a demodulator. Among them, the modulator is used to modulate the low-frequency baseband signal to be sent into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After the low-frequency baseband signal is processed by the baseband processor, it is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to a speaker 170A, a receiver 170B, etc.), or displays an image or video through a display screen 194. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be set in the same device as the mobile communication module 150 or other functional modules.

[0080] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 100. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the frequency of the electromagnetic wave signal and performs filtering, and sends the processed signal to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, modulate the frequency of it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.

[0081] In some embodiments, the antenna 1 of the electronic device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device 100 can communicate with the network and other devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology. The GNSS may include a global positioning system (GPS), a global navigation satellite system (GLONASS), a Beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS) and / or a satellite based augmentation system (SBAS).

[0082] The electronic device 100 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.

[0083] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light emitting diode or an active-matrix organic light emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-OLED, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include 1 or N display screens 194, where N is a positive integer greater than 1.

[0084] The electronic device 100 can realize the shooting function through ISP, camera 193, video codec, GPU, display screen 194 and application processor.

[0085] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function, such as storing music, video and other files in the external memory card.

[0086] The internal memory 121 can be used to store computer executable program codes, which include instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the electronic device 100 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.

[0087] The electronic device 100 can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.

[0088] Exemplarily, the technical solutions involved in the following embodiments can all be implemented in an electronic device having the above hardware architecture. The message forwarding method provided in the embodiments of the present application is described in detail below in conjunction with the accompanying drawings and application scenarios.

[0089] The message forwarding method provided in the embodiment of the present application can be applied to Figure 4 In the message forwarding system shown, the message forwarding system includes a sending end device 401 for sending a message, a transfer device 402 for determining whether to process the message sent by the sending end device 401, and a receiving end device 403 for processing the message sent by the sending end device 401. The transfer device 402 is connected to the receiving end device 403. In some embodiments, the transfer device 402 may also be a part of the receiving end device 403.

[0090] In some embodiments, see Figure 5 , the transfer device may include a first device 501 and at least one second device 502. The first device 501 may be an electronic device such as a network load balancer (NLB for short). The second device 502 may be an electronic device such as a server load balancer (SLB for short).

[0091] In some embodiments, the transfer device may also include only one electronic device. In this case, the transfer device may include a first unit and a second unit. The first unit may have the functions of an electronic device such as an NLB, and the second unit may have the functions of an electronic device such as an SLB.

[0092] The following takes the Internet of Things system provided in the embodiment of the present application as an example, including the above-mentioned sending end device, the first device, at least one second device and the receiving end device. Figure 6 , the message forwarding method provided in the embodiment of the present application is described in detail.

[0093] In some embodiments, when the sending device and the receiving device establish a handshake protocol, the receiving device may send a second message (also referred to as a ticket in the embodiments of the present application) to the sending device. The second message indicates that the sending device and the receiving device have established a communication connection. The second message carries a first time point, which indicates the time point when the receiving device sends the second message.

[0094] In some embodiments, the second message also carries a PSK (also referred to as a key in the embodiments of the present application) and a validity period corresponding to the PSK. PSK is an encryption method customized by the receiving device, and only the receiving device that sends the PSK can decrypt the message encrypted based on the PSK based on the PSK. The PSK is only valid within the validity period corresponding to the PSK. After the validity period expires, the receiving device will delete the PSK or fail to recognize the PSK.

[0095] For example, if the validity period of a PSK is 12 hours, then the PSK is valid for 12 hours. After 12 hours, even if the sending device encrypts a message based on the PSK and sends the encrypted message to the receiving device, the receiving device cannot decrypt the received encrypted message because the PSK has exceeded the validity period, and thus cannot process the encrypted message.

[0096] In some embodiments, after receiving the second message sent by the receiving device, the transmitting device may store the second message. Thereafter, the transmitting device may send the first message to the receiving device.

[0097] The first message includes data signaling, and the first message carries a first time point and a first time period. The first time period includes the time from when the transmitting end device receives the second message sent by the receiving end device to when the transmitting end device sends the first message to the receiving end device. For example, the time when the transmitting end device receives the second message sent by the receiving end device is 8:00:04 on March 28, 2023, and the time when the transmitting end device sends the first message to the receiving end device is 10:00:04 on March 28, 2023, then the first time period can be 2 hours.

[0098] Optionally, after the sending device receives the second message sent by the receiving device, in order to prevent information leakage, a cover value (also referred to as Ticket Age Add in the embodiment of the present application) may be set. The sending device will perform fuzzification processing on the first time period (also referred to as clients ticket age in the embodiment of the present application) based on the cover value, and the result of the fuzzification processing is the second time period (also referred to as Obfuscated Ticket Age in the embodiment of the present application). Afterwards, the sending device may store the second time period. Before the sending device sends the first message, as time goes by, since the first time period is also increasing, the second time period stored by the sending device will also change accordingly. When the sending device needs to send the first message to the receiving device, the sending device may determine the first time period based on the cover value and the second time period, and generate the first message based on the first message, the first time period and the second message. Afterwards, the sending device sends the first message to the receiving device.

[0099] In some embodiments, the relationship between Ticket Age Add, Obfuscated TicketAge, and clients ticket age can be represented by the following relationship:

[0100] clients ticket age=Obfuscated Ticket Age-Ticket Age Add.

[0101] In some embodiments, the first message may be an INITIAL type message. The INITIAL type is a message type for establishing a connection based on the Quick UDP Internet Connections (QUIC) protocol of the HTTP / 3 transport layer. Alternatively, the first message may also be a 0-RTT type message. The 0-RTT type is a message type for carrying an upper layer protocol HTTP / 3 request message in 0-RTT mode using the QUIC protocol based on the HTTP / 3 transport layer. The embodiment of the present application does not limit the message type of the first message.

[0102] In some embodiments, a first device may obtain a first message sent by a transmitting device to a receiving device. Furthermore, a first field included in the first message may be obtained. The first field is a field located at a preset position in the first message, and the first fields included in different messages may be the same or different. That is, the same field value of the first field corresponds to one or more messages. For example, the preset position includes the position where the destination connection identifier field in the message is located. Then the first field is the destination connection identifier (Destination Connection ID, DCID for short) field included in the message. The DCID fields included in different messages may be the same or different.

[0103] In some embodiments, each second device corresponds to one or more field values ​​of the first field. The first device can obtain a correspondence between the first field and a target second device in at least one second device based on the field value of the first field.

[0104] Among them, a consistent hash algorithm can be defined in the first device, and the field value of the first field obtained by the first device can be used as the input of the consistent hash algorithm, and the correspondence between the first field and the target second device in at least one second device is obtained based on the output of the consistent hash algorithm. Among them, the consistent hash algorithm always has the same output for the same input. The consistent hash algorithm can output N different values, where N is a positive integer. Each second device corresponds to at least one value output by the consistent hash algorithm.

[0105] For example, if there are four second devices, namely second device 1, second device 2, second device 3 and second device 4, a consistent hash algorithm that can output four different values ​​can be defined in the first device. Among them, these four different values ​​can be 1#, 2#, 3# and 4# respectively. A correspondence between 1# and the second device 1 can be established, so that when the first device processes the field value of the first field obtained by the consistent hash algorithm and outputs 1#, the correspondence between the first field and the second device 1 is obtained. Correspondingly, a correspondence between 2# and the second device 2, a correspondence between 3# and the second device 3, and a correspondence between 4# and the second device 4 can also be established, and this application will not describe them one by one.

[0106] For another example, if there are four second devices, namely second device 1, second device 2, second device 3 and second device 4, a consistent hash algorithm that can output eight different values ​​can be defined in the first device. Among them, these eight different values ​​can be 1#, 2#, 3#, 4#, 5#, 6#, 7# and 8#, respectively. A correspondence between 1# and 2# and the second device 1 can be established, so that when the first device processes the obtained first field through a consistent hash algorithm and outputs 1# or 2#, a correspondence between the first field and the second device 1 is established. Correspondingly, a correspondence between 3# and 4# and the second device 2, a correspondence between 5# and 6# and the second device 3, and a correspondence between 7# and 8# and the second device 4 can also be established, and this application will not describe them one by one.

[0107] In some embodiments, the first device may send a first message to a target second device among the second devices that has a corresponding relationship with the first field. After receiving the first message, the target second device may obtain the second field included in the first message. The field values ​​of the second fields included in different first messages are different, that is, the second field is unique.

[0108] For example, the second field may include a random number field generated by the transmitting device, or the second field may include a PSK binders field, etc., which is not limited in the embodiments of the present application.

[0109] In some embodiments, the target second device may compare the field value of the second field included in the first message with the historical field value obtained historically. If there is a historical field value that is the same as the field value of the second field, the first message is determined to be a message of a replay attack. If there is no historical field value that is the same as the field value of the second field, the field value of the second field is stored.

[0110] Among them, after the field value of the second field included in the first message is stored in the target second device, the field value will also become a new historical field value to be compared with the new second field obtained by the subsequent target second device.

[0111] After receiving messages including the same first field, the first device using the above method can divert these messages based on the defined consistent hashing algorithm to distribute them to different second devices for processing, thereby speeding up the processing speed.

[0112] Furthermore, after receiving messages including the same first field, the first device can distribute these messages to the same second device based on the defined consistent hashing algorithm. For example, when there are ten thousand messages, five thousand of them include the same first field, which is field A. The other five thousand also include the same first field, which is field B. After the first device receives these ten thousand messages, the five thousand messages including field A can be sent to a second device based on the consistent hashing algorithm. And, the five thousand messages including field B can be sent to another second device based on the consistent hashing algorithm. The two second devices can process the received messages at the same time to determine whether these messages are messages of replay attacks.

[0113] In some embodiments, if there is a history field value that is the same as the field value of the second field included in the first message, the target second device may determine that the first message is a message of a replay attack.

[0114] In some embodiments, if there is no historical field value that is the same as the field value of the second field included in the first message, the target second device may record the field value of the second field included in the first message in an identification table. The identification table records the historical field values ​​recorded by the target second device.

[0115] For example, see Table 1 below:

[0116] Table 1

[0117] Historical field values Receiving time DCID 1 2023-03-28 19:45:01 DCID 2 2023-03-28 19:46:03 … …

[0118] Continuing to refer to Table 1 above, in some embodiments, in order to save the memory of the target second device, the identification table may also record the time when the target second device receives the historical field value, and the target second device may delete the historical field value whose storage time exceeds the second time threshold to release the memory space of the target second device. The second time threshold may be a customized value in the target second device, for example, the second time threshold may be 30 minutes, 1 hour, 10 hours, etc., which is not limited in the embodiments of the present application.

[0119] For example, the time threshold can be set to 10 hours, then at 20:45:01 on March 28, 2023, the historical field value DCID1 in Table 1 will be deleted.

[0120] In some embodiments, the time of each second device is consistent with that of the receiving device. After the target second device receives the first message, the second expected time can be obtained. The second expected time is obtained based on the first time point and the transmission time. The transmission time is the sum of the first transmission time and the second transmission time. The first transmission time is the time when the message is transmitted from the receiving device to the sending device. The second transmission time is the time when the message is transmitted from the sending device to the target second device.

[0121] For example, if the time for a message to be transmitted from the receiving device to the sending device is 6 seconds, and the time for a message to be transmitted from the sending device to the target second device is 4 seconds, then the transmission time is 10 seconds. If the first time point is 8:00:00 on March 28, 2023, then the second expected time may be 8:00:10 on March 28, 2023.

[0122] In some embodiments, the first transmission time and the second transmission time may be predefined. For example, the time when the message is transmitted from the receiving device to the sending device and the time when the message is transmitted from the sending device to the target second device may be detected multiple times, and the transmission time is obtained based on the sum of the average value of the time when the message is transmitted from the receiving device to the sending device and the average value of the time when the message is transmitted from the sending device to the target second device obtained by the multiple detections.

[0123] In some embodiments, if estimated rtt is used to represent the transmission time, creation time is used to represent the first time point, and adjusted creation time is used to represent the second expected time, the relationship among estimated rtt, creation time, and adjusted creation time can be expressed as:

[0124] adjusted creation time=creation time+estimated rtt.

[0125] In some embodiments, after the target second device determines the second expected time, the first expected time can be determined based on the second expected time and the first time period. The first expected time is the time when the target second device predicts that the first message will be received. If the first expected time is represented by ch expected arrival time, the relationship between ch expected arrival time, clients ticket age (first time period) and adjusted creation time (second expected time) can be expressed as:

[0126] ch expected arrival time=adjusted creation time+clients ticket age.

[0127] For example, if the second expected time is 8:00:10 on March 28, 2023, and the first time period is 2 hours, then the first expected time is 10:00:10 on March 28, 2023.

[0128] In some embodiments, the target second device may also obtain time information related to message transmission based on the transmission time and the first time period. The time information related to message transmission indicates the time from when the second message is sent by the receiving device to when the first message is received by the second device, when the first message is not intercepted and tampered by the third device. The third device is the attacking device, and the third device is different from the second device and the first device.

[0129] Afterwards, the target second device can predict the time of receiving the first message based on the first time point and time information related to message transmission to obtain a first expected time.

[0130] In some embodiments, if the time of the target second device, the transmitting device, and the receiving device are all consistent, the first message may carry a second time point. The second time point is the time point when the transmitting device sends the first message. After the target second device receives the first message, it can predict the time of receiving the first message based on the second time point and the second transmission time to obtain the first expected time. The description of the second transmission time can refer to the description of the aforementioned embodiment, and will not be repeated here.

[0131] Exemplarily, if the second time point is 8:00:10 on March 28, 2023, and the second transmission time is 10 seconds, the first expected time may be 8:00:20 on March 28, 2023.

[0132] In some embodiments, the target second device may determine whether the first message is a message for a replay attack based on the first time threshold, the first expected time, and the time when the target second device actually receives the first message.

[0133] Among them, the first time threshold can be a customized value in the target second device. For example, the first time threshold can be 10 hours, 12 hours, etc. The first time threshold can be the same as the second time threshold or different from the second time threshold, which is not limited by the embodiment of the present application.

[0134] In some embodiments, if the time when the target second device actually receives the first message is earlier than the first expected time, the target second device determines that the first message is not a message of a replay attack. Alternatively, considering the impact of the unstable transmission network on the time when the second device actually obtains the first message, and the impact of the possible error in the transmission time on the first expected time, a first time threshold can be set. If the time when the second device actually obtains the first message is later than the first expected time, but the difference between the time when the first message is actually obtained and the first expected time is less than or equal to the first time threshold, the target second device determines that the first message is not a message of a replay attack.

[0135] In some embodiments, if the difference between the time when the target second device actually receives the first message and the first expected time is greater than a first time threshold, the target second device determines that the first message is a message of a replay attack.

[0136] If Tch represents the time when the target second device actually receives the first message and Twin represents the first time threshold, when Tch≤ch expected arrival time or Twin≤ch expected arrival time-Tch, the target second device determines that the first message is not a message of a replay attack. When Twin>ch expected arrival time-Tch, the target second device determines that the first message is a message of a replay attack.

[0137] In an embodiment of the present application, even if a field of the first message is tampered with by the attacking device, or the first message is copied by the attacking device and then resent to the receiving device, the target second device can also determine whether the first message is a replay attack message based on the actual time when the first message is obtained and the first expected time.

[0138] Among them, if the target second device determines that the first message is a message of a replay attack, the target second device may determine not to process the first message, or delete the first message to release the memory space of the target second device. If the target second device determines that the first message is not a message of a replay attack, the target second device may determine to process the first message. For example, the target second device may send the first message to the receiving device. After receiving the first message, the receiving device may process the first message. For example, the receiving device may decrypt the first message based on the PSK carried by the first message, and process the message obtained after decryption. Alternatively, if the target second device determines that the first message is not a message of a replay attack, the target second device may decrypt the first message based on the PSK carried by the first message as a receiving device, obtain the decrypted message, and perform corresponding processing on the decrypted message.

[0139] In some embodiments, the present application also provides a message forwarding method, which can be applied to a first device, such as Figure 7 As shown, the method may include steps S701-S702:

[0140] S701: Receive a first message, and obtain a first field in the first message.

[0141] Among them, the first field is located at a preset position in the message, and the same field value of the first field corresponds to one or more messages.

[0142] S702: Send the first message to the second device corresponding to the field value of the first field in the first message.

[0143] The first message includes data signaling, and the first message is sent by the sending end device after receiving the second message sent by the receiving end device when the sending end device has not established a communication connection with the receiving end device, and the second message indicates that the sending end device and the receiving end device have established a communication connection. The second message includes a key, and the first message is encrypted based on the key, and each second device corresponds to one or more field values ​​of the first field.

[0144] In some embodiments, the first device uses the field value of the first field in the first message as an input of the consistent hash algorithm to obtain an output value of the consistent hash algorithm. The first device determines a second device corresponding to the field value of the first field in the first message based on the output value.

[0145] In some embodiments, the preset location includes the location of a destination connection identifier field in the message.

[0146] In the message forwarding method implemented in the above steps S701-S702, after receiving the message, the first device can divert the message to distribute each message to different second devices for processing based on the field value of the first field in each message, thereby speeding up the processing speed. In addition, since messages including the same field value of the first field will always be distributed to the same second device for processing, each second device can identify whether the received message is a message of a replay attack without sharing messages. This can not only improve the security of each second device when receiving messages, but also reduce the memory pressure of each second device.

[0147] In some embodiments, the present application also provides a message forwarding method, which can be applied to the second device, see Figure 8 , the method may include the following steps S801-S803:

[0148] S801: Acquire a first message sent by a sending device to a receiving device, where the first message carries a first time point.

[0149] The first message includes data signaling. The first message is sent by the sending device after the sending device receives the second message sent by the receiving device without establishing a communication connection with the receiving device. The first time point represents the time point when the sending device sends the second message. The second message represents that the sending device establishes a communication connection with the receiving device, and the second message includes a key, and the first message is encrypted based on the key. In some embodiments, the second device can receive the first message sent by the first device. The first device is different from the sending device. The first message includes a first field, and the first field is located at a preset position in the message. The preset position includes the position of the destination connection identifier field in the message. The same field value of the first field corresponds to one or more messages. Each second device corresponds to one or more field values ​​of the first field.

[0150] In some embodiments, the second device may obtain a field value of a second field included in the first message. The field values ​​of the second field included in different messages are different. If it is detected that there is a historical field value that is the same as the field value of the second field in the first message, the first message is not processed. The historical field value is the field value of the second field included in the historical acquisition message.

[0151] If it is detected that the historical field value is different from the field value of the second field in the first message, the first message is processed based on the time when the first message is actually obtained and the first expected time.

[0152] In some embodiments, if it is detected that the historical field value is different from the field value of the second field in the first message, the second field may also be added to the historical field value.

[0153] In some embodiments, the second field may be a random number field included in the message. Alternatively, the second field may also be a binding code field included in the message.

[0154] In some embodiments, if the second device detects that the historical field value is the same as the field value of the second field in the first message, it continues to execute the following steps S802-S803 to determine whether the first message is a replay attack message based on the actual time when the first message is obtained and the first expected time.

[0155] S802: Based on the first time point, the first time period, and the transmission time, predict the time when the first message is received to obtain a first expected time.

[0156] The first time period refers to the time from when the sending end device receives the second message to when it sends the first message. The transmission time is obtained based on the time when the message is transmitted from the receiving end device to the sending end device and the time when the message is transmitted from the sending end device to the second device.

[0157] S803: Process the first message based on the time when the first message is actually obtained and the first expected time.

[0158] In some embodiments, see Fig. 9A If the time when the second device actually obtains the first message is earlier than the first expected time, or if the difference between the time when the second device actually obtains the first message and the first expected time is less than or equal to the first time threshold, it is determined to process the first message. The second device can send the first message to the receiving device. After receiving the first message, the receiving device can process the first message.

[0159] Alternatively, in an embodiment of the present application, if it is determined to process the first message, the second device may also serve as a receiving device to process the first message.

[0160] In some embodiments, see Fig. 9B If the difference between the time when the second device actually obtains the first message and the first expected time is greater than the first time threshold, the first message is not processed. Alternatively, the second device may delete or suspend the first message to free up memory.

[0161] In the message forwarding method implemented in the above steps S801-S803, in the 0-RTT mode, since the first expected time is the time when the first message reaches the second device when it is predicted by the second device if the first message is not intercepted and tampered by the attacking device, the second device can determine whether the first message is a message of a replay attack based on the time when the first message is actually obtained and the first expected time. And if it is determined that the first message is not a message of a replay attack, the first message is processed, thereby improving the security of the electronic device when receiving messages.

[0162] In some schemes, multiple embodiments of the present application can be combined, and the combined scheme can be implemented. Optionally, some operations in the process of each method embodiment are optionally combined, and / or the order of some operations is optionally changed. In addition, the execution order between the steps of each process is only exemplary and does not constitute a restriction on the execution order between the steps. There can also be other execution orders between the steps. It is not intended to indicate that the execution order is the only order in which these operations can be performed. A person of ordinary skill in the art will think of a variety of ways to reorder the operations described herein. In addition, it should be noted that the process details involved in a certain embodiment of this article are also applicable to other embodiments in a similar manner, or different embodiments can be used in combination.

[0163] In addition, some steps in the method embodiment may be equivalently replaced by other possible steps. Alternatively, some steps in the method embodiment may be optional and may be deleted in certain usage scenarios. Alternatively, other possible steps may be added to the method embodiment.

[0164] Furthermore, the various method embodiments may be implemented separately or in combination.

[0165] It is understandable that in order to implement the above functions, the electronic device includes hardware and / or software modules corresponding to the execution of each function. In combination with the algorithm steps of each example described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application in combination with the embodiments, but such implementation should not be considered to be beyond the scope of the present application.

[0166] In this embodiment, the electronic device can be divided into functional modules according to the above method example. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one processing module. The above integrated module can be implemented in the form of hardware. It should be noted that the division of modules in this embodiment is schematic and is only a logical function division. There may be other division methods in actual implementation.

[0167] The present application also provides an electronic device, such as Fig.10 As shown, the electronic device may include one or more processors 1001 , a memory 1002 and a communication interface 1003 .

[0168] The memory 1002 and the communication interface 1003 are coupled to the processor 1001. For example, the memory 1002, the communication interface 1003 and the processor 1001 may be coupled together via a bus 1004.

[0169] The communication interface 1003 is used for data transmission with other devices. The memory 1002 stores computer program code. The computer program code includes computer instructions. When the computer instructions are executed by the processor 1001, the electronic device executes the message forwarding method in the embodiment of the present application.

[0170] Among them, the processor 1001 can be a processor or a controller, for example, a central processing unit (CPU), a general processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. It can implement or execute various exemplary logic blocks, modules and circuits described in conjunction with the present disclosure. The processor can also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of DSP and microprocessors, and the like. The processor can be used to support electronic devices to execute the method steps provided in the above embodiments.

[0171] The bus 1004 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The bus 1004 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig.10 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0172] An embodiment of the present application also provides a chip system, including: a processor, the processor is coupled to a memory, the memory is used to store programs or instructions, when the program or instructions are executed by the processor, the chip system implements the method in any of the above method embodiments.

[0173] Optionally, the processor in the chip system may be one or more. The processor may be implemented by hardware or by software. When implemented by hardware, the processor may be a logic circuit, an integrated circuit, etc. When implemented by software, the processor may be a general-purpose processor implemented by reading software code stored in a memory.

[0174] Optionally, the memory in the chip system may also be one or more. The memory may be integrated with the processor or may be separately arranged with the processor, which is not limited in the embodiments of the present application. Exemplarily, the memory may be a non-transient processor, such as a read-only memory ROM, which may be integrated with the processor on the same chip or may be arranged on different chips respectively. The embodiments of the present application do not specifically limit the type of memory and the arrangement of the memory and the processor.

[0175] Exemplarily, the chip system can be a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on chip (SoC), a central processor unit (CPU), a network processor (NP), a digital signal processor (DSP), a microcontroller unit (MCU), a programmable logic device (PLD) or other integrated chips.

[0176] It should be understood that each step in the above method embodiment can be completed by an integrated logic circuit of hardware in a processor or by instructions in the form of software. The method steps disclosed in the embodiments of the present application can be directly embodied as being executed by a hardware processor, or by a combination of hardware and software modules in a processor.

[0177] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program code is stored. When the processor executes the computer program code, the electronic device executes the relevant method steps in the method embodiment.

[0178] The embodiment of the present application also provides a computer program product. When the computer program product is run on a computer, it enables the computer to execute the relevant method steps in the above method embodiment.

[0179] In addition, an embodiment of the present application further provides a device. The device may be a component or a module, and the device may include one or more processors and a memory connected to each other. The memory is used to store a computer program. When the computer program is executed by one or more processors, the device performs the scene configuration method in the above-mentioned method embodiments.

[0180] Among them, the device, computer-readable storage medium, computer program product or chip provided in the embodiments of the present application are used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above, and will not be repeated here.

[0181] The steps of the method or algorithm described in conjunction with the disclosed content of the embodiments of the present application can be implemented in hardware or by a processor executing software instructions. The software instructions can be composed of corresponding software modules, and the software modules can be stored in random access memory (RAM), flash memory, read only memory (ROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), registers, hard disks, mobile hard disks, read-only compact disks (CD-ROMs) or any other form of storage medium known in the art. An exemplary storage medium is coupled to a processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an application specific integrated circuit (ASIC).

[0182] Through the description of the above implementation methods, those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above functional modules is used as an example. In practical applications, the above functions can be assigned to different functional modules as needed; that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. The specific working process of the system, device and unit described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

[0183] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the modules or units is 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 device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection 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.

Claims

1. A message forwarding method, characterized in that: Applied to a first device, the method includes: Receive a first message, and obtain a first field in the first message; the first field is located at a preset position in the message; the same field value of the first field corresponds to one or more messages; Sending the first message to a second device corresponding to the field value of the first field in the first message; Among them, the first message includes data signaling, and the first message is sent by the sending device after the sending device receives the second message sent by the receiving device without establishing a communication connection with the receiving device, and the second message represents that the sending device and the receiving device have established a communication connection; the second message includes a key, and the first message is encrypted based on the key; each of the second devices corresponds to one or more field values ​​of the first field.

2. The method according to claim 1, characterized in that Before sending the first message to the second device corresponding to the field value of the first field in the first message, the method further includes: Using the field value of the first field in the first message as an input of a consistent hash algorithm to obtain an output value of the consistent hash algorithm; The second device corresponding to the field value of the first field in the first message is determined based on the output value.

3. The method according to claim 1 or 2, characterized in that: The preset position includes the position where the destination connection identifier field in the message is located.

4. A message forwarding method, characterized in that: Applied to the second device, the method includes: Acquire a first message sent by the transmitting end device to the receiving end device; the first message includes data signaling, and the first message is sent by the transmitting end device after the transmitting end device receives a second message sent by the receiving end device when the transmitting end device does not establish a communication connection with the receiving end device; the first message carries a first time point, and the first time point indicates the time point when the transmitting end device sends the second message; the second message indicates that the transmitting end device establishes a communication connection with the receiving end device; the second message includes a key, and the first message is encrypted based on the key; Based on the first time point, the first time period and the transmission time, the time of receiving the first message is predicted to obtain a first expected time; the first time period represents the time from when the sending end device receives the second message to when the first message is sent; the transmission time is obtained based on the time when the message is transmitted from the receiving end device to the sending end device and the time when the message is transmitted from the sending end device to the second device; The first message is processed based on the time when the first message is actually obtained and the first expected time.

5. The method according to claim 4, characterized in that The processing of the first message based on the time when the first message is actually acquired and the first expected time includes: If the time when the first message is actually obtained is earlier than the first expected time, processing the first message; Alternatively, if the time when the first message is actually obtained is later than the first expected time, and the difference between the time when the first message is actually obtained and the first expected time is less than or equal to a first time threshold, the first message is processed.

6. The method according to claim 4 or 5, characterized in that: The obtaining a first message sent by the sending end device to the receiving end device includes: Receive the first message sent by a first device; the first device is different from the sending device; the first message includes a first field, the first field is located at a preset position in the message, and the same field value of the first field corresponds to one or more messages; each of the second devices corresponds to one or more field values ​​of the first field.

7. The method according to claim 6, characterized in that The preset position includes the position where the destination connection identifier field in the message is located.

8. The method according to any one of claims 4 to 7, characterized in that: The method further comprises: Obtaining a field value of a second field included in the first message; wherein the field values ​​of the second field included in different messages are different; If it is detected that there is a historical field value that is the same as the field value of the second field in the first message, the first message is not processed; the historical field value is the field value of the second field included in the historically acquired message; The processing of the first message based on the time when the first message is actually acquired and the first expected time includes: If it is detected that the historical field value is different from the field value of the second field in the first message, the first message is processed based on the time when the first message is actually obtained and the first expected time.

9. The method according to claim 8, characterized in that If it is detected that the historical field value is different from the field value of the second field in the first message, the method further includes: The field value of the second field in the first message is added to the historical field value.

10. The method according to claim 8 or 9, characterized in that: The second field is a random number field included in the message; or, the second field is a binding code field included in the message.

11. The method according to any one of claims 4 to 10, characterized in that: The processing of the first message includes: Send the first message to the receiving device.

12. An electronic device, characterized in that: include: A memory and one or more processors; the memory is coupled to the processor; wherein the memory stores computer program code, the computer program code includes computer instructions, and when the computer instructions are executed by the processor, the electronic device executes the method as described in any one of claims 1-3, or the electronic device executes the method as described in any one of claims 4-11.

13. A computer-readable storage medium comprising computer instructions, characterized in that: When the computer instructions are executed on an electronic device, the electronic device is caused to execute the method as claimed in any one of claims 1 to 3, or the electronic device is caused to execute the method as claimed in any one of claims 4 to 11.

14. A computer program product, characterized in that When the computer program product is executed on a computer, the computer is enabled to execute the method according to any one of claims 1 to 3, or the computer is enabled to execute the method according to any one of claims 4 to 11.

15. A message forwarding system, characterized in that: The message forwarding system includes a first device and at least one second device; the first device is used to execute the method as described in any one of claims 1-3; the second device is used to execute the method as described in any one of claims 4-11.