Method, system, device and medium for automatically compiling and storing reservoir capacity results data

By combining PyMuPDF library and regular expressions, the key data in the reservoir capacity calculation results table is automatically identified and reorganized, and the problem of time-consuming and error-prone data entry in the existing technology is solved, and efficient and accurate data entry is achieved.

CN119759924APending Publication Date: 2025-04-04山东浪潮智水数字科技有限公司 +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411873487.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-18
Publication Date
2025-04-04

AI Technical Summary

Technical Problem

In the prior art, the data of the reservoir capacity calculation result table needs to be manually entered into the database, which is time-consuming and labor-intensive and error-prone. Especially the PDF format is complex, and OCR technology has difficulties in the identification, splicing and mapping process.

Method used

Combining the PyMuPDF library and regular expressions, we automatically identify and reorganize the key data in the reservoir capacity calculation results table, including water level, water surface area, storage capacity data and measurement time, generate six tuples matching the reservoir capacity curve table, and insert them into the database.

Benefits of technology

It significantly improves data processing efficiency and accuracy, ensures data consistency and integrity, and reduces the time and cost of manual operations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119759924A_ABST
    Figure CN119759924A_ABST
Patent Text Reader

Abstract

The present invention proposes a method, system, device and medium for automatically compiling and storing reservoir capacity results data, which belongs to the field of data processing technology. The method comprises: obtaining the file names of all stored reservoir capacity calculation results tables in a preconfigured file storage directory; cyclically reading the file names of all reservoir capacity calculation results tables under the file storage directory, and using Python's PyMuPDF library to read the key data in the reservoir capacity calculation results table; based on the fields in the capacity curve table, performing data compilation operations on the key data, generating a six-tuple matching the fields in the capacity curve table as the compiled data; inserting the compiled data into the capacity curve table, and storing it in the corresponding database. The present invention realizes the data recognition, compilation and storage of the reservoir capacity calculation results table in PDF format by combining the PyMuPDF library with regular expressions, which significantly improves the data processing efficiency and accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data processing, and more specifically to a method, system, device and medium for automatically compiling and storing reservoir capacity results data. Background Art

[0002] Reservoirs are an important part of the basin flood control engineering system. The reservoir capacity curve is a curve that reflects the relationship between the reservoir water level and the reservoir volume. It is crucial for calculating and analyzing the water storage capacity of the reservoir. Reservoir capacity is an important guarantee for the reservoir to effectively play its functions such as flood control, water supply, ecology, and power generation. In the precise layout of reservoir scheduling, the reservoir capacity curve always plays a core role. Over time, the environment and conditions of the reservoir may change, such as erosion and siltation, which may cause the data of the reservoir capacity curve to no longer be accurate. Therefore, regular re-measurement of the reservoir capacity curve can ensure the accuracy of the data and provide technical support for the rational development and utilization of the reservoir and its safe operation.

[0003] Currently, the measurement of reservoir capacity curves requires a qualified professional team to measure the reservoir as much as possible, and the delivery result is a reservoir capacity calculation result table in PDF format. After the relevant data management agency obtains the reservoir capacity calculation result table, it needs to manually enter the data in the reservoir capacity calculation result table into the database. This process is not only time-consuming and labor-intensive, but also prone to errors.

[0004] With the development of information technology, although the data in the reservoir capacity calculation results table can be automatically identified through scanning and OCR technology, automatic data entry can be achieved to a certain extent. However, the data format in the reservoir capacity calculation results table in PDF format is relatively complex, and may span multiple pages or contain multiple related tables. At the same time, its column name or data order does not completely match the fields in the reservoir capacity curve table in the database, so there are problems with identification and reading, splicing and mapping in the process of using OCR technology for entry. Summary of the invention

[0005] In view of the above problems, the purpose of the present invention is to provide a method, system, device and medium for automatic compilation and storage of reservoir capacity results data. By combining the PyMuPDF library and regular expressions, the problem of data extraction from the reservoir capacity calculation results table in PDF format is effectively solved, and the automatic identification, compilation and storage of key data are realized, which significantly improves the data processing efficiency and accuracy and ensures the consistency and integrity of the data.

