Message security transparent transmission method and device for meteorological station terminal, and medium

By using an encrypted connection channel between the weather station terminal and the central server, an asymmetric encryption algorithm is employed to negotiate a symmetric session key, and multi-dimensional legitimacy verification is performed. This solves the problem of message loss and delay in weak network environments for weather station terminals, ensuring the security and reliability of data transmission.

CN121508973APending Publication Date: 2026-02-10INSPUR YUNZHOU (SHANDONG) IND INTERNET CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511684047.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-17
Publication Date
2026-02-10

AI Technical Summary

Technical Problem

Weather station terminals are deployed in remote mountainous areas, islands, or plateaus with weak network environments, where communication link quality is limited. Traditional transparent transmission protocols are prone to message loss or delay, affecting the stability and reliability of the system.

Method used

By establishing an encrypted connection channel between the weather station terminal and the weather center server, and using an asymmetric encryption algorithm to negotiate a symmetric session key, the transmitted messages are encrypted and subjected to multi-dimensional legality verification, including signature field verification, time validity verification, and message deduplication verification, ensuring secure message transmission.

Benefits of technology

It achieves comprehensive protection of data confidentiality, integrity, authenticity, and freshness in unstable network environments, prevents data leakage and replay attacks, and improves the robustness and availability of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121508973A_ABST
    Figure CN121508973A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a message safety transparent transmission method and device for a weather station terminal and a medium, and relates to the technical field of safety transmission, and the method comprises the steps: receiving an encrypted transparent transmission message after the transparent transmission message is encrypted by the weather station terminal through a pre-constructed encrypted connection channel between the weather station terminal and a weather center server, the encrypted unvarnished transmission message is decrypted by using a session key obtained in advance to obtain a decrypted message, the decrypted message is subjected to multi-dimensional legality verification, a legality verification identifier is determined, and the multi-dimensional legality verification comprises signature field verification, time validity verification and message de-duplication verification; and when the legality verification identifier meets a preset requirement, performing service logic processing on the service data in the decryption message, generating a response transparent transmission message, encrypting the response transparent transmission message by using the session key, and sending the encrypted response message to the meteorological station terminal to realize safe transparent transmission of the message.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This specification relates to the field of secure transmission technology, and in particular to a method, device and medium for secure message transmission from a weather station terminal. Background Technology

[0002] Currently, meteorological observation station terminals typically communicate with the central platform via public wireless networks or wired networks to collect and remotely transmit meteorological data. Common terminal communication methods often employ a TCP-based long-connection communication mode, utilizing a "message pass-through" mechanism to enable the central platform to issue commands to the terminals and send data back. TCP sockets facilitate message exchange between the terminal devices and the server. Structurally, simplified protocol headers are used for data encapsulation, thereby reducing communication costs and improving response speed.

[0003] Meteorological station terminals are often deployed in remote mountainous areas, islands, or plateaus with weak network environments and limited communication link quality. While the aforementioned technologies can meet basic transparent transmission requirements, they have significant shortcomings in terms of security and stability. First, the communication content is often unencrypted or uses only simple Base64 encoding, lacking an effective encryption mechanism, making it vulnerable to data interception and tampering during public network transmission. Second, the communicating parties typically lack authentication mechanisms, allowing attackers to forge terminal identities to access the system, send malicious commands, or obtain sensitive data, causing system anomalies. Furthermore, existing message protocols often lack replay attack detection strategies, allowing attackers to repeatedly send legitimate data packets, misleading the system into misjudging command status and potentially interfering with the accuracy of meteorological data.

[0004] Therefore, since the meteorological station terminals are mostly deployed in remote mountainous areas, islands or plateaus with weak network environments, the quality of communication links is limited. Traditional transparent transmission protocols are prone to message loss or delay in weak network environments, affecting the stability and reliability of the entire system. Summary of the Invention

[0005] This specification provides one or more embodiments of a method, device, and medium for secure message transmission from a weather station terminal, which addresses the following technical problem: Since weather station terminals are often deployed in remote mountainous areas, islands, or plateaus with weak network environments, the quality of communication links is limited. Traditional transmission protocols are prone to message loss or delay in weak network environments, affecting the stability and reliability of the entire system.

[0006] One or more embodiments of this specification employ the following technical solutions: This specification provides one or more embodiments of a method for secure message transmission from a weather station terminal. The method includes: receiving an encrypted transparent transmission message encrypted by the weather station terminal through a pre-built encrypted connection channel between the weather station terminal and a weather center server, wherein the transparent transmission message includes a message body, a unique message identifier, a message timestamp, and a signature field; decrypting the encrypted transparent transmission message using a pre-acquired session key to obtain a decrypted message; performing multi-dimensional validity checks on the decrypted message to determine a validity check identifier, wherein the multi-dimensional validity checks include signature field checks, time validity checks, and message deduplication checks; when the validity check identifier meets preset requirements, performing business logic processing on the business data in the decrypted message and generating a response transparent transmission message, encrypting the response transparent transmission message using the session key, and sending the encrypted response message to the weather station terminal to achieve secure message transmission.

[0007] This specification provides one or more embodiments of a message security pass-through device for a weather station terminal, including: At least one processor; and, A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, which, when executed by the at least one processor, enables the at least one processor to perform the above-described method.

