SEGY file storage mode rapid discrimination method and device, equipment and medium

By identifying the header information of SEGY files, managing authorization and parsing file descriptors, the problem of inaccurate judgment of SEGY file storage methods in the prior art is solved, and a higher discrimination accuracy is achieved.

CN119917467APending Publication Date: 2025-05-02CHINA PETROLEUM & CHEMICAL CORP +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311436563.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-10-31
Publication Date
2025-05-02

AI Technical Summary

Technical Problem

The prior art cannot accurately determine whether the storage method of SEGY files has been converted through format, resulting in low accuracy in the judgment of storage method.

Method used

By obtaining the header information of the earthquake file to be parsed, building a call program, releasing communication connectors to the kernel space, managing authorization files, querying file descriptors, locate binary characters, parsing character information, determining storage locations, and searching fixed bytes to distinguish storage methods.

Benefits of technology

It improves the accuracy of the rapid identification of SEGY file storage method, can accurately determine whether the file has been converted through format and determine its storage mode.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119917467A_ABST
    Figure CN119917467A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of seismic data storage and detection, and discloses an SEGY file storage mode rapid discrimination method, device, equipment and medium, and the method comprises the steps: recognizing the header information of a to-be-analyzed seismic file, setting the operation mode of the to-be-analyzed seismic file, and constructing a call program according to the header information and the file operation mode; releasing a communication connector to a kernel space of the to-be-analyzed seismic file by using the calling program to obtain a connection space, and performing management authorization on the to-be-analyzed seismic file to obtain a management file; querying a file descriptor of the management file, positioning a binary character of the management file by using the file descriptor to obtain a character return pointer, and analyzing information of the character return pointer to obtain a storage position of the management file; and retrieving the fixed bytes in the storage position, calculating the byte number of the fixed bytes, and judging the storage mode of the seismic file to be analyzed according to the byte number. According to the method, the quick judgment accuracy of the SEGY file storage mode can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of seismic data storage detection, and in particular to a method, device, equipment and medium for quickly distinguishing a SEGY file storage mode. Background Art

[0002] SEGY is the abbreviation of "Seismic Data Exchange Format", which is a standard format for storing and exchanging seismic exploration data. SEGY files usually contain various information of seismic data, such as seismic profiles, seismic records, etc. There are generally two ways to store SEGY files, big endian and little endian.

[0003] At present, the main way to judge the storage mode of SEGY files is through the technical personnel specifying whether the processing is in workstation mode or PC mode. However, this method cannot determine whether the current data processing file has undergone format conversion after seismic data acquisition, and whether the file storage format is big-endian storage or little-endian storage, resulting in insufficient accuracy in judging the storage mode of SEGY files. Summary of the invention

[0004] In view of the above problems, embodiments of the present invention provide a method, device, equipment and medium for quickly identifying the storage mode of a SEGY file.

[0005] In a first aspect, an embodiment of the present invention provides a method for quickly identifying a SEGY file storage mode, comprising:

[0006] Acquire a seismic file to be parsed, identify header information of the seismic file to be parsed, set a file operation mode of the seismic file to be parsed, and construct a calling program of the seismic file to be parsed according to the header information and the file operation mode;

[0007] Using the calling program, releasing the communication connector to the kernel space of the seismic file to be parsed, obtaining the connection space, and using the connection space, performing management authorization on the seismic file to be parsed, obtaining the management file;

[0008] Querying the file descriptor of the management file, using the file descriptor to locate the binary character of the management file, obtaining a character return pointer, parsing the character information of the character return pointer, and obtaining the storage location of the management file;

[0009] The fixed bytes in the storage location are retrieved, the number of bytes of the fixed bytes is calculated, and the storage mode of the seismic file to be parsed is determined according to the number of bytes.

[0010] According to an embodiment of the present invention, the calling program of constructing the seismic file to be parsed according to the header information and the file operation mode includes:

[0011] Constructing a calling text box of the seismic file to be parsed;

[0012] Convert the header information into parameters to be operated, and convert the file operation mode into operation instruction parameters;

[0013] The parameters to be operated and the operation instruction parameters are input into the calling text box, and the calling text box is activated to obtain the calling program of the seismic file to be parsed.

[0014] According to an embodiment of the present invention, the method of using the calling program to release a communication connector to the kernel space of the seismic file to be parsed to obtain a connection space includes:

