Gas meter safety certification method based on national secret algorithm and related device

By adopting a security authentication method based on the national secret algorithm in the gas meter system, using the key management model and ESAM module for data encryption and decryption, the problem of existing system security vulnerabilities is solved, and high security and reliable data is achieved Transfer and store.

CN119483935AActive Publication Date: 2025-02-18RICHFIT INFORMATION TECH +2
View PDF 9 Cites 0 Cited by

Patent Information

Application Number
CN202411552012.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-01
Publication Date
2025-02-18
Estimated Expiration
2044-11-01

AI Technical Summary

Technical Problem

The security authentication solution of the existing gas meter remote meter reading system has security vulnerabilities and is easily compromised by attackers, resulting in illegal access or data tampering, threatening user privacy and data security.

Method used

Using the gas meter security authentication method based on the National Secret algorithm, the key negotiation file is issued by the server, and the key management model is used to generate a key allocation strategy, access the ESAM module to obtain pre-configured encrypted files, encrypt the data and upload it to the server. , the server decrypts data based on the decryption policy.

Benefits of technology

Improves the safety and reliability of the gas meter system, prevents tampering and eavesdropping of data during transmission, and ensures flexibility and high security of key management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119483935A_ABST
    Figure CN119483935A_ABST
Patent Text Reader

Abstract

The invention belongs to the field of data processing, and particularly relates to a gas meter security authentication method based on a national secret algorithm and a related device, and the method comprises the steps that a gas meter obtains a key negotiation file issued by a server; a key management model is adopted, prediction processing is conducted according to the key negotiation file, and a key distribution strategy corresponding to the gas meter is obtained; accessing the ESAM module based on the key distribution strategy, and obtaining a pre-configured encryption file matched with the key distribution strategy in the ESAM module; and executing data encryption in the gas meter by adopting the pre-configured encryption file, and uploading the encrypted gas meter data to a server, so that the server completes decryption of the gas meter data based on a pre-deployed decryption strategy. According to the method, the key updating strategy can be intelligently predicted, so that the data transmission and storage process has high safety and reliability, the flexibility of key management is guaranteed, the communication overhead caused by key updating is reduced, and the overall operation efficiency and safety of a gas meter system are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing, and in particular to a gas meter security authentication method and related devices based on a national secret algorithm. Background Art

[0002] The traditional gas meter industry mainly relies on prepaid payment. Users need to take their gas IC cards to a gas business hall or a gas charging representative point to purchase gas, and then insert the gas card containing the gas purchase record into the gas meter IC card socket to complete the gas recharge process. The entire process requires going back and forth between the gas business hall and home, which brings inconvenience to users' daily lives.

[0003] As wireless technology matures, wireless signal penetration becomes stronger and stronger, and coverage becomes wider and wider. Wireless remote meter reading begins to perform, breaking away from the constraints of wired remote meter reading. With the development of Internet of Things technology, the interconnection of all things is quietly happening, and the Internet of Things meter has also appeared, making remote meter reading more "intelligent". In recent years, smart meter reading has become more and more popular, and the gas industry has also kept up with the times and has begun to develop, produce, and promote smart gas meters. The development of smart gas meters and the emergence of remote meter reading in the gas industry have brought great convenience. At the same time, safety is an urgent problem to be solved, especially when it comes to the safety of people's livelihood infrastructure, which requires effective security authentication methods to ensure.

[0004] At present, the remote meter reading system of gas meters is mainly based on the authentication of software modules, but this network-based software authentication has great security loopholes. No matter what security algorithm and protocol is used, it is possible for professional attackers to break through and obtain illegal access rights or tamper with data. Moreover, there may be security loopholes in the process of software updates and upgrades. If strict testing and verification are not carried out, new security issues may arise. Hackers may steal data through the network and then steal user information, which poses a threat to personal privacy and the data security of gas companies.

[0005] Therefore, in order to solve at least one of the above technical problems, it is urgent to propose a new gas meter security authentication scheme based on the national secret algorithm. Summary of the invention

[0006] The present application provides a gas meter security authentication method and related devices based on a national secret algorithm, which are used to solve the technical problems existing in the current security authentication scheme that mainly relies on software module authentication.

[0007] In a first aspect, the present application provides a gas meter security authentication method based on a national secret algorithm, the method comprising:

[0008] The gas meter obtains the key negotiation file sent by the server;

[0009] A key management model is used to perform prediction processing according to the key negotiation file to obtain a key distribution strategy corresponding to the gas meter;

[0010] Accessing the ESAM module based on the key distribution strategy, and obtaining a pre-configured encryption file in the ESAM module that matches the key distribution strategy; the ESAM module is pre-deployed in the gas meter, and the ESAM module is built based on a national secret security chip;

[0011] The preconfigured encryption file is used to perform data encryption in the gas meter, and the encrypted gas meter data is uploaded to the server, so that the server completes the decryption of the gas meter data based on the pre-deployed decryption strategy; the decryption strategy matches the key distribution strategy predicted based on the key negotiation file.

[0012] In a second aspect, an embodiment of the present application provides a gas meter security authentication device based on a national secret algorithm, which is applied to a gas meter; the device includes:

[0013] An acquisition unit, configured to acquire a key negotiation file sent by a server;

[0014] A prediction unit is configured to adopt a key management model to perform prediction processing according to the pre-configured key information in the key negotiation file to obtain a key distribution strategy corresponding to the gas meter;

[0015] A configuration unit is configured to access the ESAM module based on the key distribution policy and obtain a pre-configured encryption file in the ESAM module that matches the key distribution policy; the ESAM module is pre-deployed in the gas meter, and the ESAM module is constructed based on a national secret security chip;

[0016] The encryption unit is configured to use the preconfigured encryption file to perform data encryption in the gas meter, and upload the encrypted gas meter data to the server, so that the server completes the decryption of the gas meter data based on a pre-deployed decryption strategy; the decryption strategy matches the key distribution strategy predicted based on the key negotiation file.

[0017] In a third aspect, an embodiment of the present application provides a computing device, the computing device comprising:

[0018] at least one processor, memory, and input-output unit;

[0019] The memory is used to store a computer program, and the processor is used to call the computer program stored in the memory to execute a gas meter security authentication method based on a national secret algorithm in the first aspect.

[0020] In a fourth aspect, a computer-readable storage medium is provided, which includes instructions. When the instructions are executed on a computer, the computer executes a gas meter security authentication method based on a national secret algorithm according to the first aspect.

[0021] In the technical solution provided in the embodiment of the present application, first, the gas meter obtains the key negotiation file issued by the server. Then, the key management model is used to perform prediction processing according to the key negotiation file to obtain the key distribution policy corresponding to the gas meter. Then, the ESAM module is accessed based on the key distribution policy, and the preconfigured encryption file matching the key distribution policy in the ESAM module is obtained. The ESAM module is pre-deployed in the gas meter, and the ESAM module is built based on the national secret security chip. Finally, the preconfigured encryption file is used to perform data encryption in the gas meter, and the encrypted gas meter data is uploaded to the server, so that the server completes the decryption of the gas meter data based on the pre-deployed decryption strategy. The decryption strategy matches the key distribution strategy predicted based on the key negotiation file.

