Secure transmission method used between interaction modules

By employing a method of identity authentication, dynamic keys, layered encryption, and integrity verification, the security and efficiency issues of data transmission between interactive modules are resolved, achieving multi-dimensional security protection and improving the security level and operational efficiency of the communication system.

CN121333799APending Publication Date: 2026-01-13SHENZHEN K FREE WIRELESS INFORMATION TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511757468.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-26
Publication Date
2026-01-13

AI Technical Summary

Technical Problem

The existing data transmission between interactive modules suffers from problems such as a single identity authentication mechanism, fixed session keys, lack of specific encryption methods, and simple integrity verification, resulting in insufficient security and efficiency.

Method used

The method of identity authentication, dynamic key, layered encryption, and integrity verification is adopted to ensure the security and reliability of data transmission through dual authentication, dynamic session key generation, layered data encryption, and multi-level integrity verification.

Benefits of technology

It achieves multi-dimensional security for data transmission between interactive modules, reduces the risk of forgery attacks, enhances the key anti-cracking capability, balances the security of core data with the transmission efficiency of ordinary data, and improves the security level and operating efficiency of the communication system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121333799A_ABST
    Figure CN121333799A_ABST
Patent Text Reader

Abstract

The invention provides a secure transmission method used between interaction modules, which belongs to the technical field of secure transmission, and comprises the following steps: an initiating end interaction module sends an identity authentication request to a receiving end interaction module; after the identity authentication is passed, the initiating end interaction module and the receiving end interaction module negotiate to generate a dynamic session key based on the module type and the sensitivity level of the transmission content, and the initiating end interaction module divides the transmission data into core data, common data and auxiliary data according to the sensitivity and carries out hierarchical encryption on the core data, the common data and the auxiliary data; meanwhile, an integrity check code is generated for each layer of encrypted data, and the encrypted data and the integrity check code are packaged according to a preset format and then sent; and after receiving the packaged data, the receiving end interaction module verifies the integrity check code of each layer of data, and calls a corresponding decryption algorithm for decryption after the verification is passed.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of secure transmission, in particular to a secure transmission method for interactive modules. BACKGROUND

[0002] In the current communication technology field, a communication system composed of multiple interactive modules is widely used in smart home, industrial control, Internet of Things devices and other scenarios. However, there are many security risks and efficiency problems in the data transmission between the existing interactive modules: first, the identity authentication mechanism is single, only relying on fixed device identification verification, easy to be attacked by forgery, and the session key is mostly fixed or only simply depends on the transmission content type adjustment, which cannot cope with the dynamic changing security risks, the probability of key cracking is high, and the data encryption method lacks pertinence, adopts unified encryption strategy for different sensitivity data, resulting in insufficient security protection of core data or redundant encryption of ordinary data, the integrity verification means is simple, mostly only based on single check code generated by data digest, it is difficult to find local data tampering or position offset in the transmission process. These defects seriously affect the security, reliability and efficiency of data transmission between interactive modules.

[0003] Therefore, the present application provides a secure transmission method for interactive modules. SUMMARY

[0004] The present application provides a secure transmission method for interactive modules to solve the technical problems mentioned above.

[0005] The present application provides a secure transmission method for interactive modules, applied to a communication system composed of at least two interactive modules, the method comprising: Step 1: the initiator interactive module sends an identity authentication request to the receiver interactive module; Step 2: after the identity authentication is passed, the initiator interactive module and the receiver interactive module negotiate to generate a dynamic session key based on the module type, the sensitivity level of the transmission content, etc., wherein the effective duration of the session key is positively correlated with the sensitivity level; Step 3: the initiator interactive module divides the transmission data into core data, ordinary data and auxiliary data according to the sensitivity and performs hierarchical encryption, and generates an integrity check code for each layer of encrypted data, and sends the encrypted data and the integrity check code after encapsulation according to a preset format; Step 4: the receiver interactive module verifies the integrity check code of each layer of data after receiving the encapsulated data, and decrypts the decrypted data after verification.

[0006] Preferably, the dynamic session key is negotiated to include: capture a first running log in a first preset time period after the identity authentication request is sent by the initiator interaction module, extract a non-security factor set in the first running log, and perform contrast analysis on the transmission data to determine a dangerous coverage probability; When the dangerous coverage probability is greater than a preset probability, a second preset time period before the identity authentication request is sent by the initiator interaction module is determined, a second running log in the second preset time period is extracted, a non-security factor mutation probability set based on the first running log is analyzed, a prolonged time period based on the first preset time period is determined, and a third running log in the prolonged time period is continuously captured to determine a non-security factor maintenance probability set based on the first running log; According to the non-security factor mutation probability set and the non-security factor maintenance probability set, a current dangerous coefficient of each non-security factor is obtained. Otherwise, a historical dangerous coefficient of each non-security factor in the non-security factor set based on the initiator interaction module is obtained from a historical database. According to the dangerous coefficient of each non-security factor, and in combination with the module type and the sensitivity level of the transmission content, a dynamic session key is negotiated and generated.

[0007] Preferably, according to the dangerous coefficient of each non-security factor, and in combination with the module type and the sensitivity level of the transmission content, a dynamic session key is negotiated and generated, including: A first dangerous vector is constructed based on the dangerous coefficient of each non-security factor, and the first dangerous vector is disassembled to obtain a point dangerous vector of each time point in the first preset time period based on the generated log of each time point, and a dynamic seed matrix is constructed. A key derivation seed of a latest period and a previous period of the initiator interaction module is obtained, and a two-dimensional seed matrix is generated by using a hash value generated based on the module type and the sensitivity level of the transmission content. The dynamic seed matrix and the two-dimensional seed matrix are disassembled to obtain required elements, and a dynamic session key is generated, wherein the number of the required elements is greater than the number of column vectors of the dynamic seed matrix.

[0008] Preferably, the non-security factor mutation probability set based on the first running log is analyzed, including: First time sequence data sequences of all non-security factors in the first preset time period are extracted from the first running log, and historical time sequence data sequences of the same non-security factors are extracted from the second running log. Time sequence analysis and pattern recognition algorithms are used to deeply mine the historical time sequence data sequences in the second running log, and a potential risk inducement pattern causing subsequent state changes is identified. The identified potential risk trigger patterns are used to perform causal correlation analysis with the non-safety factor mutation events detected in the first operation log, and the conditional probability of a specific pattern in the second operation log triggering a corresponding mutation in the first operation log is calculated. Based on each unsafe factor mutation detected in the first operation log and combined with conditional probability, the degree predicted by a specific historical pattern in the second operation log is determined, and the probability set of unsafe factor mutations is obtained.

[0009] Preferably, determining the non-security factor retention probability set based on the first runtime log includes: Extract the initial state feature vector of non-safety factors within the baseline window from the first runtime log; Multiple real-time status feature vectors of non-safety factors are extracted from the third operation log in chronological order to form a feature vector sequence; The initial state feature vector and the real-time state feature vector sequence are aligned on the time axis and the feature dimension is normalized to construct a state transition model for each non-safety factor. Based on the constructed state transition model, the probability that each non-safe factor will maintain its current state or not transition to a higher-risk state in each time slice within the prediction window is predicted, and the probability of maintaining the state is calculated. The probability set of maintaining all unsafe factors is obtained by combining the probability of maintaining all unsafe factors.

[0010] Preferably, the transmitted data is divided into core data, ordinary data, and auxiliary data according to their sensitivity, and then encrypted in layers, including: The unique identifier of the authentication request is converted into binary once, and the request sending time is converted into binary twice; The transmitted data undergoes three binary conversions, and the third conversion result based on the core data is extracted. The first and second transformation results are randomly shuffled and sorted to obtain a reference transformation result, which is then bit-aligned with the third transformation result. If they are perfectly aligned, then the third conversion result is encrypted according to the reference conversion result. If the number of digits in the reference conversion result is greater than the number of digits in the third conversion result, then, based on the first pair formed by the first value of the last digit of the reference conversion result and the second value of the last digit of the third conversion result, and based on the second pair formed by the third value of the first digit of the reference conversion result and the fourth value of the first digit of the third conversion result, internal intersection processing is performed on the first pair and the second pair respectively to obtain the intersection pair. According to rand(intersection pair, 0, 1), each bit to be supplemented in the third transformation result is randomly extracted and filled by 1 bit to obtain a pseudo result, and the third transformation result is encrypted in combination with the reference transformation result; If the number of bits in the reference conversion result is less than the number of bits in the third conversion result, then, obtain the fifth value of the last bit of the third conversion result, any sixth value adjacent to the fifth value in the three conversion results of the transmitted data, and at the same time, obtain the first ratio of the first number of values ​​of 1 in the third conversion result to the second number of values ​​of 1 in the reference conversion result, and obtain the second ratio of the first number of values ​​of 0 in the third conversion result to the second number of values ​​of 0 in the reference conversion result. According to rand(fifth value, sixth value, first ratio, second ratio), each bit to be supplemented in the reference conversion result is randomly extracted and filled by 1 bit, and the third conversion result is encrypted. The ordinary data and auxiliary data are randomly selected from the list of preset encryption algorithms and encrypted accordingly to achieve layered encryption.

