A method for quickly extracting data and filling in text
By defining data format and placeholder encoding and establishing data sets and type relationships, the problem of time-consuming and easy errors in filling data in biopharmaceutical companies is solved, and fast and accurate data extraction and reporting are achieved, improving work efficiency.
Patent Information
- Application Number
- CN202510131577.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-06
- Publication Date
- 2025-08-01
- Estimated Expiration
- 2045-02-06
AI Technical Summary
In biopharmaceutical companies, the data filling method generated through database search and report is time-consuming and error-prone, resulting in low work efficiency.
Using the method of defining data format and placeholder encoding, we establish the relationship between data sets, data points and data application types, and generate placeholders through configuration to quickly obtain and fill in data from the database to form a fill-in document.
It realizes the rapid and accurate extraction and filling of text data from production data, improves work efficiency, reduces human errors, and is suitable for batch issuance and archive text files of biopharmaceutical companies.
Smart Images

Figure CN120068831B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data processing, and particularly relates to a method for quickly extracting data filling texts from a data set. Background Art
[0002] The Manufacturing Execution System (MES) is a management system that integrates production processes such as planning, production, quality control, inventory management, and material requisition; it is an indispensable part of modern manufacturing enterprises. It can not only help enterprises improve production efficiency and product quality, but also promote the digital transformation of enterprises. When using the Manufacturing Execution System, especially in biopharmaceutical enterprises, data needs to be filled in according to the formats specified by relevant departments to form a number of batch release text files, which requires obtaining the data to be filled in from a large amount of production and test data; currently, corresponding reports are formed through database searches, and then data is extracted from the reports and entered into the specified format text, which takes a lot of manpower and time and is prone to errors. Summary of the Invention
[0003] The purpose of the present invention is to provide a method for quickly extracting data and filling texts, which can quickly retrieve and obtain the required data from a large amount of production data, fill it into the corresponding data filling text file, and quickly generate a filling document, greatly improving work efficiency.
[0004] To achieve the above purpose, the present invention adopts the following technical solutions:
[0005] A method for quickly extracting data and filling texts includes the following steps:
[0006] Step 1: Define the blank data format of the filling text, and label the data structure in the database according to the data format;
[0007] The data format includes data coordinates and data application types. The data coordinates include data sets and data points, and the data application types include multiple variables;
[0008] Accurately obtain the position of the required data according to the assignment of the data coordinates, and accurately obtain the required data according to the data application type;
[0009] Step 2: Establish the relationship between the data set, data point, and data application type;
[0010] Obtain the data attributes of the blanks in the filling template file, generate a placeholder for the blank according to the data format; establish the relationship between the data set, data point, and data application type by configuring and generating a placeholder to encode the data format;
[0011] Step 3: Establish a data reading template file;
[0012] Locate the blanks to be filled according to the filled text file, clarify the data attributes of the blanks, configure the corresponding data structure according to the data format and generate all blank placeholders; update the filled text file to form a data reading template file and save it;
[0013] Step 4: Data reading and filling;
[0014] Call the data reading template file, parse and scan the placeholders in the filled file line by line according to the rules, load the data according to the data format, and save the loaded data to the buffer area and the filled file to achieve data filling.
[0015] Furthermore, the data application type includes 4 variables, and the data format is expressed as $(#ds.dp#)[a][b][c][d]$, where #ds.dp# is the data coordinate, and [a][b][c][d] are the variables of the data application type.
[0016] Furthermore, the rule for generating placeholders to encode the data format is:
[0017] The encoding rule for the data set is: the label number, date and serial number of the data set;
[0018] The encoding rule for the data point is: the data field number, date and serial number;
[0019] [a][b][c][d] represents different recorded values for different batches, processes and operations, where [0] represents the initial data and [] represents the latest data.
[0020] Furthermore, the rule for configuring the corresponding data structure according to the data format:
[0021] According to the attributes of the filled blanks, select the corresponding data set and data point, generate the #ds.dp# number, and perform data address binding; assign values to the [a][b][c][d] variables according to the requirements of the data application type of the filled blanks.
[0022] Furthermore, the specific process of parsing and scanning the placeholders in the filled file line by line according to the rules is:
[0023] Parse the data coordinate value, query the corresponding data set and data point according to the internal relationship of binding data by the placeholder; parse the values of the variables [a][b][c][d] of the data application type in sequence.
[0024] Furthermore, after the loaded data is saved to the buffer area, data verification and data cleaning are performed, the validity and legality of the loaded data are judged, and the invalid data is cleaned; the data after cleaning and verification is written from the buffer area into the corresponding blanks in the document to complete data filling.
[0025] Advantages of the present invention: It can quickly retrieve and obtain from a large amount of production data, accurately write it into the fill-in text space, and save the corresponding template for immediate call, greatly improving work efficiency and reducing errors. It is applied to data filling in text files with specified formats, such as batch release texts of biopharmaceutical enterprises and data acquisition in archived technical text files, which can improve the production process and quality monitoring of biopharmaceutical enterprises. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] Figure 1 It is a flowchart of the present invention.
[0027] Figure 2 It is a diagram of an application embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0028] As Figure 1 shown, in this embodiment, taking a biopharmaceutical enterprise as an example, a method for quickly extracting data set fill-in text is disclosed, including the following steps:
[0029] Step 1: Define the data format of the blank positions in the file to be filled. The data format includes data coordinates and data application types. The data coordinates include data sets and data points, represented by ds for data sets and dp for data points, and the data coordinates are (#ds.dp#); the data application type consists of 4 variables, represented by a, b, c, and d for the 4 variables respectively, and the variables can also be increased or decreased according to the data generated by the enterprise. The data application type is [a][b][c][d].
[0030] The values of [a][b][c][d] are as follows:
[0031] [a] represents the data of the nth batch, and the values are 0, 1, 2......n;
[0032] [b] represents the data of the mth process shift, and the values are 0, 1, 2......n;
[0033] [c] represents the data of the pth operation shift, and the values are 0, 1, 2......n;
[0034] [d] represents the data of the qth record copy, and the values are 0, 1, 2......n;
[0035] The final data format is formed as: $(#ds.dp#)[a][b][c][d]$.
[0036] Step 2: Establish the relationship between data sets, data points, and data application types;
[0037] In the database of the MES system, corresponding data sets are built respectively according to the generated products, batches and data sources, such as production raw material data set, production process data set, finished product inspection data set, etc. In the MES system, these data sets have information such as names and storage addresses. The data sets store fields, types, values, etc. of several data, which are presented in data tables.
[0038] Obtain the nature of the blanks in the filling template file. Given the attributes of the data to be filled, the attributes represent the data set to which it belongs and the data names and data fields involved. Generate a placeholder for this blank according to the data format $(#ds.dp#)[a][b][c][d]$ constructed in step 1. Generate a placeholder code through configuration; the #ds.dp# code, and assign values to [a][b][c][d] to establish the association relationship between the data set, data point and data application type.
[0039] In specific implementation, the #ds.dp# code points to a certain record in a data table; #ds.dp# represents a group of numbers, and the numbers are automatically completed by the coding program. The rules of the coding program are: ds coding rule: the number of the data set to which it belongs + date + serial number; dp coding rule: the number of the field to which it belongs + date + serial number; forming the coordinates of the obtained data, so that the data to be filled can be accurately searched and obtained.
[0040] Since in actual production, especially in the production process with cycles, under the same process flow, there are multiple production records in different batches and different processes. When filling in data, it is necessary to select, and assign values to the suffix [a][b][c][d] variables of the placeholder to lock according to the filling requirements. The values in [a][b][c][d] represent different record values of different batches, processes and procedures; [0] represents the initial data, and [] represents the latest data.
[0041] Step 3: Establish a data reading template file;
[0042] Call the text file to be filled, locate and select the blanks to be filled, and clarify the attributes of the data filled in the blanks; that is, the data set and the data names and data fields involved.
[0043] Call the data component program and complete the configuration according to the data format in step 1 to generate the placeholder for the blank.
[0044] Configuration means: first, select the corresponding data set and data point according to the attributes of the blank to be filled; then bind the data address according to the #ds.dp# number; finally, assign values to the [a][b][c][d] variables according to the requirements of the data application type of the blank to be filled.
[0045] Traverse the text file to be filled until all blanks are generated with placeholders, update the text file to be filled, form a data reading template file and save it for data reading and filling calls.
[0046] Step 4: Data reading and filling;
[0047] Enter the text filling system and call the data reading template file; Parse and scan the placeholders in the data reading template file line by line according to the specifications and obtain the parsing results. Load the parsing results in the data format of $(#ds.dp#)[a][b][c][d]$ and save them in the buffer. Until the last placeholder in the text file, end the scan. Save the current template file for subsequent repeated use.
[0048] Among them, the rule parsing: Parse the data coordinate (#ds.dp#) value, query the corresponding data set and data point according to the internal relationship between the placeholder and the bound data. Parse the values of the placeholder suffixes [a][b][c][d] in turn. If there is no value in [], it is defaulted to 1. [a] represents the number of batches. If a is 2, it is parsed that the data filled this time is the data of the second batch. [b] represents the shift change data under the nth process in this batch. If it is 3, it is parsed that the data filled this time is the shift change data under the second process........ until [d] is parsed. If there is no data, replace it with a null value.
[0049] Step 5: Judge the validity of the data in the data format recorded in the buffer, clear the invalid data, and prompt to re-judge; Write the data after cleaning and inspection from the buffer into the corresponding blanks in the document to complete the data filling.
[0050] Application Example 1
[0051] Locate and select the blank to be filled, and clarify the attribute of the data filled in the blank. The blank attribute is: stock solution, corresponding data format: the data set is the tetravalent batch release test (055), the data point is the stock solution data (682), the batch is 1, the process is empty, the operation is 2, and the record is IVR-238. As Figure 2 shown, the data format is ${(055.682)[1][0][2][1]}$. Obtain the data according to the data format, and the name of the stock solution is IVR-238.
[0052] The above is only the preferred implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any modification and replacement based on the technical solution and inventive concept provided by the present invention should be covered within the protection scope of the present invention.
Claims
1. A method for quickly extracting data and filling in text, characterized in that, It includes the following steps: Step 1: Define the blank data format for filling in text, and label the data structure in the database according to the data format; The data format includes data coordinates and data application types. The data coordinates include data sets and data points. The data application types include 4 variables. The data format is expressed as $(#ds.dp#)[a][b][c][d]$, where #ds.dp# are the data coordinates and [a][b][c][d] are the variables of the data application type; Accurately obtain the position of the required data according to the assignment of the data coordinates, and accurately obtain the required data according to the data application type; Step 2: Establish the relationship between data sets, data points and data application types; Obtain the data attributes of the blanks in the filling template file, and generate placeholders for the blanks according to the data format; establish the relationship between data sets, data points and data application types by configuring the encoding of the generated placeholders for the data format; The rule for configuring the encoding of the generated placeholders for the data format is: The encoding rule for data sets is: the label number, date and serial number of the data set; The encoding rule for data points is: the data field number, date and serial number; The values of [a][b][c][d] represent different record values for different batches, processes and operations, where [0] represents the initial data and [] represents the latest data; Step 3: Establish a data reading template file; Locate the blanks to be filled according to the filling text file, clarify the data attributes of the blanks, configure the corresponding data structure according to the data format and generate all blank placeholders; update the filling text file to form a data reading template file and save it; The rule for configuring the corresponding data structure according to the data format: According to the filled blank attributes, select the corresponding data set and data point, generate the #ds.dp# number, and perform data address binding; assign values to the [a][b][c][d] variables according to the requirements of the data application type of the filled blanks; Step 4: Data reading and filling; Call the data reading template file, parse and scan the placeholders in the filling file line by line according to the rules, load the data according to the data format, and save the loaded data to the buffer area and the filling file to achieve data filling; Specifically, parsing and scanning the placeholders in the filling file line by line according to the rules is: Parse the data coordinate values, query the corresponding data set and data point according to the internal relationship of binding data by the placeholder; parse the values of the variables [a][b][c][d] of the data application type in sequence.
2. The method for quickly extracting data and filling in text according to claim 1, wherein, After the loaded data is saved to the buffer area, perform data verification and data cleaning, judge the validity and legality of the loaded data, and clean up the invalid data; write the data after cleaning and verification from the buffer area into the corresponding blanks in the document to complete data filling.
Citation Information
Patent Citations
Document processing method and device based on configuration template
CN115759024A
Digital management and control system, device and method for whole cycle flow of biopharmaceutical production
CN116341889A