[0006] In order to achieve the above object, the present invention is implemented through the following technical solutions: In a first aspect, the present invention discloses a method for automatically compiling and storing reservoir capacity achievement data, comprising: Obtain the file names of all the stored reservoir capacity calculation result tables in the pre-configured file storage directory; Loop through the file names of all the reservoir capacity calculation result tables in the file storage directory, and use Python's PyMuPDF library to read the key data in the reservoir capacity calculation result table; the key data include water level, water surface area, storage capacity data and measurement time; Based on the fields in the storage capacity curve table, perform data compilation operations on key data to generate six tuples matching the fields in the storage capacity curve table as compiled data; The compiled data is inserted into the storage capacity curve table and stored in the corresponding database.

[0007] Further, the file names of all the reservoir capacity calculation result tables stored in the preconfigured file storage directory are obtained, including: Configure the file storage directory for the reservoir capacity calculation results table, and use the os.listdir() function to list all files in the file storage directory; Filter out the reservoir capacity calculation result table files in PDF format by file extension; Use list derivation and string operation techniques to obtain the file names of all reservoir capacity calculation result tables. Further, the key data in the reservoir capacity calculation result table is read using the Python PyMuPDF library, including: The regular expression '\d+\.?\d*\n\d+\.?\d*\n\d+\.?\d*\n' is used to match the water level, water surface area, and storage capacity data in the reservoir capacity calculation results table and store them in a triple list. Further, the method of using Python's PyMuPDF library to read key data in the reservoir capacity calculation results table also includes: Remove spaces from the text data in the reservoir capacity calculation results table; The regular expression '\d+\year\d+\month\n' is used to match and extract the measurement time in the reservoir capacity calculation results table.

[0008] Furthermore, the fields in the reservoir capacity curve table include: reservoir code, measurement time, reservoir water level, reservoir capacity, water surface area, and point number.

[0009] Further, based on the fields in the storage capacity curve table, the key data is subjected to data compilation operation to generate a six-tuple matching the fields in the storage capacity curve table as compiled data, including: Based on the fields in the reservoir capacity curve table, the reservoir code and point number are generated through the file name of the reservoir capacity calculation result table to which the key data belongs and the extraction order of the key data; Based on the triple list, the measurement time, generated reservoir code and point number in the reservoir capacity calculation result table are matched and extracted, and written into the six-tuple matched by the field in the reservoir capacity curve table as the compiled data. Further, the reservoir code and point number are generated by the file name of the reservoir capacity calculation result table to which the key data belongs and the extraction order of the key data, including: According to the file name of the reservoir storage capacity calculation result table to which the key data belongs, the reservoir name is extracted; Find the corresponding reservoir code in the preset reservoir basic information table according to the reservoir name; The extraction order of each key data in the cyclic reading process is recorded as the point sequence number of the key data. In a second aspect, the present invention also discloses a system for automatically compiling and storing reservoir capacity achievement data, comprising: A directory configuration module is used to obtain the file names of all the reservoir capacity calculation result tables stored in the preconfigured file storage directory; The content reading module is used to cyclically read the file names of all reservoir capacity calculation result tables in the file storage directory, and use Python's PyMuPDF library to read the key data in the reservoir capacity calculation result table; the key data includes water level, water surface area, storage capacity data and measurement time; A data compilation module is used to perform data compilation operations on key data based on the fields in the storage capacity curve table, and generate a six-tuple matching the fields in the storage capacity curve table as the compiled data; The data storage module is used to insert the compiled data into the storage capacity curve table and store it in the corresponding database.

[0010] In a third aspect, the present invention also discloses a device for automatically compiling and storing reservoir capacity achievement data, comprising: Memory, used for storing reservoir capacity results data and automatically compiling it into a storage program; A processor is used to implement the steps of the method for automatically compiling and storing reservoir capacity results data as described in any of the above items when executing the program for automatically compiling and storing reservoir capacity results data.

[0011] In a fourth aspect, the present invention further discloses a readable storage medium, on which is stored a program for automatically compiling and storing reservoir capacity results data. When the program for automatically compiling and storing reservoir capacity results data is executed by a processor, the steps of the method for automatically compiling and storing reservoir capacity results data as described in any one of the above items are implemented.

[0012] Compared with the prior art, the present invention has the following beneficial effects: 1. The present invention realizes the automatic storage of reservoir capacity calculation results data. By combining the PyMuPDF library with regular expressions, it effectively solves the problem of data extraction from the reservoir capacity calculation results table in PDF format, improves work efficiency and saves costs.

[0013] 2. The present invention can be used as an automatic storage tool for standard reservoir capacity calculation result tables, and has good adaptability and can be copied to other projects for use, thereby reducing delivery costs and improving benefits.