[0015] Constructing a synchronous channel between the calling program and the kernel space, and generating a communication connector for the calling program;

[0016] Transmitting the communication connector to the kernel space via the synchronization channel;

[0017] The communication transmission symbol is credit authenticated in the kernel space to obtain a connection space.

[0018] According to an embodiment of the present invention, the use of the connection space to manage and authorize the seismic file to be parsed to obtain a management file includes:

[0019] Formulate a communication process and data exchange rules between the seismic file to be parsed and the connection space, and generate a data transmission protocol between the connection space and the seismic file to be parsed;

[0020] Based on the communication process, the data exchange rules and the data transmission protocol, a communication protocol between the connection space and the seismic file to be parsed is constructed;

[0021] Based on the communication protocol, management authorization is performed on the seismic file to be analyzed to obtain a management file.

[0022] According to an embodiment of the present invention, the step of using the file descriptor to locate the binary character of the management file and obtaining a character return pointer includes:

[0023] Construct a character query function for the file descriptor and use the following formula to calculate the return value of the character query function:

[0024]

[0025] Among them, G represents the return value, n represents the number of file descriptors, and n i Represents the i-th descriptor of the file descriptor, ∈(n i ) represents the return function of the file descriptor, θ represents the character query function, m j represents the jth character of a binary character, ρ represents the character encoding function, and m represents the number of binary characters;

[0026] The binary character of the management file is located according to the return value to obtain a character return pointer.

[0027] According to an embodiment of the present invention, parsing the character information of the character return pointer to obtain the storage location of the management file includes:

[0028] Identify the file attribute character in the character return pointer;

[0029] Decoding the file attribute characters to obtain file attributes;

[0030] Query the file management interface of the management file according to the file attributes;

[0031] Query the storage address number of the management file according to the file management interface;

[0032] The storage location of the management file is obtained according to the storage address number.

[0033] In a second aspect, an embodiment of the present invention provides a device for quickly distinguishing a storage mode of a SEGY file, characterized in that it includes:

[0034] A program construction module is used to obtain a seismic file to be parsed, identify header information of the seismic file to be parsed, set a file operation mode of the seismic file to be parsed, and construct a calling program of the seismic file to be parsed according to the header information and the file operation mode;

[0035] A management authorization module is used to use the calling program to release a communication connector to the kernel space of the seismic file to be parsed to obtain a connection space, and use the connection space to perform management authorization on the seismic file to be parsed to obtain a management file;

[0036] A character parsing module, used for querying the file descriptor of the management file, locating the binary character of the management file by using the file descriptor, obtaining a character return pointer, parsing the character information of the character return pointer, and obtaining the storage location of the management file;

[0037] The storage identification module is used to retrieve the fixed bytes in the storage position, calculate the number of bytes of the fixed bytes, and identify the storage mode of the seismic file to be parsed according to the number of bytes.

[0038] In a third aspect, an embodiment of the present invention provides an electronic device, comprising:

[0039] processor;

[0040] a memory for storing instructions executable by the processor;

[0041] Wherein, the processor is configured to execute the instructions to implement a method for quickly identifying a SEGY file storage mode as described in the first aspect.

[0042] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a method for quickly identifying a SEGY file storage mode as described in the first aspect.

[0043] Compared with the prior art, the above technical solution of the present invention has the following beneficial effects:

[0044] The embodiment of the present invention can first determine the file structure of the seismic file to be parsed by identifying the header information of the seismic file to be parsed, and then set the file access mode according to the file structure, and set the file operation mode of the seismic file to be parsed, which can provide a basic operation basis for the subsequent operation mode required for the seismic file to be parsed, and can also accurately perform operations such as reading and writing on the file, and by using the calling program, the communication connector is released to the kernel space of the seismic file to be parsed, and the connection space can be obtained to connect the operating system and the application program to provide operating resources for the operating system, and the connection space is used to manage and authorize the seismic file to be parsed, and the management file can obtain the file viewing authority, and then all the information of the seismic file to be parsed can be queried; further, the embodiment of the present invention can obtain the special characters describing the file by querying the file descriptor of the management file, and then the required file is queried, and the fixed bytes in the storage position can be retrieved as a prelude for the subsequent byte number calculation, because the fixed bytes of the SEGY file have particularity, so querying the fixed bytes of the SEGY file is of great significance to analyzing the storage mode of the SEGY file, and the storage mode of the seismic file to be parsed can be determined by calculating the number of bytes of the fixed bytes. Therefore, the embodiments of the present invention provide a method, device, equipment and medium for quickly distinguishing the storage mode of a SEGY file, which improves the accuracy of quickly distinguishing the storage mode of a SEGY file. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] 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 some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0046] Figure 1 The flowchart of the method for quickly distinguishing the storage mode of a SEGY file according to the first embodiment of the present invention is shown;