[0008] This specification provides one or more embodiments of a non-volatile computer storage medium storing computer-executable instructions configured to perform the above-described method.

[0009] The at least one technical solution adopted in the embodiments of this specification can achieve the following beneficial effects: Traditional communication solutions may only focus on the confidentiality of data transmission, such as using simple encoding or weak encryption, while this solution achieves comprehensive protection of confidentiality, integrity, authenticity, and freshness through encrypted connection channels and multi-dimensional legality verification; it securely negotiates a symmetric session key using an asymmetric encryption algorithm, leveraging the security advantages of asymmetric encryption in key distribution and the efficiency advantages of symmetric encryption in large-scale data processing, ensuring that even if data is intercepted during transmission, it cannot be cracked, effectively resisting the risk of eavesdropping; and it uses time validity verification for… To defend against replay attacks, message deduplication verification forms the second line of defense against replay attacks and ensures order, effectively preventing resource waste and business status chaos. The proactive retransmission strategy on the terminal side works in conjunction with the intelligent deduplication on the server side. After the terminal sends a message, it starts a waiting timer. If no response is received within the timeout period, a retransmission is triggered, effectively combating network packet loss. The deduplication verification mechanism on the server side ensures that this necessary retransmission will not lead to repeated execution on the business side. This gives the system the ability to self-repair and fault tolerance when facing unstable network links, ensuring the final reachability of critical meteorological data or control commands, and greatly improving the robustness and availability of the entire monitoring system in real deployment environments. Attached Figure Description

[0010] To more clearly illustrate the technical solutions in the embodiments or prior art of this specification, the drawings used in the description of the embodiments or prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this specification. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. In the drawings: Figure 1 A flowchart illustrating a secure message transmission method for a weather station terminal provided in an embodiment of this specification; Figure 2 A flowchart illustrating a message sending and connection management process on the weather station terminal side, provided as an embodiment of this specification; Figure 3 This is a flowchart illustrating the message receiving, processing, and response process on the meteorological center server side, as provided in the embodiments of this specification. Figure 4 This is a schematic diagram of the structure of a message security transmission device for a weather station terminal provided in an embodiment of this specification. Detailed Implementation

[0011] To enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this specification, and not all embodiments. Based on the embodiments of this specification, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of this specification.

[0012] This specification provides a method for secure message transmission from a weather station terminal. It should be noted that the execution entity in this specification can be a server or any device with data processing capabilities. Figure 1 This is a flowchart illustrating a secure message transmission method for a weather station terminal provided in an embodiment of this specification, as shown below. Figure 1 As shown, the main steps include the following: Step S101: Receive the encrypted transparent message after the weather station terminal has encrypted the transparent message through the pre-built encrypted connection channel between the weather station terminal and the weather center server.

[0013] The transparent message includes a message body, a unique message identifier, a message timestamp, and a signature field; Before establishing an encrypted connection channel between the pre-built weather station terminal and the weather center server, the method further includes: receiving a handshake request message from the weather station terminal, wherein the handshake request message contains a random number generated by the weather station terminal, a terminal timestamp, a device number, and a list of encryption algorithms supported by the weather station terminal; generating a server random number, selecting an asymmetric encryption algorithm according to the list of encryption algorithms supported by the terminal, determining a server public key and a server private key, and sending the server public key and the server random number to the weather station terminal; receiving an encryption key negotiation message from the weather station terminal, wherein the encryption key negotiation message uses the server public key to encrypt a session key; and decrypting the encryption key negotiation message using the server private key to obtain the session key.

[0014] In one embodiment of this specification, to ensure secure communication between the weather station terminal and the central server, a secure connection channel with encryption capabilities must first be established to prevent data from being stolen or tampered with during transmission. This step generates a session key through a handshake negotiation mechanism, laying the foundation for subsequent encrypted message transmission. It should be noted that in the embodiments of this specification, "terminal device" and "terminal" all refer to weather station terminals, representing different ways of expressing a weather station terminal; similarly, "central server" and "server" both refer to weather center servers, representing different ways of expressing a weather center server.

[0015] After the terminal device powers on, it automatically initializes the communication module and initiates a network connection request to the central server based on the preset server address and port. This connection is built on the TCP protocol and uses a persistent long-connection method to ensure that subsequent messages can be transmitted transparently within a stable channel. The connection request includes the terminal's unique identifier and pre-configured device access credentials, used by the central server for initial identification of the terminal. The terminal has a built-in list of supported encryption algorithms, which is sent along with the connection information for the server to negotiate and match parameters. Upon receiving the connection request, the central server registers the terminal's identity and assigns a unique connection session context to the terminal. After the connection is established, the terminal enters a secure handshake preparation state, establishing the basic environment for subsequent key exchange and secure communication.

[0016] After the terminal and server establish a basic connection, they immediately perform a handshake process and initiate a key negotiation mechanism. The terminal first sends a handshake request message, which contains a 128-bit random number generated by the terminal, the current system timestamp, the device number, and a list of supported encryption algorithms (including RSA-2048, AES-256, and HMAC-SHA256, etc.).

