A method for managing custom parameters based on a serial screen
By using a custom parameter management method, the serial port screen parameter management system achieves dynamic management and security control, solving problems such as parameter fixation, missing verification, and inefficient retrieval, thereby improving system stability and operational efficiency and reducing maintenance costs.
Patent Information
- Application Number
- CN202610449003.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-04-07
- Publication Date
- 2026-07-03
Smart Images

Figure CN122331853A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of serial port screen parameter configuration technology, and more specifically, to a method for managing custom parameters based on a serial port screen. Background Technology
[0002] Serial port displays are widely used human-machine interface devices in industrial control, smart home appliances, embedded terminals, and other fields. Their parameter configuration function directly determines the device's operational stability, configuration flexibility, and maintenance convenience. Traditional serial port display parameter management solutions generally adopt an implementation method that binds parameters to hardware registers. The number, type, and range of parameters are fixed during the firmware compilation stage. Subsequent adjustments require recompiling and flashing the firmware, resulting in long configuration cycles, poor scalability, and difficulty in adapting to the differentiated needs of multiple scenarios and multiple device models.
[0003] In existing technologies, while some serial port displays support basic parameter modification, they lack a systematic validity verification mechanism. When users input invalid values, duplicate names, or incorrectly formatted data, it can easily lead to parameter parsing errors, computational overflows, and device logic malfunctions, potentially causing system crashes. Furthermore, traditional solutions lack automatic backup and recovery mechanisms; parameters cannot be quickly rolled back after accidental modification or power outages, significantly increasing maintenance costs. Regarding parameter retrieval, existing technologies mostly employ a full-scale traversal approach, where retrieval efficiency decreases linearly with the number of parameters, failing to meet the need for rapid location. In terms of data interaction, parameter import and export lack a unified standardized format, resulting in poor compatibility between different devices and versions. Cross-device configuration reuse requires manual adaptation, making operations cumbersome. Moreover, traditional serial port display parameter configuration heavily relies on host computer software; local touch operations only support simple numerical modifications and cannot achieve full-process functions such as CRUD operations, batch import / export, and computational constraints, limiting usage scenarios and deployment flexibility.
[0004] In summary, existing serial port screen parameter management technologies suffer from numerous shortcomings, such as parameter fixation, lack of verification, absence of backup mechanisms, inefficient retrieval, inconsistent formats, and weak local operation capabilities, making it difficult to meet the demands of modern embedded devices for highly stable, flexible, and efficient parameter configuration. Summary of the Invention
[0005] In view of this, the purpose of this application is to provide a custom parameter management method based on serial port screen, which can realize dynamic management of custom parameters of serial port screen, multi-level security verification, automatic backup and recovery, indexed fast retrieval and standardized import and export, get rid of the dependence on host computer and underlying firmware, significantly improve the flexibility of parameter management, system stability and operation efficiency, and reduce operation and maintenance costs.
[0006] In a first aspect, embodiments of this application provide a custom parameter management method based on a serial port screen. This method is implemented collaboratively by a custom parameter operation interface, a parameter operation Lua logic processing module, a verification and backup module, a parameter storage module, and a retrieval module of the serial port screen system. The method includes the following steps: After the serial port screen system starts up, the parameter operation Lua logic processing module creates a backup file storage directory and checks whether the custom parameter file exists. If it exists, the parameter file is loaded into the dynamic parameter pool through the storage parameter module. If it does not exist, the parameter operation Lua logic processing module creates a default parameter pool and completes the initial save. At the same time, it builds a parameter retrieval index for the retrieval module based on the dynamic parameter pool. Based on user interaction, parameter operation commands are triggered through a custom parameter operation interface, and all parameter operation commands are transmitted in real time to the parameter operation Lua logic processing module for command type identification; the command types include parameter addition, parameter deletion, parameter modification, parameter calculation, parameter retrieval, external storage import, and external storage export. For parameter addition, deletion, modification, calculation, and import operations from external storage, the validation and backup module verifies the validity of parameters. Once the validation is successful, the parameter operation Lua logic processing module issues an execution signal. For parameter retrieval and export operations from external storage, an execution signal is issued directly. The system executes operations according to the corresponding functional modules based on the execution signal, and feeds back the execution results of all operations to the user through a custom parameter operation interface.
[0007] In some embodiments, after the serial port screen system starts, the parameter operation Lua logic processing module creates a backup file storage directory by sequentially calling the directory creation function `create_dir`, and calls the file detection function `storage_exist` to determine whether the custom parameter file exists. If it exists, the parameter file is loaded into the dynamic parameter pool by the parameter pool loading function `load_Customparam_pool` of the storage parameter module. If it does not exist, a default parameter pool is created by the default parameter pool creation function `create_default_Customparam_pool` of the parameter operation Lua logic processing module, and then the storage parameter module completes the initial saving. At the same time, the parameter operation Lua logic processing module calls the search index building function `build_search_index` based on the dynamic parameter pool to build a parameter search index for the search module.
[0008] In some embodiments, the step of triggering parameter operation commands through a custom parameter operation interface based on user interaction, and transmitting all parameter operation commands to the parameter operation Lua logic processing module in real time for command type identification, includes the following steps: Based on the user's manual input of parameter information or clicking of function buttons in the custom parameter operation interface, the corresponding parameter operation command is triggered and sent to the parameter operation Lua logic processing module. The parameter operation Lua logic processing module parses the received parameter operation instructions, identifies the instruction type, and passes it to the corresponding functional module.
[0009] In some embodiments, the verification and backup module performs multi-dimensional legality verification through parameter verification functions, including file format verification and parameter attribute verification. The file format verification includes verifying whether the imported data is in a valid JSON format and conforms to the preset name-attribute key-value pair structure for external storage import operations; The parameter attribute verification includes field integrity verification, data type verification, numerical logic verification, and uniqueness verification, which are performed in a fixed order. When all checks pass, the parameter operation Lua logic processing module issues an execution signal.
[0010] In some embodiments, the field integrity check is used to determine whether the parameter contains the core fields of name, value, upper limit value, and lower limit value. If any core field is missing, the check fails. The data type validation parameter name is a string type, and the parameter value, upper limit value, and lower limit value are numeric types. The operation type of the operation parameter is numeric and takes values from 1 to 4, corresponding to addition, subtraction, multiplication, and division, respectively. The numerical logic verification limits the upper limit of the parameter to be greater than or equal to the lower limit, the parameter value to be within the upper and lower limit range, and the parameter value to be non-zero in the division operation scenario; The uniqueness check is based on the parameter retrieval index of the retrieval module to match and determine whether the name of the parameter to be added or imported is unique in the dynamic parameter pool.
[0011] In some embodiments, the step of scheduling the corresponding functional module to perform operations according to the execution signal includes the following steps: When performing parameter addition, deletion, or modification operations, the parameter operation Lua logic processing module updates the dynamic parameter pool, the verification and backup module automatically generates parameter backup files, the parameter storage module completes the update and persistent storage of the dynamic parameter pool, and the parameter operation Lua logic processing module synchronously updates the parameter retrieval index for the retrieval module. When performing parameter operation, the retrieval module locates the target parameter through the retrieval index, the parameter operation Lua logic processing module executes the operation logic and follows the upper and lower limit constraints of the parameter, the operation result is output by the custom parameter operation interface, and the parameter storage module persists the parameter pool after completing the operation. When performing parameter retrieval operations, the retrieval module performs precise or fuzzy retrieval based on the Lua string matching algorithm through the parameter retrieval function, and the retrieval results are presented by the custom parameter operation interface. When performing external storage import and export operations, the storage parameter module completes the parsing, generation, and external storage reading and writing of JSON format data through the data import function and data export function, respectively. The import operation synchronously triggers the parameter pool backup function of the verification and backup module to perform the backup action. The parameter operation Lua logic processing module completes the local dynamic parameter pool update and the index synchronization of the retrieval module. After all operations are completed, the storage parameter module completes the persistent storage of the dynamic parameter pool through the data saving function and the parameter pool persistence function.
[0012] In some embodiments, the parameter backup file of the verification and backup module adopts an independent file read / write mechanism; the parameter retrieval index of the retrieval module is kept synchronized with the dynamic parameter pool in real time, and the parameter retrieval function is search_params, which performs preprocessing such as removing spaces and lowercase on the search keywords, and then performs precise retrieval or fuzzy retrieval. The retrieval results are output after being sorted in reverse order of parameter update time.
[0013] Secondly, embodiments of this application provide a serial port screen system, including a custom parameter operation interface, a parameter operation Lua logic processing module, a verification and backup module, a parameter storage module, and a retrieval module, used to collaboratively implement the steps of the custom parameter management method based on the serial port screen as described in any of the first aspects.
[0014] Thirdly, an electronic device provided in this application includes a processor, a memory, and a bus. The memory stores machine-readable instructions executable by the processor. When the electronic device is running, the processor communicates with the memory via the bus. When the machine-readable instructions are executed by the processor, the steps of the custom parameter management method based on a serial port screen as described in any of the first aspects are executed.
[0015] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the steps of the custom parameter management method based on a serial port screen as described in any of the first aspects.
[0016] The custom parameter management method based on a serial port screen described in this application constructs a dynamic parameter pool and retrieval index through system initialization, identifies and distinguishes operation types through instruction recognition, performs legality verification on parameter change operations and outputs execution signals, and finally the scheduling module completes the corresponding operation and feeds back the results. This realizes dynamic management and security control of serial port screen parameters, effectively improves parameter configuration flexibility, system operation stability and operation efficiency, and eliminates dependence on underlying firmware and host computer, simplifying the use and maintenance process. Attached Figure Description
[0017] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0018] Figure 1 A flowchart of the custom parameter management method based on a serial port screen according to an embodiment of this application is shown; Figure 2 This document illustrates a flowchart illustrating how the verification and backup module performs multi-dimensional legality verification through a parameter verification function, as described in an embodiment of this application. Figure 3 A structural block diagram of the electronic device described in an embodiment of this application is shown. Detailed Implementation
[0019] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. It should be understood that the accompanying drawings in this application are for illustrative and descriptive purposes only and are not intended to limit the scope of protection of this application. Furthermore, it should be understood that the schematic drawings are not drawn to scale. The flowcharts used in this application illustrate operations implemented according to some embodiments of this application. It should be understood that the operations in the flowcharts may not be implemented in sequence, and steps without logical contextual relationships may be reversed or implemented simultaneously. In addition, those skilled in the art, guided by the content of this application, may add one or more other operations to the flowcharts, or remove one or more operations from the flowcharts.
[0020] Furthermore, the described embodiments are merely some, not all, of the embodiments of this application. The components of the embodiments of this application described and illustrated herein can typically be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely to illustrate selected embodiments of the application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.
[0021] It should be noted that the term "comprising" will be used in the embodiments of this application to indicate the presence of the features declared thereafter, but does not exclude the addition of other features.
[0022] In view of the technical problems raised in the background, this application provides a custom parameter management method based on serial port screen, which can realize dynamic management and security control of serial port screen parameters, effectively improve the flexibility of parameter configuration, system operation stability and operation efficiency, and at the same time get rid of the dependence on underlying firmware and host computer.
[0023] See the instruction manual appendix Figure 1 This application provides a custom parameter management method based on a serial port screen. The method is implemented collaboratively by a custom parameter operation interface, a parameter operation Lua logic processing module, a verification and backup module, a parameter storage module, and a retrieval module of the serial port screen system. The method includes the following steps: S1. After the serial port screen system starts, the parameter operation Lua logic processing module creates a backup file storage directory and checks whether the custom parameter file exists. If it exists, the parameter file is loaded into the dynamic parameter pool through the storage parameter module. If it does not exist, the parameter operation Lua logic processing module creates a default parameter pool and completes the initial save. At the same time, it builds a parameter retrieval index for the retrieval module based on the dynamic parameter pool. S2. Based on user interaction, parameter operation commands are triggered through a custom parameter operation interface, and all parameter operation commands are transmitted in real time to the parameter operation Lua logic processing module for command type identification; among them, command types include parameter addition, parameter deletion, parameter modification, parameter calculation, parameter retrieval, external storage import, and external storage export. S3. For parameter addition, deletion, modification, calculation, and import operations from external storage, the validation and backup module performs parameter validity checks. Once the validation is successful, the parameter operation Lua logic processing module issues an execution signal. For parameter retrieval and export operations from external storage, an execution signal is issued directly. S4. Perform operations according to the corresponding functional modules based on the execution signal, and feed back the execution results of all operations to the user through the custom parameter operation interface.
[0024] Step S1 mainly involves system initialization. This includes establishing the storage environment (backup directory) required for system operation; constructing a dynamic parameter pool to decouple parameters from hardware registers; pre-generating a search index to lay the foundation for subsequent fast retrieval; and achieving a stable and ready state after the system is powered on.
[0025] Specifically, after the serial port screen system powers on, it automatically enters the initialization process, with the parameter operation Lua logic processing module acting as the core scheduling unit to perform the operations. First, the parameter operation Lua logic processing module calls the directory creation function create_dir to create an independent backup file storage directory in the internal storage area of the serial port screen. This directory is partitioned and isolated from system files and parameter files to avoid read / write anomalies caused by mixed data storage.
[0026] After the directory is created, the parameter operation Lua logic processing module calls the file detection function storage_exist to determine the existence of custom parameter files under the preset storage path. The determination is based on the matching of file identifier, format and storage address.
[0027] If a custom parameter file exists, the parameter storage module calls the parameter pool loading function load_Customparam_pool to parse the file data and load it into the dynamic parameter pool in memory. The dynamic parameter pool uses a hash table structure for storage, with the parameter name as a unique identifier, which facilitates fast reading, writing and location.
[0028] If the custom parameter file does not exist, the parameter operation Lua logic processing module calls the default parameter pool creation function create_default_Customparam_pool to generate a default dynamic parameter pool containing basic parameters. The parameter types, values, and ranges all meet the minimum requirements for system operation. Subsequently, the parameter storage module writes the default parameter pool to the storage area to complete the first persistent saving and ensure that the parameters are not lost after the system is powered off.
[0029] After the dynamic parameter pool is built, the parameter operation Lua logic processing module calls the search index building function build_search_index based on the parameter pool data to generate a parameter search index for the search module. The index uses the parameter name as the key and maps the storage address of the parameter in the dynamic parameter pool to achieve fast location.
[0030] After the initialization process is completed, the system enters standby mode, waiting for user operation commands to trigger. All initialization operations are completed at the software level, without modifying the underlying firmware of the serial port screen, and without affecting the original hardware functions and operating logic.
[0031] Step S2 mainly enables the interaction between the user and the system. Through the custom parameter operation interface, parameter operation commands including adding, deleting, modifying, calculating, retrieving, importing, and exporting are triggered. The commands are transmitted to the parameter operation Lua logic processing module in real time, which parses and identifies the command type, distinguishes between data change operations and data query operations, and provides a basis for subsequent differentiated processing.
[0032] Specifically, in system standby mode, users can initiate interactive operations through a custom parameter operation interface. This interface includes touch-sensitive units such as parameter input boxes, function buttons, and selection controls. Users can trigger corresponding parameter operation commands by manually inputting parameter information or clicking function buttons. Command types include parameter addition, deletion, modification, calculation, retrieval, external storage import, and external storage export, covering the entire lifecycle management needs of parameters. The custom parameter operation interface transmits all operation commands to the parameter operation Lua logic processing module in real time. The transmission process uses the internal data channel of the serial port screen, ensuring zero delay and zero data loss.
[0033] After receiving the instruction, the parameter operation Lua logic processing module parses the instruction identifier and the data it carries, identifies the specific operation type, classifies the operation type into data change type and data query type, and distributes the instruction to the corresponding functional module, laying the foundation for subsequent verification and execution.
[0034] Step S3 mainly ensures the compliance and security of parameter operations. For data change operations, the verification and backup module is triggered to verify the legality of parameters. After the verification is passed, the parameter operation Lua logic processing module issues an execution signal. For data query operations, an execution signal is issued directly. By differentiating the processing, the system security and execution efficiency are balanced, and a unified access permission is provided for subsequent operation execution.
[0035] Specifically, for five types of data change operations—parameter addition, deletion, modification, calculation, and import from external storage—the verification and backup module is triggered to perform multi-dimensional legality checks. For two types of data query operations—parameter retrieval and export from external storage—execution signals are issued directly, skipping the verification process and improving operational efficiency. See the attached description. Figure 2 The verification and backup module performs multi-dimensional legality verification through the parameter verification function validate_param, including file format verification and parameter attribute verification. S301. The file format verification includes verifying whether the imported data is a valid JSON format and conforms to the preset name-attribute key-value pair structure for external storage import operations. S302, The parameter attribute verification includes field integrity verification, data type verification, numerical logic verification, and uniqueness verification, which are performed in a fixed order. S303. When all checks pass, the parameter operation Lua logic processing module issues an execution signal.
[0036] In step S301, the file format verification only applies to external storage import operations. It verifies whether the imported data is in a valid JSON format and conforms to the preset name-attribute key-value pair structure, excluding invalid data with incorrect format or abnormal structure to avoid parsing failure.
[0037] In step S302, parameter attribute verification is performed sequentially in a fixed order, including field integrity verification, data type verification, numerical logic verification, and uniqueness verification: Field integrity verification is used to determine whether the parameter contains the core fields of name, value, upper limit value, and lower limit value. If any core field is missing, the verification fails, ensuring the parameter structure is complete and meets the requirements of subsequent calculations and storage; Data type verification limits the parameter name to string type, and the parameter value, upper limit value, and lower limit value to numeric type. The operation type of operation-type parameters is numeric type and takes values from 1 to 4, corresponding to addition, subtraction, multiplication, and division, respectively, to prevent script execution exceptions caused by type mismatch; Numerical logic verification limits the parameter upper limit value to be greater than or equal to the lower limit value, and the parameter value to be within the upper and lower limit range. In the case of division operation, it is determined that the parameter value is not 0, avoiding system failures caused by numerical logic errors and division by zero exceptions; Uniqueness verification is based on the parameter retrieval index of the retrieval module to match whether the name of the parameter to be added or imported is unique in the dynamic parameter pool, preventing parameter location confusion caused by duplicate names.
[0038] In step S303, after all the verification steps in steps S301 and S302 have passed, the verification and backup module sends a verification pass signal to the parameter operation Lua logic processing module, which then issues an execution signal to start the subsequent operation execution process.
[0039] Step S4 mainly involves implementing parameter management in practice. Based on the execution signal, each functional module performs parameter addition, deletion, modification, query, calculation, retrieval, import and export operations according to the type. The dynamic parameter pool, retrieval index and backup files are updated synchronously. Finally, all operation results are fed back to the user through a custom parameter operation interface to achieve operation closure, ensure parameter data is implemented and status is visualized.
[0040] Specifically, the parameter operation Lua logic processing module schedules the corresponding functional modules to perform operations according to the execution signal. All operations follow modular collaborative logic, with clear division of labor and no interference between them.
[0041] When performing parameter addition, deletion, and modification operations, the parameter operation Lua logic processing module updates the dynamic parameter pool in memory, deleting invalid parameters, adding compliant parameters, and modifying parameter values or attributes; the verification and backup module automatically generates parameter backup files, which are stored in a separate directory; the parameter storage module completes the updating and persistent storage of the dynamic parameter pool to ensure that data is not lost when power is off; at the same time, the parameter operation Lua logic processing module synchronously updates the parameter retrieval index for the retrieval module to ensure the consistency between the index and the parameter pool data.
[0042] When performing parameter calculation operations, the retrieval module quickly locates the target parameter through the retrieval index without the need for a full traversal; the parameter operation Lua logic processing module executes the calculation logic, and the calculation process strictly follows the upper and lower limit constraints of the parameters. If the parameters exceed the range, they are corrected according to the boundary values; the calculation results are output and displayed by the custom parameter operation interface, and the parameter pool is persistently stored after the parameter module completes the calculation.
[0043] When performing parameter retrieval operations, the retrieval module uses the parameter retrieval function search_params to perform precise or fuzzy searches based on the Lua string matching algorithm. The retrieval process is efficient and stable. The retrieval results are presented through a custom parameter operation interface for easy viewing by the user.
[0044] When performing external storage import and export operations, the storage parameter module completes the parsing, generation, and reading / writing of JSON format data and external storage through the data import function import_data and data export function export_data, respectively. The import operation synchronously triggers the parameter pool backup function backup_Customparam_pool of the verification and backup module to perform the backup action. The parameter operation Lua logic processing module completes the local dynamic parameter pool update and the index synchronization of the retrieval module.
[0045] After all operations are completed, the storage parameter module uses the data saving function save_data and the parameter pool persistence function save_Customparam_pool to uniformly complete the persistent storage of the dynamic parameter pool, ensuring that all data changes are saved and avoiding data loss.
[0046] The parameter backup files in the verification and backup module employ an independent file read / write mechanism. The read / write process utilizes a dedicated storage channel, does not consume serial port interaction resources of the serial screen, and does not affect the normal operation of the serial screen program, enabling parallel execution of backup and main business processes. The serial screen system stores the latest N parameter backup versions, where N is a system-preset positive integer that can be adjusted according to storage capacity. The system has the function of restoring the dynamic parameter pool based on backup files, and can quickly roll back to the normal version when parameters are abnormal. The parameter retrieval index of the retrieval module is kept synchronized with the dynamic parameter pool in real time. The index is updated immediately after parameters are added, deleted, or modified, ensuring retrieval accuracy. The parameter retrieval function `search_params` performs preprocessing on search keywords, including removing spaces and lowercase, before performing precise or fuzzy searches. The search results are output in reverse chronological order of parameter update time, improving the readability of the search results.
[0047] Furthermore, after all operations are completed, the parameter operation Lua logic processing module transmits the execution results to the custom parameter operation interface. If the operation is successful, the interface display is refreshed, showing the updated parameters, search results, or a successful export message; if the operation fails, the specific error reason is provided, such as missing fields, incorrect types, out-of-range values, duplicate names, etc., to facilitate user adjustments and corrections. This achieves full automation of the command triggering, parsing, verification, execution, and feedback process, requiring no manual intervention and significantly improving operational convenience and user experience.
[0048] As can be seen, the custom parameter management method based on a serial port screen provided in this application achieves complete decoupling between serial port screen parameters and underlying hardware registers through a modular collaborative architecture and dynamic parameter pool design. It supports real-time addition, deletion, modification, and querying of parameters, computational constraints, and standardized JSON import and export, flexibly adapting to various scenario requirements without firmware modification. Through a multi-level validity verification mechanism, it comprehensively filters illegal data such as format errors, type mismatches, out-of-bounds values, and duplicate names, significantly improving system stability and security. An independent backup mechanism automatically generates backup files before parameter modification, without consuming serial port interaction resources, and supports multi-version rollback, effectively avoiding device failures caused by accidental parameter modification or loss. The retrieval index is synchronized with the parameter pool in real time, and combined with keyword preprocessing, it enables fast, accurate / fuzzy retrieval, greatly improving response efficiency. The entire process is local touch operation, eliminating dependence on a host computer. The overall solution combines flexibility, security, efficiency, and ease of use, significantly reducing configuration and maintenance costs.
[0049] Based on the same inventive concept, this application also provides a serial port screen system, including a custom parameter operation interface, a parameter operation Lua logic processing module, a verification and backup module, a parameter storage module, and a retrieval module, which are used to collaboratively implement the steps of any of the above-described custom parameter management methods based on serial port screens.
[0050] Based on the same concept of the present invention, the specification is attached. Figure 3 As shown in the figure, an embodiment of this application provides the structure of an electronic device 300, which includes: at least one processor 301, at least one network interface 304 or other user interface 303, memory 305, and at least one communication bus 302. The communication bus 302 is used to realize the connection and communication between these components. The electronic device 300 may optionally include a user interface 303, including a display (e.g., touch screen, LCD, CRT, holographic imaging, or projector, etc.), a keyboard, or a clicking device (e.g., mouse, trackball, touchpad, or touch screen, etc.).
[0051] Memory 305 may include read-only memory and random access memory, and provides instructions and data to processor 301. A portion of memory 305 may also include non-volatile random access memory (NVRAM).
[0052] In some implementations, memory 305 stores elements that can protect modules or data structures, or subsets thereof, or extended sets thereof: The 3051 operating system contains various system programs used to implement various basic business functions and handle hardware-based tasks. Application module 3052 contains various applications, such as desktop (launcher), media player (MediaPlayer), browser (Browser), etc., to implement various application services.
[0053] In this embodiment, by calling the program or instructions stored in the memory 305, the processor 301 executes the steps of a custom parameter management method based on a serial port screen, which can realize dynamic management and security control of serial port screen parameters, effectively improve the flexibility of parameter configuration, system operation stability and operation efficiency, and get rid of the dependence on the underlying firmware and host computer.
[0054] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, performs steps such as those in a custom parameter management method based on a serial port screen.
[0055] Specifically, the storage medium can be a general-purpose storage medium, such as a removable disk or hard disk. When the computer program on the storage medium is run, it can execute the aforementioned custom parameter management method based on the serial port screen.
[0056] In the embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and there may be other division methods in actual implementation. Furthermore, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Additionally, the coupling or direct coupling or communication connection shown or discussed may be through some communication interface; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0057] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0058] In addition, the functional units in the embodiments provided in this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0059] If a function is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0060] Finally, it should be noted that the above embodiments are merely specific implementations of this application, used to illustrate the technical solutions of this application, and not to limit them. The protection scope of this application is not limited thereto. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some of the technical features, within the scope of the technology disclosed in this application; and these modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application. All should be covered within the protection scope of this application. Therefore, the protection scope of this application should be determined by the protection scope of the claims.
Claims
1. A method for managing custom parameters based on a serial console, characterized in that, Based on a serial port screen system, a custom parameter operation interface, a parameter operation Lua logic processing module, a verification and backup module, a parameter storage module, and a retrieval module are collaboratively implemented. The method includes the following steps: After the serial port screen system starts up, the parameter operation Lua logic processing module creates a backup file storage directory and checks whether the custom parameter file exists. If it exists, the parameter file is loaded into the dynamic parameter pool through the storage parameter module. If it does not exist, the parameter operation Lua logic processing module creates a default parameter pool and completes the initial save. At the same time, it builds a parameter retrieval index for the retrieval module based on the dynamic parameter pool. Based on user interaction, parameter operation commands are triggered through a custom parameter operation interface, and all parameter operation commands are transmitted in real time to the parameter operation Lua logic processing module for command type identification; the command types include parameter addition, parameter deletion, parameter modification, parameter calculation, parameter retrieval, external storage import, and external storage export. For parameter addition, deletion, modification, calculation, and import operations from external storage, the validation and backup module verifies the validity of parameters. Once the validation is successful, the parameter operation Lua logic processing module issues an execution signal. For parameter retrieval and export operations from external storage, an execution signal is issued directly. The system executes operations according to the corresponding functional modules based on the execution signal, and feeds back the execution results of all operations to the user through a custom parameter operation interface.
2. The method for managing self-defined parameters based on serial console screen according to claim 1, characterized in that, in, After the serial port screen system starts, the parameter operation Lua logic processing module creates a backup file storage directory by calling the directory creation function `create_dir` in sequence, and calls the file detection function `storage_exist` to determine whether the custom parameter file exists. If it exists, the parameter file is loaded into the dynamic parameter pool by the parameter pool loading function `load_Customparam_pool` of the storage parameter module. If it does not exist, a default parameter pool is created by the default parameter pool creation function `create_default_Customparam_pool` of the parameter operation Lua logic processing module, and then the storage parameter module completes the initial save. At the same time, the parameter operation Lua logic processing module calls the search index building function `build_search_index` based on the dynamic parameter pool to build a parameter search index for the search module.
3. The method of claim 2, wherein, The process of triggering parameter operation commands through a custom parameter operation interface based on user interaction, and transmitting all parameter operation commands to the parameter operation Lua logic processing module in real time for command type identification, includes the following steps: Based on the user's manual input of parameter information or clicking of function buttons in the custom parameter operation interface, the corresponding parameter operation command is triggered and sent to the parameter operation Lua logic processing module. The parameter operation Lua logic processing module parses the received parameter operation instructions, identifies the instruction type, and passes it to the corresponding functional module.
4. The method for managing self-defined parameters based on serial console screen according to claim 3, characterized in that, in, The verification and backup module performs multi-dimensional legality verification through parameter verification functions, including file format verification and parameter attribute verification. The file format verification includes verifying whether the imported data is in a valid JSON format and conforms to a preset name-attribute key-value pair structure for external storage import operations. The parameter attribute verification includes field integrity verification, data type verification, numerical logic verification, and uniqueness verification, which are performed in a fixed order. When all checks pass, the parameter operation Lua logic processing module issues an execution signal.
5. The method of claim 4, wherein, The field integrity check is used to determine whether the parameter contains the core fields of name, value, upper limit value, and lower limit value. If any core field is missing, the check will fail. The data type validation parameter name is a string type, and the parameter value, upper limit value, and lower limit value are numeric types. The operation type of the operation parameter is numeric and takes values from 1 to 4, corresponding to addition, subtraction, multiplication, and division, respectively. The numerical logic verification limits the upper limit of the parameter to be greater than or equal to the lower limit, the parameter value to be within the upper and lower limit range, and the parameter value to be non-zero in the division operation scenario; The uniqueness check is based on the parameter retrieval index of the retrieval module to match and determine whether the name of the parameter to be added or imported is unique in the dynamic parameter pool.
6. The method of claim 5, wherein, The step of scheduling the corresponding functional module to perform operations according to the execution signal includes the following steps: When performing parameter addition, deletion, or modification operations, the parameter operation Lua logic processing module updates the dynamic parameter pool, the verification and backup module automatically generates parameter backup files, the parameter storage module completes the update and persistent storage of the dynamic parameter pool, and the parameter operation Lua logic processing module synchronously updates the parameter retrieval index for the retrieval module. When performing parameter operation, the retrieval module locates the target parameter through the retrieval index, the parameter operation Lua logic processing module executes the operation logic and follows the upper and lower limit constraints of the parameter, the operation result is output by the custom parameter operation interface, and the parameter storage module persists the parameter pool after completing the operation. When performing parameter retrieval operations, the retrieval module performs precise or fuzzy retrieval based on the Lua string matching algorithm through the parameter retrieval function, and the retrieval results are presented by the custom parameter operation interface. When performing external storage import and export operations, the storage parameter module completes the parsing, generation, and external storage reading and writing of JSON format data through the data import function and data export function, respectively. The import operation synchronously triggers the parameter pool backup function of the verification and backup module to perform the backup action. The parameter operation Lua logic processing module completes the local dynamic parameter pool update and the index synchronization of the retrieval module. After all operations are completed, the storage parameter module completes the persistent storage of the dynamic parameter pool through the data saving function and the parameter pool persistence function.
7. The method of claim 6, wherein, in, The parameter backup file of the verification and backup module adopts an independent file read / write mechanism; the parameter retrieval index of the retrieval module is kept synchronized with the dynamic parameter pool in real time, and the parameter retrieval function is search_params, which performs preprocessing such as removing spaces and lowercase on the search keywords, and then performs precise retrieval or fuzzy retrieval. The retrieval results are output after being sorted in reverse order of parameter update time.
8. A serial port screen system characterized by It includes a custom parameter operation interface, a parameter operation Lua logic processing module, a verification and backup module, a parameter storage module, and a retrieval module, which are used to collaboratively implement the steps of the custom parameter management method based on a serial port screen as described in any one of claims 1 to 7.
9. An electronic device, characterized in that, include: The device includes a processor, a memory, and a bus. The memory stores machine-readable instructions executable by the processor. When the electronic device is running, the processor communicates with the memory via the bus. When the machine-readable instructions are executed by the processor, they perform the steps of the custom parameter management method based on a serial port screen as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, performs the steps of the custom parameter management method based on a serial port screen as described in any one of claims 1 to 7.