[0022] In the technical solution of this application, a national secret security chip (such as SM2, SM3, SM4 and other algorithms) is used to ensure the security of key storage and transmission and avoid the risk of key leakage. Through key negotiation and dynamic key distribution, different keys are used at different times and communication stages to prevent repeated attacks and eavesdropping. The key time management model is used to intelligently predict the key update timing and distribution strategy, reduce the communication burden caused by the high frequency of key updates, and ensure the timeliness of the key. Through pre-configured encryption files and distributed key management modes, the frequent communication between the device end and the server is reduced, and the operating efficiency of the system is improved. The gas meter uses the ESAM module to encrypt the data locally to ensure that the data uploaded to the server will not be tampered with during the transmission process. The server decrypts the data based on the decryption strategy consistent with the key negotiation to ensure the integrity and availability of the uploaded data. In summary, by introducing a multi-layer key management model, the gas meter can intelligently predict the key update strategy and flexibly respond to security challenges in communication. At the same time, relying on the support of the ESAM module and the national secret algorithm, the entire data transmission and storage process has high security and reliability. This solution not only ensures the flexibility of key management, but also reduces the communication overhead caused by key updates, improving the overall operating efficiency and security of the gas meter system. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0024] Figure 1It is a flow chart of a gas meter security authentication method based on a national secret algorithm according to an embodiment of the present application;

[0025] Figure 2 It is a schematic diagram of the principle of a gas meter security authentication method based on a national secret algorithm in an embodiment of the present application;

[0026] Figure 3 It is a structural schematic diagram of a gas meter security authentication device based on a national secret algorithm in an embodiment of the present application;

[0027] Figure 4 It is a structural schematic diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0028] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0029] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein in the specification of this application are only for the purpose of describing specific embodiments and are not intended to limit this application.

[0030] At present, the remote meter reading system of gas meters is mainly based on the authentication of software modules, but this network-based software authentication has great security loopholes. No matter what security algorithm and protocol is used, it is possible for professional attackers to break through and obtain illegal access rights or tamper with data. Moreover, there may be security loopholes in the process of software updates and upgrades. If strict testing and verification are not carried out, new security issues may arise. Hackers may steal data through the network and then steal user information, which poses a threat to personal privacy and the data security of gas companies.

[0031] In the related technology, the existing gas meter security authentication is mainly divided into two methods: one is the authentication scheme without a special password algorithm, in which the gas meter and the gas backend server agree on a software protocol in advance, and perform data interaction through general logic processing, and basically do not use a specific security algorithm. This authentication scheme without a special password algorithm has almost no security. The data between the gas meter and the backend server is transmitted in plain text, and sensitive information is directly exposed to the public Internet, which poses serious security risks.

[0032] The other is a software cryptographic algorithm authentication scheme, where the gas meter and the backend server pass the software security authentication of a specific algorithm, and the algorithm implementation and key storage are all completed in the software. Although this software cryptographic algorithm authentication scheme introduces a specific security algorithm, its security is still relatively low, with the highest security level being EAL2+. Since the core authentication algorithm and key information are only stored in the software storage area, and the operating system and software themselves may have security vulnerabilities, the key information is actually in a potential exposed state, and security is difficult to be effectively guaranteed.

[0033] In order to solve at least one of the above technical problems, an embodiment of the present application provides a gas meter security authentication method and related devices based on a national secret algorithm.

[0034] Specifically, first, the gas meter obtains the key negotiation file sent by the server. Then, the key management model is used to perform prediction processing based on the key negotiation file to obtain the key distribution policy corresponding to the gas meter. Then, the ESAM module is accessed based on the key distribution policy, and the preconfigured encryption file matching the key distribution policy in the ESAM module is obtained. The ESAM module is pre-deployed in the gas meter, and the ESAM module is built based on the national secret security chip. Finally, the preconfigured encryption file is used to perform data encryption in the gas meter, and the encrypted gas meter data is uploaded to the server, so that the server completes the decryption of the gas meter data based on the pre-deployed decryption strategy. The decryption strategy matches the key distribution policy predicted based on the key negotiation file.

[0035] In the technical solution of the present application, on the one hand, a secure connection is first established between the gas meter and the server to obtain the key negotiation file issued by the server. The file contains key information during communication (such as key type, update strategy) and update rules triggered by time periods or events. On the other hand, the gas meter parses the information in the key negotiation file and performs predictive processing through a preset key management model. For example, the model can analyze the communication mode of the device based on the temporal convolutional network (TCN) to predict the appropriate key update cycle in the future. Thus, a corresponding key distribution strategy is generated based on the prediction results to clarify which keys should be used at different time points or when to trigger key updates. The model makes key updates more accurate, reduces unnecessary update frequency, and ensures system security and communication efficiency. In addition, the key negotiation file contains key update rules and strategies within the communication cycle. The gas meter predicts key requirements at different stages through the model. The distribution strategy clarifies when to extract encrypted files from the ESAM module and which keys to use to encrypt data.

[0036] Then, according to the key distribution strategy, the gas meter accesses the local ESAM module, in which a set of encrypted files have been pre-deployed. The gas meter obtains the pre-configured encrypted files that match the current distribution strategy from the ESAM module. Here, ESAM (Embedded Secure Access Module) is a hardware module based on the national secret chip, which supports encryption, decryption and digital signature operations to ensure the secure storage and use of keys in the device.

[0037] Then, the gas meter uses the matching pre-configured encryption file to encrypt the collected data. The encrypted data is uploaded to the server through the communication network. At this time, the data is safe during transmission to prevent tampering or eavesdropping by a third party. After the server receives the encrypted gas meter data, it completes the data decryption according to the pre-deployed decryption strategy. The decryption strategy corresponds to the previously negotiated key distribution strategy one by one to ensure that the server can correctly decrypt the uploaded data. After the server successfully decrypts, it will verify the integrity of the data to ensure that the data has not been tampered with during transmission.

[0038] Ultimately, the decrypted data will be used for gas metering, bill generation, or other applications. The decryption policy on the server is consistent with the encryption policy of the gas meter. By matching the corresponding key with the information in the negotiation file, the consistency of the data during upload and storage is ensured.

[0039] Through the technical solution of this application, by introducing a multi-layer key management model, the gas meter can intelligently predict the key update strategy and flexibly respond to security challenges in communication. At the same time, relying on the support of the ESAM module and the national secret algorithm, the entire data transmission and storage process has high security and reliability. This solution not only ensures the flexibility of key management, but also reduces the communication overhead caused by key updates, and improves the overall operating efficiency and security of the gas meter system.

[0040] The gas meter security authentication scheme based on the national secret algorithm provided in the embodiment of the present application can be executed by an electronic device, which can be a server, a server cluster, or a cloud server. The electronic device can also be a terminal device such as a mobile phone, a computer, a tablet computer, a wearable device, or a dedicated device (such as a dedicated terminal device with a gas meter security authentication system based on the national secret algorithm, etc.). In an optional embodiment, a service program for executing a gas meter security authentication scheme based on the national secret algorithm can be installed on the electronic device.

[0041] Figure 1 A schematic diagram of a gas meter security authentication method based on a national secret algorithm provided in an embodiment of the present application is shown in FIG. Figure 1 As shown, the method comprises the following steps:

[0042] 101, the gas meter obtains the key negotiation file sent by the server;

[0043] 102, using a key management model to perform prediction processing according to the key negotiation file to obtain a key distribution strategy corresponding to the gas meter;