[0017] Upon receiving the handshake request, the server generates its own 128-bit random number and selects the mutually supported asymmetric encryption algorithm RSA-2048 as the key exchange method. Simultaneously, the server returns its RSA public key, the server's random number, and the handshake response information to the terminal. The terminal generates a symmetric encryption session key based on Diffie-Hellman or RSA mode and encrypts this key using the server's RSA public key. Subsequently, the terminal sends the encrypted key negotiation message to the server, which decrypts it using its private key and successfully obtains the session key. This session key is used for AES-256 encryption, HMAC-SHA256 message digest generation, and verification of all subsequent communication data.

[0018] Through the handshake and key exchange process described above, the terminal and the server establish a secure communication channel with confidentiality, integrity and identity verification capabilities without transmitting plaintext keys, thus ensuring the secure transmission of subsequent transparent data.

[0019] Before receiving the encrypted transparent message after the weather station terminal has encrypted the transparent message, the method further includes: obtaining a real-time timestamp and a unique device identifier through the weather station terminal, so as to generate a unique message identifier corresponding to the transparent message based on the real-time timestamp and the unique device identifier.

[0020] In one embodiment of this specification, to ensure the confidentiality and integrity of the transparently transmitted message during transmission, the message content needs to be encapsulated, encrypted, and signed to prevent data from being eavesdropped on, tampered with, or forged. This step constructs a secure message structure, providing a basic guarantee for subsequent transmission.

[0021] During the message encapsulation phase, the terminal device generates a unique message identifier (MessageID) for each transparent message to mark its uniqueness and sequence. This message identifier is generated by the terminal according to a preset algorithm and typically includes a combination of a timestamp, the terminal device number, and an incrementing sequence number. Specifically, the terminal collects the current system time in milliseconds, concatenates it with its own unique device identifier (such as a MAC address or device serial number), and appends an auto-incrementing sequence number to form a fixed-length, globally unique message identifier. This message identifier not only ensures the uniqueness of each message within the system but also provides crucial information for message deduplication, sorting, and replay detection on the server side. The server determines whether the received message is new or a duplicate based on the Message ID, preventing duplicate message processing due to network latency or retransmission and ensuring the accurate execution of business logic. Furthermore, the message identifier participates in hash calculations as an important parameter during message signing and verification, improving the accuracy of message integrity verification and further enhancing system security and transmission reliability.

[0022] During message encapsulation, the terminal device adds a timestamp field to each transparent message to record the message's sending time. The timestamp uses a standardized format for subsequent message validity verification and replay attack prevention. Simultaneously, the terminal uses a pre-negotiated session key, combined with the message content and timestamp, to generate a message signature field using a hash algorithm (such as HMAC-SHA256). This signature field verifies the integrity and legitimacy of the message during transmission, ensuring the message has not been tampered with and was indeed sent by a legitimate terminal. During signature calculation, the terminal uses the message body, timestamp, and message identifier together in the hash calculation to form a unique signature digest. After receiving the message, the server recalculates the signature on the relevant fields using the same key and algorithm, and compares it with the signature field carried in the message to determine the message's authenticity and integrity. This step effectively prevents malicious tampering, message forgery, and replay attacks, enhancing the security of message transmission between the weather station terminal and the server.

[0023] After generating the message identifier and adding the timestamp and signature fields, the terminal encrypts the entire message body using a pre-negotiated symmetric session key. The encryption algorithm employs the Advanced Encryption Standard (AES-256) to ensure the confidentiality and eavesdropping resistance of the message content during transmission. During encryption, the message body, including the transmitted business data, message identifier, timestamp, and signature fields, is treated as a single encrypted object. The terminal encrypts the message body using AES-256 block cipher mode, ensuring the randomness and security of the encryption result. The encrypted message is sent to the central server through the underlying communication channel. Upon receiving the encrypted data, the server decrypts it using the same session key. This encryption mechanism ensures that unauthorized third parties cannot decrypt and obtain the message content, effectively preventing data leakage and unauthorized tampering, and enhancing the security level of message transmission.

[0024] In one embodiment of this specification, the central server receives encrypted message data from a weather station terminal through an established secure session connection. The server first performs a format check on the received message data to confirm that the message conforms to a preset protocol structure, including the integrity of the message header, message body, and trailer. The server verifies whether the message length and format fields conform to the protocol specifications, excluding messages with abnormal formats due to transmission errors. For messages with abnormal formats or incomplete messages, the server discards them directly and logs the information for subsequent diagnosis. Simultaneously, the server verifies whether the message is within the allowed time window based on the connection context, preventing expired or out-of-sequence messages from entering the subsequent processing flow. Through the above preliminary verification, the server filters out legitimate and complete messages, laying the foundation for subsequent decryption and signature verification, ensuring the security and stability of the system processing flow.

[0025] Step S102: Decrypt the encrypted transparent message using the pre-acquired session key to obtain the decrypted message, perform multi-dimensional legality verification on the decrypted message, and determine the legality verification identifier.

[0026] This multi-dimensional legality verification includes signature field verification, time validity verification, and message deduplication verification. In one embodiment of this specification, after passing preliminary verification, the central server decrypts the received encrypted message body using the previously negotiated symmetric session key. The decryption algorithm uses the same Advanced Encryption Standard (AES-256) as the terminal and maintains the same encryption mode (such as CBC or GCM) to ensure data consistency.