[0011] Preferably, an integrity check code is generated for each layer of encrypted data, including: Obtain the data packet for each layer of encrypted data, and the data packet corresponds to the storage location ID before transmission and the placement location ID after transmission. When the number of bits of the storage location ID before transmission and the placement location ID after transmission are the same, the first check code is generated by combining the total byte length of the data packet. Otherwise, perform a bitwise XOR operation on the difference between the storage location ID before transmission and the storage location ID after transmission, and extract a reference symbol consistent with the difference in the number of bits from the data packet identifier symbol and perform a bitwise XOR operation with the corresponding bit. Then, perform another XOR operation on the result to generate a second check code. Perform global location analysis on each layer of encrypted data to obtain the data combination state of the encrypted data at each location point, determine the state ratio of each data combination state, and, in combination with each data combination state and the set data importance level of the corresponding layer, allocate the number and conditions of new check codes to each data combination state, and generate supplementary check codes. Each supplementary check code is processed by the second check code to obtain the third check code, which serves as the integrity check code for the layered encrypted data.

[0012] Preferably, a supplementary check code is generated, including: The logical space containing each layer of encrypted data is divided into a global location grid G ​​of N1×M1, where each grid cell (i,j) represents a unique location point. Define the data combination state S=(T,A,L), where T is the content type of the data at the corresponding location point; A is the encryption algorithm identifier used by the data at the corresponding location point; and L is the byte length of the data at the corresponding location point.

[0013] Analyze the T, A, and L attributes of each location point in the global location grid G ​​to determine the data combination state Sij for each location point; Count the total number of locations Ck where each unique data combination state Sk appears in the entire layer of encrypted data, where k=1,2,...,K0, and K0 is the total number of unique states; Calculate the state percentage of each data combination state Sk: Pk = Ck / (N1 × M1); Based on the data importance level W of the corresponding layer and the proportion Pk of each state, calculate the number of new check codes to be assigned to state Sk. ,in, For all The sum, This is the rounding function. Set the total number of basic check codes for the corresponding layer, and assign check code generation conditions for each state Sk; Traverse the global location grid G. For each location point (i,j), if the corresponding data combination state Sij matches Sk and satisfies the checksum generation condition corresponding to Sk, then generate a supplementary checksum using an encrypted hash function based on the data content Dij of the corresponding location point, the global location coordinates (i,j), and the timestamp t. ,in, For cryptographic hash functions; This is a byte string concatenation operation.

[0014] Compared with the prior art, the beneficial effects of this application are as follows: Through a comprehensive design encompassing identity authentication, dynamic keys, layered encryption, and integrity verification, multi-dimensional security is ensured for data transmission between interactive modules. The dual authentication mechanism reduces the risk of forgery attacks; dynamic session keys adapt to different security needs, enhancing key resistance to cracking; layered encryption balances the security of core data with the transmission efficiency of ordinary and auxiliary data; and integrity verification ensures the reliability of data transmission, thereby improving the overall security level and operational efficiency of the communication system.

[0015] Other features and advantages of the invention will be set forth in the description which follows, and will be apparent in part from the description, or may be learned by practicing the invention. The objects and other advantages of the invention may be realized and obtained by means of the structures particularly pointed out in the written description, claims, and drawings.

[0016] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. Attached Figure Description

[0017] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings: Figure 1 As described in the embodiments of the present invention Detailed Implementation

[0018] The preferred embodiments of the present invention will be described below with reference to the accompanying drawings. It should be understood that the preferred embodiments described herein are for illustration and explanation only and are not intended to limit the present invention.

[0019] This invention provides a secure transmission method between interactive modules, applicable to a communication system consisting of at least two interactive modules, such as... Figure 1 As shown, the method includes: Step 1: The initiating interaction module sends an authentication request to the receiving interaction module; Step 2: After successful identity authentication, the initiating interaction module and the receiving interaction module negotiate to generate a dynamic session key based on the module type and the sensitivity level of the transmitted content. The validity period of the session key is positively correlated with the sensitivity level. Step 3: The initiating interaction module divides the transmitted data into core data, ordinary data and auxiliary data according to sensitivity and performs layered encryption. At the same time, it generates an integrity check code for each layer of encrypted data, and encapsulates the encrypted data and integrity check code in a preset format before sending. Step 4: After receiving the encapsulated data, the receiving end interaction module verifies the integrity check code of each layer of data. If the verification is successful, the corresponding decryption algorithm is called to decrypt the data.

[0020] In this embodiment, the interaction module refers to a hardware module or software unit with data transmission and processing functions, such as a lighting controller module and a temperature sensor module in a smart home system, and a PLC communication module and a sensor acquisition module in industrial control.

[0021] An authentication request is a data packet sent by the initiator to the receiver to prove its legitimate identity. It contains core identity information such as the initiator's device ID, module model, and factory code. Assuming the communication system consists of a smart home air conditioner control module (initiator) and a gateway module (receiver), the air conditioner control module needs to transmit operating status data to the gateway module. The initiator generates an authentication request data packet containing its own device IDAC-20240501-001, module model KFR-35GW / 01, and factory code SN20240001. This packet is sent to the receiver via a Wi-Fi communication link. The authentication request data packet is encrypted using an asymmetric encryption algorithm (such as RSA-2048). The receiver holds the initiator's public key to decrypt the request data packet and extract the identity information. Identity verification employs a dual verification mechanism of device whitelist and digital signature. The receiver pre-stores a whitelist of legitimate initiators' identity information and simultaneously verifies the validity of the digital signature (generated by the initiator's private key) in the request data packet.

[0022] A dynamic session key is a key temporarily negotiated and generated between the initiating and receiving ends for encrypting and decrypting data transmission. Its generation criteria and validity period are dynamically adjusted based on the transmission scenario. For example, if the transmitted data is user-set temperature and power consumption (core data with high sensitivity) from air conditioner operating parameters, and the module type is a consumer electronics communication module, then according to the agreement, the session key for high-sensitivity data has a validity period of 1 hour, for medium-sensitivity ordinary data (such as air conditioner operating mode records) it has a validity period of 24 hours, and for low-sensitivity auxiliary data (such as device firmware version numbers) it has a validity period of 72 hours.

[0023] Sensitivity levels are classified according to the degree of harm caused by data leakage or tampering. They are usually divided into three levels: high, medium, and low, corresponding to core data, ordinary data, and auxiliary data, respectively.

[0024] Layered encryption is an encryption method that uses differentiated encryption strategies for data with different sensitivity levels. Core data uses high-strength encryption algorithms, while ordinary and auxiliary data use encryption algorithms that are adapted to their security requirements.

[0025] Integrity check codes are used to verify whether data transmission has been tampered with, lost, or erroneous. They are generated based on the characteristics of the data itself.

[0026] The default format is a data packet encapsulation format agreed upon in advance by the initiating and receiving ends, such as a combination of encrypted data, checksum, data type identifier, and timestamp.

[0027] In this embodiment, after all levels of verification pass, the corresponding decryption algorithm is called to use the dynamic session key to decrypt the encrypted data of each layer and obtain the original transmitted data.

[0028] The beneficial effects of the above technical solution are as follows: through the end-to-end design of identity authentication, dynamic keys, layered encryption, and integrity verification, multi-dimensional security assurance is achieved for data transmission between interactive modules. The dual authentication mechanism reduces the risk of forgery attacks, the dynamic session key adapts to different security requirements and improves the key's resistance to cracking, the layered encryption balances the security of core data with the transmission efficiency of ordinary and auxiliary data, and the integrity verification ensures the reliability of data transmission, thereby improving the overall security level and operational efficiency of the communication system.

[0029] This invention provides a secure transmission method for interactive modules, which negotiates and generates a dynamic session key, including: Capture the first operation log within a first preset time period after the initiating interaction module sends the authentication request, and extract the set of non-security factors in the first operation log, compare and analyze it with the transmitted data to determine the probability of danger coverage; When the probability of danger coverage is greater than the preset probability, a second preset time period is determined before the initiating interaction module sends the identity authentication request, and the second operation log within the second preset time period is extracted. The probability set of non-security factor mutations based on the first operation log is analyzed. At the same time, an extended time period based on the first preset time period is determined, and the probability set of non-security factor retention based on the first operation log is determined based on the third operation log continuously captured during the extended time period. Based on the mutation probability set and the retention probability set of the unsafe factors, the current risk coefficient of each unsafe factor is obtained; Otherwise, retrieve the historical risk coefficient of the initiating interaction module based on each non-safety factor in the non-safety factor set from the historical database; Based on the risk factor of each non-security factor, and in combination with the module type and the sensitivity level of the transmitted content, a dynamic session key is negotiated and generated.

