Analysis method and device for ship management file content and electronic equipment
By identifying and analyzing ship management files, extracting and integrating the coordinate axes information in the files, the problem of manual analysis dependence in ship manufacturing is solved, automated management is realized, and efficiency and accuracy are improved.
Patent Information
- Application Number
- CN202410913527.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-09
- Publication Date
- 2024-11-12
AI Technical Summary
During the ship manufacturing process, data analysis of engineering management files relies on manual labor, resulting in complex data analysis, high error rate and low efficiency, making it difficult to meet the needs of automated production.
By identifying and parsing the types of ship management files, using corresponding components (such as NPOI, Spire, iTextSharp, etc.) to extract and integrate the axis information in the file to form a target integrated file, which is convenient for automatic import into other software for use.
It reduces manual analysis errors, reduces designer workload, improves the orchestration efficiency of automation management plans, and supports automated management of ship manufacturing.
Smart Images

Figure CN118939721A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a method, a device and an electronic device for parsing the contents of a ship management file in the ship industry, and belongs to the field of visual management technology in digital ship design and manufacturing technology. Background Art
[0002] As a place for manufacturing ships, the shipyard is a very complex production system. In the process of shipbuilding, it is necessary to design a variety of process flows, which requires a variety of equipment, materials and human resources. Therefore, the planning management of the shipbuilding plant is particularly important. A good planning management system can improve the production efficiency of the shipbuilding plant and ensure the quality of production while reducing waste. Among them, the production planning department is responsible for preparing the production plan, supervising the implementation of the plan during the production process, and making timely adjustments to ensure the smooth implementation of the production plan. The production management department is responsible for implementing the production plan, supervising the integration of process technology and planning during the production process, and ensuring that the production quality and quantity meet the planned requirements. The production quality management department is responsible for supervising the production quality and ensuring that relevant quality standards are met during the production process.
[0003] However, with the continuous development of science and technology, the application of automation technology in the field of shipbuilding is becoming more and more extensive. Automated shipbuilding technology refers to a manufacturing method that optimizes and upgrades each link in the shipbuilding process by introducing advanced automation technology and intelligent equipment, with the goal of improving production efficiency, reducing production costs, and improving product quality. The emergence of automated shipbuilding technology not only improves production efficiency and reduces production costs. More importantly, it has brought new technological innovations and changes in production models to the shipbuilding industry. Automation technology is applied in all aspects of the shipbuilding process, including hull design, digital manufacturing, assembly production, intelligent equipment, etc. In the hull design stage, automation technology can realize hull structure design and simulation through software such as computer-aided design (CAD) and computer-aided engineering (CAE), thereby improving design efficiency and accuracy.
[0004] However, at present, shipbuilding enterprises still rely heavily on manual analysis and interpretation of engineering management documents such as scheduled dates. Since ships are highly dependent on engineering management documents during the manufacturing process, the accuracy of the data in them is often required to be very high. In addition, the automated production of ships will generate a large number of data files and the types of data files are not fixed, so manual interpretation is very complicated and difficult, and it is easy to make many mistakes. Therefore, there is an urgent need for a method that can quickly parse the content of ship management files to solve the problems raised in the above background technology. Summary of the invention
[0005] The content of this application is used to introduce concepts in a brief form, which will be described in detail in the detailed implementation section below. The content of this application is not intended to identify the key features or essential features of the technical solution claimed for protection, nor is it intended to limit the scope of the technical solution claimed for protection.
[0006] In view of the problems and shortcomings in the prior art, the present invention aims to provide a method, device and electronic device for parsing the content of ship management files, which can identify and extract the files of management type in ship manufacturing according to their types, then retrieve and extract the coordinate axes and the information expressed in the loaded target management files, integrate the effective information content into a target integrated file and export it, and use it as a data source to automatically import it in other types of software to adapt to the application of ship manufacturing projects, so as to solve the problems raised in the above background technology.
[0007] To achieve the above object, the present invention provides the following technical solutions:
[0008] As a first aspect of the present application, the present invention discloses a method for parsing the content of a ship management file, which mainly comprises the following steps:
[0009] Step 1, in response to loading a target management file to be parsed, determining the type of the target management file by format;
[0010] Step 2, in response to selecting a corresponding method for reading according to the type of the target management file;
[0011] Step 3, in response to retrieving the content value of the target management file and its corresponding coordinate axis, comparing and obtaining the information required for analysis;
[0012] Step 4, in response to cyclically extracting the information required for parsing in the target management file, forming a target integration file;
[0013] Step 5, in response to writing and saving the target integrated file into the newly created parsed file.
[0014] Furthermore, in step 2, a corresponding method is selected for reading according to the type of the target management file, specifically,
[0015] When the target management file is in EXCEL or WORD format, NPOI or Spire components must be referenced;
[0016] When the format of the target management file is PDF, iTextSharp, Spire or Aspose components need to be referenced.
[0017] Furthermore, when the target management file is a table format file, in step 3, the content value of the target management file and its corresponding coordinate axis are extracted, and the information expressed by the coordinate axis is obtained after comparison and determination, and the specific steps include:
[0018] Step 3.1.1, reading and traversing each cell in the target management file in a table format;
[0019] Step 3.1.2, retrieve the content values corresponding to the horizontal and vertical coordinates in character form;
[0020] Step 3.1.3, comparing the horizontal coordinate content value and the vertical coordinate content value to determine whether it is the information to be parsed;
[0021] Step 3.1.4, create a temporary file through the NPOI component and temporarily save the information to be parsed;
[0022] Step 3.1.5, loop the above steps, read the next target management file and perform content analysis.
[0023] Further, if the target management file is a Gantt chart format file, when the target management file is a Gantt chart format file, in step 3, the content value of the target management file and its corresponding coordinate axis are extracted, and the information expressed by the coordinate axis is obtained after comparison and determination, and the specific steps include:
[0024] Step 3.2.1, read the corresponding content and the pixel coordinate interval T of the cell in the row and column of the Gantt chart in character form y and T x ;
[0025] Step 3.2.2, according to the legend in the Gantt chart, retrieve the graphic elements in the table in character form;
[0026] Step 3.2.3, read the starting coordinate L of the pixel position of the graphic element in the Gantt chart in the table through the Spire component s and the end point coordinates L e ;
[0027] Step 3.2.4, determine the starting point coordinate L through comparison s and the end point coordinates L e Whether it is the information that needs to be parsed;
[0028] Step 3.2.5, create a temporary file through the NPOI component and temporarily save the information to be parsed;
[0029] Step 3.2.6, loop the above steps, read the next target management file and perform content analysis.
[0030] Furthermore, the coordinate interval T of the cell where the Gantt chart column is located y Represented as T y (Y a , Y b ), the coordinate interval of the cell where the Gantt chart row is located is T x Represented as T x (X a , X b ), the starting point coordinate L of the pixel position of the graphic element in the Gantt chart s Indicated as L s (X s , Y s ), the end point coordinate L of the pixel position of the graphic element in the Gantt chart e Indicated as L e (X e , Y e );
[0031] If Y a <Y s <Y e <Y b And X a <X s <X e <X b , then the information expressed by this point is determined to be the information that needs to be analyzed.
[0032] Furthermore, when the target management file is a table type file, the table type file can calculate the date adjustment value, traverse the data to be parsed obtained in the above steps, and identify and generate correct data information for final use.
[0033] As a second aspect of the present application, the present invention further discloses a content parsing device for ship management files, comprising:
[0034] An identification module is used to load the target management file to be parsed and determine the type of the file through format identification;
[0035] A reading module, used for selecting a corresponding method for reading according to the type of the target management file;
[0036] A comparison module, used for comparing and judging the information expressed by the coordinate axis according to the coordinate axis in the target management file;
[0037] A parsing and integration module, used for cyclically extracting the information expressed by the coordinate axes to form a target integration file;
[0038] The export module is used to write and save the target integrated file into a newly created file.
[0039] As a third aspect of the present application, the present invention further discloses an electronic device, comprising:
[0040] at least one processor, and a memory communicatively coupled to the at least one processor;
[0041] The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can perform the steps of the above-mentioned method for parsing the content of the ship management file.
[0042] As a fourth aspect of the present application, the present invention further discloses a computer storage medium on which a computer program is stored, characterized in that when the computer program is executed by a processor, the steps of the above-mentioned ship management file content parsing method are implemented.
[0043] Compared with the prior art, the present invention has the following beneficial effects:
[0044] The method, device and electronic device for parsing the contents of ship management files provided by the present invention use a computer to automatically parse the data contents of management files, which is convenient for the arrangement of automated management plans for shipbuilding. First, the target management file to be parsed is loaded, and the type of the target management file is determined by the format. Then, the corresponding method is selected for reading according to the type of the target management file. Then, the coordinate axis in the target management file is retrieved and extracted in character form to determine the information expressed by the coordinate axis. The information expressed by the coordinate axis is extracted in a circular manner to form a target integration file. Finally, the target integration file is written and saved in a newly created file. The present invention can reduce the mistakes made by designers in manually analyzing data, and can also effectively reduce the working hours of designers and alleviate the load pressure. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] The drawings constituting a part of this application are used to provide a further understanding of this application, so that other features, purposes and advantages of this application become more obvious. The drawings and descriptions of the exemplary embodiments of this application are used to explain this application and do not constitute an improper limitation on this application.
[0046] In the attached picture:
[0047] Figure 1 : is a flow chart of a method for parsing content of a management file in an embodiment of the present invention;
[0048] Figure 2 : is a schematic diagram of a table type file before parsing in an embodiment of the present invention;
[0049] Figure 3 : is a schematic diagram of a parsed table-type file in an embodiment of the present invention;
[0050] Figure 4: is a schematic diagram of a Gantt chart type file before parsing in an embodiment of the present invention;
[0051] Figure 5 : is a schematic diagram of a Gantt chart type file after parsing in an embodiment of the present invention;
[0052] Figure 6 :It is a flowchart of parsing a table type file in an embodiment of the present invention;
[0053] Figure 7 : is a flow chart of parsing a Gantt chart type file in an embodiment of the present invention;
[0054] Figure 8 : is a schematic diagram of the structure of an electronic device in an embodiment of the present invention. DETAILED DESCRIPTION
[0055] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments set forth herein. On the contrary, these embodiments are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.
[0056] It should also be noted that, for ease of description, only the parts related to the invention are shown in the drawings. In the absence of conflict, the embodiments and features in the embodiments of the present disclosure can be combined with each other.
[0057] Example
[0058] The present invention discloses a method, device and electronic device for analyzing the content of ship management files. The present invention will be described in detail below with reference to the accompanying drawings and in combination with embodiments. Figure 1 As shown, the present invention mainly comprises the following steps:
[0059] Step 1, in response to loading a target management file to be parsed, determining the type of the target management file by format;
[0060] Step 2, in response to selecting a corresponding method for reading according to the type of the target management file;
[0061] Step 3, in response to retrieving the content value of the target management file and its corresponding coordinate axis, compare and obtain the information required for analysis;
[0062] Step 4, in response to cyclically extracting the information required for parsing in the target management file, forming a target integration file;
[0063] Step 5, in response to writing and saving the target integrated file into the newly created parsed file.
[0064] Specifically, first load the target management file to be parsed, and determine its file type by the file type of the target management file. In step 2, select the corresponding method to read according to the type of the target management file. Specifically, if the format of the target management file is EXCEL and WORD, you need to reference NPOI or Spire components; if the format of the target management file is PDF, you need to reference iTextSharp, Spire or Aspose components. NPOI is an open source library under .NET, which is used to read and write MS Office files such as Excel and Word. Spire.XLS for.NET is a powerful library that can be used to read and write Excel and Word files without installing Microsoft Office. In addition, Spire.PDF is a powerful PDF processing library that can create, edit and modify PDF files. Aspose.PDF for.NET is an advanced PDF processing library that allows developers to create, modify, convert and extract the content of PDF documents in .NET applications. iTextSharp is an open source Java library for processing PDF files. It can be used to read the content of PDF documents. It can be read line by line as required, and can also distinguish large text blocks by spaces, and supports certain error compatibility.
[0065] Furthermore, refer to Figure 6 As shown, when the target management file is an Excel spreadsheet format file, step 3 retrieves and extracts the coordinate axis in the target management file and determines the information expressed by it. The specific steps include:
[0066] Step 3.1.1, read and traverse each cell in the target management file in the table format;
[0067] Step 3.1.2, retrieve the content values corresponding to the horizontal and vertical coordinates in character form;
[0068] Step 3.1.3, compare the horizontal coordinate content value and the vertical coordinate content value to determine whether it is the information to be parsed;
[0069] Step 3.1.4, create a temporary file through the NPOI component and temporarily save the information to be parsed;
[0070] Step 3.1.5, loop the above steps, read the next target management file and perform content parsing.
[0071] And refer to Figure 7 As shown in the figure, if the target management file is in the Gantt chart format, the specific steps include:
[0072] Step 3.2.1, read the corresponding content and the pixel coordinate interval T of the cell in the row and column of the Gantt chart in character form y and T x ;
[0073] Step 3.2.2, according to the legend in the Gantt chart, retrieve the graphic elements in the table in character form;
[0074] Step 3.2.3, read the starting coordinate L of the pixel position of the graphic element in the Gantt chart in the table through the Spire component s and the end point coordinates L e ;
[0075] Step 3.2.4, determine the starting point coordinates L after comparison s and the end point coordinates L e Whether it is the information that needs to be parsed;
[0076] Step 3.2.5, create a temporary file through the NPOI component and temporarily save the information to be parsed;
[0077] Step 3.2.6, loop the above steps, read the next target management file and perform content parsing.
[0078] Among them, the coordinate interval of the cell where the Gantt chart column is located is T y Represented as T y (Y a , Y b ), the coordinate interval of the cell where the Gantt chart row is located is T x Represented as T x (X a , X b ), the starting point coordinate L of the pixel position of the graphic element in the Gantt chart s Indicated as L s (X s , Y s ), the end point coordinate L of the pixel position of the graphic element in the Gantt chart e Indicated as L e (X e , Y e ). If Y a <Y s <Y e <Y b And X a <X s <X e <X b, then the information expressed by the point is determined to be the information that needs to be parsed. When the information that needs to be parsed is obtained, a temporary file is created through the NPOI component to temporarily store the information that needs to be parsed. NPOI is the .NET version of the POI project, and POI is an open source Java project that reads and writes Microsoft OLE2 component documents such as Excel and Word. Using NPOI, you can read and write Excel and Word documents on machines that do not have Office or the corresponding environment installed.
[0079] In addition, when the target management file is a table type file, the table type file can automatically calculate the adjustment value. That is, the LOT table is upgraded. After the upgrade, we will compare the scheduled use days before and after the upgrade, and then we can calculate the "number of scheduled use days". Then traverse the data to be parsed to identify whether the "number of scheduled use days" is greater than three days. If it is greater than three days, repeat steps 3.1.2 to 3.1.5 to generate the "correct version of scheduled use days". If it is less than three days, proceed directly to the subsequent steps.
[0080] Below we will further explain the fixed plate schedule and LOT table. The fixed plate schedule is used to track the nodes of the total assembly of the blocks and the nodes of the total section loading. The LOT table is used to track the installation nodes of the small assembly, the medium assembly and the large assembly. Specifically, the current shipyard generally adopts the method of block manufacturing and slipway assembly when building the hull, that is, according to the structural characteristics of the hull, the production conditions of the shipyard, the shipbuilding process, etc., the hull is divided into several sections, which are first built separately on the platform of the workshop or other venues, and the small sections are assembled into large sections or total sections, and finally assembled on the slipway in sequence to form a complete hull. Therefore, when the shipyard builds the hull, we use the fixed plate schedule to track and record the total assembly nodes of the sections and the loading nodes of the total sections. The block construction process of the hull is roughly divided into three steps: small assembly, medium assembly and large assembly. Among them, the small assembly of the hull is the initial stage of the hull block assembly, which is to assemble the components and parts into system components. The medium assembly is to assemble multiple system components into components, that is, multi-system modules or small sections that make up the sections. The large assembly combines these multi-system modules or small sections into sections, which are called master sections, and then the sections and master sections are combined into a ship. Therefore, the LOT table is used to track and record the installation nodes during the small, medium and large assemblies.
[0081] The Gantt chart is mainly used for the schedule. The Gantt chart uses a bar chart to show the internal relationship between the project, schedule and other time-related system progress as time progresses. The Gantt chart uses a list of activities and a time scale to graphically represent the sequence and duration of a specific project. The horizontal axis represents time, the vertical axis represents the project, and the lines represent the planned and actual completion of the period. It intuitively shows when the plan should be carried out, so that managers can understand the remaining tasks of the project and evaluate the progress of the work.
[0082] Reference Figure 2 As shown, Figure 2 It is a schematic diagram of the LOT table. Among them, the horizontal axis in the table includes the content values of the ship number, large segment name, UNIT (unit) name, LOT number, large group scheduled date, use scheduled date and purchase scheduled days. Specifically, first use the Spire.XLS component to load the Excel type target management file, read and traverse each cell in the LOT table. Spire.XLS is a component for Excel table processing, which can realize basic functions such as value acquisition, assignment, setting cell style, etc. It can also convert uploaded Excel into PDF and common xml, Image, Html files, etc. In addition, the Spire.XLS component can also solve the problem of generating charts. Traverse each cell in the LOT table, and use conditional statements to retrieve the content values of the vertical coordinates corresponding to the horizontal coordinates of "ship number" and "large segment name" in character form. Extract the content values of the vertical coordinates corresponding to the horizontal coordinates of "large group scheduled date" and "use scheduled date" and save them as T. a and T b , and then compare the content values of "large group reservation date" and "use reservation date". a >T b , indicating that the time of the group's scheduled date is later than the time of the scheduled date, then T b The information needed to express the scheduled date of use is completed in this way. Then, the above steps are repeated to continue reading the corresponding information of the next large group, and all target management files are analyzed to achieve the purpose of integrating management file data. Finally, the ImportExcel command is used to create a new file in the specified path, and "vessel number", "scheduled date of use" and other lists are created in the new file, and the data information obtained after analysis is written into the new file and automatically saved. The LOT table output after analysis is as follows Figure 3 shown.
[0083] ImportExcel can be understood as a powerful class library for operating Excel based on the PowerShell environment. It can be used on Windows, Linux and Mac, making it easier to create tables, pivot tables, summaries, charts, etc. Another good point is that it allows users to directly operate Excel files without installing Microsoft Office or using COM objects, so it can be used directly on servers that do not have Office installed.
[0084] Furthermore, refer to Figure 2As shown. The LOT table will automatically upgrade. After the upgrade, we will compare and calculate the scheduled use days before and after the upgrade, and then we can calculate the "number of scheduled use days". Then we traverse the data that needs to be analyzed to identify whether the "number of scheduled use days" is greater than three days. If it is greater than three days, repeat steps 3.1.2 to 3.1.5 to generate the "correct version of scheduled use days". If it is less than three days, proceed directly to the subsequent steps.
[0085] Specific reference Figure 4 As shown, Figure 4 The following is a schematic diagram of the fixed-plate reservation table. The horizontal axis in the table includes the date and time, and the vertical axis includes the zone / segment name. The date and time also include the countdown date of the water entry date and the start date. First, in the fixed-plate reservation table, extract the information of the segment name of each row and the Gantt chart pixel coordinate interval T of the cell in the zone / segment name column in character form. y (Y a , Y b ), Y a Indicates the segment name in the first row, Y b Indicates the segment name at the end of the last row. The linear period is also read in character form in the date and time row, as well as the Gantt chart pixel coordinate interval T of the cell where it is located. x (X a , X b ), X a Indicates the date and time in the first column, X b Indicates the date and time at the end of the last column.
[0086] In addition, we Figure 4 In it, you can see symbols such as “■, □, ▲, △, ○”. Among them, “■” indicates the scheduled moving-out date of the large group, which is the planned date for the internal segmented moving-out and the corresponding construction node return value. “□” indicates the delivery period of the outsourced segment, which is the completion date of the outsourced segment and the corresponding construction node return value. “▲” indicates the moving-out performance, which is the actual moving-out date and the corresponding construction node return value. “△” indicates hull inspection, which is the inspection date of the completed hull and the corresponding construction node return value. “○” indicates loading, which is the loading date of the completed segment and the corresponding construction node return value. According to the legend in the Gantt chart, retrieve the graphic elements in the table in character form. Then, use the Spire method to obtain the starting and ending coordinate values L of the shape graphic element s (X s , Y s )、L e (X e , Y e ). Among them, L s Indicates the coordinate value of the starting point of the shape graphic element, L eIndicates the coordinate value of the end point of the shape graphic element, X s Indicates the planned date and time of the starting point of the shape graphic element, Y s Indicates the segment name corresponding to the starting point of the shape graphic element, X e Indicates the planned date and time of the end point of the shape graphic element, Y e Indicates the segment name of the corresponding end point of the shape graphic element. Then determine the starting and ending coordinate values of the shape graphic element according to the above steps. e and L s Is it within the range? a <Y s <Y e <Y b And X a <X s <X e <X b That is to say, if the coordinate values of the starting point and the end point of the shape element are between the first and last row of segment names and the first and last columns of planned dates and times, then the starting and ending points of the shape graphic element are determined to be the information to be expressed. This completes a file content analysis cycle.
[0087] Then, continue to loop the above steps to read the corresponding information of the next segment, and wait until all segment management files are analyzed to achieve the purpose of integrating management file data. Finally, call the ImportExcel command to create a new file in the specified path. This command can help us import Excel tables into the database. Create "ship number", "division / segment name" and other lists in the file, and then write the data information obtained after analysis into the new file and save it automatically.
[0088] In order to implement the above-mentioned embodiment, the present disclosure also proposes a device for parsing the content of ship management files. The device includes an identification module, which is used to load the target management file to be parsed and determine the type of the file through format recognition. A reading module is used to select a corresponding method for reading according to the type of the target management file. A comparison module is used to compare and determine the information expressed by the coordinate axis based on the coordinate axis in the target management file. A parsing and integration module is used to cyclically extract the information expressed by the coordinate axis to form a target integration file. An export module is used to write and save the target integration file into a newly created file.
[0089] In order to implement the above embodiments, the present disclosure also provides an electronic device. Figure 8As shown, the electronic device 800 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 801, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 802 or a program loaded from a storage device 808 into a random access memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the electronic device 800 are also stored. The processing device 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.
[0090] Typically, the following devices may be connected to the I / O interface 805: input devices 806 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; output devices 807 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 808 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 809. The communication device 809 may allow the electronic device 800 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 8 The electronic device 800 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead. Figure 8 Each block shown in the figure may represent one device, or may represent multiple devices as required.
[0091] In particular, according to some embodiments of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, some embodiments of the present disclosure include a computer program product, which includes a computer program carried on a computer storage medium, and the computer program contains program code for executing the method shown in the flowchart. In some such embodiments, the computer program can be downloaded and installed from the network through the communication device 809, or installed from the storage device 808, or installed from the ROM 802. When the computer program is executed by the processing device 801, the above-mentioned functions defined in the method of some embodiments of the present disclosure are executed.
[0092] It should be noted that the computer storage medium described above in some embodiments of the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0093] In some embodiments of the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device, or device. In some embodiments of the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer storage medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in combination with an instruction execution system, device, or device. The program code contained on the computer storage medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0094] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (Hyper Text Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.
[0095] The computer storage medium may be included in the electronic device or may exist independently without being installed in the electronic device. The computer storage medium carries one or more programs, and when the one or more programs are executed by the electronic device, the electronic device can implement the method for parsing the contents of ship management files.
[0096] Computer program code for performing the operations of some embodiments of the present disclosure may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0097] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the module, program segment, or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than that marked in the accompanying drawings.
[0098] For example, two boxes represented in succession may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of boxes in the block diagram and / or flow chart, may be implemented by a dedicated hardware-based system that performs the specified function or operation, or may be implemented by a combination of dedicated hardware and computer instructions. The units described in some embodiments of the present disclosure may be implemented by software or by hardware. The described units may also be arranged in a processor, and the names of these units do not constitute limitations on the units themselves in some cases.
[0099] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.
[0100] The above descriptions are only some preferred embodiments of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the embodiments of the present disclosure is not limited to the technical solutions formed by a specific combination of the above-mentioned technical features, but should also cover other technical solutions formed by any combination of the above-mentioned technical features or their equivalent features without departing from the above-mentioned inventive concept. For example, the above-mentioned features are replaced with the technical features with similar functions disclosed in the embodiments of the present disclosure (but not limited to) and the technical solutions formed.
Claims
1. A method for analyzing the contents of a ship management document, characterized in that: The steps include: Step 1, in response to loading a target management file to be parsed, determining the type of the target management file by format; Step 2, in response to selecting a corresponding method for reading according to the type of the target management file; Step 3, in response to retrieving the content value of the target management file and its corresponding coordinate axis, comparing and obtaining the information required for analysis; Step 4, in response to cyclically extracting the information required for parsing in the target management file, forming a target integration file; Step 5, in response to writing and saving the target integrated file into the newly created parsed file.
2. A method for parsing contents of a ship management file according to claim 1, characterized in that: In step 2, a corresponding method is selected for reading according to the type of the target management file, specifically, When the target management file is in EXCEL or WORD format, NPOI or Spire components must be referenced; When the format of the target management file is PDF, iTextSharp, Spire or Aspose components need to be referenced.
3. A method for analyzing the contents of a ship management file according to claim 2, characterized in that: When the target management file is a table format file, in step 3, the content value of the target management file and its corresponding coordinate axis are extracted, and the information expressed by the coordinate axis is obtained after comparison and determination. The specific steps include: Step 3.1.1, reading and traversing each cell in the target management file in a table format; Step 3.1.2, retrieve the content values corresponding to the horizontal and vertical coordinates in character form; Step 3.1.3, comparing the horizontal coordinate content value and the vertical coordinate content value to determine whether it is the information to be parsed; Step 3.1.4, create a temporary file through the NPOI component and temporarily save the information to be parsed; Step 3.1.5, loop the above steps, read the next target management file and perform content analysis.
4. A method for analyzing the contents of a ship management file according to claim 3, characterized in that: When the target management file is a Gantt chart format file, in step 3, the content value of the target management file and its corresponding coordinate axis are extracted, and the information expressed by the coordinate axis is obtained after comparison and determination. The specific steps include: Step 3.2.1, read the corresponding content and the pixel coordinate interval T of the cell in the row and column of the Gantt chart in character form y and T x ; Step 3.2.2, according to the legend in the Gantt chart, retrieve the graphic elements in the table in character form; Step 3.2.3, read the starting coordinate L of the pixel position of the graphic element through the Spire component s and the end point coordinates L e ; Step 3.2.4, determine the starting point coordinate L through comparison s and the end point coordinates L e Whether it is the information that needs to be parsed; Step 3.2.5, create a temporary file through the NPOI component and temporarily save the information to be parsed; Step 3.2.6, loop the above steps, read the next target management file and perform content analysis.
5. A method for parsing contents of a ship management file according to claim 4, characterized in that: The coordinate interval T of the cell where the Gantt chart column is located y Represented as T y (Y a , Y b ), the coordinate interval of the cell where the Gantt chart row is located is T x Represented as T x (X a , X b ), the starting point coordinate L of the pixel position of the graphic element in the Gantt chart s Indicated as L s (X s , Y s ), the end point coordinate L of the pixel position of the graphic element in the Gantt chart e Indicated as L e (X e , Y e ); If Y a <Y s <Y e <Y b And X a <X s <X e <X b , then it is determined that the information expressed by this point is the information that needs to be analyzed.
6. A method for parsing contents of a ship management file according to claim 3, characterized in that: Furthermore, when the target management file is a table type file, the table type file can calculate the date adjustment value, traverse the data to be parsed obtained in the above steps, and identify and generate correct data information for final use.
7. A content analysis device for a ship management file, characterized in that: include: An identification module is used to load the target management file to be parsed and determine the type of the file through format identification; A reading module, used for selecting a corresponding method for reading according to the type of the target management file; A comparison module, used for comparing and judging the information expressed by the coordinate axis according to the coordinate axis in the target management file; A parsing and integration module, used for cyclically extracting the information expressed by the coordinate axes to form a target integration file; The export module is used to write and save the target integrated file into a newly created file.
8. An electronic device, characterized in that: include: at least one processor, and a memory communicatively coupled to the at least one processor; The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can perform the steps of the method according to any one of claims 1 to 6.
9. A computer storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps according to any one of claims 1 to 6 are implemented.
Citation Information
Cited By
Cross-platform adaptive method and device based on target component
CN122526619A