[0027] The decrypted message undergoes multi-dimensional legality verification to determine a legality verification identifier. Specifically, this includes: using the session key and a preset hash algorithm, calculating the current signature digest based on the message body, timestamp, and message identifier in the decrypted message; comparing the current signature digest with the signature field in the decrypted message to determine the field consistency attribute, and determining the signature field verification identifier based on this attribute; extracting the message timestamp from the decrypted message and obtaining the current system time of the meteorological center server to calculate the time difference between the message timestamp and the current system time, and determining the time validity verification identifier based on the relationship between this time difference and a preset time deviation threshold; extracting the message unique identifier from the decrypted message, and searching in a preset message identifier cache based on this unique identifier to determine the message deduplication verification identifier; and determining the legality verification identifier through the signature field verification identifier, the time validity verification identifier, and the message deduplication verification identifier.

[0028] In one embodiment of this specification, after decryption, the server extracts the timestamp, message identifier, and signature field from the message. Using the session key, combined with the message content, timestamp, and message identifier, the server recalculates the message signature digest using the HMAC-SHA256 algorithm. Subsequently, the server compares the calculated signature digest with the signature field carried in the message to determine the field consistency attribute. This field consistency attribute includes whether the current signature digest matches or does not match the signature field in the decrypted message. Based on the field consistency attribute, a signature field verification identifier is determined. The signature field verification identifier includes successful and unsuccessful verification. If the verification is successful, it confirms that the message content has not been tampered with and was indeed sent by a legitimate terminal. If the signature verification fails, the server rejects the message and records an exception log; if the verification is successful, the server passes the message content to the subsequent business processing module.

[0029] The central server extracts the timestamp field from the message and compares it with the server's current system time. A unified time standard (such as UTC) is used to calculate the time difference. If the time difference exceeds a preset allowable threshold (e.g., ±5 minutes), the server determines that the message has excessive delay or may be a replay attack, actively rejects the message, and logs the anomaly for future analysis. This timestamp verification mechanism effectively limits the timeliness of messages during transmission, preventing attackers from using expired legitimate messages for replay attacks, and ensuring the real-time performance and accuracy of communication data. Simultaneously, the server can dynamically adjust the time threshold based on the actual network environment and system requirements to balance timeliness and tolerance for network fluctuations.

[0030] Based on the unique message identifier, a search is performed in the preset message identifier cache to determine the message deduplication verification identifier. Specifically, this includes: if the unique message identifier does not exist in the message identifier cache, the message deduplication verification identifier is determined to be a pass identifier, and the unique message identifier is stored in the message identifier cache, recording the current storage timestamp; based on the current storage timestamp, the storage duration of the unique message identifier is determined; when the storage duration exceeds the preset expiration time window corresponding to the message identifier cache, the unique message identifier is removed from the message identifier cache.

[0031] In one embodiment of this specification, the central server performs message deduplication based on the received message identifier (MessageID). The server maintains a message ID cache or database to store recently processed message identifiers. When a new message is received, the server first checks whether the message's Message ID already exists in the cache. If it exists, the message is determined to be a duplicate message and is refused further processing to avoid duplicate instruction execution or data redundancy due to network retransmission or attacks. If the Message ID is not recorded, it is written to the cache, and subsequent business processing continues. A reasonable expiration time window is set for the message IDs in the cache to ensure deduplication efficiency while preventing excessive cache expansion. This mechanism effectively prevents duplicate message reception and processing, improves system stability and accuracy, avoids abnormal business operations caused by message replay attacks, and ensures the reliability of message transmission from the weather station terminal.

[0032] In one embodiment of this specification, the central server authenticates the accessing weather station terminals using pre-registered terminal identity credentials. During the connection handshake or message sending process, the terminal attaches a digital certificate based on an asymmetric key system or a pre-allocated key credential to prove its legitimate identity. The server uses Public Key Infrastructure (PKI) or a symmetric key verification mechanism to verify the credentials provided by the terminal, ensuring the terminal's identity is authentic and reliable. The verification process includes certificate chain verification, signature verification, and credential validity checking to prevent counterfeit devices or unauthorized access. Through authentication, the server rejects connection requests or message pass-through requests initiated by unauthenticated terminals, effectively preventing unauthorized devices from entering the system and ensuring the legitimacy and security of the weather station's data source. The authentication mechanism, together with key exchange and message signing, constitutes a multi-layered security system, enhancing the overall security protection capabilities of the weather station terminal communication system.

[0033] Step S103: When the legality verification identifier meets the preset requirements, the business data in the decryption message is processed by business logic, and a response pass-through message is generated. The response pass-through message is encrypted using the session key, and the encrypted response message is sent to the weather station terminal to achieve secure message pass-through.

[0034] The business data in the decrypted message is processed using business logic, specifically including: parsing the business data to obtain the instruction type and / or data content, executing the corresponding business operation according to the instruction type and / or data content, and determining the business operation result, wherein the business operation includes data storage operation and / or control instruction execution operation; and determining the response message based on the business operation result.

