Method and system for automatically generating 3gpp nas protocol signaling coding and decoding library according to yaml description file

By automating the generation of 3GPP NAS protocol signaling codec libraries through YAML description files and code generators, the problems of low efficiency and poor consistency of traditional manual encoding are solved, and efficient and reliable signaling processing is achieved.

CN120892031APending Publication Date: 2025-11-04NANJING RUIKONDA TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510935106.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-08
Publication Date
2025-11-04

AI Technical Summary

Technical Problem

In traditional 3GPP NAS protocol signaling processing, manual coding is labor-intensive, prone to errors, difficult to synchronize protocol updates, and inconsistent code quality, resulting in high development and maintenance costs and low efficiency.

Method used

The protocol specification is defined using YAML description files, and a multilingual signaling codec library is automatically generated through a code generator. The code is generated using a template engine such as Jinja2, thereby achieving decoupling of the protocol and code and consistency management.

Benefits of technology

It greatly improves development and maintenance efficiency, reduces human error, ensures consistent code quality, reduces costs, and enhances the robustness and reliability of signaling processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure FT_1
    Figure FT_1
  • Figure FT_2
    Figure FT_2
  • Figure SMS_1
    Figure SMS_1
Patent Text Reader

Abstract

The invention provides a method and a system for automatically generating a 3GPP (3rd Generation Partnership Project) NAS (Network Attached Storage) protocol signaling coding and decoding library according to a YAML description file. By decoupling protocol specifications and codes and utilizing an automatic code generation technology, the problems of efficiency, quality and maintenance in traditional NAS library development are effectively solved. The method has high flexibility and expandability, can adapt to rapid evolution of future communication protocols, and has important application value in the field of wireless communication.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of wireless communication, in particular to a 3GPP non-access stratum (NAS) protocol signaling processing technology for a mobile communication core network, and specifically to a method and system for automatically generating a signaling codec library according to a YAML description file. BACKGROUND

[0002] In the 5G core network (5GC) and evolved packet core (EPC) defined by 3GPP (Third Generation Partnership Project), the NAS protocol is a key protocol for communication between a terminal (UE) and a core network. NAS signaling carries core functions such as session management and mobility management. When developing and maintaining the NAS protocol stack, a large number of signaling codec functions need to be implemented. Traditionally, these codec libraries are usually manually written. With the evolution of protocol versions and the addition of new functions, manually developing and maintaining these libraries faces many challenges: huge workload, easy introduction of human errors, difficulty in synchronizing modifications when the protocol is updated, and inconsistent code quality due to different developer styles. SUMMARY

[0003] 1. Technical Solution

[0004] The present application proposes an automated solution that separates protocol specifications from code implementation by defining a set of YAML syntaxes to describe NAS signaling. Developers only need to focus on the accuracy of the YAML file, and a code generator can automatically complete the tedious coding work. The core of this solution is a code generator that parses YAML files and generates signaling codec libraries in multiple target programming languages (such as C++, Go, Python) using predefined templates.

[0005] 2. Innovation Points

[0006] • Protocol-as-Code: Abstract complex 3GPP protocol specifications into structured and highly readable YAML data files, making protocol definition, modification, and version management simple and intuitive. • Template-driven multi-language generation: Use template engines (such as Jinja2) to flexibly generate customized code for different programming languages and project frameworks, with high scalability.

[0007] • Automation and consistency: The entire process is automated, eliminating human errors introduced by manual coding and ensuring consistency in NAS signaling processing logic across different modules and projects.

[0008] 3. Technical Effects

[0009] • Improved efficiency: Signaling development work that takes days or even weeks is reduced to a few minutes, greatly accelerating product development and iteration speed.

[0010] • Reduced cost: Significantly reduces the human effort in protocol development and maintenance, especially when protocol versions are frequently updated, the maintenance cost is greatly reduced.

[0011] • Improved quality: The generated code style is uniform, the logic is consistent, and it is easy to verify by automated testing, thereby improving the robustness and reliability of the code base. BRIEF DESCRIPTION OF DRAWINGS

[0012] Figure 1 is the architecture diagram of the system described in the present application, showing the process from the YAML file to the finally generated library.

[0013] Figure 2 is a detailed flowchart of the method described in the present application, describing each processing step. DETAILED DESCRIPTION

[0014] The present application will be described in detail below in conjunction with the drawings and specific embodiments.