[0044] 103, accessing the ESAM module based on the key distribution policy, and obtaining a preconfigured encryption file in the ESAM module that matches the key distribution policy;

[0045] 104 , encrypting the data in the gas meter using the pre-configured encryption file, and uploading the encrypted gas meter data to the server, so that the server completes the decryption of the gas meter data based on the pre-deployed decryption strategy.

[0046] In an embodiment of the present application, the key negotiation file is a file sent by the server to the gas meter, which contains relevant information for key management and update during communication. Specifically, the key type indicates the type of key to be used for encryption and decryption, such as keys based on national encryption algorithms (such as SM2, SM3, SM4). The key update policy specifies the rules for updating the keys, including when the keys need to be updated or replaced (based on time, data volume or specific events). The time period or event triggering rules specify the time period or events based on which key updates or renegotiations are triggered. The purpose of the key negotiation file is to provide the gas meter with all the information required for key management, including how to generate, distribute and update keys, so that the gas meter can use appropriate encryption keys in different time periods based on this information to ensure the security and effectiveness of communication.

[0047] In the embodiment of the present application, the key distribution strategy is a strategy generated by the gas meter after analyzing and predicting the received key negotiation file through the key management model. This strategy is used to guide how the gas meter uses and distributes keys at specific times or under specific conditions. Specifically, the key distribution strategy includes the following information: key usage time point, which is used to clarify when to use a specific key for encryption operations to ensure data security; key update timing, which indicates when the key to be used needs to be updated, which may be based on the time interval, data transmission volume, or specific events received; matching encryption file selection, which indicates which preconfigured encryption file needs to be extracted from the ESAM module to ensure that the encryption operation meets the current key distribution requirements. Through the key distribution strategy, the gas meter can effectively manage and utilize key resources to ensure security during data transmission, while ensuring the efficiency of the key update process.

[0048] In the embodiment of the present application, the ESAM module is pre-deployed in the gas meter, and the ESAM module is built based on the national secret security chip. The ESAM module (Embedded Secure Access Module) is a hardware module built based on the national secret security chip, which is mainly used to ensure key management and data security in gas meters and other devices. The ESAM module safely stores key files for encryption, decryption and signing. These key files are pre-configured and matched with the key distribution policy. Due to the hardware-level security design, the key will not be easily accessed or tampered with by the outside, ensuring the security of the device. The ESAM module supports encryption and decryption functions based on the national secret algorithm. Common national secret algorithms include: SM2, a public key encryption algorithm based on elliptic curves, mainly used for key exchange and signature verification. SM3, a secure hash algorithm, is used to generate data summaries to ensure data integrity. SM4, a block encryption algorithm, is used for symmetric encryption of data to ensure the secure transmission of communication data.

[0049] In addition, the ESAM module also supports the generation and verification of digital signatures to ensure the authenticity and tamper-proof function of data. During the communication process, the digital signature can ensure that the receiver can verify whether the data comes from a trusted source and has not been modified. Since the ESAM module is built on the national secret security chip, it has hardware-level protection functions, including anti-physical attack, protection chip detection and other means, which further improves the security of the device.

[0050] It can be seen that the ESAM module plays a key role in the gas meter, ensuring that key management, secure storage, and encryption and decryption operations within the device are performed at a high security level, providing strong support for secure communication between the gas meter and the server.

[0051] In an embodiment of the present application, the decryption strategy matches the key distribution strategy predicted based on the key negotiation file. That is, the decryption strategy is consistent with and matches the key distribution strategy predicted by the gas meter based on the key negotiation file, ensuring that data transmission between the gas meter and the server can be carried out safely and reliably. The decryption strategy is closely coordinated with the key distribution strategy of the gas meter to ensure the security and consistency of data during transmission. The server can dynamically adapt to the key usage of the gas meter by formulating a decryption strategy based on the key negotiation file, avoid decryption failure or data leakage, and achieve reliable data decryption and secure communication.

[0052] It can be understood that the decryption policy needs to be consistent with the key distribution policy on the gas meter side, which means that the server must accurately understand which keys the gas meter used to encrypt data when and based on what rules. First, the key version or ID specified in the decryption policy needs to be consistent with the gas meter side to ensure that the server can correctly decrypt the corresponding data, and if the gas meter updates the key according to the key negotiation file, the server's decryption policy will also be dynamically adjusted to use the same key version for decryption. Secondly, data format matching is crucial. The server decryption policy must ensure that the data format and algorithm used in its decryption process are consistent with the encryption operation on the gas meter side. For example, if the gas meter uses the SM4 symmetric encryption algorithm for data encryption, the server decryption policy also needs to use the same algorithm to decrypt the data. In addition, if the data encryption on the gas meter side contains certain metadata (such as timestamps, key IDs, etc.), the server needs to be able to identify and process this information. The decryption policy must also ensure that the decryption algorithm matches the process, using the same algorithm as the gas meter encryption (such as SM2, SM3, SM4), and at the same time identifying and reading the event trigger point or update timing in the key distribution policy to ensure that the corresponding key decryption is called at the right time. If the data is found to be not correctly decrypted during the decryption process (such as the key version does not match or the data is tampered with), the server can trigger a retransmission request and work with the gas meter to update the key or resend the data. Finally, security monitoring and logging are part of the decryption strategy, recording key operations and abnormal situations during the decryption process to track whether data has been leaked or whether the key has not been synchronized. These log information are extremely useful for auditing and subsequent key management optimization.

[0053] As an optional embodiment, in 101, first, the gas meter uploads a pre-processed message for starting the encryption process to the server. The pre-processed message includes at least: an authentication request, handshake data, security signature information, and identity authentication information. The pre-processed message undergoes a pre-negotiated first encryption process. Furthermore, in 101, the gas meter receives the key negotiation file issued by the server in response to the pre-processed message. The key negotiation file includes at least: a key configuration type, key configuration parameters, and a key configuration timing. The key negotiation file is obtained by a second encryption process that matches the first encryption process.

[0054] Specifically, in this optional embodiment, the key negotiation between the gas meter and the server is mainly divided into two steps: uploading a pre-processed message and receiving a key negotiation file. Before starting the encryption process, the gas meter first needs to send a pre-processed message containing necessary information to the server. The message mainly includes:

[0055] Authentication request: used to request the server to verify the identity of the gas meter to ensure the legitimacy of both communicating parties.

[0056] Handshake data: used to establish a preliminary communication connection, including handshake information such as protocol version and random number.

[0057] Security signature information: Digitally sign the key information of the pre-processed message to provide data integrity verification.

[0058] Authentication information: Contains device identification information, such as device ID or serial number, which is used for server-side identity authentication.

[0059] The above information is encrypted through the pre-negotiated first encryption process. This process involves the selection of encryption algorithms and keys to ensure that the transmitted messages will not be eavesdropped or tampered with during the transmission process.

[0060] Then, the gas meter sends the encrypted pre-processed message to the server and waits for the server's response. This process ensures that only authenticated and authorized devices can start the subsequent key negotiation process. After verifying and processing the pre-processed message of the gas meter, the server generates a key negotiation file. The file specifically includes:

[0061] Key configuration type: Describes which type of key configuration is used, such as symmetric key or public-private key pair.

[0062] Key configuration parameters: Detailed configuration of key parameters, such as key length, algorithm type, etc.

[0063] Key configuration timing: Indicates when or under what conditions these keys are used or updated.