[0047] Figure 2 A functional module diagram of a device for quickly distinguishing the storage mode of a SEGY file according to a third embodiment of the present invention is shown;

[0048] Figure 3 A schematic diagram showing the composition structure of an electronic device for implementing the method for quickly distinguishing the storage mode of a SEGY file according to the fifth embodiment of the present invention is shown; DETAILED DESCRIPTION

[0049] The present disclosure is further described below in conjunction with the embodiments shown in the accompanying drawings.

[0050] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present invention will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0051] Embodiment 1

[0052] like Figure 1 As shown, the present invention proposes a method for quickly distinguishing the storage mode of a SEGY file, comprising the following steps:

[0053] S1. Acquire a seismic file to be parsed, identify header information of the seismic file to be parsed, set a file operation mode of the seismic file to be parsed, and construct a calling program of the seismic file to be parsed according to the header information and the file operation mode.

[0054] The embodiment of the present invention can determine the file structure of the seismic file to be parsed by identifying the header information of the seismic file to be parsed, and then set the file access method according to the file structure. The header information refers to the basic description and parameter settings of the file, such as data format, sampling rate, number of sampling points, data compression method, etc.

[0055] Optionally, the header information of the seismic file to be parsed is identified by reading the metadata of the seismic file to be parsed using a metadata reading code generated by Java language.

[0056] Furthermore, the embodiment of the present invention can provide a basic operation basis for the subsequent operation mode required for the seismic file to be parsed by setting the file operation mode of the seismic file to be parsed, and can also accurately perform operations such as reading and writing on the file.

[0057] Optionally, the file operation mode of setting the seismic file to be parsed is generated by a file operation function generated by Python language.

[0058] The embodiment of the present invention constructs a calling program for the seismic file to be parsed according to the header information and the file operation mode, so that the file operation to be performed can be programmed and then the file operation can be performed automatically, wherein the calling program refers to a function generated by languages ​​such as Java and Python to achieve a certain purpose or complete a certain task.

[0059] As an embodiment of the present invention, the calling program of the seismic file to be parsed is constructed according to the header information and the file operation mode, including: constructing a calling text box of the seismic file to be parsed, converting the header information into parameters to be operated, converting the file operation mode into operation instruction parameters, inputting the parameters to be operated and the operation instruction parameters into the calling text box, and activating the calling text box to obtain the calling program of the seismic file to be parsed.

[0060] The calling text box refers to the basic framework of the operating program, and the parameters refer to the basic codes that can be read and used by the program.

[0061] Optionally, the calling text box of the seismic file to be parsed is generated by Java, and the parameters to be operated and the operation instruction parameters are converted by binary code.

[0062] S2. Using the calling program, release the communication connector to the kernel space of the seismic file to be parsed to obtain the connection space, and using the connection space to perform management authorization on the seismic file to be parsed to obtain the management file.

[0063] The embodiment of the present invention utilizes the calling program to release a communication connector to the kernel space of the seismic file to be parsed, and obtains a connection space that can connect the operating system and the application to provide operating resources for the operating system. The kernel space refers to a part of the operating system used to execute kernel code and process system resources, and the communication connector refers to special characters, strings, marks, etc. used to establish and maintain communication connections.

[0064] As an embodiment of the present invention, the method of using the calling program to release a communication connector to the kernel space of the seismic file to be parsed to obtain a connection space includes: constructing a synchronous channel between the calling program and the kernel space, generating a communication connector of the calling program, transmitting the communication connector to the kernel space through the synchronous channel, and performing credit authentication on the communication transmission symbol in the kernel space to obtain a connection space. The synchronous channel refers to a channel that keeps a constant time for data transmission and has a data adjustment function, and the credit authentication refers to authorization of data communication.

