Table generation method and device, electronic equipment and medium
By generating a table template file containing variable placeholders and a target mapping table file, and using automated scripts to perform variable replacement, the problems of flexibility and high maintenance costs of change control tables are solved, achieving efficient and standardized table generation.
Patent Information
- Application Number
- CN202610211744.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-02-13
- Publication Date
- 2026-06-26
AI Technical Summary
In existing technologies, automated processing solutions for change control tables suffer from poor flexibility, high maintenance costs, and an inability to simultaneously meet the needs of lightweight and batch processing.
By generating table template files containing variable placeholders and target mapping table files, and using automated scripts to perform variable substitution, the generation of table template files can be automated, standardized, and batched.
It improves the efficiency and standardization of operation and maintenance documentation generation, separates template content from data input, and balances the system's flexibility and low-cost requirements.
Smart Images

Figure CN122287577A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, specifically to a table generation method, apparatus, electronic device, and medium. Background Technology
[0002] In data center operations and maintenance management, change control sheets are crucial documents for standardizing processes and preserving operational records. They need to meticulously record the change background, implementation steps, risk assessments, and rollback plans. With increasingly frequent change operations, traditional manual filling methods suffer from low efficiency, inconsistent formatting, and a large amount of repetitive work, making it difficult to meet the needs of efficient and standardized operations and maintenance.
[0003] Currently, there are two main technical solutions for automating the processing of change control tables: one is to use the native functions of office software such as Excel (e.g., built-in functions, macros, etc.) to achieve simple data filling and processing in the table; the other is to use custom-developed professional integrated management tools to automate the processing of the table.
[0004] However, the relevant technologies have obvious shortcomings: office software solutions have limited functionality, are difficult to maintain and have compatibility issues, and cannot cope with frequent spreadsheet adjustments and batch processing needs; customized tools, on the other hand, require large investments, have long development cycles, and lack flexibility, making it difficult to adapt to lightweight or rapidly changing business needs. Summary of the Invention
[0005] This application provides a table generation method, apparatus, electronic device, and medium to solve the problems of poor flexibility, high maintenance costs, and inability to meet the needs of lightweight and batch processing in related technologies for automated table generation schemes.
[0006] In a first aspect, embodiments of this application provide a table generation method, which includes: modifying information in an information table to be modified based on preset modification rules to obtain a table template file containing at least one variable placeholder, wherein the variable placeholder is used to identify dynamic parameter information to be filled in the table template file; generating a target mapping table file based on at least one variable placeholder and at least one set of actual variable information, wherein the target mapping table file is used to establish a variable mapping relationship between at least one variable placeholder and at least one actual variable information in each set of actual variable information; and performing at least one variable substitution operation on the table template file based on at least one set of variable mapping relationships in the target mapping table file to obtain at least one target information table.
[0007] In some embodiments, based on preset change rules, modifying the information table to be modified to obtain a table template file containing at least one variable placeholder includes: based on preset change rules, identifying static information and dynamic information in the information table to be modified, where static information represents fixed operation information and dynamic information represents parameter information that changes with specific application scenarios; and changing the dynamic information into variable placeholders in a preset format to obtain a table template file containing static information and variable placeholders.
[0008] In some embodiments, generating a target mapping table file based on at least one variable placeholder and at least one set of actual variable information includes: creating a mapping table file to be filled based on at least one variable placeholder, the mapping table file to be filled including at least one variable placeholder and at least one field to be filled corresponding to at least one variable placeholder; obtaining at least one set of actual variable information based on user filling operations on at least one field to be filled; and generating the target mapping table file based on the variable mapping relationship between at least one variable placeholder and at least one set of actual variable information.
[0009] In some embodiments, performing at least one variable substitution operation on a table template file based on at least one set of variable mapping relationships in a target mapping table file to obtain at least one target information table includes: parsing the table template file based on a preset parsing tool to identify at least one variable placeholder in the table template file; and replacing at least one variable placeholder in the table template file with at least one set of actual variable information based on at least one set of variable mapping relationships in the target mapping table file to obtain at least one target information table.
[0010] In some embodiments, replacing at least one variable placeholder in a table template file with at least one set of actual variable information based on at least one set of variable mapping relationships in a target mapping table file to obtain at least one target information table includes: performing a validity check on at least one set of actual variable information in the target mapping table file based on a preset verification rule to obtain a verification result; if the verification result is a pass, replacing at least one variable placeholder in the table template file with at least one set of actual variable information based on at least one set of variable mapping relationships in the target mapping table file to obtain at least one target information table.
[0011] In some embodiments, based on at least one set of variable mapping relationships in the target mapping table file, at least one variable placeholder in the table template file is replaced with at least one set of actual variable information. Then, the method includes: setting the actual variable information after variable replacement with rich text format based on the semantic category and preset format rules corresponding to at least one variable placeholder.
[0012] Secondly, embodiments of this application provide a table generation apparatus, the apparatus comprising:
[0013] The change unit is used to change the information in the information table to be changed based on the preset change rules, and obtain a table template file containing at least one variable placeholder. The variable placeholder is used to identify the dynamic parameter information to be filled in the table template file. The generation unit is used to generate a target mapping table file based on at least one variable placeholder and at least one set of actual variable information. The target mapping table file is used to establish a variable mapping relationship between at least one variable placeholder and at least one actual variable in each set of actual variable information. The variable substitution unit is used to perform at least one variable substitution operation on the table template file based on at least one set of variable mapping relationships in the target mapping table file, so as to obtain at least one target information table.
[0014] Thirdly, embodiments of this application provide an electronic device, including: a processor and a memory for storing a computer program capable of running on the processor, wherein, when the processor runs the computer program, it performs the method described in any embodiment of the first aspect.
[0015] Fourthly, embodiments of this application provide a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause a computer to perform the methods described in any embodiment of the first aspect.
[0016] Fifthly, embodiments of this application provide a computer program product including a computer program that, when executed by a processor, performs the method described in any embodiment of the first aspect.
[0017] This application provides a table generation method that, based on preset change rules, modifies an information table to be changed, resulting in a table template file containing at least one variable placeholder. The variable placeholder identifies the dynamic parameter information to be filled in the table template file. Based on the at least one variable placeholder and at least one set of actual variable information, a target mapping table file is generated. This target mapping table file establishes a variable mapping relationship between the at least one variable placeholder and at least one actual variable in each set of actual variable information. Based on the at least one set of variable mapping relationships in the target mapping table file, at least one variable substitution operation is performed on the table template file to obtain at least one target information table. This method automates, standardizes, and batches the generation of information tables, simplifying the complex table document creation process into a lightweight operation of parameter configuration and template calling. It significantly improves the generation efficiency and standardization of operation and maintenance documents, while separating template content, data input, and generation logic. This approach balances the system's flexibility, maintainability, and low-cost requirements, effectively addressing the shortcomings of related technical solutions in terms of flexibility, maintenance cost, and processing efficiency.
[0018] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit this application. Attached Figure Description
[0019] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are merely embodiments of this application. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort, and this application can be applied to other similar scenarios based on the provided drawings.
[0020] Figure 1 A flowchart illustrating the first table generation method provided in this application embodiment; Figure 2 A flowchart illustrating the second table generation method provided in this application embodiment; Figure 3 A flowchart of the third table generation method provided in the embodiments of this application; Figure 4 A flowchart illustrating the fourth table generation method provided in this application embodiment; Figure 5 A schematic diagram of the system architecture of a specific table generation method provided in this application embodiment; Figure 6 A flowchart illustrating a specific table generation method provided in this application embodiment; Figure 7 This is a schematic diagram of the structure of a table generation device provided in an embodiment of this application; Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0021] The present application will now be described in further detail with reference to the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and not intended to limit it. The described embodiments are only a part of the embodiments of this application, and not all of them. 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.
[0022] It should be noted that the terms "system," "device," "unit," and / or "module" used in this application are methods of distinguishing different components, elements, parts, sections, or assemblies at different levels. However, if other terms can achieve the same purpose, they can be replaced by other expressions.
[0023] Hereinafter, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first," "second," or "third" may explicitly or implicitly include one or more of that feature.
[0024] In data center operations and maintenance management, change management is a crucial aspect of ensuring the stable operation of business systems. Change control sheets, as a core tool for standardizing change processes and retaining operational records, need to meticulously document the change background, implementation steps, risk assessments, and rollback plans. With the increasing frequency of data center changes, the traditional method of manually filling out and modifying change control sheets suffers from repetitive workloads, low efficiency, and inconsistent formats, making it unsuitable for efficient and standardized operations and maintenance management.
[0025] Currently, there are two main technical solutions for automating the processing of change control tables: one is to rely on the native functions of office software such as Excel to achieve simple data filling and processing of tables through built-in functions and macros; the other is to use custom-developed professional integrated management tools to complete the automated generation and centralized management of tables.
[0026] However, the relevant technologies have obvious shortcomings: the native solutions of office software have limited functionality, are difficult to maintain and have compatibility issues, and cannot cope with frequent spreadsheet adjustments and batch processing needs; customized professional tools require large upfront investments, have long development cycles and slow response times, and cannot flexibly adapt to lightweight and temporary new needs, lacking practicality and flexibility.
[0027] To address the aforementioned issues, this application proposes a table generation method. This method involves template-based modification of reusable information tables to generate a table template file containing variable placeholders. Simultaneously, a target mapping table file is created, mapping the variable placeholders to the actual variable information. Based on this target mapping table file, an automated script automatically replaces variables in the table template file to obtain the target information table. This process, through complete decoupling of templates and data, transforms the complex task of generating table documents into a standardized parameter configuration and automated batch processing workflow. This achieves efficient, accurate, and batch generation of change control tables in a lightweight and low-cost manner.
[0028] The table generation method provided in this application will be described in detail below with reference to the accompanying drawings.
[0029] Figure 1 A flowchart illustrating a table generation method provided in an embodiment of this application is shown. Figure 1 As shown, the table generation method includes steps 101-103.
[0030] Step 101: Based on the preset change rules, change the information in the information table to be changed to obtain a table template file containing at least one variable placeholder. The variable placeholder is used to identify the dynamic parameter information to be filled in the table template file.
[0031] In the embodiments of this application, the information table to be changed refers to the original change control table that has not undergone template processing and can be directly filled out manually, containing all the fields and content structure required for change management. The change control table is a project management tool used to track change requests within a project or system. It is primarily presented in Excel spreadsheet format and records all details of operations performed on the target environment or system, including the change background, change time, change impact assessment, detailed steps and verification methods, rollback plans, etc., to ensure that every change operation is traceable, orderly, and controllable, thereby avoiding unplanned changes to the system and ensuring its stable operation.
[0032] Predefined change rules refer to a set of predefined document structuring and content fixing rules based on specific business scenarios (such as data center server restarts, database table structure changes, etc.). These rules clarify which content in the table document is general and unchanging (such as the operational process framework), and which content needs to change based on each specific task (such as server IP, execution commands, etc.). In one example, it can be pre-specified that general change stages, operation content, detailed steps, and verification methods in the original change control table are fixed, while key operation objects and execution steps are set as variables.
[0033] A table template file is a standardized Excel file that has been modified from the original change control table, solidifying common information and retaining only variable placeholders (i.e., variable placeholders). It can then be used for implementation after replacing all variable placeholders in the table template file with actual variable information. Variable placeholders are unique text markers defined according to a preset, uniform format, used to locate the positions in the template that need to be replaced by actual data, distinguishing them from fixed, static text.
[0034] Step 102: Based on at least one variable placeholder and at least one set of actual variable information, generate a target mapping table file. The target mapping table file is used to establish the variable mapping relationship between at least one variable placeholder and at least one set of actual variable information in each set of actual variable information.
[0035] In the embodiments of this application, the actual variable information refers to the real business data generated by a single change operation, including the operation object identifier, execution time, specific execution step parameters, scope of impact, etc., which is the valid business information that needs to be filled into the template.
[0036] A target mapping table file is a separate data file specifically used to store the correspondence between variable placeholders and actual variable information. It is usually in Excel or structured text format and is mainly used to achieve the separation and management of data and templates.
[0037] The variable mapping relationship refers to the one-to-one correspondence between variable placeholders and corresponding actual variable information, ensuring accurate positioning and error-free data matching during subsequent template variable replacement.
[0038] It's important to note that the target mapping table file supports independent editing, repeated use, and batch expansion by users. Users can add, modify, delete, and save actual variable information within the mapping table according to actual change scenarios, without modifying the table template file itself, thus achieving complete decoupling between the template structure and business data. Simultaneously, the target mapping table file supports filling multiple sets of independent actual change information based on the same template. Each set of actual change information corresponds to a specific change task, meeting the need for batch generation of multiple differentiated target information tables. Furthermore, the target mapping table file can be archived and stored separately, facilitating subsequent traceability, querying, and reuse of change data. When change requirements are slightly adjusted, only the variable information in the corresponding mapping table needs to be updated to quickly complete the adaptation, significantly reducing maintenance costs.
[0039] Step 103: Based on at least one set of variable mapping relationships in the target mapping table file, perform at least one variable substitution operation on the table template file to obtain at least one target information table.
[0040] In the embodiments of this application, the variable substitution operation refers to the automated processing of replacing the variable placeholders in the table template with the corresponding actual variable information in the target mapping table according to the mapping relationship between variables and actual information in the target mapping table file.
[0041] The target information table is a formal change control table that, after variable substitution and formatting, can be directly used for change implementation, review, and archiving, possessing full business validity and compliance.
[0042] Specifically, this application uses the Python third-party library openpyxl to write automated scripts to automate the parsing of configurable table template files. The table templates are populated according to the pre-configured parameter information (i.e., actual variable information) in the target mapping table file. At the same time, it supports multiple batch variable replacement operations on the same table template file based on multiple independent variable mapping relationships. Each replacement generates an independent target information table. Multiple target information tables can be integrated into the same worksheet (such as Excel) file containing the template file and mapping table file as new worksheets, or exported as independent worksheet files for storage, meeting the business needs of batch generating multiple differentiated change control tables.
[0043] Optionally, after the variables in the table template file are replaced, no manual adjustment of the format is required. Different rich text format settings can be applied to the actual variable information after replacement according to different variable categories. The final target information table can be directly used for change implementation, internal review and archiving, with complete business effectiveness and compliance.
[0044] In summary, the table generation method proposed in this application modifies the information in the table to be changed based on preset change rules, resulting in a table template file containing at least one variable placeholder; a target mapping table file is generated based on at least one variable placeholder and at least one set of actual variable information; and at least one variable substitution operation is performed on the table template file based on at least one set of variable mapping relationships in the target mapping table file, resulting in at least one target information table. This method automates, standardizes, and batches the generation of change control tables, simplifying the complex process of creating table documents into a lightweight operation of parameter configuration and template calling. This significantly improves the efficiency and standardization of maintenance document generation, while also separating template content, data input, and generation logic. It balances the system's flexibility, maintainability, and low-cost requirements, effectively addressing the shortcomings of related technical solutions in terms of flexibility, maintenance cost, and processing efficiency.
[0045] As one possible implementation method, Figure 2 The flowchart illustrates a second table generation method provided in an embodiment of this application. Based on preset change rules, information is modified in the information table to be changed, resulting in a table template file containing at least one variable placeholder, including the following steps: Step 201: Based on preset change rules, identify static and dynamic information in the information table to be changed.
[0046] In the embodiments of this application, static information represents fixed and unchanging operational information, specifically referring to content that remains consistent in similar change operations and does not require modification each time, including fixed text and format frameworks such as general process descriptions, operating specifications, verification standards, rollback principles, and risk warnings for change management.
[0047] Dynamic information represents parameter information that changes with specific application scenarios. Specifically, it refers to business parameters that change with the object, content, and time of each change, such as target device IP, change execution time, specific operation steps, and verification results.
[0048] In one example, based on pre-defined change rules, the original change control table (i.e., the information table to be changed) can be parsed through manual analysis or natural language processing technology to identify which information needs to be changed and which information remains unchanged.
[0049] Step 202: Change the dynamic information into variable placeholders in a preset format to obtain a table template file containing static information and variable placeholders.
[0050] In the embodiments of this application, the preset format refers to a special text format uniformly set for variable placeholders, which is usually enclosing a unique identifier with special symbols, such as {variable name} or $variable name$. The specific format is not limited in the embodiments of this application.
[0051] In one example, after identifying static and dynamic information, all static information, including its content, position, font, and alignment, is retained unchanged. For all cells marked as dynamic information, existing examples or reserved content are cleared, and variable placeholders with unique names are generated according to a preset format and written into the corresponding cells. The naming of the placeholders is consistent with the semantics of the dynamic information to facilitate subsequent mapping and maintenance. After all dynamic information changes are completed, the retained static information and the newly added variable placeholders are integrated to form a complete and uniformly formatted table template file, completing the template construction.
[0052] In summary, this application achieves standardized template transformation of the change control table by first accurately distinguishing between static general information and dynamic variable information in the information table to be changed, and then uniformly replacing the dynamic information with variable placeholders in a standardized format. This lays the foundation for subsequent automated batch filling, while ensuring the stability of the template structure and the standardization of the content.
[0053] As one possible implementation method, Figure 3 A flowchart of a third table generation method provided in this application is shown. Based on at least one variable placeholder and at least one set of actual variable information, a target mapping table file is generated, including the following steps: Step 301: Create a mapping table file to be filled based on at least one variable placeholder. The mapping table file to be filled includes at least one variable placeholder and at least one field to be filled corresponding to the at least one variable placeholder.
[0054] In the embodiments of this application, the mapping table file to be filled is a blank structured document (such as an Excel worksheet) created based on template variable placeholders to guide users to enter actual information, containing information such as variable names and actual variable information fields to be filled.
[0055] In one example, using an Excel worksheet, if the variable placeholders and the fields to be filled are located in different columns, the mapping table file to be filled will contain at least two columns: one for the variable placeholder identifiers and the other for the fields to be filled. Users can then fill in the actual variable information in the fields to be filled. Furthermore, to meet batch generation requirements, independent field groups can be added to the column dimensions of the mapping table file to support users filling in multiple sets of actual variable information simultaneously. This means users do not need to create multiple independent mapping table files to complete the actual data entry for multiple change control tables at once. It should be noted that the variable placeholders and the fields to be filled can also be arranged at the row level, meaning they are located in different rows of the table. The specific arrangement is not limited in the embodiments of this application.
[0056] Step 302: Based on the user's fill operation on at least one field to be filled, obtain at least one set of actual variable information.
[0057] In the embodiments of this application, users can fill in the corresponding actual variable information in each field to be filled in sequentially by manually inputting, selecting or importing, according to the actual situation of the current change task.
[0058] Step 303: Generate a target mapping table file based on the variable mapping relationship between at least one variable placeholder and at least one set of actual variable information.
[0059] In the embodiments of this application, after the user completes the filling of the fields to be filled according to the variable mapping relationship between variable placeholders and actual variable information and saves the file, the target mapping table file can be obtained. This file is essentially a dataset containing all variable placeholders, actual variable information and corresponding relationships. Moreover, this file can be repeatedly called, edited and archived, thereby realizing the separate management of templates and business data, and improving the flexibility and maintainability of table generation.
[0060] In summary, this application achieves standardized collection and structured management of variable information by creating a structured mapping table file, ensuring the data accuracy and reliability of the correspondence in the subsequent replacement process.
[0061] As one possible implementation method, Figure 4 The flowchart illustrates a fourth table generation method provided in this application. Based on at least one set of variable mapping relationships in a target mapping table file, at least one variable substitution operation is performed on the table template file to obtain at least one target information table, including the following steps: Step 401: Based on the preset parsing tool, parse the table template file and identify at least one variable placeholder in the table template file.
[0062] In the embodiments of this application, the preset parsing tool refers to a program tool library used to read and process spreadsheet files. For Excel templates, the preset parsing tool can specifically be the openpyxl library in the Python environment (used to open, read, traverse, and recognize content in Excel format spreadsheet templates). This tool has the core advantages of efficiently processing Excel files and supporting rich text format parsing and editing, and can meet the accurate parsing requirements of spreadsheet template files.
[0063] In one example, this application uses an automated script (such as a Python script) to call the openpyxl library to load and open a pre-prepared worksheet file (containing a table template file and a target mapping table file). The worksheet template file is then parsed, and variable placeholders are identified using regular expressions or string matching algorithms. This provides precise location information for subsequent variable replacement operations.
[0064] Step 402: Based on preset verification rules, perform legality verification on at least one set of actual variable information in the target mapping table file to obtain the verification result.
[0065] In the embodiments of this application, the preset verification rules are judgment standards set in advance by R&D personnel to determine whether the actual variable information meets the business requirements and format specifications. These include, but are not limited to, non-empty verification, format verification, length verification, semantic rationality verification, and key field integrity verification. They can be flexibly configured according to the business needs of the change control table and are not restricted in the embodiments of this application.
[0066] The verification result is divided into two types: verification passed and verification failed. When the verification fails, the specific exception item and prompt information are returned synchronously.
[0067] Specifically, automated scripts are used to perform multi-dimensional validation on each actual variable in the target mapping table file. This includes checking whether key fields are empty, whether the information format conforms to specifications (such as IP address and time format), whether the content length is within a reasonable range, and whether the logical relationships are consistent. Missing, erroneous, and non-standard data found during the validation process are marked and recorded. After all validations are completed, an overall validation result is generated: if all information conforms to the rules, the validation is considered successful; if any item does not conform, the validation is considered unsuccessful, and an exception list is output to the user terminal or log file, guiding the user to modify the target mapping table file and avoid generating invalid or erroneous target information tables.
[0068] Step 403: If the verification result is successful, based on at least one set of variable mapping relationships in the target mapping table file, replace at least one variable placeholder in the table template file with at least one set of actual variable information to obtain at least one target information table.
[0069] In the embodiments of this application, if the verification passes, the script calls a method in the openpyxl library (such as direct assignment) to replace the variable placeholders in the table template file with the actual variable information filled in the target mapping table file in sequence.
[0070] Optionally, during the variable replacement process, the actual variable information after variable replacement can be formatted using rich text based on the semantic category and preset formatting rules corresponding to at least one variable placeholder. Rich text is a text format that supports multiple formats and multimedia content, including rich formatting settings (such as font, color, size, etc.), the insertion of multimedia elements such as images and tables, and support for hyperlinks and interactive functions.
[0071] Among them, the preset formatting rules are a set of rich text styles pre-defined for different semantic categories, including formatting attributes such as font type, font size, font color, bold, italics, and cell shading. These are configured by the user according to the review requirements of the change control table and reading habits. Specific formatting rules are not limited in the embodiments of this application.
[0072] In one example, each variable placeholder is first pre-assigned a corresponding semantic category (configurable in a table template or target mapping table), and a correspondence between semantic categories and rich text styles is established. After the variable replacement operation is completed, for each cell that has been replaced with actual variable information, different rich text settings are applied according to the semantic category associated with its corresponding variable placeholder. For example, semantics for ordinary operation steps are configured with SimSun, 10-point font, black, and regular style; semantics for key parameters are configured with SimSun, 11-point font, red, and bold styles. After the rich text formatting is completed, the target information table file is saved, that is, the target information table file with applied variable replacement and rich text settings is saved locally as a new sheet.
[0073] In summary, this application achieves fully automated, standardized, and batch generation of change control tables by accurately parsing the template, strictly validating the mapping data, performing automated variable replacement after the validation is passed, and further completing the rich text formatting based on semantic categories. This improves efficiency while significantly enhancing the accuracy, standardization, and readability of the output documents.
[0074] In one example, to help better understand the table generation scheme provided in this application, such as Figure 5 As shown, Figure 5 This is a schematic diagram of the system architecture of a specific table generation method provided in an embodiment of this application.
[0075] Reference Figure 5The system architecture is divided into three core modules: input, core processing, and output. The input includes an Excel-formatted change control table template file, which contains two key worksheets: Sheet1 is the template page (i.e., the table template file); Sheet2 is the mapping table (i.e., the target mapping table file in this application), which has been filled with actual variable information according to the specific circumstances of this change task.
[0076] The core processing is executed by a Python automated script, which consists of two main engines: a parsing and validation engine, which reads the template file, identifies variable placeholders in the table template file, and performs validity checks on the information in the mapping table; and a variable substitution and formatting engine, which, after successful validation, replaces the actual variable information in the mapping table with the corresponding variable placeholders in the template page, and automatically applies different rich text formats based on the semantic category of the variables.
[0077] The output is a new Excel file that retains the original Sheet1 (template page) and Sheet2 (mapping table) for recording and tracing, and adds a new Sheet page to store the generated actionable change process control table (i.e., the target information table in this application).
[0078] Furthermore, for ease of understanding, please refer to the following: Figure 6 , Figure 6 This is a flowchart illustrating a specific table generation method provided in an embodiment of this application.
[0079] Reference Figure 6 First, the target change control table (i.e. the information table to be changed) is templated, the static information is fixed, the dynamic information is replaced with variable placeholders, a table template file containing variable placeholders is generated, and a mapping table to be filled is created. The implementation information of this change (i.e. the actual variable information) is filled into the mapping table to be filled.
[0080] Then, an automated script is run to parse the table template file and verify the validity of the mapping table file information. If the verification fails, return to the "Pop up implementation information" step to correct the data; if the verification passes, the automated script automatically replaces the variable placeholders in the table template file according to the variable mapping relationship in the target mapping table file, and applies different rich text formatting settings to the actual variable information of different semantic categories.
[0081] Finally, save the generated implementation control table (i.e., the target information table) as a new file or a new worksheet to ensure that the original template file is not modified.
[0082] To implement the above embodiments, this application also provides a table generation apparatus. Figure 7This is a schematic diagram of the structure of a table generation device 700 provided in an embodiment of this application. Figure 7 As shown, the device includes: The modification unit 710 is used to modify the information table to be modified based on the preset modification rules, and obtain a table template file containing at least one variable placeholder. The variable placeholder is used to identify the dynamic parameter information to be filled in the table template file. The generation unit 720 is used to generate a target mapping table file based on at least one variable placeholder and at least one set of actual variable information. The target mapping table file is used to establish a variable mapping relationship between at least one variable placeholder and at least one actual variable in each set of actual variable information. The variable substitution unit 730 is used to perform at least one variable substitution operation on the table template file based on at least one set of variable mapping relationships in the target mapping table file, so as to obtain at least one target information table.
[0083] In some embodiments of this application, the modification unit 710 is used to: identify static information and dynamic information in the information table to be modified based on preset modification rules, wherein static information represents fixed operation information and dynamic information represents parameter information that changes with specific application scenarios; and modify the dynamic information into variable placeholders in a preset format to obtain a table template file containing static information and variable placeholders.
[0084] In some embodiments of this application, the generation unit 720 is configured to: create a mapping table file to be filled based on at least one variable placeholder, the mapping table file including at least one variable placeholder and at least one field to be filled corresponding to the at least one variable placeholder; obtain at least one set of actual variable information based on the user's filling operation on at least one field to be filled; and generate a target mapping table file based on the variable mapping relationship between at least one variable placeholder and at least one set of actual variable information.
[0085] In some embodiments of this application, the variable replacement unit 730 is used to: parse the table template file based on a preset parsing tool to identify at least one variable placeholder in the table template file; and replace at least one variable placeholder in the table template file with at least one set of actual variable information based on at least one set of variable mapping relationships in the target mapping table file to obtain at least one target information table.
[0086] In some embodiments of this application, the variable replacement unit 730 is used to: perform legality verification on at least one set of actual variable information in the target mapping table file based on preset verification rules, and obtain verification results; if the verification result is that the verification is passed, replace at least one variable placeholder in the table template file with at least one set of actual variable information based on at least one set of variable mapping relationships in the target mapping table file, and obtain at least one target information table.
[0087] In some embodiments of this application, the variable replacement unit 730 is used to: set the rich text format of the actual variable information after variable replacement based on the semantic category and preset format rules corresponding to at least one variable placeholder.
[0088] The methods and apparatus provided in the embodiments of this application have been described above. To implement the functions of the methods provided in the embodiments of this application, the electronic device may include a hardware structure and software modules, and may implement the above functions in the form of a hardware structure, software modules, or a hardware structure plus software modules. One of the above functions may be executed in the form of a hardware structure, software modules, or a hardware structure plus software modules.
[0089] Figure 8 This is a block diagram illustrating an electronic device 800 for implementing the above-described table generation method, according to an exemplary embodiment. For example, the electronic device 800 may be a mobile phone, computer, messaging device, game console, tablet device, medical device, fitness equipment, personal digital assistant, etc.
[0090] Reference Figure 8 The electronic device 800 may include a communication interface 801, capable of interacting with other devices; a processor 802, connected to the communication interface 801 to interact with other devices, used to execute the methods provided by one or more of the above-described technical solutions when running a computer program; and a memory 803, on which the computer program is stored. Specifically, the specific processing procedure of the processor 802 can refer to the table generation method described in the above embodiments of this application.
[0091] Of course, in practical applications, the various components in electronic device 800 are coupled together through bus system 804. It can be understood that bus system 804 is used to realize the connection and communication between these components. In addition to a data bus, bus system 804 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, in... Figure 8 The general labeled all buses as Bus System 804.
[0092] The memory 803 in this embodiment is used to store various types of data to support the operation of the electronic device 800. Examples of such data include any computer program used to operate on the electronic device 800.
[0093] The methods disclosed in the embodiments of this application can be applied to processor 802, or implemented by processor 802. Processor 802 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the integrated logic circuit of the hardware in processor 802 or by instructions in the form of software. The processor 802 may be a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Processor 802 can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. A general-purpose processor may be a microprocessor or any conventional processor, etc. The steps of the methods disclosed in the embodiments of this application can be directly manifested as being executed by a hardware decoding processor, or being executed by a combination of hardware and software modules in the decoding processor. The software modules may be located in a storage medium, which is located in memory 803. Processor 802 reads the information in memory 803 and combines it with its hardware to complete the steps of the aforementioned method.
[0094] In an exemplary embodiment, the electronic device 800 may be implemented by one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), general-purpose processors, controllers, microcontrollers (MCUs), microprocessors, or other electronic components to perform the aforementioned method.
[0095] Embodiments of this application also propose a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause a computer to execute the table generation method described in the above embodiments of this application.
[0096] Embodiments of this application also propose a computer program product, including a computer program that is executed by a processor using the table generation method described in the above embodiments of this application.
[0097] Embodiments of this application also propose a chip including one or more interface circuits and one or more processors; the interface circuits are used to receive signals from the memory of an electronic device and send signals to the processors, the signals including computer instructions stored in the memory, and when the processor executes the computer instructions, it causes the electronic device to perform the table generation method described in the above embodiments of this application.
[0098] It should be noted that the terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0099] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "illustrative embodiment," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with an embodiment or example is included in at least one embodiment or example of the present invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0100] Any process or method description in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or more executable instructions for implementing a particular logical function or process, and the scope of the preferred embodiments of the invention includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the functions involved, as will be understood by those skilled in the art to which embodiments of the invention pertain.
[0101] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a system including a processing module, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of computer-readable media include: an electrical connection having one or more wires (control method), a portable computer disk drive (magnetic device), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic device, and portable optical disc read-only memory (CDROM). Furthermore, computer-readable media can even be paper or other suitable media on which programs can be printed, because programs can be obtained electronically, for example, by optically scanning the paper or other media, followed by editing, interpreting, or otherwise processing as necessary, and then stored in computer memory.
[0102] It should be understood that various parts of the embodiments of the present invention can be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.
[0103] Those skilled in the art will understand that all or part of the steps of the methods described in the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, the program includes one or a combination of the steps of the method embodiments.
[0104] Furthermore, the functional units in the various embodiments of the present invention can be integrated into a processing module, or each unit can exist physically separately, or two or more units can be integrated into a module. The integrated module can be implemented in hardware or as a software functional module. If the integrated module is implemented as a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. The storage medium mentioned above can be a read-only memory, a disk, or an optical disk, etc.
[0105] Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of the present invention.
Claims
1. A method for generating tables, characterized in that, The method includes: Based on preset change rules, information changes are made to the information table to be changed, resulting in a table template file containing at least one variable placeholder. The variable placeholder is used to identify the dynamic parameter information to be filled in the table template file. Based on the at least one variable placeholder and at least one set of actual variable information, a target mapping table file is generated. The target mapping table file is used to establish a variable mapping relationship between the at least one variable placeholder and at least one set of actual variable information in each set of actual variable information. Based on at least one set of variable mapping relationships in the target mapping table file, at least one variable substitution operation is performed on the table template file to obtain at least one target information table.
2. The method according to claim 1, characterized in that, The process of modifying the information in the table to be modified based on preset change rules to obtain a table template file containing at least one variable placeholder includes: Based on preset change rules, static and dynamic information in the information table to be changed are identified. The static information represents fixed operation information, and the dynamic information represents parameter information that changes with specific application scenarios. The dynamic information is changed into variable placeholders in a preset format to obtain the table template file containing the static information and the variable placeholders.
3. The method according to claim 1, characterized in that, The process of generating the target mapping table file based on the at least one variable placeholder and at least one set of actual variable information includes: Based on the at least one variable placeholder, a mapping table file to be filled is created, the mapping table file to be filled includes the at least one variable placeholder and at least one field to be filled corresponding to the at least one variable placeholder; Based on the user's filling operation on the at least one field to be filled, the at least one set of actual variable information is obtained; The target mapping table file is generated based on the variable mapping relationship between the at least one variable placeholder and the at least one set of actual variable information.
4. The method according to claim 1, characterized in that, The step of performing at least one variable substitution operation on the table template file based on at least one set of variable mapping relationships in the target mapping table file to obtain at least one target information table includes: Based on a preset parsing tool, the table template file is parsed to identify at least one variable placeholder in the table template file; Based on at least one set of variable mapping relationships in the target mapping table file, the at least one variable placeholder in the table template file is replaced with the at least one set of actual variable information to obtain the at least one target information table.
5. The method according to claim 4, characterized in that, The step of replacing at least one variable placeholder in the table template file with at least one set of actual variable information based on at least one set of variable mapping relationships in the target mapping table file to obtain the at least one target information table includes: Based on preset verification rules, the legality of at least one set of actual variable information in the target mapping table file is verified to obtain the verification result; If the verification result is successful, based on at least one set of variable mapping relationships in the target mapping table file, the at least one variable placeholder in the table template file is replaced with the at least one set of actual variable information to obtain the at least one target information table.
6. The method according to claim 5, characterized in that, Based on at least one set of variable mapping relationships in the target mapping table file, the method replaces at least one variable placeholder in the table template file with at least one set of actual variable information. Then, the method includes: Based on the semantic category and preset format rules corresponding to the at least one variable placeholder, the actual variable information after variable replacement is formatted with rich text.
7. A table generation device, characterized in that, The device includes: The modification unit is used to modify the information table to be modified based on the preset modification rules, and obtain a table template file containing at least one variable placeholder. The variable placeholder is used to identify the dynamic parameter information to be filled in the table template file. A generation unit is configured to generate a target mapping table file based on the at least one variable placeholder and at least one set of actual variable information, wherein the target mapping table file is used to establish a variable mapping relationship between the at least one variable placeholder and at least one set of actual variable information in each set of actual variable information; The variable substitution unit is used to perform at least one variable substitution operation on the table template file based on at least one set of variable mapping relationships in the target mapping table file, so as to obtain at least one target information table.
8. An electronic device, characterized in that, include: The processor and the memory used to store computer programs that can run on the processor. When the processor is used to run the computer program, it performs the method according to any one of claims 1 to 6.
9. A non-transitory computer-readable storage medium storing computer instructions, characterized in that, The computer instructions are used to cause the computer to perform the method according to any one of claims 1 to 6.
10. A computer program product, characterized in that, Includes a computer program that, when executed by a processor, implements the method according to any one of claims 1 to 6.