[0064] Next, the key agreement file generated by the server is encrypted by a second encryption process that matches the first encryption process. This means that the encryption process uses a compatible or negotiated algorithm and key to ensure that the gas meter can correctly decrypt and read the file content. The encrypted key agreement file is transmitted to the gas meter, which, after receiving the file, uses the corresponding decryption algorithm to interpret the key agreement file and updates or adjusts its key distribution strategy accordingly.

[0065] Through the above two steps, a secure and efficient key negotiation mechanism is established between the gas meter and the server. The encryption of the preprocessing message and the key negotiation file ensures the secure transmission of data and the confidentiality of the key, effectively avoiding unauthorized access and potential security threats. This mechanism ensures the reliability of key synchronization between the gas meter and the server and realizes secure communication encryption.

[0066] As another optional embodiment, in 101, first, the gas meter receives the key negotiation file issued by the server based on a preset strategy. The key negotiation file is similar to the above, and will not be described in detail. The difference is that the key negotiation file is obtained by using the pre-negotiated third encryption process.

[0067] In this optional embodiment, the gas meter receives the key negotiation file issued by the server based on the preset policy. The main difference from the above embodiment is the different encryption processing methods. Specifically, the server generates and issues the key negotiation file to the gas meter according to the preset key management policy. The information contained in the file is similar to that in the above embodiment, such as key configuration type, key configuration parameters, key configuration timing, etc. The difference is that the key negotiation file here is encrypted by the pre-negotiated third encryption process. This encryption process may use a more suitable encryption algorithm or key to meet specific security requirements or compatibility requirements. For example, it may use a specific symmetric encryption algorithm or asymmetric encryption scheme, which is agreed upon by both parties in advance. Here, the third encryption process uses a higher-intensity encryption algorithm to improve security performance and prevent potential eavesdropping and tampering. The encryption algorithm selected is to meet certain specific protocol or device capability requirements to ensure that there are no compatibility issues between the two devices during the encryption and decryption process. According to the preset policy, the encryption scheme that best suits the current environment and needs is flexibly selected. After receiving the key negotiation file, the gas meter needs to use the decryption mechanism corresponding to the third encryption process for decryption. This requires the gas meter device to support the encryption method and hold the corresponding key or decryption information. Once decryption is successful, the gas meter will update its key configuration based on the information in the file to ensure that subsequent communications with the server are secure and synchronized.

[0068] By using the third encryption process, this embodiment enhances the aforementioned file protection and adjusts the encryption scheme according to specific needs. In this way, while meeting security requirements, the flexibility and compatibility of the encryption and decryption processes are also guaranteed. This adjustment enables the key negotiation process to not only have higher security protection, but also adapt to the needs of specific application environments.

[0069] 102. Using a key management model, perform prediction processing according to the key negotiation file to obtain a key distribution strategy corresponding to the gas meter.

[0070] As an optional embodiment, it is assumed that the key management model at least includes: a key space management model and a key time management model. Based on the above assumption, in 102, the key management model is used to perform prediction processing according to the key negotiation file to obtain the key distribution strategy corresponding to the gas meter, see Figure 2 , as shown, can be implemented as:

[0071] 201. Extracting pre-configured key information from the key agreement file;

[0072] 202. Use the key space management model to predict the pre-configured key information to obtain key storage space configuration information corresponding to the gas meter;

[0073] 203. Use the key time management model to predict the pre-configured key information to obtain key time configuration information corresponding to the gas meter;

[0074] 204. Generate the key distribution strategy based on the key storage space configuration information and the key time configuration information; the key distribution strategy is used to dynamically adjust the storage area location of key distribution and the key distribution timing.

[0075] Through steps 201 to 204, a key management model is used to perform prediction processing according to the key negotiation file, so as to obtain a key distribution strategy corresponding to the gas meter, which helps to further increase the dynamics and unpredictability of the key.

[0076] In this embodiment, a key management model is used to predict the key distribution strategy of the gas meter, and the key distribution strategy is generated by analyzing the information in the key negotiation file. The following is a detailed description of steps 201 to 204:

[0077] In step 201, first, the gas meter or server extracts the pre-configured key information from the key negotiation file. The pre-configured key information may include the key type, initial key, encryption algorithm, key length, key usage scope, etc. This information provides basic data for key management in subsequent steps and is the starting point for predicting and configuring key distribution strategies.

[0078] In step 202, the extracted preconfigured key information is predicted using a key space management model in order to determine the storage space configuration of the key. The key space management model is a model for managing the distribution and layout of keys in the device storage space. It predicts how to best allocate and manage the storage space for keys based on the device's storage resources, performance requirements, and the number and size of keys. The prediction includes, but is not limited to: the specific storage location of the key in the gas meter memory, the storage area allocated to different keys, and the possibility of dynamic adjustment based on future key usage requirements. Through this prediction, the gas meter can efficiently manage limited storage resources and avoid excessive key storage or space waste.

[0079] Through the key management algorithm optimized by neural networks, the key distribution strategy can be dynamically adjusted to ensure that the key is not exposed in a fixed location. Even if there are vulnerabilities in the software storage area, the dynamic and unpredictable nature of key management can greatly improve security.

[0080] Further optionally, it is assumed that the key space management model at least includes: a construction layer, a parsing layer, a prediction layer, and an optimization layer. Based on this, in step 202, the key space management model is used to predict the pre-configured key information to obtain the key storage space configuration information corresponding to the gas meter, which can be implemented as follows:

[0081] By constructing the layer, according to the gas meter deployment information carried in the pre-configured key information, a target graph node corresponding to the gas meter in the target graph structure is constructed; the gas meter deployment information at least includes: location information of the area where the gas meter is located, the spatial connection relationship between the gas meter and the server, and the associated architecture information in the communication network where the gas meter is located; the target graph structure corresponds to the deployment architecture of the communication network where the gas meter is located; each graph node in the target graph structure corresponds to a gas meter;

[0082] By means of the parsing layer, based on the target graph structure, the key association degree between the target graph node and other graph nodes and the key usage frequency of the target graph node are parsed;

[0083] By means of the prediction layer, a target key storage area of ​​the gas meter is predicted based on the key association degree and the key usage frequency;

[0084] Through the optimization layer, risk prediction is performed on the target key storage area to obtain the key storage space configuration information indicating the target key storage area.

[0085] The above key space management model consists of a construction layer, a parsing layer, a prediction layer and an optimization layer, and dynamically optimizes the key storage space configuration of the gas meter through multiple steps.

[0086] First, through the construction layer, according to the gas meter deployment information carried in the pre-configured key information, a target graph structure corresponding to the gas meter communication network architecture is constructed. Each graph node represents a gas meter. This information includes the location information of the gas meter, the connection relationship with the server, and the network architecture. Then, in the parsing layer, the key association degree and key usage frequency between the graph node and other nodes are parsed based on the target graph structure, so as to determine the key interaction of each node. Then, the prediction layer predicts the target key storage area of ​​the gas meter based on the key association degree and usage frequency, and determines which specific storage area the key should be allocated to. Finally, the optimization layer predicts the risk of the target key storage area, evaluates the security risk, and generates the final key storage space configuration information to ensure the security and optimized distribution of the key in the storage area. In addition, the model based on the graph neural network (GNN) can capture the complex relationship between keys, dynamically optimize the key storage space configuration, and prevent the security risks caused by the centralized storage of keys. Through this neural network optimized key management algorithm, the storage location and allocation time of the key will be highly dynamic and unpredictable, which greatly improves the security of the system. Even if there are vulnerabilities in the software storage area, the dynamic management of the key can still effectively prevent security risks.