[0065] Optionally, the synchronous channel between the calling program and the kernel space is constructed through a pss channel, and the communication connector of the calling program is generated through a script generated by java language.

[0066] Furthermore, the embodiment of the present invention uses the connection space to manage and authorize the seismic file to be parsed, and the management file can obtain the file viewing authority, and then all the information of the seismic file to be parsed can be queried.

[0067] As an embodiment of the present invention, the use of the connection space to manage and authorize the seismic file to be parsed to obtain a management file includes: formulating a communication process and data exchange rules between the seismic file to be parsed and the connection space, and generating a data transmission protocol between the connection space and the seismic file to be parsed, constructing a communication protocol between the connection space and the seismic file to be parsed based on the communication process, the data exchange rules and the data transmission protocol, and authorizing the seismic file to be parsed based on the communication protocol to obtain a management file.

[0068] Among them, the communication process refers to the method of transmitting and receiving data, the data exchange rule is the format of the file directly received or transmitted, the data transmission protocol refers to a mechanism provided by a layer of the data link for data transmission, and the communication protocol refers to a security protocol for data transmission to ensure the security of data transmission.

[0069] Optionally, the communication process and data exchange rules between the seismic file to be parsed and the connection space are generated by Python language according to preset communication protocols and data exchange rules, and the data transmission protocol between the connection space and the seismic file to be parsed is generated by TCP communication protocol, and the communication protocol is generated by HTTP application protocol.

[0070] S3. Query the file descriptor of the management file, use the file descriptor to locate the binary character of the management file, obtain a character return pointer, parse the character information of the character return pointer, and obtain the storage location of the management file.

[0071] In the embodiment of the present invention, the special characters describing the file can be obtained by querying the file descriptor of the management file, and then the required file can be queried. The file descriptor refers to an integer value used to identify and operate a file or an input / output device. In UNIX-like systems, including Linux and MacOS, each open file or device is assigned a unique file descriptor.

[0072] Optionally, the file descriptor of the management file is queried through a script generated by JAVA language.

[0073] Furthermore, the embodiment of the present invention uses the file descriptor to locate the binary character of the management file, and obtains the character return pointer, so as to query the specific location of the track data of the management file in the storage system, and then understand the encoding information of the management file.

[0074] As an embodiment of the present invention, the method of locating the binary character of the management file by using the file descriptor to obtain a character return pointer includes: constructing a character query function of the file descriptor, and calculating the return value of the character query function by using the following formula:

[0075]

[0076] Among them, G represents the return value, n represents the number of file descriptors, and n i Represents the i-th descriptor of the file descriptor, ∈(n i ) represents the return function of the file descriptor, θ represents the character query function, m j represents the jth character of a binary character, ρ represents the character encoding function, m represents the number of binary characters,

[0077] The binary character of the management file is located according to the return value to obtain a character return pointer.

[0078] Optionally, the character query function is constructed using Python language.

[0079] The embodiment of the present invention can obtain the storage location of the management file by parsing the character information of the character return pointer to understand the storage information of the management file, and then query the storage node of the file information to be queried according to the storage information. The character return pointer refers to the information feedback character, that is, the task feedback information returned by the system when a certain task is executed.

[0080] As an embodiment of the present invention, parsing the character information of the character return pointer to obtain the storage location of the management file includes: identifying the file attribute characters in the character return pointer, decoding the file attribute characters to obtain the file attributes, querying the file management interface of the management file according to the file attributes, querying the storage address number of the management file according to the file management interface, and obtaining the storage location of the management file according to the storage address number.

[0081] The file attribute characters refer to characters describing file attributes, such as file format, creation time, file path, etc.; the storage address number refers to the IP address number.

[0082] The optional file attribute characters are identified by querying the character source code of the character return pointer, the file attribute characters are decoded, the file attributes are obtained by generating a character decoding script in java to identify, and the storage IP of the management file is queried by the ipconfig tool generated in C language.

[0083] S4, retrieving the fixed bytes in the storage location, calculating the number of the fixed bytes, and determining the storage mode of the seismic file to be parsed according to the number of bytes.

[0084] In the embodiment of the present invention, the fixed bytes in the storage location can be retrieved as a prelude for the subsequent byte number calculation, because the fixed bytes of the SEGY file are special, and thus querying the fixed bytes of the SEGY file is of great significance for analyzing the storage method of the SEGY file. The byte refers to a basic unit for recording information in a computer system, and the fixed bytes are preset 3225-3226 bytes.