[0035] In one embodiment of this specification, the central server receives the decrypted transparent message after passing security verification and forwards it to the business processing module. The business module performs corresponding instruction parsing, data storage, or control operations based on the message content. After processing, the business module generates a response result, including the operation execution status, data confirmation, or error message. The server encapsulates the response result into a standard format response message, adding necessary response identifiers and timestamps. The response message then enters an encryption process to ensure that the message returned to the terminal also possesses confidentiality and integrity. This step enables feedback on instructions initiated by the weather station terminal, ensuring a complete closed loop of bidirectional communication and real-time response capability.

[0036] The central server uses the response message generated by the business processing as the encryption object, employing the previously negotiated symmetric session key and the AES-256 algorithm to encrypt the response message. The encryption process ensures the confidentiality and integrity of the response content during transmission. After encryption, the server sends the encrypted response message to the corresponding weather station terminal through the established secure connection channel. Upon receiving the encrypted response, the terminal decrypts the message using the same session key and verifies the message's integrity and signature. This encrypted response mechanism ensures secure message transmission from the server to the terminal, prevents data leakage and malicious tampering, and enables two-way secure message interaction between the weather station terminal and the server.

[0037] The method further includes, after the weather station terminal sends the encrypted transparent message, starting a response waiting timer to obtain the real-time waiting duration; determining the real-time message response status based on the real-time waiting duration and a preset timeout threshold, and retransmitting the encrypted transparent message based on the real-time message response status and a preset retransmission strategy. Specifically, retransmitting the encrypted transparent message based on the real-time message response status and the preset retransmission strategy includes: when the real-time message response status is non-response, determining the current cumulative retransmission count corresponding to the encrypted transparent message; if the current cumulative retransmission count is not less than the preset maximum retransmission count, retransmitting the encrypted transparent message.

[0038] In one embodiment of this specification, after sending a message, the terminal device starts a response waiting timer to monitor whether the server returns a corresponding response message within a preset timeout threshold, thereby determining the real-time message response status. If no response is received within the timeout period, the terminal determines that the message may have been lost or unprocessed. To ensure reliable message transmission, the terminal automatically retransmits the unresponsive message according to a preset retransmission strategy. The retransmission process includes re-encapsulating the message identifier, timestamp, and signature to ensure the uniqueness and integrity of each sent message. The server processes duplicate messages based on a message identifier deduplication mechanism to avoid duplicate service execution. This detection and retransmission mechanism effectively compensates for communication failures caused by network instability, packet loss, and interruptions, improving the reliability and stability of message transmission between the weather station terminal and the server.

[0039] The terminal device sets a maximum retry threshold for the automatic retransmission of the same message to prevent resource waste caused by infinite retransmissions. If no response is received from the server after reaching the maximum retry count, the terminal stops retransmission. Simultaneously, the terminal records the message transmission failure event and triggers a local alarm mechanism. Alarm information includes the message identifier, retransmission count, and failure time, used to prompt maintenance personnel to promptly investigate communication anomalies. Furthermore, the terminal can synchronously upload failure alarm information to the central management platform, enabling remote fault monitoring and maintenance. This mechanism ensures timely response and handling of communication anomalies, improving the overall stability and security of the meteorological station terminal operation.

[0040] Figure 2 This is a flowchart illustrating a message sending and connection management process on the weather station terminal side, as provided in an embodiment of this specification. Figure 3 This is a flowchart illustrating the message receiving, processing, and response process on a meteorological center server side, as provided in an embodiment of this specification. Figure 2 and Figure 3 As shown in the embodiments of this specification, a secure and reliable message transmission method for a weather station terminal is provided. Its core lies in building an end-to-end secure communication closed loop to ensure that data can be transmitted securely, completely and reliably between the terminal and the central server in complex network environments, especially in IoT scenarios such as weather monitoring deployed in remote areas with unstable network conditions.

[0041] The first step in the embodiments of this specification is to establish an encrypted connection channel for key negotiation based on an asymmetric encryption algorithm. This process is not a simple TCP connection establishment, but an enhanced secure handshake protocol. Specifically, after power-on initialization, the weather station terminal will proactively initiate a TCP connection request to the preset weather center server address. After the basic network connection is established, the terminal will immediately initiate an encrypted handshake request. This handshake request message is not ordinary business data, but a negotiation signaling message containing multiple key parameters. These parameters include a random number generated locally by the terminal (used to increase the randomness of the negotiation process and prevent prediction), the terminal's current system timestamp (used for initial time synchronization and freshness verification), the terminal's unique device number (used for identification), and a list of encryption algorithms supported by the terminal (such as RSA-2048, AES-256, HMAC-SHA256, etc.), which indicates the terminal's set of security capabilities.

[0042] Upon receiving this handshake request, the weather station server initiates the key negotiation logic. First, the server generates its own server random number, similar in function to the terminal's random number, to ensure the unpredictability of the final negotiated session key. Next, the server compares the list of encryption algorithms sent by the terminal with its own supported algorithm list, selecting an asymmetric encryption algorithm that is mutually supported and has the highest security level (e.g., RSA-2048 is preferred) for the key exchange in this session. After determining the algorithm, the server sends its public key, the newly generated server random number, and a handshake response confirmation message to the weather station terminal.

