Automatic management and stripping method and system for Lua codes

By adding specific tags to Lua code and utilizing version control platforms and automation tools, the problems of cumbersome operations and poor reusability in Lua code management are solved, achieving efficient code stripping and management, and improving development efficiency and code reusability.

CN121742884APending Publication Date: 2026-03-27FUJIAN TQ DIGITAL
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-20
Publication Date
2026-03-27

AI Technical Summary

Technical Problem

Current technologies lack automated support for Lua code management, resulting in cumbersome operations, low efficiency, poor code reusability, and difficulty in quickly separating and reusing functional modules.

Method used

By adding module tags, description tags, function tags, dependency tags, and end tags to Lua code, and combining version control platforms and automation tools, automated code management and separation can be achieved.

Benefits of technology

It enables automated management and separation of Lua code, improving development efficiency, enhancing code reusability, and reducing redundancy and repetitive work.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121742884A_ABST
    Figure CN121742884A_ABST
Patent Text Reader

Abstract

The invention relates to the field of software development, in particular to a Lua code automatic management and stripping method and system, the system comprises a version control platform, and the method comprises the steps that for a function module, a plurality of function branches are created through the version control platform, each function branch can be independently developed and submitted by using a Lua code, and the Lua code can be independently developed and submitted through the version control platform; performing user-defined marking on the Lua code, and storing the Lua code in a code library; automatically detecting the custom mark, and verifying the state of the custom mark; according to the method, the lua codes with the specific marks are automatically stripped and extracted from the functional branches and are independently stored and managed, the codes can be automatically stripped and managed, the reusability of the codes is high, and the development efficiency is high.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of software development, and in particular to a method and system for automated management and stripping of Lua code. Background Technology

[0002] In current technologies, code management primarily relies on version control platforms (such as SVN and Git) and manual code stripping and merging operations. While some tools offer code tagging and module management features, they have not yet formed a complete, automated Lua code management solution.

[0003] A functional module is a broader concept, typically representing a collection of related functions, which can consist of one or more sets of code. Functional modules often encompass higher-level business logic, involving the collaborative work of multiple codebases. Each functional module may implement specific business requirements, such as user authentication or data processing. In code management, functional modules achieve complete business logic through the combination of code. For example, in game development, different game functional modules (such as characters, scenes, and items) need to be developed and managed independently, and existing technologies cannot quickly extract and reuse functional modules.

[0004] The shortcomings of existing technologies are as follows:

[0005] 1. Manual operation is cumbersome: Developers need to manually mark and extract code, which is prone to errors and inefficient.

[0006] 2. Lack of automation support: Existing tools have limited support for automated code tagging and stripping, making it difficult to effectively manage code in complex projects.

[0007] 3. Poor code reusability: Due to the lack of systematic management, the code reusability is low, which easily leads to code redundancy and duplication. Summary of the Invention

[0008] To overcome the problems of cumbersome management methods, lack of automation support, poor code reusability, and low development efficiency in existing Lua code management solutions, the purpose of this invention is to provide a method and system for automated Lua code management and stripping, which can achieve automatic code stripping and management, strong code reusability, and high development efficiency.

[0009] This invention is implemented using the following scheme:

[0010] A method for automated management and stripping of Lua code, including a version control platform, comprises the following steps:

[0011] Step 1: For a functional module, create several functional branches through the version control platform. Each functional branch can be independently developed and committed using Lua code, and the Lua code can be marked with custom tags. The Lua code is stored in the code repository.

[0012] Step 2: Automated detection of custom tags and verification of their status;

[0013] Step 3: Automatically extract Lua code with specific tags from the function branches, and save and manage it independently.

[0014] Furthermore, the custom tags mentioned in step 1 specifically include module tags, description tags, function tags, dependency tags, and end tags;

[0015] The module marker is added at the beginning of the Lua code corresponding to the functional branch that needs to be stripped;