[0087] Next, in step 203, the key time management model is used to predict the preconfigured key information to determine the key usage time and update cycle. The key time management model is responsible for managing the key life cycle, including the time schedule for key generation, use, expiration and update. It predicts the key usage strategy in different time periods based on factors such as the device's communication requirements, security policies, and the validity period of the key. The predicted content includes but is not limited to: the key usage time, validity period, whether it needs to be updated regularly or triggered when a specific event occurs (such as device restart, key leakage risk, etc.). Through this time management, the gas meter can dynamically adjust the use of the key to ensure the security and effectiveness of the key throughout the life cycle.

[0088] In this step, neural networks are used to learn communication patterns, dynamically generate and distribute keys, and update and rotate them at appropriate times to minimize the risk of key exposure.

[0089] Further optionally, it is assumed that the key time management model at least includes: an input layer, a multi-layer causal convolution layer, an extended convolution layer, an optimization layer, and a fully connected layer. Based on this, in step 203, the key time management model is used to predict the pre-configured key information to obtain the key time configuration information corresponding to the gas meter, which can be implemented as follows:

[0090] The pre-configured key information is converted into gas meter characteristic information through the input layer; the gas meter characteristic information at least includes: communication data characteristics, communication time characteristics, and signaling transmission characteristics in the communication network where the gas meter is located;

[0091] Through multiple causal convolution layers, a convolution kernel sliding window is used to perform communication time pattern recognition on the characteristic information of the gas meter to obtain the communication time pattern in the communication network where the gas meter is located;

[0092] By extending the convolution layer, identifying a long-term dependency pattern in the communication network where the gas meter is located from the gas meter feature information;

[0093] By means of an optimization layer, different characteristic information of the communication time mode and the long-time dependency mode is optimized;

[0094] Through the fully connected layer, all the feature information after optimization processing is fused to obtain the key time configuration information corresponding to the gas meter.

[0095] Specifically, the design of the key time management model aims to effectively predict the update and distribution timing of the key by analyzing the communication mode of the gas meter, thereby improving the security of the system. The model mainly consists of an input layer, a multi-layer causal convolution layer, an extended convolution layer, an optimization layer, and a fully connected layer. The input layer converts the pre-configured key information into the characteristic information of the gas meter, which includes communication data characteristics, communication time characteristics, and signaling transmission characteristics. This conversion provides basic data for subsequent pattern recognition and prediction. The multi-layer causal convolution layer identifies the communication time pattern in the characteristic information of the gas meter through the convolution kernel sliding window. This process uses the characteristics of causal convolution to ensure that the model output does not depend on future information, thereby accurately capturing the current and historical communication time patterns. The extended convolution layer identifies long-term dependency patterns from the characteristic information of the gas meter. Extended convolution can expand the receptive field of the model, enabling it to effectively capture long-term communication dependencies, thereby determining the best time for key update. The optimization layer optimizes different feature information in the communication time pattern and long-term dependency pattern. This process optimizes the key time management strategy by weighing the impact of each feature to fully adapt to the complex communication environment. The fully connected layer fuses all the optimized feature information to generate the key time configuration information corresponding to the gas meter. Through complete feature fusion, this layer ensures that the generated configuration information can guide dynamic and timely key update and distribution.

[0096] In summary, by capturing changes in the gas meter communication mode, the model can dynamically adjust the key update and allocation time, thereby improving system security. Frequent key updates and rotations reduce the risk of key exposure. Even in the face of network attacks or security vulnerabilities, the system can still adjust the key configuration in a timely manner. The time series convolutional network has strong parallelism and can quickly process large-scale time series data, which is suitable for complex communication environments such as IoT devices. The use of extended convolution enhances the model's ability to capture long-term dependencies, ensuring that the timing of key updates is more accurate, and avoiding potential security risks caused by premature or late updates.

[0097] In general, the core of the key time management model lies in the efficient analysis and prediction of time patterns in gas meter communication to dynamically adjust the update and distribution timing of keys. The model consists of multiple key structures, each of which has a specific role, and works together to achieve complex time series data processing. The model effectively implements dynamic key management through the learning and analysis of communication patterns by neural networks, ensuring that keys are updated and distributed at the right time to minimize security risks. It is suitable for complex communication environments that require flexible key management, especially communication management of IoT devices. The model achieves efficient analysis and prediction of gas meter communication patterns through causal convolution, dilated convolution and optimization techniques. Using a multi-layer structure, the model can capture complex time dependencies and dynamically adjust the distribution and update of keys to ensure the security and reliability of the system. This structure is particularly suitable for application scenarios with high security requirements and complex communication patterns, such as IoT devices.

[0098] In step 204, a comprehensive key distribution strategy is generated based on the key storage space configuration information in step 202 and the key time configuration information in step 203. The core of the key distribution strategy is to dynamically adjust the storage area and usage time of the key. It will determine when the key is distributed, when it is updated, and the specific location of the key in the device memory or storage area. For example, the policy can specify that a key is allocated to a specific storage area within a specific time period, or update the key immediately when a certain condition is triggered (such as when the device is detected to be under attack). This step ensures that the gas meter always maintains the flexibility and security of key management during the secure communication process, avoiding security issues caused by improper key management.

[0099] Through the above four steps, this embodiment implements prediction processing based on the key management model and generates a key distribution strategy for the gas meter. This process not only optimizes the storage space usage of the key through the joint application of the key space and time management model, but also ensures the effective management and use of the key throughout the life cycle. The generated key distribution strategy provides strong support for secure communication between the gas meter and the server.

[0100] As an optional embodiment, in 102, after a key management model is used to perform prediction processing based on the preconfigured key information in the key negotiation file to obtain the key distribution strategy corresponding to the gas meter, a key strategy optimization model can also be used to perform risk distribution prediction on the key management strategy running in the key management model, and the key management strategy is dynamically updated based on the risk distribution prediction result. The risk probability distribution of the key management strategy in the key strategy optimization model is expressed as follows:

[0101]

[0102] Among them, P(I j h) represents the risk probability distribution I of the jth key management strategy in the key management environment h j Based on the risk prediction results, the key management strategy can be dynamically updated. Using the above risk probability distribution, the model can predict the risk level of the current key management strategy in different environments. By identifying this risk, the system can identify potential weak links or high-risk areas, and make targeted adjustments.

[0103] Furthermore, the weight and priority of each policy are adjusted according to the real-time risk assessment, thereby optimizing the overall key distribution strategy to ensure security and reliability. h represents the weight item corresponding to the key management environment h, which is the weight of the impact of different environmental factors. h It represents the bias term corresponding to the key management environment h, taking into account the basic risk level of the environment. represents the weight item corresponding to the jth key management strategy, reflecting the inherent risk of the strategy itself. n is the maximum number of keys that can be configured under the key management environment h. By adjusting the key management environment weights and bias items, the model can adaptively change the strategy selection to reflect changes in the current environment. For example, in the case of increased potential threats detected, the strategy can be biased towards a more secure key distribution scheme.

