MES page Chinese collection method and system
Patent Information
- Application Number
- CN202410849323.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-27
- Publication Date
- 2025-02-21
AI Technical Summary
Traditionally, manual operation is relied on in the process of collecting Chinese data on MES system pages, which is time-consuming and labor-intensive and error-prone, affecting system performance and user experience.
Through an automated program, the code files in html format are extracted from the MES page code file, and the Chinese data of the page title area, query area, edit area and data area are collected, and the Chinese data is stored in a multilingual database.
The Chinese data collection of MES system pages is realized, which saves collection time, improves efficiency, and effectively reduces the error rate during the data collection process.
Smart Images

Figure CN119493624A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of Chinese collection on MES system pages, and in particular to a method and system for Chinese collection on MES pages. Background Art
[0002] In the MES system, multi-language support is an important function, which allows users in different regions or countries to operate the system using the language interface they are familiar with. However, the traditional process of collecting Chinese data on the MES system page often relies on manual operation, which is not only time-consuming and laborious, but also due to the uncertainty of manual operation, data omissions, format errors, inaccurate translations and other problems may occur, which in turn affects the overall performance and user experience of the MES system. Summary of the invention
[0003] In view of the above defects, the present invention proposes a method and system for collecting Chinese data on MES pages, aiming to solve the problem that the traditional process of collecting Chinese data on MES system pages often relies on manual operation, which is not only time-consuming and labor-intensive, but also prone to errors.
[0004] To achieve this object, the present invention adopts the following technical solutions:
[0005] A method for collecting Chinese content on an MES page, comprising the following steps:
[0006] Step S1: Obtain MES page code file and establish a multi-language database;
[0007] Step S2: Filter out the code files in HTML format from the MES page code files to obtain a set of code files to be processed, FileList;
[0008] Step S3: Get all code files to be processed from FileList n , and collect each code file to be processed n Chinese data in the page title area, query area, edit area and data area, where n is a positive integer;
[0009] Step S4: For all code files to be processed n Process the Chinese data in the page title area, query area, edit area and data area to obtain processed Chinese data;
[0010] Step S5: storing the processed Chinese data in a multi-language database.
[0011] Preferably, in step S3, each code file to be processed is collected nThe Chinese data in the page title area includes the following sub-steps: Get each code file to be processed File n Find the div element with ID tabTitled and get the value of the data-options attribute of the div element;
[0012] Collect each code file to be processed n The Chinese data in the query area includes the following sub-steps: Get each code file to be processed File n Find the div element whose ID is tabquery, traverse the table elements in the div element, and obtain the ID and text value of all td elements in the table element;
[0013] Collect each code file to be processed n The Chinese data in the editing area includes the following sub-steps: Get each code file to be processed File n Find the div element whose ID is tabedit, traverse the table elements in the div element, and get the ID and text value of all td elements in the table element;
[0014] Collect each code file to be processed n The Chinese data in the data area includes the following sub-steps: n In the JavaScript code embedded in , get the object named columns and traverse the object to get the values of the field name field and field title attributes of the object.
[0015] Preferably, in step S3, the following steps are also included: collecting each code file to be processed File n The Chinese data of other regions in the , specifically includes the following sub-steps:
[0016] Step S31: Get each code file to be processed n The ID and text value of the title attribute in all double-layer div elements;
[0017] Step S32: Get each code file to be processed n Find the div element with ID dlg-buttons, and get the ID and text value of all td elements in the div element;
[0018] Step S33: Get each code file to be processed nThe div element whose ID is MotherDataGridToolBar, and get the ID and text value of all a elements or span elements in the div element;
[0019] Step S34: Get each code file to be processed n The ID and text value of the div element with ID btnPrint.
[0020] Preferably, in step S4, all code files to be processed File n Data processing is performed on the Chinese data in the page title area, query area, edit area and data area, which specifically includes the following sub-steps: Remove all code files to be processed File n Duplicate values and outliers in Chinese data in the page title area, query area, edit area, and data area.
[0021] Another aspect of the present application provides a system for collecting Chinese characters on MES pages, the system comprising:
[0022] The first acquisition module is used to acquire the MES page code file;
[0023] Establishing modules for building multilingual databases;
[0024] The screening module is used to screen out the code files in HTML format from the MES page code files to obtain the code file set FileList to be processed;
[0025] The second acquisition module is used to obtain all the code files to be processed from FileList n ;
[0026] The collection module is used to collect each code file to be processed. n Chinese data in the page title area, query area, edit area and data area, where n is a positive integer;
[0027] Data processing module, used to process all code files to be processed n Process the Chinese data in the page title area, query area, edit area and data area to obtain processed Chinese data;
[0028] The storage module is used to store the processed Chinese data in a multilingual database.
[0029] Preferably, the collection module comprises:
[0030] The first collection submodule is used to obtain each code file to be processed. nFind the div element with ID tabTitled and get the value of the data-options attribute of the div element;
[0031] The second collection submodule is used to obtain each code file to be processed. n Find the div element whose ID is tabquery, traverse the table elements in the div element, and obtain the ID and text value of all td elements in the table element;
[0032] The third collection submodule is used to obtain each code file to be processed. n Find the div element whose ID is tabedit, traverse the table elements in the div element, and get the ID and text value of all td elements in the table element;
[0033] The fourth collection submodule is used to obtain each code file to be processed n The ID and text value of the div element with ID btnPrint.
[0034] Preferably, the collection module further includes:
[0035] The fifth collection submodule is used to obtain each code file to be processed n The ID and text value of the title attribute in all double-layer div elements;
[0036] The sixth collection submodule is used to obtain each code file to be processed n Find the div element with ID dlg-buttons, and get the ID and text value of all td elements in the div element;
[0037] The seventh collection submodule is used to obtain each code file to be processed n The div element whose ID is MotherDataGridToolBar, and get the ID and text value of all a elements or span elements in the div element;
[0038] The eighth collection submodule is used to obtain each code file to be processed n The ID and text value of the div element with ID btnPrint.
[0039] Preferably, the data processing module includes a data removal submodule for removing all code files to be processed. n Duplicate values and outliers in Chinese data in the page title area, query area, edit area, and data area.
[0040] The technical solution provided by the embodiments of the present application may have the following beneficial effects:
[0041] This solution automatically extracts multiple HTML code files from the MES page code files by setting up a program, traverses these code files, and collects Chinese data in the page title area, query area, edit area and data area in each code file, so as to realize the collection of Chinese data of the entire MES system page. Compared with the traditional manual collection of Chinese data of MES system pages, this solution can not only save collection time and thus improve collection efficiency, but also effectively reduce the error rate in the data collection process. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1 It is a step flow chart of the method of collecting Chinese on MES pages. DETAILED DESCRIPTION
[0043] The embodiments of the present invention are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals represent the same or similar elements or elements having the same or similar functions from beginning to end. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and cannot be understood as limiting the present invention.
[0044] A method for collecting Chinese content on an MES page, comprising the following steps:
[0045] Step S1: Obtain MES page code file and establish a multi-language database;
[0046] Step S2: Filter out the code files in HTML format from the MES page code files to obtain a set of code files to be processed, FileList;
[0047] Step S3: Get all code files to be processed from FileList n , and collect each code file to be processed n Chinese data in the page title area, query area, edit area and data area, where n is a positive integer;
[0048] Step S4: For all code files to be processed n Process the Chinese data in the page title area, query area, edit area and data area to obtain processed Chinese data;
[0049] Step S5: storing the processed Chinese data in a multi-language database.
[0050] This solution uses a method for collecting Chinese text from MES pages, such as Figure 1As shown, the first step is to obtain the MES page code file and establish a multilingual database. In this embodiment, by obtaining the MES page code file, it is convenient to extract the code file in HTML format from it. By establishing a multilingual database, it is convenient to store and manage Chinese data in the future. The second step is to filter out the code file in HTML format from the MES page code file to obtain the code file set FileList to be processed. In this embodiment, by separating HTML files from other types of code files, it helps developers to find and understand the structure and layout of the front-end page more easily. The third step is to obtain all the code files File to be processed from FileList n , and collect each code file to be processed n The Chinese data of the page title area, query area, edit area and data area in the code file to be processed are collected, where n is a positive integer. In this embodiment, in the code file to be processed, the areas that need Chinese translation are the page title area, query area, edit area and data area. Therefore, it is sufficient to collect the Chinese data of these areas. The fourth step is to perform Chinese translation on all the code files to be processed. n The Chinese data in the page title area, query area, edit area and data area are processed to obtain processed Chinese data. In this embodiment, the data processing specifically includes removing duplicate values and abnormal values in the Chinese data, which is conducive to ensuring the accuracy and consistency of the data. The fifth step is to store the processed Chinese data in a multilingual database. In this embodiment, by storing the processed Chinese data in a multilingual database, the multilingual database can support Chinese language data, thereby improving the language diversity in the multilingual database.
[0051] This solution automatically extracts multiple HTML code files from the MES page code files by setting up a program, traverses these code files, and collects Chinese data in the page title area, query area, edit area and data area in each code file, so as to realize the collection of Chinese data of the entire MES system page. Compared with the traditional manual collection of Chinese data of MES system pages, this solution can not only save collection time and thus improve collection efficiency, but also effectively reduce the error rate in the data collection process.
[0052] Preferably, in step S3, each code file to be processed is collected n The Chinese data in the page title area includes the following sub-steps: Get each code file to be processed File n Find the div element with ID tabTitled and get the value of the data-options attribute of the div element;
[0053] Collect each code file to be processed n The Chinese data in the query area includes the following sub-steps: Get each code file to be processed File n Find the div element whose ID is tabquery, traverse the table elements in the div element, and obtain the ID and text value of all td elements in the table element;
[0054] Collect each code file to be processed n The Chinese data in the editing area includes the following sub-steps: Get each code file to be processed File n Find the div element whose ID is tabedit, traverse the table elements in the div element, and get the ID and text value of all td elements in the table element;
[0055] Collect each code file to be processed n The Chinese data in the data area includes the following sub-steps: n In the JavaScript code embedded in , get the object named columns and traverse the object to get the values of the field name field and field title attributes of the object.
[0056] In this embodiment, by n Get the div element with ID tabTitled and get the value of the data-options attribute of the div element. These values store Chinese data. Data-options is a custom attribute in HTML tags, which is used to store specific options or configuration information of elements. The div element with ID tabTitled indicates that the div element is the title area. n Get the div element with ID tabquery, and traverse the table elements in the div element, and get the ID and text values of all td elements in the table element. These values store Chinese data, where the div element with ID tabquery indicates that the div element is the query area. n Get the div element with ID tabedit, and traverse the table elements in the div element, and get the ID and text values of all td elements in the table element. These values store Chinese data. Among them, the div element with ID tabedit indicates that the div element is the editing area. nIn the JavaScript code embedded in , get the columns object and traverse the object to get the values of the field name field and field title attributes of the object, which store Chinese data.
[0057] Preferably, in step S3, the following steps are also included: collecting each code file to be processed File n The Chinese data of other regions in the , specifically includes the following sub-steps:
[0058] Step S31: Get each code file to be processed n The ID and text value of the title attribute in all double-layer div elements;
[0059] Step S32: Get each code file to be processed n Find the div element with ID dlg-buttons, and get the ID and text value of all td elements in the div element;
[0060] Step S33: Get each code file to be processed n The div element whose ID is MotherDataGridToolBar, and get the ID and text value of all a elements or span elements in the div element;
[0061] Step S34: Get each code file to be processed n The ID and text value of the div element with ID btnPrint.
[0062] In this embodiment, each code file to be processed File n The ID and text value of the title attribute in all double-layer div elements, the ID and text value of all td elements in the div element with ID dlg-buttons, the ID and text value of all a elements or span elements in the div element with ID MotherDataGridToolBar, and the ID and text value of the div element with ID btnPrint all store Chinese data. Among them, the double-layer div element refers to the div element in the div element, the div element with ID dlg-buttons indicates that the div element is a button, the div element with ID MotherDataGridToolBar indicates that the div element is a table, and the div element with ID btnPrint indicates that the div element is a drop-down selection box for printing.
[0063] Preferably, in step S4, all code files to be processed File nData processing is performed on the Chinese data in the page title area, query area, edit area and data area, which specifically includes the following sub-steps: Remove all code files to be processed File n In the present embodiment, by removing the duplicate values and abnormal values in the Chinese data, it is beneficial to ensure the accuracy and consistency of the data, thereby improving the quality of the Chinese data.
[0064] Another aspect of the present application provides a system for collecting Chinese characters on MES pages, the system comprising:
[0065] The first acquisition module is used to acquire the MES page code file;
[0066] Establishing modules for building multilingual databases;
[0067] The screening module is used to screen out the code files in HTML format from the MES page code files to obtain the code file set FileList to be processed;
[0068] The second acquisition module is used to obtain all the code files to be processed from FileList n ;
[0069] The collection module is used to collect each code file to be processed. n Chinese data in the page title area, query area, edit area and data area, where n is a positive integer;
[0070] Data processing module, used to process all code files to be processed n Process the Chinese data in the page title area, query area, edit area and data area to obtain processed Chinese data;
[0071] The storage module is used to store the processed Chinese data in a multilingual database.
[0072] The present scheme provides a system for collecting Chinese data on MES pages, which realizes the collection of Chinese data on the entire MES system page through the cooperation of a first acquisition module, an establishment module, a screening module, a second acquisition module, a collection module, a data processing module and a storage module. Compared with the traditional method of manually collecting Chinese data on MES system pages, the present scheme automatically extracts multiple HTML format code files from the MES page code files through a setting program, traverses these code files, and collects Chinese data in the page title area, query area, editing area and data area in each code file. This not only saves collection time and thus improves collection efficiency, but also effectively reduces the error rate in the data collection process.
[0073] Preferably, the collection module includes:
[0074] The first collection submodule is used to obtain each code file to be processed. n Find the div element with ID tabTitled and get the value of the data-options attribute of the div element;
[0075] The second collection submodule is used to obtain each code file to be processed. n Find the div element whose ID is tabquery, traverse the table elements in the div element, and obtain the ID and text value of all td elements in the table element;
[0076] The third collection submodule is used to obtain each code file to be processed. n Find the div element whose ID is tabedit, traverse the table elements in the div element, and get the ID and text value of all td elements in the table element;
[0077] The fourth collection submodule is used to obtain each code file to be processed n The ID and text value of the div element with ID btnPrint.
[0078] In this embodiment, in the first collection submodule, from each code file to be processed File n Get the div element with ID tabTitled and the value of the data-options attribute of the div element. These values store Chinese data. Data-options is a custom attribute in HTML tags, which is used to store specific options or configuration information of elements. The div element with ID tabTitled indicates that the div element is the title area. n Get the div element with ID tabquery, and traverse the table elements in the div element, and get the ID and text values of all td elements in the table element, which store Chinese data. The div element with ID tabquery indicates that the div element is the query area. In the third collection submodule, by nGet the div element with ID tabedit, and traverse the table elements in the div element, and get the ID and text values of all td elements in the table element, which store Chinese data. Among them, the div element with ID tabedit indicates that the div element is the editing area. In the fourth collection submodule, by n In the JavaScript code embedded in , get the columns object and traverse the object to get the values of the field name field and field title attributes of the object, which store Chinese data.
[0079] Preferably, the collection module further includes:
[0080] The fifth collection submodule is used to obtain each code file to be processed n The ID and text value of the title attribute in all double-layer div elements;
[0081] The sixth collection submodule is used to obtain each code file to be processed n Find the div element with ID dlg-buttons, and get the ID and text value of all td elements in the div element;
[0082] The seventh collection submodule is used to obtain each code file to be processed n The div element whose ID is MotherDataGridToolBar, and get the ID and text value of all a elements or span elements in the div element;
[0083] The eighth collection submodule is used to obtain each code file to be processed n The ID and text value of the div element with ID btnPrint.
[0084] In this embodiment, in the fifth collection submodule, each code file to be processed File nThe ID and text values of all double-layer div elements containing title attributes store Chinese data. In the sixth collection module, the ID and text values of all td elements in the div element with ID dlg-buttons store Chinese data. In the seventh collection sub-module, the ID and text values of all a elements or span elements in the div element with ID MotherDataGridToolBar store Chinese data. In the eighth collection sub-module, the ID and text values of the div element with ID btnPrint store Chinese data. Among them, the double-layer div element refers to the div element in the div element, the div element with ID dlg-buttons indicates that the div element is a button, the div element with ID MotherDataGridToolBar indicates that the div element is a table, and the div element with ID btnPrint indicates that the div element is a drop-down selection box for printing.
[0085] Preferably, the data processing module includes a data removal submodule for removing all code files to be processed. n In the present embodiment, by setting the data removal submodule, it is helpful to ensure the accuracy and consistency of the data, thereby improving the quality of the Chinese data.
[0086] In addition, each functional unit in each embodiment of the present invention may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.
[0087] Although the embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present invention. A person skilled in the art may change, modify, replace and vary the above embodiments within the scope of the present invention.
Claims
1. A method for collecting Chinese content on MES pages, characterized by: The following steps are involved: Step S1: Obtain MES page code file and establish a multi-language database; Step S2: Filter out the code files in HTML format from the MES page code files to obtain a set of code files to be processed, FileList; Step S3: Get all code files to be processed from FileList n , and collect each code file to be processed n Chinese data in the page title area, query area, edit area and data area, where n is a positive integer; Step S4: For all code files to be processed n Process the Chinese data in the page title area, query area, edit area and data area to obtain processed Chinese data; Step S5: storing the processed Chinese data in a multi-language database.
2. According to the method for collecting Chinese content on MES pages as described in claim 1, it is characterized by: In step S3, collect each code file to be processed n The Chinese data in the page title area includes the following sub-steps: Get each code file to be processed File n Find the div element with ID tabTitled and get the value of the data-options attribute of the div element; Collect each code file to be processed n The Chinese data in the query area includes the following sub-steps: Get each code file to be processed File n Find the div element whose ID is tabquery, traverse the table elements in the div element, and obtain the ID and text value of all td elements in the table element; Collect each code file to be processed n The Chinese data in the editing area includes the following sub-steps: Get each code file to be processed File n Find the div element whose ID is tabedit, traverse the table elements in the div element, and get the ID and text value of all td elements in the table element; Collect each code file to be processed n The Chinese data in the data area includes the following sub-steps: n In the JavaScript code embedded in , get the object named columns and traverse the object to get the values of the field name field and field title attributes of the object.
3. According to claim 1, a method for collecting Chinese content on MES pages, characterized in that: In step S3, the following steps are also included: collecting each code file to be processed File n The Chinese data of other regions in the , specifically includes the following sub-steps: Step S31: Get each code file to be processed n The ID and text value of the title attribute in all double-layer div elements; Step S32: Get each code file to be processed n Find the div element with ID dlg-buttons, and get the ID and text value of all td elements in the div element; Step S33: Get each code file to be processed n The div element whose ID is MotherDataGridToolBar, and get the ID and text value of all a elements or span elements in the div element; Step S34: Get each code file to be processed n The ID and text value of the div element with ID btnPrint.
4. According to claim 1, a method for collecting Chinese content on MES pages, characterized in that: In step S4, all code files to be processed are n Data processing is performed on the Chinese data in the page title area, query area, edit area and data area, which specifically includes the following sub-steps: Remove all code files to be processed File n Duplicate values and outliers in Chinese data in the page title area, query area, edit area, and data area.
5. A system for collecting Chinese characters on MES pages, characterized by: Using the method for collecting Chinese characters on MES pages as described in any one of claims 1 to 4, the system includes: The first acquisition module is used to acquire the MES page code file; Establishing modules for building multilingual databases; The screening module is used to screen out the code files in HTML format from the MES page code files to obtain the code file set FileList to be processed; The second acquisition module is used to obtain all the code files to be processed from FileList n ; The collection module is used to collect each code file to be processed. n Chinese data in the page title area, query area, edit area and data area, where n is a positive integer; Data processing module, used to process all code files to be processed n Process the Chinese data in the page title area, query area, edit area and data area to obtain processed Chinese data; The storage module is used to store the processed Chinese data in a multilingual database.
6. A system for collecting Chinese characters on MES pages according to claim 5, characterized in that: The collection module comprises: The first collection submodule is used to obtain each code file to be processed. n Find the div element with ID tabTitled and get the value of the data-options attribute of the div element; The second collection submodule is used to obtain each code file to be processed. n Find the div element whose ID is tabquery, traverse the table elements in the div element, and obtain the ID and text value of all td elements in the table element; The third collection submodule is used to obtain each code file to be processed. n Find the div element whose ID is tabedit, traverse the table elements in the div element, and get the ID and text value of all td elements in the table element; The fourth collection submodule is used to obtain each code file to be processed n The ID and text value of the div element with ID btnPrint.
7. A system for collecting Chinese characters on MES pages according to claim 6, characterized in that: The collection module also includes: The fifth collection submodule is used to obtain each code file to be processed n The ID and text value of the title attribute in all double-layer div elements; The sixth collection submodule is used to obtain each code file to be processed n Find the div element with ID dlg-buttons, and get the ID and text value of all td elements in the div element; The seventh collection submodule is used to obtain each code file to be processed n The div element whose ID is MotherDataGridToolBar, and get the ID and text value of all a elements or span elements in the div element; The eighth collection submodule is used to obtain each code file to be processed n The ID and text value of the div element with ID btnPrint.
8. The system for collecting Chinese characters on MES pages according to claim 5, characterized in that: The data processing module includes a data removal submodule for removing all code files to be processed. n Duplicate values and outliers in Chinese data in the page title area, query area, edit area, and data area.