[0014] 3. The present invention automatically completes the missing fields in the storage capacity calculation result table and the storage capacity curve table in the database without manual query and matching, thereby improving work efficiency, saving time, shortening the project delivery cycle, and saving costs.

[0015] 4. The present invention provides a technical reference for the extraction, matching, compilation and storage of data of other PDF file types.

[0016] It can be seen that compared with the prior art, the present invention has outstanding substantive features and significant progress, and the beneficial effects of its implementation are also obvious. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0018] Figure 1 It is a method flow chart of a method for automatically compiling and storing reservoir capacity results data in a specific implementation mode of the present invention.

[0019] Figure 2 It is a system structure diagram of a system for automatically compiling and storing reservoir capacity results data in a specific implementation mode of the present invention.

[0020] Figure 3 It is a structural schematic diagram of a device for automatically compiling and storing reservoir capacity results data in a specific implementation manner of the present invention.

[0021] In the figure, 1. Directory configuration module; 2. Content reading module; 3. Data compilation module; 4. Data storage module; 101. Processor; 102. Memory; 103. Input interface; 104. Output interface; 105. Communication unit; 106. Keyboard; 107. Display; 108. Mouse. DETAILED DESCRIPTION

[0022] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art of the present invention. The terms used in the specification of the present invention herein are only for the purpose of describing specific embodiments and are not intended to limit the present invention.

[0023] The key terms appearing in the present invention are explained below.

[0024] Reservoir capacity curve: The reservoir capacity curve is a curve that shows the relationship between the reservoir water level and its corresponding reservoir capacity. It is drawn with the water level as the ordinate and the reservoir capacity as the abscissa. It is an important basis for reservoir planning, design, management and dispatching.

[0025] PyMuPDF: PyMuPDF is a high-performance Python library for data extraction, analysis, conversion, and manipulation of PDF (and other) documents.

[0026] Regular Expression: Regular Expression (regex) is a powerful text processing tool used to describe and match string patterns. It matches, searches, and replaces text by using specific characters and patterns. Almost all modern programming languages ​​support the use of regular expressions. Regular expressions consist of common characters and special characters (called metacharacters), where metacharacters have special meanings and are used to define matching rules.

[0027] In order to enable those skilled in the art to better understand the scheme of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific implementation methods. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0028] See also Figure 1 As shown, this embodiment provides a method for automatically compiling and storing reservoir capacity results data, including the following steps: S1: Obtain the file names of all stored reservoir capacity calculation result tables in the preconfigured file storage directory.

[0029] In a specific implementation, firstly, by configuring a specified directory path, the Python os library is used to check whether the file storage directory of the reservoir capacity calculation result table exists. If it does not exist, a creation operation is performed.

[0030] Then, use the os.listdir() function to list all files in the file storage directory; at this time, filter out the PDF format reservoir capacity calculation results table files by file extension. Finally, use list derivation and string operation techniques to obtain the file names of all reservoir capacity calculation results tables.

[0031] S2: Circularly read the file names of all reservoir capacity calculation result tables in the file storage directory, and use Python's PyMuPDF library to read the key data in the reservoir capacity calculation result table. Among them, the key data include water level, water surface area, storage capacity data and measurement time.

[0032] In a specific implementation, this step adopts two data extraction methods for specific types of key data, as follows: 1. Extract the water level, water surface area and storage capacity data in the reservoir capacity calculation results table. Use the regular expression '\d+\.?\d*\n\d+\.?\d*\n\d+\.?\d*\n' to match the water level, water surface area and storage capacity data in the table and store them in a triple list.

[0033] 2. Extract the measurement time, using the regular expression '\d+\year\d+\month\n' to match and extract the measurement time. It should be noted that before matching the time regular expression, the spaces in the read PDF text data are removed to ensure the accuracy of the match.

[0034] S3: Based on the fields in the storage capacity curve table, perform data reorganization operations on the key data to generate a six-tuple matching the fields in the storage capacity curve table as reorganized data.

[0035] In the specific implementation, the fields designed to be stored in the existing reservoir capacity curve table include reservoir code, measurement time, reservoir water level, reservoir capacity, water surface area, point number, modification time, etc. However, the reservoir capacity calculation result table only extracts the reservoir, reservoir capacity, water surface area and measurement time. If the data is to be finally stored in the reservoir capacity curve table of the database, the reservoir code and point number still need to be completed. The data compilation operation is specifically performed in the following manner: First, based on the fields in the storage capacity curve table, the reservoir code and point number are generated through the file name of the reservoir storage capacity calculation result table to which the key data belongs and the extraction order of the key data. Then, based on the triple list, the measurement time in the reservoir storage capacity calculation result table that is matched and extracted, the generated reservoir code and point number are written into the six-tuple matched by the fields in the storage capacity curve table as the reorganized data.