[0104] In this optional embodiment, the optimization of the key management policy introduces a key policy optimization model, which enables the system to dynamically adjust the key management policy to improve security and adaptability. By predicting and analyzing the risk probability distribution of the key management policy, possible security threats can be identified in advance, and the policy can be dynamically adjusted to reduce these risks. The model allows the key management policy to be adjusted based on the risk distribution evaluated in real time, so that the system can adapt to the changing network environment and potential attacks. Through more accurate policy adjustments, the system can allocate and use key resources more efficiently and avoid unnecessary waste of resources. The model can be extended to IoT devices and network environments of different sizes and complexities, enhancing the flexibility of the system.

[0105] In general, the core of this embodiment is to closely combine risk prediction with the selection of key management strategies, and ensure that the system always maintains the best security status in a changing communication environment by continuously evaluating and adjusting strategies. This method is particularly suitable for application in the Internet of Things and large-scale networks, and can effectively cope with various dynamic security challenges.

[0106] In 103, the ESAM module is accessed based on the key distribution policy, and a pre-configured encryption file matching the key distribution policy in the ESAM module is obtained. In an embodiment of the present application, the ESAM module is pre-deployed in the gas meter, and the ESAM module is constructed based on a national security chip.

[0107] In this embodiment, the ESAM module is a key security component in the gas meter, responsible for storing and processing pre-configured encryption files related to the key distribution policy. By accessing the ESAM module based on the key distribution policy, it can be ensured that the communication and data transmission in the gas meter meet the security standards.