[0030] In this embodiment, the first preset time period is a fixed duration used to capture operation logs after the initiating end sends the authentication request. It is usually set to 1-10 minutes according to the module's operating characteristics. For example, if the first preset time period is set to 5 minutes, after the initiating end sends the authentication request, it starts the log capture tool and records the operating status for 5 minutes to generate the first operation log. Three non-security factors are extracted from the log: network latency (average latency 80ms, threshold 50ms), device CPU load (75%, threshold 60%), and number of accesses from unknown IPs (2 times, threshold 0 times), forming the non-security factor set {excessive network latency, excessive CPU load, and access from unknown IPs}.

[0031] The first operation log is a record of the operation status generated by the initiating end within a first preset time period, including information such as network transmission status, device load, data processing speed, and number of abnormal accesses.

[0032] The hazard coverage probability is the probability that a set of non-security factors poses a security threat to the currently transmitted data. It is calculated by the correlation between the non-security factors and the transmitted data. For example, if the currently transmitted data is equipment start / stop commands in industrial control (core data with high sensitivity), the non-security factors are compared with the transmitted data: excessive network latency may cause command transmission timeouts, with a correlation weight of 0.4; excessive CPU load may cause command processing delays, with a correlation weight of 0.3; access from unknown IPs may cause commands to be intercepted and tampered with, with a correlation weight of 0.3. The hazard coverage probability = (0.4 + 0.3 + 0.3) × (average of the actual degree of exceedance of each factor), which calculates to a hazard coverage probability of 35%. The preset probability is set to 30%. Since 35% > 30%, the second and third operation logs need to be further extracted. A weighted summation algorithm is used to calculate the hazard coverage probability. The correlation weight of each non-security factor is pre-configured based on the type of transmitted data and the application scenario of the module. The preset probability can be dynamically adjusted according to the security level of the communication system. The preset probability is lower in high-security scenarios and higher in low-security scenarios.

[0033] The second preset time period is a fixed duration before the initiator sends the authentication request. It is used to extract historical operation logs and is usually longer than the first preset time period, typically set to 5-30 minutes. For example, if the second preset time period is set to 10 minutes, the second operation log for the 10 minutes before the initiator sends the authentication request will be extracted. Historical time-series data on network latency, CPU load, and access from unknown IPs are extracted from the logs. Analysis shows that the probability of network latency mutation is 0.2 (mutations occurred 2 times in 10 similar scenarios), the probability of CPU load mutation is 0.15, and the probability of access from unknown IPs mutation is 0.4, forming the non-security factor mutation probability set {0.2, 0.15, 0.4}.

[0034] The second operation log is a record of the operating status of the initiating end within a second preset time period, used to analyze the historical change patterns of non-safety factors.

[0035] The probability set of unsafe factors mutation is the set of probabilities that each unsafe factor will undergo a sudden and abnormal change in the current transmission scenario.

[0036] The extended time period is a fixed duration extending from the first preset time period. It is used to capture the persistent state of non-security factors and is set to be the same as or longer than the first preset time period. For example, if the extended time period is set to 5 minutes, the operation logs (third operation logs) of the initiating end will be continuously captured for 5 minutes after the first preset time period. Analysis shows that the probability of network latency remaining in the current excessive state is 0.3, the probability of CPU load remaining in the excessively high state is 0.25, and the probability of unfamiliar IP access no longer occurring is 0.6, forming the probability set of non-security factors {0.3, 0.25, 0.6}.

[0037] The third runtime log is a record of the initiator's runtime status over an extended period of time, used to analyze the continued stability of non-security factors.

[0038] The probability set of non-security factors is the set of probabilities that each non-security factor will maintain its current state or not transition to a higher-risk state during subsequent transmission.

[0039] The historical database is a database that stores the past operation logs of the initiating interaction module, records of non-security factors, and corresponding risk coefficients. The historical risk coefficient is the risk coefficient of non-security factors in similar transmission scenarios in the past, stored in the historical database.

[0040] In this embodiment, the current risk factor is calculated as (mutation probability × 0.6 + (1 - retention probability) × 0.4). The current risk factor for network latency is (0.2 × 0.6 + (1 - 0.3) × 0.4) = 0.4, CPU load is (0.15 × 0.6 + (1 - 0.25) × 0.4) = 0.39, and unknown IP access is (0.4 × 0.6 + (1 - 0.6) × 0.4) = 0.4. Finally, the current risk factor set for each non-security factor is obtained as {0.4, 0.39, 0.4}. The risk factor calculation formula adjusts the weights according to the actual application scenario.

[0041] In this embodiment, if the transmitted data is auxiliary data (firmware version number), and the calculated risk coverage probability is 25% (less than the preset probability of 30%), then the historical risk coefficients of the same non-security factors (excessive network latency, excessive CPU load) in past auxiliary data transmission scenarios are extracted from the historical database, and are 0.2 and 0.18 respectively. The historical database is stored using a relational database (such as MySQL) or a non-relational database (such as MongoDB), and an association index is established between non-security factors, transmitted data types, and historical risk coefficients to support fast queries. The preset probability is set according to the security level of the communication system, with 20%-25% for high security levels and 30%-40% for ordinary levels.

[0042] In this embodiment, the negotiation to generate a dynamic session key is to combine the current risk factor (or historical risk factor) of each non-security factor, the module type (industrial control module), and the sensitivity level of the transmitted content (high), and use a key generation algorithm to generate a 128-bit dynamic session key 0x7a3f9d2b4e6c8a015f7d9c3b2e4a6f8d.

[0043] The beneficial effects of the above technical solution are: by dynamically capturing multi-period operation logs, comprehensively analyzing the real-time status, historical change patterns, and continuous stability of non-security factors, and accurately calculating the risk coefficient, the generation of dynamic session keys is made more closely aligned with actual security scenarios. Compared to fixed key generation methods, this process can respond promptly to changes in security risks during transmission, improve the targeting and anti-attack capabilities of keys, and further strengthen the security foundation of data transmission.

[0044] This invention provides a secure transmission method for interactive modules, which negotiates and generates a dynamic session key based on the risk coefficient of each insecure factor and in combination with the module type and the sensitivity level of the transmitted content, including: A first danger vector is constructed based on the danger coefficient of each non-safety factor, and the first danger vector is decomposed based on the generation logs at each time point within the first preset time period to obtain the point danger vector at the corresponding time point, and a dynamic seed matrix is ​​constructed. Obtain the key derivation seed of the latest cycle and the previous cycle of the initiating interaction module, and generate a two-dimensional seed matrix using the hash value generated by the module type and the sensitivity level of the transmitted content. The dynamic seed matrix and the two-dimensional seed matrix are decomposed to obtain the required elements and generate a dynamic session key, wherein the number of required elements is greater than the number of column vectors in the dynamic seed matrix.

[0045] In this embodiment, the first danger vector is a vector composed of the current danger coefficients of each non-safety factor arranged in a preset order, used to quantify the overall risk level of the non-safety factors. The point danger vector is the danger coefficient vector corresponding to each time point after the first danger vector is broken down according to the time points within the first preset time period, reflecting the risk status at each time point. For example, if the first preset time period is 5 minutes, it is divided into 5 time points, each minute. The current danger coefficients of each non-safety factor are network latency 0.4, CPU load 0.39, and unknown IP access 0.4, and the first danger vector is [0.4, 0.39, 0.4]. Based on the operation logs at each time point, five danger vectors are obtained: time point 1 [0.35, 0.38, 0.39], time point 2 [0.42, 0.37, 0.41], time point 3 [0.4, 0.4, 0.4], time point 4 [0.39, 0.39, 0.42], and time point 5 [0.44, 0.39, 0.38].