[0085] Optionally, the fixed bytes in the storage location are queried by generating a byte retrieval script using the Python language. Since the bytes are stored in a fixed order of 0, 1, 2, by inputting byte parameters in the byte retrieval script, the script automatically locates the set byte parameter point to obtain the fixed bytes.

[0086] Furthermore, the embodiment of the present invention can determine the storage mode (big-endian mode, little-endian mode) of the seismic file to be parsed by calculating the number of bytes of the fixed bytes.

[0087] As an embodiment of the present invention, the calculation of the number of bytes of the fixed bytes includes: identifying the encoding tool of the fixed bytes, and querying the encoding rules of the encoding tool, obtaining the number of encoded characters of the fixed bytes according to the encoding rules, and calculating the number of bytes of the fixed bytes according to the number of encoded characters.

[0088] Among them, the encoding tool refers to a tool for converting data into code, such as tensorflow, pytorch, keras, etc., and the encoding rule refers to the encoding method, such as each character in ASCII encoding occupies 1 byte, while Chinese characters in UTF-8 encoding occupy 3 bytes.

[0089] Optionally, the fixed-byte encoding tool is identified by querying the fixed-byte file format. It should be noted that each encoding tool has fixed encoding rules. The encoding rules can be understood by obtaining the encoding tool. The number of encoded characters of the fixed byte is calculated by the encoded characters. For example, one character in ASCII encoding means that the fixed byte contains one byte.

[0090] Furthermore, in an embodiment of the present invention, the storage method of the seismic file to be parsed is determined based on the number of bytes. When the number of bytes is an integer multiple of 1 to 8, it is stored in little endian format, otherwise it is stored in big endian format. The storage method of the seismic file to be parsed can be understood based on the rule.

[0091] Embodiment 2

[0092] In order to understand the present invention more clearly, a second embodiment is used below to further explain the situation in which the number of bytes of the fixed bytes in the embodiment of the present invention is calculated.

[0093] The present invention can pave the way for subsequent byte number calculations based on the header information and the calculation of the number of bytes of the fixed bytes, because the fixed bytes of the SEGY file are special, and thus querying the fixed bytes of the SEGY file is of great significance for analyzing the storage method of the SEGY file. Among them, the byte refers to a basic unit for recording information in a computer system, and the fixed bytes are preset 3225-3226 bytes.

[0094] As an embodiment of the present invention, the calculation of the number of bytes of the fixed bytes includes: identifying the encoding tool of the fixed bytes, and querying the encoding rules of the encoding tool, obtaining the number of encoded characters of the fixed bytes according to the encoding rules, and calculating the number of bytes of the fixed bytes according to the number of encoded characters.

[0095] Among them, the encoding tool refers to a tool for converting data into code, such as tensorflow, pytorch, keras, etc., and the encoding rule refers to the encoding method, such as each character in ASCII encoding occupies 1 byte, while Chinese characters in UTF-8 encoding occupy 3 bytes.

[0096] Optionally, the fixed-byte encoding tool is identified by querying the fixed-byte file format. It should be noted that each encoding tool has fixed encoding rules. The encoding rules can be understood by obtaining the encoding tool. The number of encoded characters of the fixed byte is calculated by the encoded characters. For example, one character in ASCII encoding means that the fixed byte contains one byte.

[0097] Furthermore, in another optional embodiment of the present invention, the step of calculating the number of bytes of the fixed bytes according to the number of coded characters includes:

[0098] The number of bytes of the fixed bytes is calculated using the following formula:

[0099]

[0100] Among them, m represents the number of fixed bytes, n represents the number of coded characters, k i represents the i-th byte in the fixed bytes, and ε represents the encoding rule function.

[0101] The encoding rule function refers to a function constructed according to the encoding rule. For example, one character corresponds to one byte and can be expressed as a=b, and one character corresponds to three bytes and can be expressed as a=3b, where a represents the number of characters and b represents the number of bytes.

[0102] Embodiment 3

[0103] like Figure 2 , which is a functional module diagram of a SEGY file storage mode rapid identification device provided in this embodiment.