[0108] Specifically, ESAM is a secure hardware module specifically used to process sensitive data. In this embodiment, the ESAM module is designed based on the national secret algorithm (China's national cryptographic standard) to ensure data security during the gas meter communication process. The ESAM module is pre-integrated in the gas meter device as a secure execution unit for the entire key management system. In the ESAM module of the gas meter, some encrypted files that match the key distribution strategy are pre-stored. These files are encrypted according to the national cryptographic algorithm standard and are used to protect and transmit sensitive data of the gas meter. These encrypted files can contain encrypted communication keys, identity authentication information or other confidential data, and are used to ensure the integrity and confidentiality of the data in actual operations.

[0109] In the key management model, the system decides when to access the ESAM module based on the key distribution strategy obtained through prediction and analysis. This strategy determines how to obtain the appropriate encryption key and perform encryption operations within a specific time. Once the key management model generates a key distribution strategy, the system will access the ESAM module through the strategy to ensure that the correct encrypted file is obtained from the module. By querying the key distribution strategy, the encrypted file that matches the current strategy is found in the ESAM module. The file contains the encryption key or data that needs to be used in a specific time period and a specific communication environment. After obtaining the pre-configured encrypted file, the ESAM module will perform related operations such as encryption, decryption, key generation, etc. through the national secret algorithm to ensure that the data transmission process between the gas meter and the external system is safe and reliable. The core of the ESAM module is based on national cryptographic standards (such as SM2, SM3, SM4, etc.). These algorithms are used to ensure that the key management system of the gas meter meets national security standards in terms of data encryption, authentication, signature and data integrity protection. The ESAM module is built on a hardware security chip with a high level of physical security and can resist a variety of hardware attacks, such as side-channel attacks and differential power consumption analysis.

[0110] In this way, by storing and accessing pre-configured encryption files in the ESAM module, it is ensured that all key operations in the gas meter are performed in a highly secure hardware environment, effectively preventing key leakage and unauthorized access. Combined with the key distribution strategy, the ESAM module can dynamically obtain the corresponding encryption files according to the actual needs of the gas meter, realize flexible key update and management mechanisms, and improve the adaptability of the system. The ESAM module of the national secret algorithm ensures that the gas meter system complies with the requirements of China's national information security standards, which is particularly important in critical infrastructure such as gas metering systems. The ESAM module is designed as low-power hardware and can run efficiently on resource-constrained devices such as gas meters, ensuring security without affecting the normal functions of the equipment.

[0111] In this embodiment, the ESAM module, as a core component based on the national secret security chip, ensures the security of the key management and encryption process of the gas meter system. By combining the key distribution strategy, the system can dynamically access and obtain encrypted files that match the strategy in the ESAM module, thereby ensuring the encryption and transmission security of the data. At the same time, this solution complies with national cryptographic standards and is suitable for application scenarios with high security requirements in critical infrastructure, such as gas metering systems in IoT devices.

[0112] In 104, the preconfigured encryption file is used to perform data encryption in the gas meter, and the encrypted gas meter data is uploaded to the server, so that the server completes the decryption of the gas meter data based on the pre-deployed decryption strategy. In the embodiment of the present application, the decryption strategy matches the key distribution strategy predicted based on the key agreement file.

[0113] In this embodiment, the data in the gas meter is encrypted by a pre-configured encryption file, and the encrypted data is uploaded to the server, and the server completes the decryption of the data according to the pre-deployed decryption strategy. This process ensures the security of the entire data transmission and storage.

[0114] Specifically, inside the gas meter, the system first generates a key distribution strategy through the key management model, and obtains a preconfigured encryption file from the ESAM module based on the strategy. The encryption file usually contains encryption keys generated based on national cryptographic standards (such as SM2, SM4, etc.), which are used to encrypt sensitive data in the gas meter (such as metering data, communication records, etc.). The data in the gas meter is encrypted using a preconfigured key. The encryption algorithm may be based on symmetric or asymmetric encryption, and the specific choice depends on the security requirements and resource constraints of the system. Once the data is encrypted, the gas meter uploads the encrypted data to the server. This is usually transmitted over a wireless communication network (such as NB-IoT, LoRa, or cellular network). The encrypted data cannot be directly tampered with or interpreted, ensuring the confidentiality and integrity of the data during transmission and preventing man-in-the-middle attacks or data tampering.

[0115] The server has pre-deployed a decryption strategy that matches the key distribution strategy, that is, the server can correctly select the corresponding decryption key for decryption operations based on the key distribution strategy used by the gas meter. This decryption strategy is usually based on the information in the key negotiation file and uses the previously negotiated key or key distribution strategy to perform decryption. The server obtains the corresponding key from the decryption strategy to decrypt the transmitted encrypted data. After receiving the encrypted data, the server uses the pre-configured decryption strategy and the content of the key negotiation file to perform the decryption operation using the corresponding decryption key. Because the decryption strategy matches the key distribution strategy, the server can successfully restore the encrypted data uploaded by the gas meter to plaintext data for further processing or storage.

[0116] In this way, during the whole process, the data of the gas meter is always transmitted and stored in an encrypted form, avoiding the risk of data being stolen or tampered by malicious attackers on the transmission link. The encryption algorithm based on the national secret standard (such as the SM4 symmetric encryption algorithm or the SM2 asymmetric encryption algorithm) further enhances the security of the system and meets the national security requirements for critical information infrastructure. The decryption strategy is matched with the key distribution strategy to ensure that the server and the gas meter use consistent encryption and decryption keys, avoid inconsistencies in key management, and improve the reliability of decryption operations. By using pre-configured encryption files and decryption strategies, the system can reduce the burden of dynamically generating keys. The pre-configuration method not only saves the computing resources of the device, but also simplifies the key management process, which is particularly suitable for resource-constrained IoT devices. In a wireless network environment, encryption technology is used to ensure the secure transmission of data, and the matching of the key distribution strategy and the decryption strategy ensures the efficiency of decryption without repeated negotiation or additional key calculation.

[0117] In this embodiment, the system encrypts the gas meter data through a preconfigured encryption file, and uses a decryption strategy that matches the key distribution strategy on the server side to ensure the secure transmission and processing of data from the gas meter to the server. This mechanism not only improves data security, but also simplifies key management and encryption and decryption processes, which is very suitable for security requirements in large-scale IoT environments, especially for devices with limited resources such as gas meters.

[0118] In summary, by introducing a multi-layer key management model, the gas meter can intelligently predict the key update strategy and flexibly respond to security challenges in communication. At the same time, relying on the support of the ESAM module and the national encryption algorithm, the entire data transmission and storage process has high security and reliability. This solution not only ensures the flexibility of key management, but also reduces the communication overhead caused by key updates, and improves the overall operating efficiency and security of the gas meter system.

[0119] In another embodiment of the present application, a gas meter security authentication device based on a national secret algorithm is also provided. Figure 3 As shown, the device is applied to a gas meter and comprises the following units:

[0120] An acquisition unit, configured to acquire a key negotiation file sent by a server;

[0121] A prediction unit is configured to adopt a key management model to perform prediction processing according to the pre-configured key information in the key negotiation file to obtain a key distribution strategy corresponding to the gas meter;

[0122] A configuration unit is configured to access the ESAM module based on the key distribution policy and obtain a pre-configured encryption file in the ESAM module that matches the key distribution policy; the ESAM module is pre-deployed in the gas meter, and the ESAM module is constructed based on a national secret security chip;

[0123] The encryption unit is configured to use the preconfigured encryption file to perform data encryption in the gas meter, and upload the encrypted gas meter data to the server, so that the server completes the decryption of the gas meter data based on a pre-deployed decryption strategy; the decryption strategy matches the key distribution strategy predicted based on the key negotiation file.

[0124] Further optionally, the obtaining unit obtains the key negotiation file sent by the server, and is specifically configured as follows:

[0125] The gas meter uploads a pre-processed message for starting the encryption process to the server; the pre-processed message includes at least: an authentication request, handshake data, security signature information, and identity authentication information; the pre-processed message undergoes a pre-negotiated first encryption process;

[0126] The gas meter receives the key negotiation file sent by the server in response to the preprocessing message; the key negotiation file includes at least: key configuration type, key configuration parameters, key configuration timing; the key negotiation file is obtained by a second encryption process that matches the first encryption process.

[0127] Further optionally, the obtaining unit obtains the key negotiation file sent by the server, and is specifically configured as follows:

[0128] The gas meter receives the key negotiation file issued by the server based on a preset strategy; the key negotiation file includes at least: key configuration type, key configuration parameters, and key configuration timing; the key negotiation file is obtained by using a pre-negotiated third encryption process.

[0129] Further optionally, the key management model at least includes: a key space management model and a key time management model;

[0130] The prediction unit adopts a key management model to perform prediction processing according to the key negotiation file to obtain a key distribution strategy corresponding to the gas meter, and is specifically configured as follows:

[0131] Extracting preconfigured key information from the key agreement file;

[0132] The key space management model is used to predict the pre-configured key information to obtain key storage space configuration information corresponding to the gas meter;

[0133] The key time management model is used to predict the pre-configured key information to obtain the key time configuration information corresponding to the gas meter;

[0134] The key distribution strategy is generated based on the key storage space configuration information and the key time configuration information; the key distribution strategy is used to dynamically adjust the storage area location of the key distribution and the key distribution timing.

[0135] Further optionally, the key space management model includes at least: a construction layer, a parsing layer, a prediction layer, and an optimization layer;

[0136] The prediction unit uses the key space management model to predict the pre-configured key information to obtain the key storage space configuration information corresponding to the gas meter, and is specifically configured as follows:

[0137] By constructing the layer, according to the gas meter deployment information carried in the pre-configured key information, a target graph node corresponding to the gas meter in the target graph structure is constructed; the gas meter deployment information at least includes: location information of the area where the gas meter is located, the spatial connection relationship between the gas meter and the server, and the associated architecture information in the communication network where the gas meter is located; the target graph structure corresponds to the deployment architecture of the communication network where the gas meter is located; each graph node in the target graph structure corresponds to a gas meter;

[0138] By means of the parsing layer, based on the target graph structure, the key association degree between the target graph node and other graph nodes and the key usage frequency of the target graph node are parsed;

[0139] By means of the prediction layer, a target key storage area of ​​the gas meter is predicted based on the key association degree and the key usage frequency;

[0140] Through the optimization layer, risk prediction is performed on the target key storage area to obtain the key storage space configuration information indicating the target key storage area.

[0141] Further optionally, the key time management model includes at least: an input layer, a multi-layer causal convolution layer, an extended convolution layer, an optimization layer, and a fully connected layer;

[0142] The prediction unit uses the key time management model to predict the pre-configured key information to obtain the key time configuration information corresponding to the gas meter, and is specifically configured as follows:

[0143] The pre-configured key information is converted into gas meter characteristic information through the input layer; the gas meter characteristic information at least includes: communication data characteristics, communication time characteristics, and signaling transmission characteristics in the communication network where the gas meter is located;

[0144] Through multiple causal convolution layers, a convolution kernel sliding window is used to perform communication time pattern recognition on the characteristic information of the gas meter to obtain the communication time pattern in the communication network where the gas meter is located;

[0145] By extending the convolution layer, identifying a long-term dependency pattern in the communication network where the gas meter is located from the gas meter feature information;

[0146] By means of an optimization layer, different characteristic information of the communication time mode and the long-time dependency mode is optimized;

[0147] Through the fully connected layer, all the feature information after optimization processing is fused to obtain the key time configuration information corresponding to the gas meter.

[0148] Further optionally, the prediction unit, after adopting a key management model to perform prediction processing according to the preconfigured key information in the key negotiation file and obtaining a key distribution strategy corresponding to the gas meter, is further configured to:

[0149] Using a key policy optimization model, predicting the risk distribution of the key management policy running in the key management model, and dynamically updating the key management policy based on the risk distribution prediction result;

[0150] The risk probability distribution of the key management strategy in the key strategy optimization model is expressed as follows:

[0151]

[0152] Among them, P(I j h) represents the risk probability distribution I of the jth key management strategy in the key management environment h j , w h represents the weight item corresponding to the key management environment h, b h represents the bias term corresponding to the key management environment h, represents the weight item corresponding to the jth key management policy, and n is the maximum number of keys that can be configured in the key management environment h.

[0153] In the embodiment of the present application, by introducing a multi-layer key management model, the key update strategy is intelligently predicted, so that the data transmission and storage process have high security and reliability, the flexibility of key management is guaranteed, and the communication overhead caused by key update is reduced, thereby improving the overall operation efficiency and security of the gas meter system.

[0154] In another embodiment of the present application, an electronic device is provided, comprising: a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;

[0155] Memory, used to store computer programs;

[0156] The processor is used to implement a gas meter security authentication method based on a national secret algorithm described in a method embodiment when executing a program stored in the memory.

[0157] The communication bus 1140 mentioned in the above electronic device may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus 1140 may be divided into an address bus, a data bus, a control bus, etc.

[0158] For ease of representation, Figure 4 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0159] The communication interface 1120 is used for communication between the above electronic device and other devices.