[0046] It uses vector building tools (such as Python's NumPy library) to generate the first danger vector and point danger vectors, and the division of time points can be flexibly adjusted according to the length of the first preset time period and the log collection frequency to ensure data continuity.

[0047] In this embodiment, the dynamic seed matrix is ​​a matrix composed of all point danger vectors, used to provide dynamic seed data for key generation. For example, arranging the 5 point danger vectors in chronological order can construct a 5-row, 3-column dynamic seed matrix. Specifically, the construction of the dynamic seed matrix adopts a matrix processing algorithm to normalize the values ​​of the point danger vector (mapped to the 0-1 interval) to ensure the consistency of matrix elements.

[0048] In this embodiment, the key derivation seed is the basic seed data for key generation extracted from the operation cycle of the initiating interaction module. It is usually a value after hashing, such as device hardware information and operating status parameters.

[0049] In this embodiment, the latest cycle is the current running cycle of the initiating interaction module, such as the third running cycle after the device starts up (each cycle is 2 hours), and the previous cycle is the running cycle before the latest cycle.

[0050] In this embodiment, the hash value is a fixed-length value obtained by processing the module type and the sensitivity level of the transmitted content using a hash function. It is unique and irreversible.

[0051] In this embodiment, the two-dimensional seed matrix is ​​a two-dimensional matrix composed of the key-derived seeds from the latest cycle and the previous cycle, combined with hash values. This matrix provides the basic seed data for key generation. For example, the key-derived seed for the latest cycle (3rd cycle) of the initiating interaction module is the first 8 bits of the device MAC address 00:1B:44:11:3A:B7 after SHA-256 hashing: 0x1a3b5c7d. The key-derived seed for the previous cycle (2nd cycle) is 0x2d4f6h8j. The module type is an industrial control module, corresponding to the encoding 01; the transmission content sensitivity level is high, encoded as 10. The combination of these two is 0110, which, after SHA-256 hashing, yields the hash value 0x7f9e5d3b. The two key-derived seeds and the hash value are arranged in rows to construct a 3x4 two-dimensional seed matrix. Specifically, the key derivation seed is generated by combining device hardware information (MAC address, CPU serial number) and operating status parameters (runtime, average load), and is processed by hash functions (SHA-256, SHA-512) to ensure security; the module type and sensitivity level are encoded in binary or hexadecimal, and a fixed-length hash value is obtained after hash processing.

[0052] In this embodiment, matrix decomposition is the process of breaking down the dynamic seed matrix and the two-dimensional seed matrix into multiple basic elements. A specific matrix decomposition algorithm is used, and the required elements are the core elements extracted after matrix decomposition for generating the dynamic session key. Their number is set according to the key length requirement. The singular value decomposition (SVD) algorithm is used to decompose the dynamic seed matrix (5×3) and the two-dimensional seed matrix (3×4). After the dynamic seed matrix is ​​decomposed, the following is obtained: The matrix, obtained after decomposing the two-dimensional seed matrix. Matrix. Extract 6 desired elements from the decomposed matrix (greater than the number of column vectors in the dynamic seed matrix, which is 3), respectively. The [0,0] elements of the matrix The [1,2] elements of the matrix The [2,0] elements of the matrix The [1,3] elements of the matrix The [0,1] and [2,3] elements of the matrix are combined sequentially and converted into 128-bit binary numbers to generate a dynamic session key. The matrix decomposition uses mature matrix decomposition algorithms (SVD, LU decomposition, etc.) and is implemented through an algorithm library (such as Python's SciPy library). The extraction position and number of required elements are preset according to the key length requirements to ensure that the extracted elements have sufficient randomness and uniqueness, and the generated key meets the key length requirements of the encryption algorithm.

[0053] The beneficial effects of the above technical solution are as follows: By quantifying the dynamic risks of non-security factors into a danger vector and a seed matrix, and combining this with a basic seed matrix generated based on module characteristics and the sensitivity of transmitted data, matrix decomposition is used to extract core elements to generate a key, thus deeply binding the key generation process with real-time security risks. The dynamic session key generated in this way has higher randomness, uniqueness, and specificity, effectively resisting common attack methods such as brute-force attacks and dictionary attacks, further improving the security level of the key.

[0054] This invention provides a secure transmission method for interactive modules, which analyzes the probability set of non-security factor mutations based on the first operation log, including: Extract the first time-series data sequence of all non-safety factors within the first preset time period from the first operation log, and at the same time, extract the historical time-series data sequence of the same non-safety factors from the second operation log; Time series analysis and pattern recognition algorithms are used to deeply mine the historical time series data sequences in the second operation log to identify potential risk factors that lead to subsequent state changes. The identified potential risk trigger patterns are used to perform causal correlation analysis with the non-safety factor mutation events detected in the first operation log, and the conditional probability of a specific pattern in the second operation log triggering a corresponding mutation in the first operation log is calculated. Based on each unsafe factor mutation detected in the first operation log and combined with conditional probability, the degree predicted by a specific historical pattern in the second operation log is determined, and the probability set of unsafe factor mutations is obtained.

[0055] In this embodiment, the first time-series data sequence is a numerical sequence of each non-safety factor collected at fixed time intervals within a first preset time period, reflecting the changing trend of non-safety factors in a real-time scenario. For example, if the first preset time period is 5 minutes and the time interval is 1 minute, the first time-series data sequence (network latency) is [45ms, 55ms, 80ms, 90ms, 85ms]; if the second preset time period is 10 minutes and the time interval is 1 minute, the historical time-series data sequence (network latency) is [30ms, 35ms, 40ms, 45ms, 50ms, 55ms, 60ms, 65ms, 70ms, 75ms].

[0056] The historical time series data sequence is a numerical sequence of each non-safety factor collected at the same time intervals as the first time series data sequence within the second preset time period, reflecting the historical change pattern of the non-safety factors.

[0057] Time series analysis is a data analysis method used to process time-series data and uncover trends and patterns in data changes. It includes trend analysis, periodic analysis, and anomaly detection.

[0058] Pattern recognition algorithms are algorithms used to identify hidden patterns and rules in data, and can extract features from large amounts of data and classify them.

[0059] Potential risk trigger patterns are characteristic patterns extracted from historical time-series data sequences that may lead to abnormal changes in non-safety factors. For example, using trend fitting algorithms (such as linear regression) in time series analysis to analyze historical time-series data sequences, it was found that network latency showed a continuous upward trend, with the increase exceeding 10% for every three consecutive time points (e.g., 30→35→40→45, with each increase of approximately 16.7%). This feature was identified as a potential risk trigger pattern with an increase exceeding 10% for three consecutive time points. Specifically, a combination of time series analysis algorithms (ARIMA model, exponential smoothing) and pattern recognition algorithms (decision tree, support vector machine SVM) was used to extract features from historical time-series data sequences and establish a potential risk trigger pattern library, containing various common risk trigger features.

[0060] A non-safety factor mutation event is an event in the first time series where the value of a non-safety factor suddenly exceeds the normal range or fluctuates drastically.

[0061] Causal correlation analysis is an analytical method used to determine whether there is a causal relationship between two events. Here, it is used to establish the association between potential risk trigger patterns and unsafe factor mutation events.

[0062] Conditional probability is the probability of another event occurring given that a certain event has occurred. Here, it refers to the probability of a non-safety factor mutation event occurring after a potential risk trigger pattern has occurred. For example, a correlation analysis is performed between a potential risk trigger pattern showing an increase of more than 10% over three consecutive time points and a non-safety factor mutation event (network latency abruptly changing from 55ms to 80ms, an increase of 45.5%) in the first time series data. The number of times network latency mutated after this pattern occurred in historical data is statistically analyzed: out of 100 occurrences of the pattern, 30 resulted in mutations, with a conditional probability of 30 / 100 = 0.3. Causal correlation analysis algorithms (such as Bayesian networks and Granger causality tests) are used to establish a correlation model between the potential risk trigger pattern and the mutation event. Conditional probabilities are calculated using historical data to ensure the accuracy of the correlation analysis.

[0063] In this embodiment, if two network latency mutation events are detected in the first time-series data sequence, the mutation probability of network latency is determined to be 0.3 based on a conditional probability of 0.3. Similarly, by analyzing the historical time-series data sequence of CPU load, a potential risk trigger pattern is identified where the load value exceeds the threshold twice consecutively. A conditional probability of 0.25 is calculated, and the mutation probability of CPU load is determined to be 0.25. The potential risk trigger pattern for unfamiliar IP access is more than two unfamiliar IP requests within one minute, with a conditional probability of 0.4, and its mutation probability is determined to be 0.4. This ultimately forms the mutation probability set of non-security factors {0.3, 0.25, 0.4}. For each non-security factor, potential risk trigger pattern mining, causal correlation analysis, and conditional probability calculation are performed separately. The results are then summarized to form a mutation probability set, which is processed automatically by the algorithm module.

[0064] The beneficial effects of the above technical solution are: through time-series data mining and causal correlation analysis, it accurately identifies risk-inducing patterns of non-security factors, quantifies mutation probabilities, and provides accurate risk data support for the generation of dynamic session keys. This analysis process can predict abnormal change trends of non-security factors in advance, making key generation more forward-looking and effectively avoiding key security risks caused by mutations in non-security factors.

[0065] This invention provides a secure transmission method for interactive modules, which determines a non-security factor retention probability set based on a first operation log, including: Extract the initial state feature vector of non-safety factors within the baseline window from the first runtime log; Multiple real-time status feature vectors of non-safety factors are extracted from the third operation log in chronological order to form a feature vector sequence; The initial state feature vector and the real-time state feature vector sequence are aligned on the time axis and the feature dimension is normalized to construct a state transition model for each non-safety factor. Based on the constructed state transition model, the probability that each non-safe factor will maintain its current state or not transition to a higher-risk state in each time slice within the prediction window is predicted, and the probability of maintaining the state is calculated. The probability set of maintaining all unsafe factors is obtained by combining the probability of maintaining all unsafe factors.

[0066] In this embodiment, the reference window is a fixed-duration sub-interval within a first preset time period, used to extract the initial state features of non-safety factors, and is usually set to 1 / 5 to 1 / 3 of the first preset time period.

[0067] The initial state feature vector is a feature vector reflecting the initial state of non-safety factors extracted from the first operation log within the baseline window. It includes features such as the value, rate of change, and fluctuation range of non-safety factors. For example, if the first preset time period is 5 minutes, the baseline window is set to 1 minute (from the 3rd to the 4th minute). The initial state features of network latency within the baseline window are extracted from the first operation log: average value 70ms, rate of change 5%, fluctuation range ±5ms, forming the initial state feature vector [70, 0.05, 5]. The selection of the baseline window can be done by random sampling or fixed position (such as the middle interval) to ensure that the initial state is representative. The extraction of the initial state features uses feature engineering methods (such as statistical feature extraction and time-domain feature extraction) to extract key features from the log data of the baseline window.

[0068] The real-time state feature vector is a feature vector reflecting the real-time state of non-safety factors extracted from the third operation log in chronological order. It has the same dimension as the initial state feature vector. For example, if the extended time period of the third operation log is 5 minutes and the time interval is 1 minute, the real-time state feature vectors of network latency are extracted in chronological order as follows: [72,0.03,4], [68,0.04,6], [71,0.02,3], [73,0.05,5], [70,0.03,4], forming a feature vector sequence. The extraction of the real-time state feature vector uses the same feature dimension and extraction method as the initial state feature vector to ensure feature consistency. The feature vector sequence is arranged in chronological order to facilitate subsequent state transition analysis.

[0069] The feature vector sequence is a sequence composed of multiple real-time state feature vectors arranged in chronological order, reflecting the continuous changes in the state of non-safety factors. Time axis alignment matches the initial state feature vector with the real-time state feature vector sequence along the time dimension, ensuring the temporal consistency of feature comparison. For example, aligning the initial state feature vector [70, 0.05, 5] with the real-time state feature vector sequence along the time axis, with the end time of the baseline window as the zero point, the time points of the real-time vector sequence are 1 minute, 2 minutes, 3 minutes, 4 minutes, and 5 minutes. Normalizing all feature vectors and mapping the values ​​to the 0-1 interval, we obtain the initial state normalized vector [0.7, 0.5, 0.5], and the normalized real-time vector sequence is [0.72, 0.3, 0.4], [0.68, 0.4, 0.6], [0.71, 0.2, 0.3], [0.73, 0.5, 0.5], and [0.7, 0.3, 0.4]. Based on the normalized feature vectors, a Markov chain model is used to construct a state transition model for network latency. Time axis alignment is achieved using timestamp matching to ensure accurate temporal correspondence among feature vectors; feature dimension normalization employs the Min-Max normalization algorithm; and the state transition model utilizes mature models such as Markov chains and Hidden Markov Models (HMMs), implemented using algorithm libraries (such as Python's Hmmlearn library).

[0070] In this embodiment, feature dimension normalization is to map the values ​​of each dimension in the feature vector to a uniform range (such as 0-1) to eliminate the impact of differences in the numerical range of different dimensions on the analysis results.

[0071] In this embodiment, the state transition model is a mathematical model built based on feature vector sequences to predict the state change trend of unsafe factors. It describes the probability of an unsafe factor transitioning from one state to another. The prediction window is a fixed duration for predicting the state change of unsafe factors, usually the same as the first preset time period. A time slice is a sub-interval within the prediction window divided by a fixed time interval, used to refine the granularity of state prediction. The retention probability is the probability that an unsafe factor will maintain its current state or not transition to a higher-risk state in each time slice. For example, if the prediction window is set to 5 minutes and the time slice is 1 minute, there are a total of 5 time slices. Based on the constructed Markov chain model, the probability that the network latency will maintain its current state (around 70ms, change rate ≤5%, fluctuation range ≤5ms) or not transition to a higher-risk state (latency ≥90ms) in each time slice is predicted: 0.8 for time slice 1, 0.75 for time slice 2, 0.82 for time slice 3, 0.78 for time slice 4, and 0.81 for time slice 5. The average value of 0.79 is taken as the retention probability of the network latency. Similarly, the retention probability of CPU load is calculated to be 0.75, and the retention probability of unfamiliar IP access is 0.85, forming a retention probability set of non-security factors {0.79, 0.75, 0.85}. The prediction of retention probability is based on the state transition matrix of the state transition model, which is achieved by calculating the transition probability of the target state under each time slice. The average value of the probabilities of each time slice is taken as the final retention probability of the non-security factor to ensure the stability of the results. Finally, the results are summarized to form a retention probability set.

[0072] The beneficial effects of the aforementioned counting method are: by extracting the initial and real-time state characteristics of insecure factors, constructing a state transition model, and accurately predicting the retention probability, the continuous stability of insecure factors can be comprehensively assessed. This process provides long-term risk data of insecure factors for dynamic session key generation, making the key's effective duration and security capabilities more aligned with actual transmission scenarios, further enhancing the scientific rigor and rationality of key generation.

[0073] This invention provides a secure transmission method for interactive modules, which divides transmitted data into core data, ordinary data, and auxiliary data according to their sensitivity and performs layered encryption, including: The unique identifier of the authentication request is converted into binary once, and the request sending time is converted into binary twice; The transmitted data undergoes three binary conversions, and the third conversion result based on the core data is extracted. The first and second transformation results are randomly shuffled and sorted to obtain a reference transformation result, which is then bit-aligned with the third transformation result. If they are perfectly aligned, then the third conversion result is encrypted according to the reference conversion result. If the number of digits in the reference conversion result is greater than the number of digits in the third conversion result, then, based on the first pair formed by the first value of the last digit of the reference conversion result and the second value of the last digit of the third conversion result, and based on the second pair formed by the third value of the first digit of the reference conversion result and the fourth value of the first digit of the third conversion result, internal intersection processing is performed on the first pair and the second pair respectively to obtain the intersection pair. According to rand(intersection pair, 0, 1), each bit to be supplemented in the third transformation result is randomly extracted and filled by 1 bit to obtain a pseudo result, and the third transformation result is encrypted in combination with the reference transformation result; If the number of bits in the reference conversion result is less than the number of bits in the third conversion result, then, obtain the fifth value of the last bit of the third conversion result, any sixth value adjacent to the fifth value in the three conversion results of the transmitted data, and at the same time, obtain the first ratio of the first number of values ​​of 1 in the third conversion result to the second number of values ​​of 1 in the reference conversion result, and obtain the second ratio of the first number of values ​​of 0 in the third conversion result to the second number of values ​​of 0 in the reference conversion result. According to rand(fifth value, sixth value, first ratio, second ratio), each bit to be supplemented in the reference conversion result is randomly extracted and filled by 1 bit, and the third conversion result is encrypted. The ordinary data and auxiliary data are randomly selected from the list of preset encryption algorithms and encrypted accordingly to achieve layered encryption.

[0074] In this embodiment, the unique identifier is a unique identifier for the authentication request, used to uniquely distinguish different authentication requests, and is usually a UUID (Universally Unique Identifier).

[0075] In this embodiment, the internal intersection process is to perform an intersection operation on two values ​​in a numerical pair. Here, it means taking the same value of the two values ​​(if both are 0 or both are 1, then take that value; if they are different, then take a random value), and the intersection pair is the numerical pair obtained after the internal intersection process.

[0076] In this embodiment, if the unique identifier of the authentication request is UUID6ba7b810-9dad-11d1-80b4-00c04fd430c8, it is converted to binary using ASCII encoding, resulting in 64-bit binary data: 0110011001010101...00110000 (some bits omitted); the request sending time is 2024-05-2014:30:25.123, which is converted to a timestamp of 17. The code 16215425123 undergoes a two-stage decimal-to-binary conversion, yielding 40 bits of binary data: 1100110101100010...11110011. The core data transmitted is the user-defined temperature of 26℃, converted to byte data (0x320x360xE20x840x83), which undergoes a third binary conversion, resulting in a 40-bit final conversion: 0011001000110110...10000011. The binary conversion employs mature encoding algorithms (ASCII, UTF-8, decimal-to-binary, etc.), selecting the appropriate conversion method based on the data type. The length of the converted binary data is automatically adjusted according to the data size to ensure data integrity.

[0077] In this embodiment, generating the reference conversion result and aligning its bits involves merging the first conversion result (64 bits) and the second conversion result (40 bits) into 104 bits of binary data. The order is then shuffled using a random sorting algorithm (such as the Fisher-Yates shuffle algorithm), resulting in a 104-bit reference conversion result: 0100110010101101...00111000. Aligning the reference conversion result (104 bits) with the third conversion result (40 bits) reveals that the reference conversion result (104 bits) has a larger bit count than the third conversion result (40 bits).

[0078] Implementation methods: The random sorting algorithm ensures the randomness of the reference conversion result and improves encryption security; bit alignment adopts a bit-by-bit matching method, and the program automatically determines the bit relationship between the two.

[0079] In this embodiment, if the first value of the last bit of the reference conversion result is 1 and the second value of the last bit of the third conversion result is 0, a first pair (1,0) is formed; if the third value of the first bit of the reference conversion result is 0 and the fourth value of the first bit of the third conversion result is 0, a second pair (0,0) is formed. The first pair undergoes internal intersection processing; since the values ​​are different, 0 is randomly selected, resulting in an intersection pair (0). The second pair undergoes internal intersection processing; since the values ​​are the same, 0 is selected, resulting in an intersection pair (0). The `rand(intersection pair (0,0), 0, 1)` function is called to randomly generate 0 or 1 values ​​for the 64 bits to be filled in the third conversion result, resulting in a 104-bit pseudo-result. This pseudo-result is then encrypted using an XOR operation combined with the reference conversion result. The internal intersection processing uses a combination of random number generation and numerical matching to ensure the randomness of the processing result; the `rand` function uses an encryption-level random number generator (such as Python's `secrets` module) to ensure the unpredictability of the generated values; the encryption operation uses basic encryption operations such as XOR and shifting, combined with the reference conversion result to achieve high-strength encryption of the core data.

[0080] In this embodiment, if the third conversion result is 120 bits and the reference conversion result is 104 bits, the fifth value of the last bit in the third conversion result is 1, and the adjacent sixth value is 0; the first number of values ​​of 1 in the third conversion result is 60, the second number of values ​​of 1 in the reference conversion result is 52, and the first ratio = 60 / 52 ≈ 1.15; the first number of values ​​of 0 in the third conversion result is 60, the second number of values ​​of 0 in the reference conversion result is 52, and the second ratio = 60 / 52 ≈ 1.15. The rand(1, 0, 1.15, 1.15) function is called to randomly generate 0 or 1 values ​​for the 16 bits to be supplemented in the reference conversion result and fill them in, resulting in a 120-bit extended reference conversion result. An XOR operation is then used to encrypt the third conversion result. The filling of the bits to be supplemented is based on the characteristics and ratio parameters of the core data to ensure the correlation between the filled values ​​and the core data, improving the targeting of the encryption; the encryption operation also uses a combination of basic encryption operations and the reference conversion result.

[0081] In this embodiment, if both the reference conversion result and the third conversion result are 64 bits and are completely identical after bit alignment, then the third conversion result is directly XORed and encrypted according to the reference conversion result to obtain the encrypted result of the core data. The encryption operation when completely aligned simplifies the process, improves encryption efficiency, and ensures encryption strength.

[0082] Encryption of both ordinary and auxiliary data uses a preset encryption algorithm list containing DES, 3DES, and AES-128. A random number generator selects DES from the list to encrypt ordinary data in automatic mode, while a 3DES algorithm is selected to encrypt auxiliary data (firmware version V1.2.0), thus achieving layered encryption. The preset encryption algorithm list can be expanded or adjusted according to actual security needs, including algorithms with different security levels. The random algorithm selection uses an encryption-level random number generator to ensure the randomness of algorithm selection and avoid the security vulnerabilities associated with fixed algorithms.

[0083] The beneficial effects of the above technical solution are: it designs differentiated layered encryption strategies for data with different levels of sensitivity; core data uses a high-strength encryption method based on multi-dimensional binary transformation and random padding; and ordinary and auxiliary data uses flexible random algorithm encryption methods, ensuring the security of core data while also considering overall transmission efficiency. This encryption process enhances the anti-cracking capability of encrypted data through operations such as random sorting, dynamic padding, and associated encryption, while also adapting to data of different lengths, exhibiting good compatibility and flexibility.

[0084] This invention provides a secure transmission method for interactive modules, generating an integrity check code for each layer of encrypted data, including: Obtain the data packet for each layer of encrypted data, and the data packet corresponds to the storage location ID before transmission and the placement location ID after transmission. When the number of bits of the storage location ID before transmission and the placement location ID after transmission are the same, the first check code is generated by combining the total byte length of the data packet. Otherwise, perform a bitwise XOR operation on the difference between the storage location ID before transmission and the storage location ID after transmission, and extract a reference symbol consistent with the difference in the number of bits from the data packet identifier symbol and perform a bitwise XOR operation with the corresponding bit. Then, perform another XOR operation on the result to generate a second check code. Perform global location analysis on each layer of encrypted data to obtain the data combination state of the encrypted data at each location point, determine the state ratio of each data combination state, and, in combination with each data combination state and the set data importance level of the corresponding layer, allocate the number and conditions of new check codes to each data combination state, and generate supplementary check codes. Each supplementary check code is processed by the second check code to obtain the third check code, which serves as the integrity check code for the layered encrypted data.

[0085] In this embodiment, the storage location ID is a unique identifier of the data in the storage medium, used to locate the storage location of the data. Before transmission, the storage location ID is the storage location identifier of the initiating end, and after transmission, the storage location ID is the storage location identifier of the receiving end, which is usually a memory address, disk sector address, etc.

[0086] The total byte length of a data packet is the total number of bytes in the data packet corresponding to each layer of encrypted data, reflecting the size of the data packet.

[0087] The first checksum is a basic checksum generated by combining the total byte length of the data packet when the number of bits in the storage location ID before transmission is the same as the number of bits in the storage location ID after transmission.

[0088] The difference in bit length sign is the difference in bit length between the storage location ID before transmission and the storage location ID after transmission, and the sign of the difference (positive indicates that the ID has more bits after transmission, and negative indicates that the ID has more bits before transmission).

[0089] Bitwise XOR operation is an operation that performs an XOR operation on corresponding bits of two binary numbers (0 if they are the same, 1 if they are different), used to generate feature data.

[0090] A packet identifier is a symbol used to uniquely identify a packet; it is usually a header identifier or a specific field of the packet.

[0091] Reference symbols are a sequence of symbols extracted from the data packet identifier symbols, with a length consistent with the number of difference bits.

[0092] The second XOR operation involves performing a second XOR operation on each bit of the reference symbol and the corresponding bit of the bitwise XOR result to generate new feature data.

[0093] The second check code is the basic check code generated by XOR operation and subsequent XOR processing when the number of bits in the location ID stored before transmission is different from that in the location ID placed after transmission.

[0094] Global location analysis involves a comprehensive analysis of the storage location of each layer of encrypted data in the logical space to determine the specific location of each data segment.

[0095] The data combination state is the comprehensive state of the encrypted data at each location point, including features such as content type, encryption algorithm identifier, and byte length.

[0096] State percentage is the proportion of each data combination state in the entire layer of encrypted data.

[0097] Setting data importance levels is a pre-defined level based on the importance of the data. It usually corresponds to the sensitivity level, with core data at high level, ordinary data at medium level, and auxiliary data at low level.

[0098] The number of new check codes is the number of check codes allocated for each data combination state to supplement the verification.

[0099] The conditions for generating a new check code are the conditions that must be met to generate a new check code, such as the number of position points in the data combination state and the length of bytes.

[0100] In this embodiment, the third check code is the final check code obtained by processing the supplementary check code and the second check code. It is used for integrity verification of the layered encrypted data. For example, the seven supplementary check codes are XORed with the second check code (or the first check code if the number of bits is the same) to obtain seven intermediate results. The intermediate results are then hashed using the SHA-256 function to generate the third check code 0x56789abcdef12340, etc., which serves as the integrity check code for the core data encrypted data packet. The operation between the supplementary check code and the basic check code uses XOR and hash operations to ensure the uniqueness and tamper resistance of the third check code. The generation process of the third check code is automated by the algorithm module to improve processing efficiency.

[0101] Consistent bit width: For example, in the encrypted data packet containing core data, the storage location ID before transmission is 0x7f00a1b2 (32 bits), and the storage location ID after transmission is 0x7f00c3d4 (32 bits), ensuring consistent bit width. The total byte length of the data packet is 1024 bytes. The first checksum is generated using the formula: First Checksum = SHA-256(Pre-transmission ID + Post-transmission ID + Total Byte Length) = 0x123456789abcdef0...

[0102] Different bit lengths: For example, in a data packet encrypted with ordinary data, the storage location ID before transmission is 0x1234 (16 bits), and the storage location ID after transmission is 0x123456 (24 bits), a difference of 8 bits, with a positive sign. A bitwise XOR operation is performed on the 8-bit sign corresponding to the difference (the ID before transmission is padded with 0s and then XORed with the first 16 bits of the ID after transmission), resulting in an XOR result of 0x0012. An 8-bit reference sign 0xef12 is extracted from the data packet identifier 0xabcdef123456, and the reference sign is XORed again with the XOR result, resulting in 0xfe00, which serves as the second checksum. The storage location ID is obtained through the interface of the storage medium (e.g., the memory address is obtained through the operating system API). The generation of the first and second checksums uses hash functions (SHA-256, MD5) to ensure the uniqueness and irreversibility of the checksums. The XOR operation is implemented through the bitwise operation module in the program to ensure computational efficiency.

[0103] In this embodiment, when performing global location analysis on the encrypted data packets of core data, its logical space is divided into a 10×10 global location grid, with each location point corresponding to a data segment. The 100 location points in the grid are traversed, and the content type (text type T=1), encryption algorithm identifier (AES-256 identifier A=001), and byte length (L=10 bytes) of the data at each location point are analyzed to determine the data combination state S=(1,001,10). The number of location points where this state occurs is counted as Ck=80, and the state ratio is Pk=80 / 100=0.8. The global location analysis uses a spatial partitioning algorithm (such as grid partitioning or quadtree partitioning) combined with the data storage structure; the analysis of the data combination state is achieved by parsing the header information and encryption algorithm identifier field of the data segments; and the state statistics are processed automatically using a counting algorithm.

[0104] In this embodiment, the number and conditions for adding new checksums are allocated, and supplementary checksums are generated. For example, the core data is set with an importance level of W=0.9 (high), and the total number of basic checksums Nb=10. The number of new checksums is calculated using the formula Ek=floor(Nb×W×Pk+0.5), where Ek=floor(10×0.9×0.8+0.5)=7. The checksum generation condition is set as the byte length of the location point ≥ 8 bytes. The global location grid is traversed, and for the 7 location points that meet the condition, 7 supplementary checksums (0x987654321fedcba0...0xabcdef1234567890, etc.) are generated using the SHA-512 function based on the data content, location coordinates, and timestamp. The data importance level and the total number of basic checksums are pre-configured according to the data sensitivity level; the calculation of the number of new checksums is implemented through formula programming to ensure calculation accuracy; the checksum generation conditions can be flexibly configured according to actual needs; and the generation of supplementary checksums uses a high-strength hash function to improve the security of the verification.

[0105] The beneficial effects of the above technical solution are as follows: by generating a basic checksum based on the number of digits in the storage location ID, and combining this with global location analysis and data combination status to generate a supplementary checksum, a comprehensive third checksum is ultimately formed. This checksum generation method takes into account multiple dimensions of information such as data storage location, size, and content characteristics, and can effectively detect problems such as tampering, loss, and location offset during data transmission, significantly improving the accuracy and comprehensiveness of data integrity verification.

[0106] This invention provides a secure transmission method for interactive modules, which generates a supplementary checksum, including: The logical space containing each layer of encrypted data is divided into a global location grid G ​​of N1×M1, where each grid cell (i,j) represents a unique location point. Define the data combination state S=(T,A,L), where T is the content type of the data at the corresponding location point; A is the encryption algorithm identifier used by the data at the corresponding location point; and L is the byte length of the data at the corresponding location point.

[0107] Analyze the T, A, and L attributes of each location point in the global location grid G ​​to determine the data combination state Sij for each location point; Count the total number of locations Ck where each unique data combination state Sk appears in the entire layer of encrypted data, where k=1,2,...,K0, and K0 is the total number of unique states; Calculate the state percentage of each data combination state Sk: Pk = Ck / (N1 × M1); Based on the data importance level W of the corresponding layer and the proportion Pk of each state, calculate the number of new check codes to be assigned to state Sk. ,in, For all The sum, This is the rounding function. Set the total number of basic check codes for the corresponding layer, and assign check code generation conditions for each state Sk; Traverse the global location grid G. For each location point (i,j), if the corresponding data combination state Sij matches Sk and satisfies the checksum generation condition corresponding to Sk, then generate a supplementary checksum using an encrypted hash function based on the data content Dij of the corresponding location point, the global location coordinates (i,j), and the timestamp t. ,in, For cryptographic hash functions; This is a byte string concatenation operation.

[0108] In this embodiment, the logical space is the logical storage area where encrypted data resides in the computer system, which is different from the physical space of the physical storage medium.

[0109] The global location grid G ​​is a grid structure formed by dividing the logical space into a fixed number of rows and columns, used to accurately locate the position of each data segment.

[0110] N1×M1 is the number of rows (N1) and columns (M1) of the global location grid, which is set according to the size of the encrypted data and the range of the logical space.

[0111] The grid cell (i,j) is the cell in the i-th row and j-th column of the global location grid. Each cell corresponds to a unique location point. The value of i ranges from 1 to N1, and the value of j ranges from 1 to M1.

[0112] The data combination state S=(T,A,L) is a triple used to describe the comprehensive characteristics of location point data, where T is the content type (such as text, binary, numerical, etc., represented by numerical encoding), A is the encryption algorithm identifier (a unique code corresponding to each encryption algorithm), and L is the byte length (the specific number of bytes of location point data).

[0113] In this embodiment, sum1 is the sum of the state proportions Pk of all data combination states Sk, and theoretically sum1=1.

[0114] The check code generation conditions are the constraints that must be met when generating supplementary check codes, such as the data combination state Sk of the location point, the byte length range, and the location region in the grid.

[0115] In this embodiment, the encrypted logical space of the core data is divided into a 10×10 (N1=10, M1=10) global location grid G, with a total of 100 grid cells. Each grid cell (i,j) (i=1-10, j=1-10) corresponds to a unique location point. The data combination state S=(T,A,L) is defined, where the encoding rules of T are: text type=1, binary type=2, numeric type=3; the encoding rules of A are: AES-256=001, AES-128=002, DES=003; and L is the byte length of the location point data (e.g., 8 bytes, 16 bytes, etc.). The number of rows N1 and columns M1 of the global location grid are set according to the size of the encrypted data and the logical space range to ensure that the data fragment size of each location point is appropriate. The encoding rules of the data combination state are predefined and stored in the system to ensure consistency between the initiator and the receiver.

[0116] In this embodiment, if 100 location points of the global location grid G ​​are traversed, the data combination state Sij of each location point is analyzed: the state of 80 location points is S1=(1,001,10) (text type, AES-256 encryption, 10 bytes), the state of 15 location points is S2=(1,001,8), and the state of 5 location points is S3=(2,001,16), therefore K0=3. The state ratio is calculated as follows: Pk1=80 / 100=0.8, Pk2=15 / 100=0.15, Pk3=5 / 100=0.05, sum1=0.8+0.15+0.05=1. The analysis of the data combination state is achieved by parsing the header identifier and content features of the data of each location point; the calculation of the state ratio adopts counting statistics and division operations, and the program is automated to ensure the accuracy of the statistical results.

[0117] In this embodiment, the core data is set to an importance level of W=0.9, and the total number of basic check codes Nb=10. The number of new check codes for each state is calculated as follows: Ek1=floor(10×0.9×0.8+0.5)=floor(7.7)=8; Ek2=floor(10×0.9×0.15+0.5)=floor(1.85)=2; Ek3=floor(10×0.9×0.05+0.5)=floor(0.95)=1. Generation conditions are assigned: S1's generation condition is that position i+j is even; S2's generation condition is that position i≤5; S3's generation condition is that position j≥8. Specifically, the calculation of the number of new check codes is implemented through formula programming, and the rounding function ensures the result is an integer; the generation conditions are flexibly configured according to the characteristics and distribution of the data combination states to ensure the uniformity of the distribution of supplementary check codes.

[0118] In this embodiment, the global location grid G ​​is traversed. For location points in state S1, eight location points with even numbers i+j are selected (such as (1,1), (1,3), (2,2), etc.). Taking location point (1,1) as an example, its data content Dij is an encrypted fragment of the user's temperature setting of 26℃, with global location coordinates (1,1) and timestamp t=1716215425123. The supplementary check code CC11=SHA-512(Dij||1||1||1716215425123)=0x987654321fedcba0 is generated through the encryption hash function SHA-512. Similarly, two location points are selected according to the generation conditions of state S2 and one location point is selected according to state S3, and supplementary check codes are generated respectively, finally resulting in 11 supplementary check codes. Specifically, the data content Dij is obtained by reading the stored data of the location point; the timestamp t is obtained by the system clock to ensure accuracy; the encrypted hash function adopts a high-strength hash algorithm (SHA-512) and is implemented through an encryption algorithm library to ensure the security and uniqueness of the supplementary check code; the generation process of the supplementary check code is implemented automatically by the program to improve processing efficiency.

[0119] The beneficial effects of the above technical solution are as follows: By gridding the logical space, the position of each data segment is accurately located. Combined with the distribution characteristics of the data combination state, the number and generation conditions of supplementary check codes are scientifically allocated. The generated supplementary check codes can comprehensively cover the key positions and core features of the layered encrypted data. This generation method makes the supplementary check codes targeted and uniform. Combined with the basic check codes, it can significantly improve the accuracy of data integrity verification and effectively resist attacks such as partial tampering and data replacement.

[0120] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.

Claims

1. A method for secure transmission between interactive modules, characterized in that, The method, applied to a communication system consisting of at least two interactive modules, includes: Step 1: The initiating interaction module sends an authentication request to the receiving interaction module; Step 2: After successful identity authentication, the initiating interaction module and the receiving interaction module negotiate to generate a dynamic session key based on the module type and the sensitivity level of the transmitted content. The validity period of the session key is positively correlated with the sensitivity level. Step 3: The initiating interaction module divides the transmitted data into core data, ordinary data and auxiliary data according to sensitivity and performs layered encryption. At the same time, it generates an integrity check code for each layer of encrypted data, and encapsulates the encrypted data and integrity check code in a preset format before sending it. Step 4: After receiving the encapsulated data, the receiving end interaction module verifies the integrity check code of each layer of data. If the verification is successful, the corresponding decryption algorithm is called to decrypt the data.

2. The secure transmission method between interactive modules according to claim 1, characterized in that, Negotiate and generate a dynamic session key, including: Capture the first operation log within a first preset time period after the initiating interaction module sends the authentication request, and extract the set of non-security factors in the first operation log, compare and analyze it with the transmitted data to determine the probability of danger coverage; When the probability of danger coverage is greater than the preset probability, a second preset time period is determined before the initiating interaction module sends the identity authentication request, and the second operation log within the second preset time period is extracted. The probability set of non-security factor mutations based on the first operation log is analyzed. At the same time, an extended time period based on the first preset time period is determined, and the probability set of non-security factor retention based on the first operation log is determined based on the third operation log continuously captured during the extended time period. Based on the mutation probability set and the retention probability set of the unsafe factors, the current risk coefficient of each unsafe factor is obtained; Otherwise, retrieve the historical risk coefficient of the initiating interaction module based on each non-safety factor in the non-safety factor set from the historical database; Based on the risk factor of each non-security factor, and in combination with the module type and the sensitivity level of the transmitted content, a dynamic session key is negotiated and generated.

3. The secure transmission method between interactive modules according to claim 2, characterized in that, Based on the risk factor of each non-security factor, and in conjunction with the module type and the sensitivity level of the transmitted content, a dynamic session key is negotiated and generated, including: A first danger vector is constructed based on the danger coefficient of each non-safety factor, and the first danger vector is decomposed based on the generation logs at each time point within the first preset time period to obtain the point danger vector at the corresponding time point, and a dynamic seed matrix is ​​constructed. Obtain the key derivation seed of the latest cycle and the previous cycle of the initiating interaction module, and generate a two-dimensional seed matrix using the hash value generated by the module type and the sensitivity level of the transmitted content. The dynamic seed matrix and the two-dimensional seed matrix are decomposed to obtain the required elements and generate a dynamic session key, wherein the number of required elements is greater than the number of column vectors in the dynamic seed matrix.

4. The secure transmission method between interactive modules according to claim 2, characterized in that, The analysis of the non-security factor mutation probability set based on the first runtime log includes: Extract the first time-series data sequence of all non-safety factors within the first preset time period from the first operation log, and at the same time, extract the historical time-series data sequence of the same non-safety factors from the second operation log; Time series analysis and pattern recognition algorithms are used to deeply mine the historical time series data sequences in the second operation log to identify potential risk factors that lead to subsequent state changes. The identified potential risk trigger patterns are used to perform causal correlation analysis with the non-safety factor mutation events detected in the first operation log, and the conditional probability of a specific pattern in the second operation log triggering a corresponding mutation in the first operation log is calculated. Based on each unsafe factor mutation detected in the first operation log and combined with conditional probability, the degree predicted by a specific historical pattern in the second operation log is determined, and the probability set of unsafe factor mutations is obtained.

5. The secure transmission method between interactive modules according to claim 2, characterized in that, Determine the non-security factor persistence probability set based on the first runtime log, including: Extract the initial state feature vector of non-safety factors within the baseline window from the first runtime log; Multiple real-time status feature vectors of non-safety factors are extracted from the third operation log in chronological order to form a feature vector sequence; The initial state feature vector and the real-time state feature vector sequence are aligned on the time axis and the feature dimension is normalized to construct a state transition model for each non-safety factor. Based on the constructed state transition model, the probability that each non-safe factor will maintain its current state or not transition to a higher-risk state in each time slice within the prediction window is predicted, and the probability of maintaining the state is calculated. The probability set of maintaining all unsafe factors is obtained by combining the probability of maintaining all unsafe factors.

6. The secure transmission method between interactive modules according to claim 1, characterized in that, Transmitted data is divided into core data, ordinary data, and auxiliary data according to sensitivity, and then encrypted in layers, including: The unique identifier of the authentication request is converted into binary once, and the request sending time is converted into binary twice. The transmitted data undergoes three binary conversions, and the third conversion result based on the core data is extracted. The first and second transformation results are randomly shuffled and sorted to obtain a reference transformation result, which is then bit-aligned with the third transformation result. If they are perfectly aligned, then the third conversion result is encrypted according to the reference conversion result. If the number of digits in the reference conversion result is greater than the number of digits in the third conversion result, then, based on the first pair formed by the first value of the last digit of the reference conversion result and the second value of the last digit of the third conversion result, and based on the second pair formed by the third value of the first digit of the reference conversion result and the fourth value of the first digit of the third conversion result, internal intersection processing is performed on the first pair and the second pair respectively to obtain the intersection pair. According to rand(intersection pair, 0, 1), each bit to be supplemented in the third transformation result is randomly extracted and filled by 1 bit to obtain a pseudo result, and the third transformation result is encrypted in combination with the reference transformation result; If the number of bits in the reference conversion result is less than the number of bits in the third conversion result, then, obtain the fifth value of the last bit of the third conversion result, any sixth value adjacent to the fifth value in the three conversion results of the transmitted data, and at the same time, obtain the first ratio of the first number of values ​​of 1 in the third conversion result to the second number of values ​​of 1 in the reference conversion result, and obtain the second ratio of the first number of values ​​of 0 in the third conversion result to the second number of values ​​of 0 in the reference conversion result. According to rand(fifth value, sixth value, first ratio, second ratio), each bit to be supplemented in the reference conversion result is randomly extracted and filled by 1 bit, and the third conversion result is encrypted. The ordinary data and auxiliary data are randomly selected from the list of preset encryption algorithms and encrypted accordingly to achieve layered encryption.

7. The secure transmission method for interactive modules according to claim 1, characterized in that, Generate an integrity checksum for each layer of encrypted data, including: Obtain the data packet for each layer of encrypted data, and the data packet corresponds to the storage location ID before transmission and the placement location ID after transmission. When the number of bits of the storage location ID before transmission and the placement location ID after transmission are the same, the first check code is generated by combining the total byte length of the data packet. Otherwise, perform a bitwise XOR operation on the difference between the storage location ID before transmission and the storage location ID after transmission, and extract a reference symbol consistent with the difference in the number of bits from the data packet identifier symbol and perform a bitwise XOR operation with the corresponding bit. Then, perform another XOR operation on the result to generate a second check code. Perform global location analysis on each layer of encrypted data to obtain the data combination state of the encrypted data at each location point, determine the state ratio of each data combination state, and, in combination with each data combination state and the set data importance level of the corresponding layer, allocate the number and conditions of new check codes to each data combination state, and generate supplementary check codes. Each supplementary check code is processed by the second check code to obtain the third check code, which serves as the integrity check code for the layered encrypted data.

8. The secure transmission method for interactive modules according to claim 7, characterized in that, Generate supplementary verification codes, including: The logical space containing each layer of encrypted data is divided into a global location grid G ​​of N1×M1, where each grid cell (i,j) represents a unique location point. Define the data combination state S=(T,A,L), where T is the content type of the data at the corresponding location point; A is the encryption algorithm identifier used by the data at the corresponding location point; and L is the byte length of the data at the corresponding location point.

9. Traverse each location point in the global location grid G, analyze the T, A, and L attributes, and determine the data combination state Sij for each location point; Count the total number of locations Ck where each unique data combination state Sk appears in the entire layer of encrypted data, where k=1,2,...,K0, and K0 is the total number of unique states; Calculate the state percentage of each data combination state Sk: Pk = Ck / (N1 × M1); Based on the data importance level W of the corresponding layer and the proportion Pk of each state, calculate the number of new check codes to be assigned to state Sk. ,in, For all The sum, This is the rounding function. Set the total number of basic check codes for the corresponding layer, and assign check code generation conditions for each state Sk; Traverse the global location grid G. For each location point (i,j), if the corresponding data combination state Sij matches Sk and satisfies the checksum generation condition corresponding to Sk, then generate a supplementary checksum using an encrypted hash function based on the data content Dij of the corresponding location point, the global location coordinates (i,j), and the timestamp t. ,in, For cryptographic hash functions; This is a byte string concatenation operation.