[0036] Specifically, the generation of reservoir codes and point numbers can be achieved in the following ways: 1. First, extract the name of the reservoir according to the file name of the reservoir capacity calculation results table to which the key data belongs; then find the corresponding reservoir code in the preset reservoir basic information table according to the reservoir name. For example: from the file name of the reservoir capacity calculation results table, "A reservoir capacity calculation results table.pdf", extract "A reservoir" as the reservoir name, and then find the corresponding reservoir code in the reservoir basic information table according to the reservoir name.

[0037] 2. Record the extraction order of each key data in the loop reading process as the point number of the key data. For example: according to the order of extracting table data, the data point order of the first row is 1, and so on, to complete the completion of subsequent point numbers.

[0038] At this point, the final result of compiling a reservoir capacity curve data is a six-tuple (reservoir code, measurement time, reservoir water level, reservoir capacity, water surface area, point number).

[0039] S4: Insert the compiled data into the storage capacity curve table and store it in the corresponding database.

[0040] In a specific implementation, this step inserts the compiled data in the previous step into the storage capacity curve table of the corresponding database by configuring database information, and completes the storage of all reservoir storage capacity calculation result table data under the configuration directory through nested loops.

[0041] The present invention provides a method for automatically compiling and storing reservoir capacity results data. By combining the PyMuPDF library with regular expressions, the method effectively solves the problem of data extraction from PDF format reservoir capacity calculation results tables, realizes automatic identification, compilation and storage of key data, significantly improves data processing efficiency and accuracy, and ensures data consistency and integrity.

[0042] See also Figure 2 As shown, the present invention also discloses a system for automatically compiling and storing reservoir capacity results data, including: a directory configuration module 1, a content reading module 2, a data compilation module 3 and a data storage module 4.

[0043] The directory configuration module 1 is used to obtain the file names of all the reservoir capacity calculation result tables stored in the preconfigured file storage directory.

[0044] Content reading module 2 is used to cyclically read the file names of all reservoir capacity calculation result tables under the file storage directory, and use Python's PyMuPDF library to read the key data in the reservoir capacity calculation result table; among them, the key data include water level, water surface area, storage capacity data and measurement time.

[0045] The data reorganization module 3 is used to perform data reorganization operations on key data based on the fields in the storage capacity curve table, and generate a six-tuple matching the fields in the storage capacity curve table as reorganized data.

[0046] The data storage module 4 is used to insert the compiled data into the storage capacity curve table and store it in the corresponding database.

[0047] The specific implementation of the system for automatically compiling and storing reservoir capacity results data in this embodiment is basically the same as the specific implementation of the method for automatically compiling and storing reservoir capacity results data described above, and will not be repeated here.

[0048] See also Figure 3 As shown, the present invention also discloses a device for automatically compiling and storing reservoir capacity achievement data, comprising a processor 101 and a memory 102; wherein, when the processor 101 executes the program for automatically compiling and storing reservoir capacity achievement data stored in the memory, the following steps are implemented: 1. Obtain the file names of all stored reservoir capacity calculation result tables in the preconfigured file storage directory.

[0049] 2. Loop through the file names of all reservoir capacity calculation result tables in the file storage directory, and use Python's PyMuPDF library to read the key data in the reservoir capacity calculation result table.

[0050] 3. Based on the fields in the storage capacity curve table, perform data reorganization operations on the key data to generate a six-tuple matching the fields in the storage capacity curve table as the reorganized data.

[0051] 4. Insert the compiled data into the storage capacity curve table and store it in the corresponding database.

[0052] The device for automatically compiling and storing reservoir capacity results data provided in this embodiment may include but is not limited to a smart phone, a tablet computer, a laptop computer or a desktop computer.

[0053] Among them, the processor 101 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 101 can be implemented in at least one hardware form of a digital signal processor (DSP), a field-programmable gate array (FPGA), and a programmable logic array (PLA). The processor 101 may also include a main processor and a coprocessor. The main processor is a processor for processing data in an awake state, also known as a central processing unit (CPU); the coprocessor is a low-power processor for processing data in a standby state. In some embodiments, the processor 101 may be integrated with a graphics processing unit (GPU), and the GPU is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 101 may also include an artificial intelligence (AI) processor, which is used to process computing operations related to machine learning.