[0043] After receiving the server's response, the weather station terminal can begin generating a session key for subsequent symmetric encryption. The terminal combines its own previously generated random number with the random number received from the server, and uses a specific key generation algorithm (such as a variant of the RSA key exchange standard or the Diffie-Hellman algorithm) to calculate a symmetric session key. This session key will be the core of encryption and decryption for all subsequent communication data. To ensure the security of this key during transmission, the terminal uses the public key obtained from the server to encrypt this newly generated session key, forming a so-called "encryption key negotiation message," and sends it back to the server.

[0044] Upon receiving this encrypted message, the server decrypts it using the paired private key, thus securely obtaining the same session key as the terminal. At this point, the terminal and server have successfully negotiated a shared session key without directly transmitting the plaintext key. This channel provides the foundation for the confidentiality and integrity of all subsequent application-layer messages, using the security of asymmetric encryption to securely transmit symmetric encryption keys, balancing security and efficiency.

[0045] After the secure channel is established, the weather station terminal needs to send actual operational data (such as meteorological readings like temperature, humidity, and air pressure, or equipment status information). In the embodiments described in this specification, the terminal performs a series of rigorous security encapsulation processes on the original message before sending it, such as... Figure 2 The core process chain shown involves generating a unique message identifier, adding a timestamp and signature field, and encrypting the message body using a session key.

[0046] When encapsulating each transparent message, the terminal first generates a globally unique message identifier. This identifier is generated under highly unique and sequential rules. It typically consists of the following parts: the terminal's unique device identifier (such as a MAC address or device serial number), a millisecond-precise timestamp obtained from the current system time, and a serial number maintained internally by the terminal that automatically increments for each transmission. This combination ensures that IDs for different messages at different times will never be repeated on the same terminal; and that the generated IDs will naturally differ between different terminals due to the fundamental differences in device identifiers. The core purpose of this unique message identifier is to provide a crucial index for the server-side message deduplication mechanism (anti-replay attack).

[0047] Next, the terminal adds a current timestamp to the message. This timestamp uses a uniform format (such as UTC time), and its main purpose is to give the message timeliness, serving as another important line of defense against replay attacks on the server side. Even if an attacker intercepts and replays a legitimate encrypted message, it will be identified and rejected because its timestamp differs significantly from the server's current time. This also includes generating a message signature field. The terminal uses the previously negotiated session key and a keyed hash message authentication code algorithm such as HMAC-SHA256 to calculate a signature digest for the specific message content. The specific message content includes core business data (the message body), the newly generated unique message identifier, and the timestamp. It should be noted that any tampering with the message content, identifier, or time will result in the final calculated signature not matching the original signature. This signature field is appended to the message as a "digital fingerprint" for message integrity and authenticity.

[0048] After adding the identifier, timestamp, and signature, the terminal receives a complete, structured plaintext transparent message packet. To ensure confidentiality during transmission and prevent sensitive meteorological data from being eavesdropped on, the terminal uses the previously negotiated symmetric session key and a high-strength symmetric encryption algorithm such as AES-256 to encrypt the entire message body (which now contains business data, message ID, timestamp, and signature). After encryption, the original plaintext message becomes ciphertext, i.e., an encrypted transparent message. Finally, this encrypted message is sent to the meteorological center server through the established TCP long connection.

[0049] The server's job is to verify and process messages from the terminal, such as... Figure 3 As shown, the process mainly includes the steps of "server receiving and preliminary verification," "message body decryption," and "signature verification." After receiving the encrypted transparent message through a secure connection, the server does not immediately decrypt it but first performs a preliminary verification based on the protocol format. The server checks the basic structure of the message, such as the magic number in the message header and the length field, to see if they conform to the preset protocol specifications. This quickly filters out malformed data packets caused by network transmission errors or obviously malicious attack data. For messages that fail verification, the server discards them directly and logs the error, preventing invalid data from entering the more resource-intensive decryption process. Messages that pass the preliminary verification are considered valid data packets. The server then uses the session key shared with the terminal, employing the corresponding AES-256 algorithm and decryption mode, to decrypt the encrypted message body. After successful decryption, the original plaintext structure sent by the terminal is restored, yielding the complete transparent message containing business data, a unique message identifier, a timestamp, and a signature field.

[0050] After decryption, the server enters the core security verification phase, namely "multi-dimensional legitimacy verification," which aims to confirm the legitimacy and security of the message from different perspectives. The server uses the same session key and HMAC-SHA256 algorithm to recalculate the signature digest for the decrypted message body, unique message identifier, and timestamp. Then, the calculated "current signature digest" is compared with the "original signature field" carried in the message. If they match perfectly, it proves that the message has not been tampered with during transmission and was indeed sent by the entity holding the correct session key (i.e., the legitimate terminal). If they do not match, it indicates that the message may have been corrupted or forged, and the server will refuse to process it and log the security anomaly.

[0051] The server extracts the timestamp from the decrypted message and compares it with its own system's current time to calculate the time difference. The server presets a reasonable time deviation threshold (e.g., ±5 minutes). If the message's timestamp differs from the server's time by more than this threshold, the message is determined to be an expired message with excessive delay or malicious replay and is rejected. This defense effectively prevents attackers from replaying previously intercepted valid messages.