[0160] The memory 1130 may include a random access memory (RAM) or a non-volatile memory (non-volatile memory), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

[0161] The above-mentioned processor 1110 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0162] Accordingly, an embodiment of the present application further provides a computer-readable storage medium storing a computer program, which, when executed, can implement each step that can be executed by an electronic device in the above method embodiment.

Claims

1. A gas meter security authentication method based on a national secret algorithm, characterized in that: The method comprises: The gas meter obtains the key negotiation file sent by the server; A key management model is used to perform prediction processing according to the key negotiation file to obtain a key distribution strategy corresponding to the gas meter; Accessing the ESAM module based on the key distribution strategy, and obtaining a pre-configured encryption file in the ESAM module that matches the key distribution strategy; the ESAM module is pre-deployed in the gas meter, and the ESAM module is built based on a national secret security chip; The preconfigured encryption file is used to perform data encryption in the gas meter, and the encrypted gas meter data is uploaded to the server, so that the server completes the decryption of the gas meter data based on the pre-deployed decryption strategy; the decryption strategy matches the key distribution strategy predicted based on the key negotiation file.

2. A gas meter security authentication method based on a national secret algorithm according to claim 1, characterized in that: The gas meter obtains the key negotiation file sent by the server, including: The gas meter uploads a pre-processed message for starting the encryption process to the server; the pre-processed message includes at least: an authentication request, handshake data, security signature information, and identity authentication information; the pre-processed message undergoes a pre-negotiated first encryption process; The gas meter receives the key negotiation file sent by the server in response to the preprocessing message; the key negotiation file includes at least: key configuration type, key configuration parameters, key configuration timing; the key negotiation file is obtained by a second encryption process that matches the first encryption process.

3. A gas meter security authentication method based on a national secret algorithm according to claim 1, characterized in that: The gas meter obtains the key negotiation file sent by the server, including: The gas meter receives the key negotiation file issued by the server based on a preset strategy; the key negotiation file includes at least: key configuration type, key configuration parameters, and key configuration timing; the key negotiation file is obtained by using a pre-negotiated third encryption process.

4. A gas meter security authentication method based on a national secret algorithm according to claim 1, characterized in that: The key management model at least includes: a key space management model and a key time management model; The key management model is adopted to perform prediction processing according to the key negotiation file to obtain a key distribution strategy corresponding to the gas meter, including: Extracting preconfigured key information from the key agreement file; The key space management model is used to predict the pre-configured key information to obtain key storage space configuration information corresponding to the gas meter; The key time management model is used to predict the pre-configured key information to obtain the key time configuration information corresponding to the gas meter; The key distribution strategy is generated based on the key storage space configuration information and the key time configuration information; the key distribution strategy is used to dynamically adjust the storage area location of the key distribution and the key distribution timing.

5. A gas meter security authentication method based on a national secret algorithm according to claim 4, characterized in that: The key space management model at least includes: a construction layer, a parsing layer, a prediction layer, and an optimization layer; The key space management model is used to predict the pre-configured key information to obtain the key storage space configuration information corresponding to the gas meter, including: By constructing the layer, according to the gas meter deployment information carried in the pre-configured key information, a target graph node corresponding to the gas meter in the target graph structure is constructed; the gas meter deployment information at least includes: location information of the area where the gas meter is located, the spatial connection relationship between the gas meter and the server, and the associated architecture information in the communication network where the gas meter is located; the target graph structure corresponds to the deployment architecture of the communication network where the gas meter is located; each graph node in the target graph structure corresponds to a gas meter; By means of the parsing layer, based on the target graph structure, the key association degree between the target graph node and other graph nodes and the key usage frequency of the target graph node are parsed; By means of the prediction layer, a target key storage area of ​​the gas meter is predicted based on the key association degree and the key usage frequency; Through the optimization layer, risk prediction is performed on the target key storage area to obtain the key storage space configuration information indicating the target key storage area.

6. A gas meter security authentication method based on a national secret algorithm according to claim 4, characterized in that: The key time management model at least includes: an input layer, a multi-layer causal convolution layer, an extended convolution layer, an optimization layer, and a fully connected layer; The key time management model is used to predict the pre-configured key information to obtain the key time configuration information corresponding to the gas meter, including: The pre-configured key information is converted into gas meter characteristic information through the input layer; the gas meter characteristic information at least includes: communication data characteristics, communication time characteristics, and signaling transmission characteristics in the communication network where the gas meter is located; Through multiple causal convolution layers, a convolution kernel sliding window is used to perform communication time pattern recognition on the characteristic information of the gas meter to obtain the communication time pattern in the communication network where the gas meter is located; By extending the convolution layer, identifying a long-term dependency pattern in the communication network where the gas meter is located from the gas meter feature information; By means of an optimization layer, different characteristic information of the communication time mode and the long-time dependency mode is optimized; Through the fully connected layer, all the feature information after optimization processing is fused to obtain the key time configuration information corresponding to the gas meter.

7. A gas meter security authentication method based on a national secret algorithm according to claim 1, characterized in that: After the key management model is adopted and the preconfigured key information in the key negotiation file is used for prediction processing to obtain the key distribution strategy corresponding to the gas meter, the method further includes: Using a key policy optimization model, predicting the risk distribution of the key management policy running in the key management model, and dynamically updating the key management policy based on the risk distribution prediction result; The risk probability distribution of the key management strategy in the key strategy optimization model is expressed as follows: Among them, P(I j |h) represents the risk probability distribution I of the jth key management strategy in the key management environment h j , w h represents the weight item corresponding to the key management environment h, b h represents the bias term corresponding to the key management environment h, represents the weight item corresponding to the jth key management policy, and n is the maximum number of keys that can be configured in the key management environment h.

8. A gas meter security authentication device based on a national secret algorithm, characterized in that: The device is applied to a gas meter; the device comprises: An acquisition unit, configured to acquire a key negotiation file sent by a server; A prediction unit is configured to adopt a key management model to perform prediction processing according to the pre-configured key information in the key negotiation file to obtain a key distribution strategy corresponding to the gas meter; A configuration unit is configured to access the ESAM module based on the key distribution policy and obtain a pre-configured encryption file in the ESAM module that matches the key distribution policy; the ESAM module is pre-deployed in the gas meter, and the ESAM module is constructed based on a national secret security chip; The encryption unit is configured to use the preconfigured encryption file to perform data encryption in the gas meter, and upload the encrypted gas meter data to the server, so that the server completes the decryption of the gas meter data based on a pre-deployed decryption strategy; the decryption strategy matches the key distribution strategy predicted based on the key negotiation file.

9. An electronic device, characterized in that: include: Memory for storing computer software programs; A processor is used to read and execute the computer software program, thereby implementing a gas meter security authentication method based on a national secret algorithm as described in any one of claims 1 to 7.

10. A non-transitory computer-readable storage medium, characterized in that: The storage medium stores a computer software program, and when the computer software program is executed by the processor, it implements a gas meter security authentication method based on a national secret algorithm as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Gas meter safety certification system based on national cryptographic algorithm

    CN112087301A

  • QKD network key resource pre-allocation method based on reinforcement learning

    CN114499842A

  • Method for improving quantum key relay service quality

    CN114697011A

  • Information protection method for secure access gateway and secure access gateway

    CN116707795A

  • Adaptive key distribution method, system and device based on reinforcement learning and medium

    CN118074897A