[0104] The SEGY file storage mode fast identification device 100 described in this embodiment can be installed in an electronic device. According to the functions to be implemented, the SEGY file storage mode fast identification device 100 may include a program construction module 101, a management authorization module 102, a character parsing module 103 and a storage identification module 104. The module described in the present invention can also be called a unit, which refers to a series of computer program segments that can be executed by an electronic device processor and can complete fixed functions, which are stored in the memory of the electronic device.

[0105] In this embodiment, the functions of each module / unit are as follows:

[0106] The program construction module 101 is used to obtain the seismic file to be parsed, identify the header information of the seismic file to be parsed, set the file operation mode of the seismic file to be parsed, and construct the calling program of the seismic file to be parsed according to the header information and the file operation mode;

[0107] The management authorization module 102 is used to use the calling program to release the communication connector to the kernel space of the seismic file to be parsed to obtain the connection space, and use the connection space to perform management authorization on the seismic file to be parsed to obtain the management file;

[0108] The character parsing module 103 is used to query the file descriptor of the management file, locate the binary character of the management file using the file descriptor, obtain the character return pointer, parse the character information of the character return pointer, and obtain the storage location of the management file;

[0109] The storage determination module 104 is used to retrieve the fixed bytes in the storage location, calculate the number of the fixed bytes, and determine the storage mode of the seismic file to be parsed according to the number of bytes.

[0110] In detail, each module described in the SEGY file storage mode rapid identification device 100 described in the embodiment of the present invention adopts the same technical means as the SEGY file storage mode rapid identification method described in Example 1 and Example 2 when in use, and can produce the same technical effect, which will not be repeated here.

[0111] Embodiment 4

[0112] like Figure 3 As shown, a computer electronic device provided in this embodiment may include a processor 10, a memory 11, a communication bus 12 and a communication interface 13, and may also include a computer program stored in the memory 11 and executable on the processor 10, such as a SEGY file storage mode quick identification program.

[0113] In some embodiments, the processor 10 may be composed of an integrated circuit, for example, a single packaged integrated circuit, or a plurality of packaged integrated circuits with the same or different functions, including one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and combinations of various control chips. The processor 10 is the control core (ControlUnit) of the electronic device, and uses various interfaces and lines to connect various components of the entire electronic device, and executes or executes programs or modules stored in the memory 11 (for example, executing a SEGY file storage method fast identification program, etc.), and calls data stored in the memory 11 to execute various functions of the electronic device and process data.

[0114] The memory 11 includes at least one type of readable storage medium, and the readable storage medium includes a flash memory, a mobile hard disk, a multimedia card, a card-type memory (for example, an SD or DX memory, etc.), a magnetic memory, a disk, an optical disk, etc. In some embodiments, the memory 11 may be an internal storage unit of an electronic device, such as a mobile hard disk of the electronic device. In other embodiments, the memory 11 may also be an external storage device of an electronic device, such as a plug-in mobile hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the electronic device. Further, the memory 11 may also include both an internal storage unit of the electronic device and an external storage device. The memory 11 may not only be used to store application software and various types of data installed in the electronic device, such as the code of the SEGY file storage method quick identification program, but also be used to temporarily store data that has been output or is to be output.

[0115] The communication bus 12 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. The bus is configured to realize connection and communication between the memory 11 and at least one processor 10, etc.

[0116] The communication interface 13 is used for communication between the above-mentioned electronic device and other devices, including a network interface and a user interface. Optionally, the network interface may include a wired interface and / or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is generally used to establish a communication connection between the electronic device and other electronic devices. The user interface may be a display (Display), an input unit (such as a keyboard (Keyboard)), and optionally, the user interface may also be a standard wired interface, a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, and an OLED (Organic Light-Emitting Diode, organic light-emitting diode) touch device, etc. Among them, the display may also be appropriately referred to as a display screen or a display unit, which is used to display information processed in the electronic device and to display a visual user interface.

[0117] The figure only shows an electronic device with components. Those skilled in the art will understand that the structure shown in the figure does not constitute a limitation on the electronic device, and may include fewer or more components than shown in the figure, or combine certain components, or arrange the components differently.