[0016] Description tags are used to add basic information;

[0017] Function tags are used to add a function tag at the beginning of each specific function or method in a function branch;

[0018] Dependency tags are used to add dependency tags at the appropriate locations if there are dependencies in Lua code or feature branches;

[0019] End markers are used to add end markers at the end of Lua code, clearly defining the boundaries of function branches.

[0020] Furthermore, step 2 is further specified as follows:

[0021] Step 2.1: Scan the entire codebase to find all custom tags;

[0022] Step 2.2: Verify the format and position of the custom tags;

[0023] Step 2.3: Check if the dependencies corresponding to the custom tag exist;

[0024] Step 2.4: Generate a detailed custom tag detection report, listing all discovered custom tags and their status.

[0025] Furthermore, step 3 is further specified as follows:

[0026] Step 3.1: Traverse all Lua code in the codebase and identify and extract custom tags using regular expressions;

[0027] Step 3.2: Extract Lua code based on the location of the custom markers, and save the extracted Lua code to the designated directory;

[0028] Step 3.3: Scan the dependency tags in each functional branch and extract the corresponding Lua code based on the dependency tags;

[0029] Step 3.4: Remove the extracted Lua code from the codebase and commit the extracted Lua code to the version control platform.

[0030] Furthermore, after the extracted Lua code is submitted to the version control platform, it is combined into a new functional module and then verified and tested. The verification and testing are as follows:

[0031] Preload new functional modules, perform automated testing on the extracted Lua code, verify the integrity and correctness of the Lua code, generate reports on the extraction and verification process, and notify developers when problems are found.

[0032] An automated Lua code management and stripping system includes a version control platform, the system comprising: a functional branch module, a custom tag detection module, and a code management module;

[0033] The functional branch module is used to create several functional branches through the version control platform. Each functional branch can be independently developed and committed using Lua code, and the Lua code can be marked with custom tags. The Lua code is stored in the code repository.

[0034] The custom tag detection module is used to automatically detect custom tags and verify their status.

[0035] The code management module is used to automatically extract Lua code with specific tags from functional branches, and save and manage it independently.

[0036] Furthermore, the custom tags specifically include module tags, description tags, function tags, dependency tags, and end tags;

[0037] The module marker is added at the beginning of the Lua code corresponding to the functional branch that needs to be stripped;

[0038] Description tags are used to add basic information;

[0039] Function tags are used to add a function tag at the beginning of each specific function or method in a function branch;

[0040] Dependency tags are used to add dependency tags at the appropriate locations if there are dependencies in Lua code or feature branches;

[0041] End markers are used to add end markers at the end of Lua code, clearly defining the boundaries of function branches.

[0042] Furthermore, the custom marker detection module is specifically as follows:

[0043] Scan the entire codebase to find all custom tags;

[0044] Validate the format and position of custom tags;

[0045] Check if the dependencies corresponding to the custom tag exist;

[0046] Generate a detailed custom tag detection report, listing all discovered custom tags and their status.

[0047] Furthermore, the code management module specifically includes:

[0048] Iterate through all Lua code in the codebase and use regular expressions to identify and extract custom tags;

[0049] Extract Lua code based on the location of the custom markers, and save the extracted Lua code to a predefined directory;

[0050] Scan the dependency tags in each feature branch and extract the corresponding Lua code based on the dependency tags;

[0051] Remove the extracted Lua code from the codebase and commit the changes to the version control platform.

[0052] Furthermore, the code management module specifically works as follows: after the extracted Lua code is submitted to the version control platform, new functional code is synthesized, and then verification and testing are performed. The verification and testing are as follows:

[0053] Preload new feature code, perform automated testing on the extracted Lua code, verify code integrity and functional correctness, generate reports on the extraction and verification process, and notify developers when problems are found.

[0054] The beneficial effects of this invention are as follows:

[0055] This invention provides a method and system for automated management and extraction of Lua code. By adding specific tags to Lua code and combining them with automation tools, the system achieves automatic code extraction and management. Specifically, through custom tagging, scanning, and extraction of code, functional modules can be isolated for easy reuse and maintenance. Simultaneously, by utilizing version control systems (such as SVN and Git), functional branches can be created, achieving efficient code management and version control. Attached Figure Description

[0056] Figure 1 This is a flowchart of the method of the present invention;

[0057] Figure 2 This is a structural block diagram of the system of the present invention. Detailed Implementation

[0058] The invention will now be further described with reference to the accompanying drawings.

[0059] See Figure 1 A method for automated management and stripping of Lua code, the steps of which are as follows:

[0060] The method steps are as follows:

[0061] Step 1: For a functional module, create several functional branches through the version control platform. Each functional branch can be independently developed and committed using Lua code, and the Lua code can be marked with custom tags. The Lua code is stored in the code repository.

[0062] Step 2: Automated detection of custom tags and verification of their status;

[0063] Step 3: Automatically extract Lua code with specific tags from the function branches, and save and manage it independently.

[0064] The present invention will be further described below with reference to a specific embodiment:

[0065] A method for automated management and stripping of Lua code, the method comprising the following steps:

[0066] Step S1: Create a feature branch, develop and commit code.

[0067] Create a new feature branch in a version control platform (such as Git or SVN) for independent feature development. Development must adhere to specific rules and standards, and Lua code must be marked with custom tags.

[0068] The custom tags specifically include module tags, description tags, function tags, dependency tags, and end tags;

[0069] The module marker is added at the beginning of the Lua code corresponding to the functional branch that needs to be stripped;

[0070] Specific examples:

[0071] --@Module:NewFeature

[0072] Description tags are used to add basic information;

[0073] Function tags are used to add a function tag at the beginning of each specific function or method in a function branch;

[0074] Specific examples:

[0075]

[0076] Dependency tags are used to add dependency tags at the appropriate locations if there are dependencies in Lua code or feature branches;

[0077] Specific examples:

[0078] --@DependsOn:UtilityModule

[0079] End markers are used to add end markers at the end of Lua code, clearly defining the boundaries of function branches.

[0080] Specific examples:

[0081] --@EndModule

[0082] Complete example:

[0083]

[0084]

[0085] Step S2: Automated marking and detection.

[0086] Step S21: Scan the entire codebase to find all custom tags; Code example:

[0087]

[0088]

[0089] Step S22: Verify the format and position of the custom tags to ensure they conform to the specifications:

[0090] Code example:

[0091]

[0092] Step S23: Check if the dependencies corresponding to the custom tag exist, i.e., dependency check, check the dependency relationship of the tag, and ensure that all dependencies exist.

[0093] Code example:

[0094]

[0095]

[0096] Step S24: Generate a detailed custom tag detection report, listing all discovered custom tags and their status (valid, invalid, missing, etc.).

[0097] Code example:

[0098]

[0099] Document Name: {marker[3]} | Time: {marker[4]} | Developer: {marker[5]}\n")

[0100] Step S3: Automatic stripping, the process of extracting Lua code with specific tags from feature branches, saving and managing them independently. The following are detailed step instructions:

[0101] Step S31: Traverse all Lua code in the codebase and identify and extract custom tags using regular expressions;

[0102] Code example:

[0103]

[0104]

[0105] Step S32: Extract Lua code based on the location of the custom marker, and save the extracted Lua code to a predefined directory;

[0106] Example code:

[0107]

[0108]

[0109]

[0110] Step S33: Scan the dependency tags in each functional branch and extract the corresponding Lua code based on the dependency tags;

[0111] Example code:

[0112]

[0113] Step S34: Remove the extracted Lua code from the code repository and commit the extracted Lua code to the version control platform.

[0114] Example code:

[0115]

[0116]

[0117] Step S4: After the extracted Lua code is submitted to the version control platform, it is combined into a new functional module and then verified and tested. The verification and testing are as follows:

[0118] Preload new functional modules, perform automated testing on the extracted module code, verify code integrity and functional correctness, generate reports on the extraction and verification process, and notify developers when problems are found.

[0119] Example code:

[0120]

[0121] See Figure 2 An automated Lua code management and stripping system, including a version control platform, the system comprising: a functional branch module, a custom tag detection module, and a code management module;

[0122] The functional branch module is used to create several functional branches through the version control platform. Each functional branch can be independently developed and committed using Lua code, and the Lua code can be marked with custom tags. The Lua code is stored in the code repository.

[0123] The custom tag detection module is used to automatically detect custom tags and verify their status.

[0124] The code management module is used to automatically extract Lua code with specific tags from functional branches, and save and manage it independently.

[0125] In one embodiment of the present invention, the custom tags specifically include module tags, description tags, function tags, dependency tags, and end tags;

[0126] The module marker is added at the beginning of the Lua code corresponding to the functional branch that needs to be stripped;

[0127] Description tags are used to add basic information;

[0128] Function tags are used to add a function tag at the beginning of each specific function or method in a function branch;

[0129] Dependency tags are used to add dependency tags at the appropriate locations if there are dependencies in Lua code or feature branches;

[0130] End markers are used to add end markers at the end of Lua code, clearly defining the boundaries of function branches.

[0131] In one embodiment of the present invention, the custom marker detection module specifically comprises:

[0132] Scan the entire codebase to find all custom tags;

[0133] Validate the format and position of custom tags;

[0134] Check if the dependencies corresponding to the custom tag exist;

[0135] Generate a detailed custom tag detection report, listing all discovered custom tags and their status.

[0136] In one embodiment of the present invention, the code management module specifically comprises:

[0137] Iterate through all Lua code in the codebase and use regular expressions to identify and extract custom tags;

[0138] Extract Lua code based on the location of the custom markers, and save the extracted Lua code to a predefined directory;

[0139] Scan the dependency tags in each feature branch and extract the corresponding Lua code based on the dependency tags;

[0140] Remove the extracted Lua code from the codebase and commit the changes to the version control platform.

[0141] In one embodiment of the present invention, the code management module specifically involves: after the extracted Lua code is submitted to the version control platform, a new functional module is synthesized and then verified and tested, as follows:

[0142] Preload new functional modules, perform automated testing on the extracted module code, verify code integrity and functional correctness, generate reports on the extraction and verification process, and notify developers when problems are found.

[0143] The specific application scenarios of this invention are as follows:

[0144] Game Development: In game development, different game functional modules (such as characters, scenes, items, etc.) need to be developed and managed independently. This technical solution can help development teams quickly isolate and reuse functional modules, reducing redundant development work.

[0145] Automation Scripts: In the development of automation scripts, different tasks and functional modules require frequent updates and optimizations. This technical solution ensures that each functional module is developed and tested independently, improving the reliability and maintainability of the scripts.

[0146] Embedded System Development: In embedded systems, Lua scripts are commonly used to achieve flexible feature expansion and configuration management. This technical solution can help developers effectively manage script code, ensuring system stability and rapid feature iteration.

[0147] The above description is only a preferred embodiment of the present invention. All equivalent changes and modifications made within the scope of the claims of the present invention should be included in the scope of the present invention.

Claims

1. A method for automated management and stripping of Lua code, comprising a version control platform, characterized in that, The method steps are as follows: Step 1: For a functional module, create several functional branches through the version control platform. Each functional branch can be independently developed and committed using Lua code, and the Lua code can be marked with custom tags. The Lua code is stored in the code repository. Step 2: Automated detection of custom tags and verification of their status; Step 3: Automatically extract Lua code with specific tags from the function branches, and save and manage it independently.