[0052] The server maintains a message identifier cache, such as a cache database with an automatic expiration mechanism, to store the unique identifiers of recently successfully processed messages. The server retrieves the unique identifier of the current message and queries this cache. If the identifier already exists, it means that the message has already been processed, and the message received now is a duplicate (possibly due to network retransmission or malicious replay). The server will discard it directly to prevent business logic from being executed repeatedly. If the identifier does not exist, it is stored in the cache with an expiration time (slightly greater than a time deviation threshold), and then automatically cleaned up to prevent the cache from growing indefinitely.

[0053] Only when a message successfully passes all three of the above checks (valid signature, valid time, and non-duplicate), will the server ultimately determine that its "legitimacy check flag" has passed and allow it to enter the business processing stage. Failure of any one of the checks will result in the message being rejected and trigger the corresponding exception handling and logging mechanisms.

[0054] For messages that have been verified as valid, the server submits the business data (such as meteorological data or instruction confirmation information) to the backend business logic processing module. The business module performs corresponding operations according to predefined rules, such as data storage operations (storing meteorological data in a database) or control instruction execution operations (such as responding to parameter query requests from the terminal). After processing, the business module generates a processing result, such as "data received successfully" or "instruction executed successfully." The server needs to securely return this response result to the terminal. This process can be viewed as a mirror image of the above sending process: the server encapsulates the response result into a response message, then encrypts it using the same session key to form an encrypted response message, and finally sends it back to the meteorological station terminal through the original secure connection. This achieves a closed-loop, two-way secure communication between the terminal and the server.

[0055] Considering that weather stations are often deployed in environments with unstable networks, the method of this invention incorporates a robust fault tolerance mechanism. For example... Figure 3As shown, after sending an encrypted pass-through message, the terminal starts a response waiting timer. The terminal sets a preset timeout threshold. If no encrypted response message is received from the server within the timeout threshold, the terminal determines that the transmission may have failed, such as due to network packet loss or temporary server unavailability. At this time, the terminal initiates an automatic retransmission process according to a preset retransmission strategy. Retransmission is not unlimited. A counter maintaining the current cumulative retransmission count is used to check whether the count is less than the preset "maximum retransmission count" before each retransmission. If it is not exceeded, the terminal re-executes the message encapsulation process (generating a new message ID and timestamp, recalculating the signature, and encrypting), and then sends it again. This design ensures reliability in weak network conditions while preventing the waste of resources due to unlimited retransmissions caused by permanent network outages.

[0056] If a message still doesn't receive a response after reaching the maximum number of retransmissions, the terminal determines that the communication has ultimately failed, triggering a local alarm mechanism (such as illuminating a fault indicator light) and recording a detailed failure log (including message ID, number of retransmissions, failure time, etc.) so that maintenance personnel can intervene and troubleshoot promptly. The server, relying on its robust message deduplication mechanism, can accurately identify these retransmitted messages and avoid duplicate processing, ensuring the idempotency of the business logic.

[0057] The technical solutions described in this specification offer a significant advantage over traditional communication solutions that may only focus on data confidentiality, such as using simple encoding or weak encryption. This solution, however, achieves comprehensive protection of confidentiality, integrity, authenticity, and freshness through encrypted connection channels and multi-dimensional legitimacy verification. By securely negotiating a symmetric session key using an asymmetric encryption algorithm, it leverages the security advantages of asymmetric encryption in key distribution and the efficiency advantages of symmetric encryption in handling large data volumes, ensuring that even if data is intercepted during transmission, it cannot be cracked, effectively resisting eavesdropping risks. Time validity verification is used to defend against replay attacks, while message deduplication verification... This forms the second line of defense against replay and ensures order, effectively preventing resource waste and business status chaos. The proactive retransmission strategy on the terminal side works in conjunction with the intelligent deduplication on the server side. After the terminal sends a message, it starts a waiting timer. If no response is received within the timeout period, a retransmission is triggered, which effectively combats network packet loss. Meanwhile, the deduplication verification mechanism on the server side ensures that this necessary retransmission will not lead to repeated execution on the business side. This enables the system to have self-repair and fault tolerance capabilities when facing unstable network links, ensuring the final reachability of key meteorological data or control commands, and greatly improving the robustness and availability of the entire monitoring system in real deployment environments.

[0058] This specification also provides an embodiment of a secure message transmission device for a weather station terminal, such as... Figure 4As shown, the device includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the above-described method.

[0059] This specification also provides a non-volatile computer storage medium storing computer-executable instructions configured to perform the above-described method.

[0060] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the embodiments of apparatus, devices, and non-volatile computer storage media are basically similar to the method embodiments, so the descriptions are relatively simple; relevant parts can be referred to the descriptions of the method embodiments.

[0061] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.

[0062] The devices, media, and methods provided in the embodiments of this specification are one-to-one correspondences. Therefore, the devices and media also have similar beneficial technical effects as their corresponding methods. Since the beneficial technical effects of the methods have been described in detail above, the beneficial technical effects of the devices and media will not be repeated here.

[0063] Those skilled in the art will understand that embodiments of this specification can be provided as methods, systems, or computer program products. Therefore, this specification may take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this specification may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0064] This specification is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this specification. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0065] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0066] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0067] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0068] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.