[0118] For example, although not shown, the electronic device may also include a power source (such as a battery) for supplying power to each component. Preferably, the power source may be logically connected to the at least one processor 10 through a power management device, so that the power management device can realize functions such as charging management, discharging management, and power consumption management. The power source may also include one or more DC or AC power sources, recharging devices, power failure detection circuits, power converters or inverters, power status indicators, and other arbitrary components. The electronic device may also include a variety of sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be repeated here.

[0119] It should be understood that the embodiment is for illustration only and the scope of the patent application is not limited to this structure.

[0120] The SEGY file storage mode fast identification program stored in the memory 11 of the electronic device is a combination of multiple instructions. When running in the processor 10, it can achieve:

[0121] Acquire a seismic file to be parsed, identify header information of the seismic file to be parsed, set a file operation mode of the seismic file to be parsed, and construct a calling program of the seismic file to be parsed according to the header information and the file operation mode;

[0122] Using the calling program, releasing the communication connector to the kernel space of the seismic file to be parsed, obtaining the connection space, and using the connection space, performing management authorization on the seismic file to be parsed, obtaining the management file;

[0123] Querying the file descriptor of the management file, using the file descriptor to locate the binary character of the management file, obtaining a character return pointer, parsing the character information of the character return pointer, and obtaining the storage location of the management file;

[0124] The fixed bytes in the storage location are retrieved, the number of bytes of the fixed bytes is calculated, and the storage mode of the seismic file to be parsed is determined according to the number of bytes.

[0125] Specifically, the specific implementation method of the processor 10 for the above instructions can refer to the description of the relevant steps in the corresponding embodiment of the accompanying drawings, which will not be repeated here.

[0126] Furthermore, if the module / unit integrated in the electronic device is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. The computer-readable storage medium can be volatile or non-volatile. For example, the computer-readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a mobile hard disk, a magnetic disk, an optical disk, a computer memory, and a read-only memory (ROM).

[0127] Embodiment 5

[0128] This embodiment provides a storage medium storing a computer program. When the computer program is executed by a processor, the steps of the method for quickly distinguishing the storage mode of a SEGY file as described above are implemented.

[0129] These program codes can also be loaded onto a computer or other programmable data processing device so that a series of operation steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions executed on the computer or other programmable device for implementing the process. Figure 1 The steps of a specified function in a process or multiple processes.

[0130] Storage media include permanent and non-permanent, removable and non-removable media, and can be implemented by any method or technology to store information. Information can be computer-readable instructions, data structures, modules of programs or other data. Examples of storage media can include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices or any other non-transmission medium that can be used to store information that can be accessed by a computing device.

[0131] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit the exemplary embodiments according to the present application. When the terms "include" and / or "include" are used in this specification, they indicate the presence of features, steps, operations, devices, components and / or their combinations.

[0132] It is to be understood that the terms so used are interchangeable under appropriate circumstances such that the embodiments of the application described herein are, for example, capable of operation in sequences other than those illustrated or described herein.

[0133] In the several embodiments provided by the present invention, it should be understood that the disclosed devices, apparatuses and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation.

[0134] The modules described as separate components may or may not be physically separated, and the components shown as modules 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 modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0135] In addition, each functional module in each embodiment of the present invention may be integrated into one processing unit, each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional modules.

[0136] It is obvious to those skilled in the art that the present invention is not limited to the details of the above exemplary embodiments, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention.

[0137] Therefore, no matter from which point of view, the embodiments should be regarded as illustrative and non-restrictive, and the scope of the present invention is limited by the appended claims rather than the above description, so it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims are included in the present invention. Any attached figure mark in the claims should not be regarded as limiting the claims involved.

[0138] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Among them, artificial intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.

[0139] In addition, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices stated in the system claim can also be implemented by one unit or device through software or hardware. The words first, second, etc. are used to indicate names, and do not indicate any particular order.

[0140] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of the present invention.

Claims

1. A method for quickly distinguishing the storage mode of a SEGY file, characterized in that: The method comprises: Acquire a seismic file to be parsed, identify header information of the seismic file to be parsed, set a file operation mode of the seismic file to be parsed, and construct a calling program of the seismic file to be parsed according to the header information and the file operation mode; Using the calling program, releasing the communication connector to the kernel space of the seismic file to be parsed, obtaining the connection space, and using the connection space, performing management authorization on the seismic file to be parsed, obtaining the management file; Querying the file descriptor of the management file, using the file descriptor to locate the binary character of the management file, obtaining a character return pointer, parsing the character information of the character return pointer, and obtaining the storage location of the management file; The fixed bytes in the storage location are retrieved, the number of bytes of the fixed bytes is calculated, and the storage mode of the seismic file to be parsed is determined according to the number of bytes.