[0015] Referring to Figure 1 , the system includes three core parts: YAML description file, code generation engine and code template.

[0016] 1. YAML description file: defines a clear and readable format to describe NAS signaling. For example, a registration request (RegistrationRequest) message can be described as follows:

[0017]

[0018]

[0019] 2. Code generation engine: the engine uses a YAML parsing library (such as `pyyaml` for Python) to read the above file. Then, it will traverse the file content, extract the name, ID and all information element (IE) attributes of each signaling. According to these information, it will load the corresponding code template.

[0020] 3. Code template: created using a template engine (such as Jinja2). The template defines the skeleton of the code and uses placeholders to fill in the specific information extracted from the YAML file.

[0021] Referring to Figure 2 , the method flow of the present application is as follows:

[0022] Step 1: Protocol experts write or update YAML files describing NAS signaling according to 3GPP TS 24.501 and other specifications.

[0023] ​Step 2: The developer runs the code generator script and specifies the input YAML file path and output directory. Step 3: The generator parses the YAML and generates source code files for all signaling in combination with code templates.

[0024] Step 4: The generated code is integrated into the communication protocol stack project and built into the final library file through compilation.

[0025] Application scenarios

[0026] The present application can be widely applied to the following scenarios:

[0027] • 5G / 6G core network device development: rapid development and prototype verification of network functions such as AMF, SMF, etc. • Terminal and chipset development: generating efficient NAS protocol stacks for devices such as mobile phones and Internet of Things modules. • Protocol consistency testing tools: automatically generating test cases and simulation models for verifying whether devices conform to 3GPP standards.

[0028]

[0029] • Education and research: providing researchers and students with an easy-to-understand and modify protocol implementation platform.

[0030] Conclusion

[0031] The present application provides a method and system for automatically generating 3GPP NAS protocol signaling encoding and decoding libraries based on YAML description files. By decoupling protocol specifications from code implementation and utilizing automated code generation technology, the present application effectively solves the efficiency, quality, and maintenance difficulties in traditional NAS library development. This method has high flexibility and scalability, and can adapt to the rapid evolution of future communication protocols, having important application value in the field of wireless communication.​

Claims

1. A method for automatically generating a 3GPP NAS protocol signaling codec library based on a YAML description file, characterized in that, Includes the following steps: ●Step S1: Obtain a YAML file describing the 3GPP NAS protocol signaling, wherein the YAML file includes at least the message structure, field types, encoding rules and message direction; ●Step S2: Parse the YAML file, extract the definitions of signaling messages and information elements (IEs), and perform syntax compliance verification; ●Step S3: Based on the predefined code template, combined with the parsed signaling messages and IE properties, generate the encoding and decoding code for the target programming language; ●Step S4: Output the generated code file to form a complete NAS protocol signaling codec library.

2. The method according to claim 1, characterized in that, The structure of the YAML file includes: ● The name, unique identifier (ID), and transmission direction of the signaling message; ● The name, type, length, and whether each information element (IE) is required; ● Logical relationships between signaling messages.

3. The method according to claim 1, characterized in that, The code template in step S3 supports multiple programming languages, including C, C++, Python, or Go, and uses a template engine to dynamically generate code.

4. The method according to claim 1, characterized in that, The method further includes: Perform static analysis or automated testing on the generated code to ensure it complies with 3GPP protocol specifications.

5. A system for automatically generating 3GPP NAS protocol signaling codec libraries based on YAML description files, characterized in that, include: ● YAML parsing module, used to read and parse YAML files describing NAS signaling; ● The syntax checking module is used to verify the compliance of YAML files and ensure that they conform to predefined syntax rules; ● Code generation engine, used to generate encoding and decoding code for the target language based on the parsing results and code templates; ● Output module, used to organize the generated code files into an integrable codec library.

6. The system according to claim 5, characterized in that, The code generation engine uses a template engine (such as Jinja2) to achieve dynamic code generation and supports custom templates to adapt to different programming languages ​​or project requirements.

7. The system according to claim 5, characterized in that, The system also includes: The automated testing module is used to perform functional verification on the generated code to ensure that it correctly implements the encoding and decoding logic of 3GPP NAS protocol signaling.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed, it implements the method as described in any one of claims 1-4.

9. An electronic device comprising a processor and a memory, characterized in that, The memory stores executable instructions, and the processor executes the instructions to implement the method as described in any one of claims 1-4.