[0069] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0070] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0071] The above description is merely one or more embodiments of this specification and is not intended to limit this specification. Various modifications and variations can be made to the one or more embodiments of this specification by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principle of one or more embodiments of this specification should be included within the scope of the claims of this specification.

Claims

1. A method for secure message transmission from a weather station terminal, characterized in that, The method includes: Through a pre-built encrypted connection channel between the weather station terminal and the weather center server, the encrypted transparent message after the weather station terminal has encrypted the transparent message is received. The transparent message includes a message body, a unique message identifier, a message timestamp, and a signature field. The encrypted transparent message is decrypted using a pre-acquired session key to obtain the decrypted message. The decrypted message is then subjected to multi-dimensional legality verification to determine a legality verification identifier. The multi-dimensional legality verification includes signature field verification, time validity verification, and message deduplication verification. When the legitimacy verification identifier meets the preset requirements, the business data in the decryption message is processed by business logic, and a response pass-through message is generated. The response pass-through message is then encrypted using the session key, and the encrypted response message is sent to the weather station terminal to achieve secure message pass-through.

2. The method for secure message transmission from a weather station terminal according to claim 1, characterized in that, Prior to establishing an encrypted connection channel between the pre-built weather station terminal and the weather center server, the method further includes: Receive a handshake request message from the weather station terminal, wherein the handshake request message includes a random number generated by the weather station terminal, a terminal timestamp, a device number, and a list of encryption algorithms supported by the weather station terminal; Generate a server random number, select an asymmetric encryption algorithm according to the list of encryption algorithms supported by the terminal, determine the server public key and server private key, and send the server public key and the server random number to the weather station terminal; Receive an encryption key negotiation message from the weather station terminal, wherein the encryption key negotiation message is a session key encrypted using the server's public key; The server's private key is used to decrypt the encryption key negotiation message to obtain the session key.

3. The method for secure message transmission from a weather station terminal according to claim 1, characterized in that, The decrypted message undergoes multi-dimensional validity verification to determine a validity verification identifier, specifically including: Using the session key and a preset hash algorithm, calculate the current signature digest based on the message body, timestamp, and message identifier in the decrypted message; The current signature digest is compared with the signature field in the decryption message to determine the field consistency attribute, and the signature field verification identifier is determined based on the field consistency attribute. Extract the message timestamp from the decrypted message and obtain the current system time of the meteorological center server to calculate the time difference between the message timestamp and the current system time. Based on the relationship between the time difference and a preset time deviation threshold, determine the time validity verification identifier. Extract the unique message identifier from the decrypted message, and search in the preset message identifier cache based on the unique message identifier to determine the message deduplication verification identifier; The legality verification identifier is determined by the signature field verification identifier, the time validity verification identifier, and the message deduplication verification identifier.

4. The method for secure message transmission from a weather station terminal according to claim 3, characterized in that, Based on the unique message identifier, a search is performed in a preset message identifier cache to determine the message deduplication verification identifier, specifically including: If the message unique identifier does not exist in the message identifier cache, the message deduplication verification identifier is determined to be a pass identifier, and the message unique identifier is stored in the message identifier cache, and the current storage timestamp is recorded; Based on the current storage timestamp, the storage duration of the message unique identifier is determined. When the storage duration exceeds the pre-set expiration time window corresponding to the message identifier cache, the message unique identifier is removed from the message identifier cache.

5. The method for secure message transmission from a weather station terminal according to claim 1, characterized in that, The business logic processing of the business data in the decrypted message specifically includes: The business data is parsed to obtain the instruction type and / or data content, and the corresponding business operation is executed according to the instruction type and / or data content to determine the business operation result. The business operation includes data storage operation and / or control instruction execution operation. The response message is determined based on the result of the business operation.

6. The method for secure message transmission from a weather station terminal according to claim 1, characterized in that, The method further includes: After the weather station terminal sends the encrypted transparent message, it starts a response waiting timer to obtain the real-time waiting time. Based on the real-time waiting time and the preset timeout threshold, the real-time message response status is determined, and the encrypted transparent message is retransmitted based on the real-time message response status and the preset retransmission strategy.

7. The method for secure message transmission from a weather station terminal according to claim 6, characterized in that, Based on the real-time message response status and the preset retransmission strategy, the encrypted transparent message is retransmitted, specifically including: When the real-time message response status is non-response, determine the current cumulative retransmission count corresponding to the encrypted transparent message; If the current cumulative retransmission count is not less than the preset maximum retransmission count, the encrypted transparent message will be retransmitted.

8. The method for secure message transmission from a weather station terminal according to claim 1, characterized in that, Before receiving the encrypted transparent message after the weather station terminal has encrypted the transparent message, the method further includes: The weather station terminal obtains a real-time timestamp and a unique device identifier, and generates a unique message identifier corresponding to the transparent message based on the real-time timestamp and the unique device identifier.

9. A secure message transmission device for a weather station terminal, characterized in that, The device includes: At least one processor; and, A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method as described in any one of claims 1-8.

10. A non-volatile computer storage medium storing computer-executable instructions, characterized in that, The computer-executable instructions are configured to perform the method as described in any one of claims 1-8.