2. A method for quickly distinguishing the storage mode of a SEGY file as claimed in claim 1, characterized in that: The calling program of constructing the seismic file to be parsed according to the header information and the file operation mode comprises: Constructing a calling text box of the seismic file to be parsed; Convert the header information into parameters to be operated, and convert the file operation mode into operation instruction parameters; The parameters to be operated and the operating instruction parameters are input into the calling text box, and the calling text box is activated to obtain the calling program of the seismic file to be parsed.

3. A method for quickly distinguishing the storage mode of a SEGY file as claimed in claim 1, characterized in that: The method of using the calling program to release a communication connector to the kernel space of the seismic file to be parsed to obtain a connection space includes: Constructing a synchronous channel between the calling program and the kernel space, and generating a communication connector for the calling program; Transmitting the communication connector to the kernel space via the synchronization channel; The communication transmission symbol is credit authenticated in the kernel space to obtain a connection space.

4. A method for quickly distinguishing the storage mode of a SEGY file as claimed in claim 1, characterized in that: The method of using the connection space to manage and authorize the seismic file to be analyzed to obtain a management file includes: Formulate a communication process and data exchange rules between the seismic file to be parsed and the connection space, and generate a data transmission protocol between the connection space and the seismic file to be parsed; Based on the communication process, the data exchange rules and the data transmission protocol, a communication protocol between the connection space and the seismic file to be parsed is constructed; The seismic file to be parsed is managed and authorized based on the communication protocol to obtain a management file.

5. A method for quickly distinguishing the storage mode of a SEGY file as claimed in claim 4, characterized in that: The method of using the file descriptor to locate the binary character of the management file and obtaining a character return pointer includes: Construct a character query function for the file descriptor and use the following formula to calculate the return value of the character query function: Among them, G represents the return value, n represents the number of file descriptors, and n i Represents the i-th descriptor of the file descriptor, ∈(n i ) represents the return function of the file descriptor, θ represents the character query function, m j represents the jth character of a binary character, ρ represents the character encoding function, and m represents the number of binary characters; The binary character of the management file is located according to the return value to obtain a character return pointer.

6. A method for quickly distinguishing the storage mode of a SEGY file as claimed in claim 4, characterized in that: The parsing of the character information of the character return pointer to obtain the storage location of the management file includes: Identify the file attribute character in the character return pointer; Decoding the file attribute characters to obtain file attributes; Query the file management interface of the management file according to the file attributes; Query the storage address number of the management file according to the file management interface; The storage location of the management file is obtained according to the storage address number.

7. A method for quickly distinguishing the storage mode of a SEGY file as claimed in claim 1, characterized in that: The calculating the number of bytes of the fixed bytes comprises: Identify the fixed-byte encoding tool and query the encoding rules of the encoding tool; Obtain the number of coded characters of the fixed bytes according to the coding rule; The number of bytes of the fixed bytes is calculated according to the number of encoded characters.

8. A device for quickly distinguishing the storage mode of SEGY files, characterized in that: The device comprises: A program construction module is used to obtain a seismic file to be parsed, identify header information of the seismic file to be parsed, set a file operation mode of the seismic file to be parsed, and construct a calling program of the seismic file to be parsed according to the header information and the file operation mode; A management authorization module is used to use the calling program to release a communication connector to the kernel space of the seismic file to be parsed to obtain a connection space, and use the connection space to perform management authorization on the seismic file to be parsed to obtain a management file; A character parsing module, used for querying the file descriptor of the management file, locating the binary character of the management file by using the file descriptor, obtaining a character return pointer, parsing the character information of the character return pointer, and obtaining the storage location of the management file; The storage identification module is used to retrieve the fixed bytes in the storage position, calculate the number of bytes of the fixed bytes, and identify the storage mode of the seismic file to be parsed according to the number of bytes.

9. An electronic device, comprising: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the SEGY file storage mode fast identification method as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and when the program is executed by a processor, a method for quickly distinguishing the storage mode of a SEGY file as described in any one of claims 1 to 7 is implemented.