[0054] The memory 102 may include one or more computer-readable storage media, which may be non-transitory. The memory 102 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In this embodiment, the memory 102 is at least used to store the following computer program, wherein, after the computer program is loaded and executed by the processor 101, the relevant steps of the method for automatically compiling and storing reservoir capacity results data disclosed in any of the aforementioned embodiments can be implemented. In addition, the resources stored in the memory 102 may also include an operating system and data, etc., and the storage method may be temporary storage or permanent storage. Among them, the operating system may include Windows, Unix, Linux, etc. The data may include but is not limited to the data involved in the above-mentioned method for automatically compiling and storing reservoir capacity results data.

[0055] Furthermore, the device for automatically compiling and storing reservoir capacity achievement data in this embodiment may also include: The input interface 103 is used to obtain the automatic integration and storage program of the reservoir capacity achievement data imported from the outside, and save the obtained automatic integration and storage program of the reservoir capacity achievement data into the memory 102. It can also be used to obtain various instructions and parameters transmitted by external terminal devices, and transmit them to the processor 101, so that the processor 101 can use the above various instructions and parameters to carry out corresponding processing. In this embodiment, the input interface 103 can specifically include but is not limited to a USB interface, a serial interface, a voice input interface, a fingerprint input interface, a hard disk reading interface, etc.

[0056] The output interface 104 is used to output various data generated by the processor 101 to a terminal device connected thereto, so that other terminal devices connected to the output interface can obtain various data generated by the processor 101. In this embodiment, the output interface 104 may specifically include but is not limited to a USB interface, a serial interface, and the like.

[0057] The communication unit 105 is used to establish a remote communication connection between the server operation business optimization configuration device and the external server, so that the reservoir capacity achievement data automatic compilation and storage device can mount the image file to the external server. In this embodiment, the communication unit 105 can specifically include but is not limited to a remote communication unit based on wireless communication technology or wired communication technology.

[0058] The keyboard 106 is used to obtain various parameter data or instructions input by the user by tapping the keycaps in real time.

[0059] The display 107 is used to display in real time the relevant information of the process of automatically compiling and storing the reservoir capacity results data.

[0060] The mouse 108 can be used to assist the user in inputting data and simplify the user's operation.

[0061] The present invention also discloses a readable storage medium, wherein the readable storage medium includes a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable hard disk, a CD-ROM or any other form of storage medium known in the technical field. The readable storage medium stores a program for automatically compiling and storing reservoir capacity achievement data, and when the program is executed by a processor, the following steps are implemented: 1. Obtain the file names of all stored reservoir capacity calculation result tables in the preconfigured file storage directory.

[0062] 2. Loop through the file names of all reservoir capacity calculation result tables in the file storage directory, and use Python's PyMuPDF library to read the key data in the reservoir capacity calculation result table.

[0063] 3. Based on the fields in the storage capacity curve table, perform data reorganization operations on the key data to generate a six-tuple matching the fields in the storage capacity curve table as the reorganized data.

[0064] 4. Insert the compiled data into the storage capacity curve table and store it in the corresponding database.

[0065] In summary, the present invention effectively solves the problem of data extraction from the reservoir capacity calculation results table in PDF format by combining the PyMuPDF library with regular expressions, realizes the automatic identification, compilation and storage of key data, significantly improves data processing efficiency and accuracy, and ensures data consistency and integrity.

[0066] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. As for the method disclosed in the embodiment, since it corresponds to the system disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.

[0067] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0068] In the several embodiments provided by the present invention, it should be understood that the disclosed systems, systems and methods can be implemented in other ways. For example, the system embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of systems or units, which can be electrical, mechanical or other forms.

[0069] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0070] In addition, each functional module in each embodiment of the present invention may be integrated into one processing unit, or each module may exist physically separately, or two or more modules may be integrated into one unit.

[0071] Similarly, each processing unit in each embodiment of the present invention may be integrated into one functional module, or each processing unit may exist physically, or two or more processing units may be integrated into one functional module.

[0072] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0073] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0074] The above is a detailed introduction to the method, system, device and readable storage medium for automatically compiling and storing reservoir capacity results data provided by the present invention. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present invention, several improvements and modifications can be made to the present invention, and these improvements and modifications also fall within the scope of protection of the present invention.

Claims