2. The method for automated management and stripping of Lua code according to claim 1, characterized in that, The custom tags mentioned in step 1 specifically include module tags, description tags, function tags, dependency tags, and end tags; The module marker is added at the beginning of the Lua code corresponding to the functional branch that needs to be stripped; Description tags are used to add basic information; Function tags are used to add a function tag at the beginning of each specific function or method in a function branch; Dependency tags are used to add dependency tags at the appropriate locations if there are dependencies in Lua code or feature branches; End markers are used to add end markers at the end of Lua code, clearly defining the boundaries of function branches.

3. The method for automated management and stripping of Lua code according to claim 1, characterized in that, Step 2 is further specified as follows: Step 2.1: Scan the entire codebase to find all custom tags; Step 2.2: Verify the format and position of the custom tags; Step 2.3: Check if the dependencies corresponding to the custom tag exist; Step 2.4: Generate a detailed custom tag detection report, listing all discovered custom tags and their status.

4. The method for automated management and stripping of Lua code according to claim 1, characterized in that, Step 3 is further specified as follows: Step 3.1: Traverse all Lua code in the codebase and identify and extract custom tags using regular expressions; Step 3.2: Extract Lua code based on the location of the custom markers, and save the extracted Lua code to the designated directory; Step 3.3: Scan the dependency tags in each functional branch and extract the corresponding Lua code based on the dependency tags; Step 3.4: Remove the extracted Lua code from the codebase and commit the extracted Lua code to the version control platform.

5. The method for automated management and stripping of Lua code according to claim 4, characterized in that, After the extracted Lua code is submitted to the version control platform, it is combined into a new functional module and then verified and tested. The verification and testing are as follows: Preload new functional modules, perform automated testing on the extracted Lua code, verify the integrity and correctness of the Lua code, generate reports on the extraction and verification process, and notify developers when problems are found.

6. A Lua code automation management and stripping system, comprising a version control platform, characterized in that, The system includes: a functional branch module, a custom marker detection module, and a code management module; The functional branch module is used to create several functional branches through the version control platform. Each functional branch can be independently developed and committed using Lua code, and the Lua code can be marked with custom tags. The Lua code is stored in the code repository. The custom tag detection module is used to automatically detect custom tags and verify their status. The code management module is used to automatically extract Lua code with specific tags from functional branches, and save and manage it independently.

7. The Lua code automated management and stripping system according to claim 6, characterized in that, The custom tags specifically include module tags, description tags, function tags, dependency tags, and end tags; The module marker is added at the beginning of the Lua code corresponding to the functional branch that needs to be stripped; Description tags are used to add basic information; Function tags are used to add a function tag at the beginning of each specific function or method in a function branch; Dependency tags are used to add dependency tags at the appropriate locations if there are dependencies in Lua code or feature branches; End markers are used to add end markers at the end of Lua code, clearly defining the boundaries of function branches.

8. The Lua code automated management and stripping system according to claim 6, characterized in that, The custom marker detection module is as follows: Scan the entire codebase to find all custom tags; Validate the format and position of custom tags; Check if the dependencies corresponding to the custom tag exist; Generate a detailed custom tag detection report, listing all discovered custom tags and their status.

9. A Lua code automated management and stripping system according to claim 6, characterized in that, The code management module is as follows: Iterate through all Lua code in the codebase and use regular expressions to identify and extract custom tags; Extract Lua code based on the location of the custom markers, and save the extracted Lua code to a predefined directory; Scan the dependency tags in each feature branch and extract the corresponding Lua code based on the dependency tags; Remove the extracted Lua code from the codebase and commit the changes to the version control platform.

10. A Lua code automated management and stripping system according to claim 9, characterized in that, The code management module works as follows: After the extracted Lua code is submitted to the version control platform, it is combined into new functional code and then verified and tested. The verification and testing are as follows: Preload new feature code, perform automated testing on the extracted Lua code, verify code integrity and functional correctness, generate reports on the extraction and verification process, and notify developers when problems are found.