1. A method for automatically compiling and storing reservoir capacity results data, characterized in that: include: Obtain the file names of all the stored reservoir capacity calculation result tables in the pre-configured file storage directory; Loop through the file names of all the reservoir capacity calculation result tables in the file storage directory, and use Python's PyMuPDF library to read the key data in the reservoir capacity calculation result table; the key data include water level, water surface area, storage capacity data and measurement time; Based on the fields in the storage capacity curve table, perform data compilation operations on key data to generate six tuples matching the fields in the storage capacity curve table as compiled data; The compiled data is inserted into the storage capacity curve table and stored in the corresponding database.

2. The method for automatically compiling and storing reservoir capacity results data according to claim 1 is characterized in that: The file names of all the reservoir capacity calculation result tables stored in the preconfigured file storage directory are obtained, including: Configure the file storage directory for the reservoir capacity calculation results table, and use the os.listdir() function to list all files in the file storage directory; Filter out the reservoir capacity calculation result table files in PDF format by file extension; Use list derivation and string operation techniques to obtain the file names of all reservoir capacity calculation result tables.

3. The method for automatically compiling and storing reservoir capacity results data according to claim 1 is characterized in that: The key data in the reservoir capacity calculation results table are read using the Python PyMuPDF library, including: The regular expression '\d+\.?\d*\n\d+\.?\d*\n\d+\.?\d*\n' is used to match the water level, water surface area, and storage capacity data in the reservoir capacity calculation results table and store them in a triple list.

4. The method for automatically compiling and storing reservoir capacity results data according to claim 3 is characterized in that: The method of using Python's PyMuPDF library to read key data in the reservoir capacity calculation results table also includes: Remove spaces from the text data in the reservoir capacity calculation results table; The regular expression '\d+\year\d+\month\n' is used to match and extract the measurement time in the reservoir capacity calculation results table.

5. The method for automatically compiling and storing reservoir capacity results data according to claim 4 is characterized in that: The fields in the reservoir capacity curve table include: reservoir code, measurement time, reservoir water level, reservoir capacity, water surface area, and point number.

6. The method for automatically compiling and storing reservoir capacity results data according to claim 5 is characterized in that: The data reorganization operation is performed on the key data based on the fields in the storage capacity curve table to generate a six-tuple matching the fields in the storage capacity curve table as reorganized data, including: Based on the fields in the reservoir capacity curve table, the reservoir code and point number are generated through the file name of the reservoir capacity calculation result table to which the key data belongs and the extraction order of the key data; Based on the triple list, the measurement time, generated reservoir code and point number in the reservoir capacity calculation result table are matched and extracted, and written into the six-tuple matched by the field in the reservoir capacity curve table as the compiled data.

7. The method for automatically compiling and storing reservoir capacity results data according to claim 6 is characterized in that: The reservoir code and point number are generated by the file name of the reservoir capacity calculation result table to which the key data belongs and the extraction order of the key data, including: According to the file name of the reservoir storage capacity calculation result table to which the key data belongs, the reservoir name is extracted; Find the corresponding reservoir code in the preset reservoir basic information table according to the reservoir name; The extraction order of each key data in the cyclic reading process is recorded as the point sequence number of the key data.

8. A system for automatically compiling and storing reservoir capacity data, characterized in that: include: A directory configuration module is used to obtain the file names of all the reservoir capacity calculation result tables stored in the preconfigured file storage directory; The content reading module is used to cyclically read the file names of all reservoir capacity calculation result tables in the file storage directory, and use Python's PyMuPDF library to read the key data in the reservoir capacity calculation result table; the key data includes water level, water surface area, storage capacity data and measurement time; A data compilation module is used to perform data compilation operations on key data based on the fields in the storage capacity curve table, and generate a six-tuple matching the fields in the storage capacity curve table as the compiled data; The data storage module is used to insert the compiled data into the storage capacity curve table and store it in the corresponding database.

9. A device for automatically compiling and storing reservoir capacity results data, characterized in that: include: Memory, used for storing reservoir capacity results data and automatically compiling it into a storage program; A processor is used to implement the steps of the method for automatically compiling and storing reservoir capacity results data as described in any one of claims 1 to 7 when executing the program for automatically compiling and storing reservoir capacity results data.

10. A readable storage medium, characterized in that: The readable storage medium stores a program for automatically compiling and storing reservoir capacity results data. When the program for automatically compiling and storing reservoir capacity results data is executed by the processor, the steps of the method for automatically compiling and storing reservoir capacity results data as described in any one of claims 1 to 7 are implemented.