Method, device, equipment, medium and product for processing spatial data of database

By verifying the integrity, member variable values, and data quantity of spatial data in the Oracle database, the problem of spatial data validity verification was solved, thereby improving data quality and processing reliability.

CN123157702APending Publication Date: 2026-11-24WUHAN DAMENG DATABASE
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611561988.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-10-10
Publication Date
2026-11-24

AI Technical Summary

Technical Problem

In Oracle databases, validating the validity of spatial data is difficult, especially since the array of member variable types involved in SDO_GEOMETRY is too large, making validity verification challenging.

Method used

This paper provides a method for processing spatial data in a database. It verifies the integrity of the member variables of the spatial data, the validity of the values ​​of the member variables, and the validity of the number of data in the member variables, and outputs the validity verification results.

Benefits of technology

It improves the data quality and processing reliability of spatial data, enables the rapid and accurate location and correction of erroneous data, and enhances data processing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123157702A_ABST
    Figure CN123157702A_ABST
Patent Text Reader

Abstract

This application discloses a method, apparatus, device, medium, and product for processing spatial data in a database. It relates to the field of database technology. The method for processing spatial data in a database includes: acquiring spatial data; verifying the legality of the spatial data, including verifying whether the member variables of the spatial data are complete, whether the values ​​of the member variables are valid, and whether the number of data in the member variables is valid; and outputting the verification result of the spatial data's legality. The above technical solution verifies spatial data from several aspects, including completeness, member variable values, and the number of data in the member variables, thereby improving the data quality and reliability of spatial data processing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data processing technology, and in particular to a method, apparatus, device, medium and product for processing spatial data of a database. Background Technology

[0002] In Oracle databases, spatial data (such as SDO_GEOEMTRY) can be used to store, manage, and query geospatial information (such as geometric objects like points, lines, and polygons). The core validity validation function in Oracle is closed-source; typically, the specific validity of spatial data is not validated when it is created, stored, or used. Furthermore, SDO_GEOEMTRY involves various member variables, some of which are extremely large NUMBER arrays, making validity validation extremely difficult. Therefore, how to reliably validate spatial data is a problem that urgently needs to be solved. Summary of the Invention

[0003] This application provides a method, apparatus, device, medium, and product for processing spatial data in a database, so as to reliably verify the legality of spatial data.

[0004] In a first aspect, embodiments of this application provide a method for processing spatial data in a database, including: Acquire spatial data; The validity of the spatial data is verified, including verifying whether the member variables of the spatial data are complete, whether the values ​​of the member variables of the spatial data are valid, and whether the number of data in the member variables of the spatial data is valid. In a second aspect, embodiments of this application also provide a spatial data processing apparatus for a database, comprising: (The apparatus outputs the verification result of the legality of the spatial data.) The acquisition module is used to acquire spatial data; The verification module is used to verify the legality of the spatial data, including verifying whether the member variables of the spatial data are complete, verifying whether the values ​​of the member variables of the spatial data are valid, and verifying whether the number of data in the member variables of the spatial data is valid. An output module is used to output the verification result of the legality of the spatial data. Thirdly, embodiments of this application provide an electronic device, including: One or more processors; Storage device for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the spatial data processing method of the database as described in the first aspect.

[0005] Fourthly, embodiments of this application also provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the spatial data processing method for the database as described in the first aspect.

[0006] Fifthly, embodiments of this application also provide a computer program product, including a computer program and / or instructions, which, when executed by a processor, implement the spatial data processing method of the database as described in any of the above embodiments.

[0007] This application provides a method, apparatus, device, medium, and product for processing spatial data in a database. The method includes: acquiring spatial data; verifying the legality of the spatial data, including verifying the completeness of the member variables, the validity of the values ​​of the member variables, and the validity of the number of data points in the member variables; and outputting the verification result of the spatial data's legality. This technical solution verifies spatial data from several aspects, including completeness, member variable values, and the number of data points in the member variables, thereby improving the data quality and reliability of spatial data processing. Attached Figure Description

[0008] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic, and the originals and elements are not necessarily drawn to scale.

[0009] Figure 1 A flowchart illustrating a method for processing spatial data in a database, as provided in this application embodiment; Figure 2 This is a schematic diagram illustrating a process for verifying the legality of spatial data, as provided in one embodiment. Figure 3 A schematic diagram of the structure of a spatial data processing device for a database provided in an embodiment of this application; Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0010] The present application will now be described in further detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and not intended to limit it. Furthermore, it should be noted that, for ease of description, only the parts relevant to the present application are shown in the drawings, not all structures. Moreover, unless otherwise specified, the embodiments and features described in the present application can be combined with each other.

[0011] Before discussing the exemplary embodiments in more detail, it should be noted that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although the flowcharts describe the steps as sequential processes, many of these steps can be performed in parallel, concurrently, or simultaneously. Furthermore, the order of the steps can be rearranged. The process can be terminated when its operation is complete, but may also have additional steps not included in the figures. The process can correspond to a method, function, procedure, subroutine, subroutine, etc.

[0012] It should be noted that the concepts of "first" and "second" mentioned in the embodiments of this application are only used to distinguish different devices, modules, units or other objects, and are not used to limit the order of functions performed by these devices, modules, units or other objects or their interdependencies.

[0013] In the embodiments of this application, "multiple" refers to at least two unless otherwise specified.

[0014] In the embodiments of this application, "A / B" refers to A and / or B unless otherwise specified.

[0015] The acquisition, storage, use, and processing of data in this application all comply with the relevant provisions of national laws and regulations.

[0016] In the embodiments of this application, certain software, components, models and other existing solutions in the industry may be mentioned. These should be regarded as exemplary and are only intended to illustrate the feasibility of implementing the technical solution of this application. However, they do not mean that the applicant has used or necessarily used the relevant content of the solution.

[0017] In this embodiment of the application, spatial data mainly refers to SDO_GEOMETRY. Taking SQL language as an example, the declaration of the SDO_GEOMETRY type is as follows: CREATE OR REPLACE TYPE MDSYS.SDO_GEOMETRY AS OBJECT( SDO_GTYPENUMBER, SDO_SRID NUMBER, SDO_POINTMDSYS.SDO_POINT_TYPE, SDO_ELEM_INFO MDSYS.SDO_ELEM_INFO_ARRAY, SDO_ORDINATESMDSYS.SDO_ORDINATE_ARRAY ); The declaration of the SDO_GEOMETRY member is as follows: CREATE OR REPLACE TYPE MDSYS.SDO_POINT_TYPE AS OBJECT( X NUMBER, Y NUMBER, Z NUMBER ); CREATE OR REPLACE TYPE MDSYS.SDO_ELEM_INFO_ARRAY AS VARRAY(1048576)OF NUMBER; CREATE OR REPLACE TYPE MDSYS.SDO_ORDINATE_ARRAY AS VARRAY(1048576) OFNUMBER.

[0018] The validity of SDO_GEOEMTRY may involve multiple of the five member variables (SDO_GTYPE, SDO_SRID, SDO_POINT, SDO_ELEM_INFO, SDO_ORDINATES), among which SDO_ELEM_INFO and SDO_ORDINATES are large-capacity NUMBER type arrays with potentially very complex contents.

[0019] Figure 1 This is a flowchart illustrating a method for processing spatial data in a database, provided as an embodiment of this application. This embodiment is applicable to situations involving the verification of the legality of spatial data. Specifically, the method for processing spatial data in a database can be executed by a spatial data processing device. This device can be implemented through software and / or hardware and integrated into an electronic device. The electronic device includes, but is not limited to, devices with data processing capabilities such as computers, smartphones, or servers.

[0020] like Figure 1 As shown, the method specifically includes the following steps: S110, Obtain spatial data.

[0021] S120. Verify the legality of the spatial data, including verifying whether the member variables of the spatial data are complete, verifying whether the values ​​of the member variables of the spatial data are legal, and verifying whether the number of data in the member variables of the spatial data is legal.

[0022] For example, regarding integrity, SDO_GEOMETRY involves five member variables: geometry type code (SDO_GTYPE), spatial reference identifier (SDO_SRID), point coordinates (SDO_POINT), element information array (SDO_ELEM_INFO), and coordinate array (SDO_ORDINATES). In some scenarios, some member variables can be omitted or null. For example, SDO_SRID can be null, or if SDO_POINT exists, SDO_ELEM_INFO and SDO_ORDINATES can be null. When verifying the integrity of member variables, the judgment can be made according to the actual situation. For example, SDO_GEOMETRY includes SDO_GTYPE and SDO_POINT, but does not include SDO_ELEM_INFO and SDO_ORDINATES. In this case, the spatial data is still complete.

[0023] For example, regarding the values ​​of member variables, any of the five member variables mentioned above can have a corresponding range of values. If the value of a member variable belongs to the corresponding range of values, then the value of that member variable is valid.

[0024] For example, regarding the number of data for member variables, the number of data for any of the five member variables mentioned above can have a corresponding range. If the number of data for a member variable falls within the corresponding range, then the number of data for that member variable is valid.

[0025] Optionally, for some member variables (such as SDO_POINT and SDO_ELEM_INFO), the correctness of their contents can also be verified.

[0026] Optionally, the validity of spatial data can be judged from the following aspects in turn: completeness, values ​​of member variables, number of data in member variables, and correctness of content (optional).

[0027] S130. Output the verification result of the legality of the spatial data.

[0028] In this embodiment, the verification result can be represented as SDO_ERROR_MESSAGE, which can record whether the member variables of the spatial data are complete, whether the values ​​of the member variables are valid, and whether the number of data in the member variables is valid. If the content of the member variables is incorrect, the verification result can also include specific error information.

[0029] This application provides a method for processing spatial data in a database, which verifies the spatial data from several aspects, including integrity, values ​​of member variables, and the amount of data in member variables, thereby improving the data quality and reliability of spatial data processing.

[0030] In one embodiment, verifying the completeness of the member variables of spatial data includes: S1210. Spatial data is complete if it includes at least one of the following sets of member variables: Geometry type code and point coordinates; Geometry type code, element information array, and coordinate array.

[0031] For example, SDO_SRID in SDO_GEOMETRY can be NULL. A minimum complete SDO_GEOMETRY can contain SDO_GTYPE and SDO_POINT, or contain SDO_GEOMETRY, SDO_ELEM_INFO, and SDO_ORDINATES; wherein, when SDO_POINT is included, SDO_ELEM_INFO and SDO_ORDINATES can be NULL, and when SDO_ELEM_INFO and SDO_ORDINATES are included, SDO_POINT can be NULL.

[0032] Based on this, the integrity can be reliably verified by comprehensively considering the combination of various member variables.

[0033] In one embodiment, verifying the validity of the values ​​of member variables of spatial data includes: S1220. If the values ​​of member variables in spatial data satisfy the following conditions, then the values ​​of the member variables are reasonable: The dimensions and linear referencing system (LRS) value fields of the geometry type code belong to the first range; The data type field of the geometry type code belongs to the second range of values; If the spatial data also includes a spatial reference identifier, the value of the spatial reference identifier exists in the metadata table.

[0034] For example, the structure of SDO_GTYPE is as follows: the first two digits are the dimension and LRS value, with a value range of one or more of the first range (e.g., 20, 30, 33, 40, 43, and 44); the last two digits are the geometric data type, with a value range of one or more of the second range (e.g., 01-09); the value range of SDO_SRID includes all default (e.g., 6025) Spatial Reference System Identifier (SRID) values ​​defined in the metadata table (MDSYS.CS_SRS) and user-defined SRID values. If a value of SDO_SRID exists in the MDSYS.CS_SRS table, then the value of SDO_SRID is valid.

[0035] Based on this, the correctness and validity of the values ​​of member variables can be ensured by validating the values ​​of the member variables.

[0036] In one embodiment, verifying the validity of the number of data in the member variables of spatial data includes: S1230. If the number of member variables in spatial data meets the following conditions, then the number of data is reasonable: The amount of data for point coordinates is related to the geometry type code; The number of data in the element information array is a multiple of three; The number of data points in the coordinate array is related to the first data point in the element information array; When the number of member variables in spatial data is unreasonable, the verification result includes location information for locating erroneous data.

[0037] For example, the validity of the number of data in member variables is verified. The number of data in `SDO_POINT` is related to `SDO_GTYPE`; `SDO_ELEM_INFO` is a triple array, and its number of data should be a multiple of three; the number of data in `SDO_ORDINATES` is related to the first data element of the triple array in `SDO_ELEM_INFO` (specifically, the maximum value among the first data elements of each triple array). Furthermore, if the number of data in any member variable is incorrect, start and end information (`ERROR_START_POSITION` and `ERROR_END_POSITION`) can be recorded in the verification result to quickly locate the location of the data error.

[0038] Based on this, the correctness and validity of the data in the member variables can be ensured by validating the number of data in the member variables.

[0039] In one embodiment, verifying the legality of spatial data further includes: S1240. When the spatial data includes an element information array and a coordinate array, verify whether the data in the element information array and the coordinate array are correct. The verification of the correctness of the element information array and coordinate array includes: A) The data in the element information array is correct if it meets the following conditions: The first data in each ternary array in the element information array is the offset of the first coordinate of the corresponding element (relative to the ternary array) stored in the coordinate array; The second data in each ternary array in the element information array is the type of the corresponding element stored in the coordinate array (with the ternary array), and is associated with the geometry type code; In the element information array, the third data of each triplet is related to the second data, and both the third data and the second data are greater than or equal to 0; The ternary array of SDO_ELEM_INFO is related to SDO_GTYPE, and different types of spatial data may have different validity requirements. For example, the first data of SDO_ELEM_INFO is the offset of the first coordinate of the element stored in SDO_ORDINATES, starting from 1; the second data of SDO_ELEM_INFO is the type of the element (SDO_ETYPE), and the value of the second data can include 0, 1, 2, 1003, 2003, 4, 1005, 2005, 1006, 2006, or 1007, and the second data must be associated with SDO_GTYPE; the third data of SDO_ELEM_INFO (SDO_INTERPRETATION) is related to the second data, and both are data greater than or equal to 0. The correspondence between the two is shown in Table 1.

[0040] Table 1. Data Correspondence between SDO_ELEM_INFO B) The coordinate array is correct if it meets the following conditions: The coordinate array data is divided according to the offset represented by the first data in each ternary array of the element information array.

[0041] For example, the content of SDO_ORDINATES is related to the content of SDO_ELEM_INFO. It is necessary to divide the coordinate data of different geometric elements according to the offset represented by the first data of SDO_ELEM_INFO. Different types of spatial data may have different validity requirements. For example, the outer ring of a polygon must be counterclockwise and the inner ring must be clockwise. All coordinates of the polygon cannot be collinear. Three consecutive points of a curve cannot be collinear, etc. Specific error types are shown in Table 2.

[0042] Table 2. Possible error types in the coordinate array Based on this, the validity of the control data can be ensured by validating the correctness of the data content in the element information array and coordinate array.

[0043] In one embodiment, if the content of the element information array is incorrect, the verification result includes first position information, which is used to locate the erroneous data in the element information array. If the contents of the coordinate array are incorrect, the verification result includes a second position information, which is used to locate the erroneous data in the coordinate array.

[0044] For example, if an error is found in the element information array, the first position information (including ERROR_START_POSITION and ERROR_END_POSITION) can be recorded in the verification result to quickly locate the position of the erroneous data; if an error is found in the coordinate array, the second position information (including ERROR_START_POSITION and ERROR_END_POSITION) can be recorded in the verification result to quickly locate the position of the erroneous data. Based on this, even complex element information arrays and coordinate arrays can be reliably verified and the position of erroneous data can be accurately recorded, improving the efficiency of spatial data processing.

[0045] In one embodiment, such as Figure 2 As shown, the validity of spatial data can be judged from several aspects in turn: integrity, values ​​of member variables, number of data in member variables, and correctness of the contents of element information array and coordinate array. Based on the judgment results, SDO_ERROR_MESSAGE is generated. If any aspect is invalid, it can be determined that the spatial data is invalid, and the specific error information can be recorded and returned in SDO_ERROR_MESSAGE.

[0046] In one example, using C language, the SDO_ERROR_MESSAGE structure is defined as follows: The declaration of the SDO_ERROR_MESSAGE type is as follows: typedef struct SDO_ERROR_MESSAGE { CHARSDO_STRUCT

[20] ; INT ERROR_START_POSITION; INT ERROR_END_POSITION; CHAR* ERROR_MESSAGE; }; Here, SDO_STRUCT represents the member variable name in the SDO_GEOMETRY structure where the error occurred, including "SDO_GTYPE", "SDO_SRID", "SDO_POINT", "SDO_ELEM_INFO", and "SDO_ORDINATES"; ERROR_START_POSITION indicates the starting position of the error data in the array, and ERROR_END_POSITION indicates the ending position of the error data in the array; ERROR_MESSAGE indicates the specific information of the error, including the ORACLE error code and a detailed description of the error reason, etc.

[0047] In one example, for SDO_GEOMETRY spatial data, SDO_GTYPE and SDO_SRID have only one NUMBER data. When SDO_GTYPE or SDO_SRID encounters an error, ERROR_START_POSITION and ERROR_END_POSITION are both 1.

[0048] In one example, for SDO_GEOMETRY space data, SDO_POINT, SDO_ELEM_INFO, and SDO_ORDINATES are all arrays. When SDO_POINT, SDO_ELEM_INFO, or SDO_ORDINATES encounters an error, ERROR_START_POSITION and ERROR_END_POSITION can be used to mark the start and end points of the erroneous data in the array, starting from 1.

[0049] For example: SDO_GEOMETRY(2004, NULL, NULL, SDO_ELEM_INFO_ARRAY(1, 1, 2, 5,2, 1), SDO_ORDINATE_ARRAY(1, 1, 1, 1, 1, 1, 1, 1)), the returned result structure is SDO_ERROR_MESSAGE(“SDO_ORDINATE_ARRAY”,5,8,“There are repeated points in thesequence of coordinates.”).

[0050] Based on the above, comprehensive and reliable legality verification of spatial data is achieved, and erroneous data can be located quickly and accurately, thereby improving the quality of spatial data and data processing efficiency.

[0051] Figure 3 This is a schematic diagram of the structure of a spatial data processing device for a database provided in an embodiment of this application. Figure 3 As shown, the spatial data processing device for the database provided in this embodiment includes: Module 210 is used to acquire spatial data; The verification module 220 is used to verify the legality of the spatial data, including verifying whether the member variables of the spatial data are complete, verifying whether the values ​​of the member variables of the spatial data are legal, and verifying whether the number of data in the member variables of the spatial data is legal. Output module 230 is used to output the verification result of the legality of the spatial data.

[0052] This device verifies spatial data from several aspects, including integrity, values ​​of member variables, and the amount of data in member variables, thereby improving the data quality and reliability of spatial data processing.

[0053] Based on any of the above embodiments, verifying whether the member variables of the spatial data are complete includes: The spatial data is complete if it includes at least one of the following sets of member variables: Geometry type code and point coordinates; Geometry type code, element information array, and coordinate array.

[0054] Based on any of the above embodiments, verifying the validity of the values ​​of the member variables of the spatial data includes: The values ​​of the member variables in the spatial data are considered reasonable if they meet the following conditions: The dimensions and linear reference system (LRS) value fields of the geometry type code belong to the first range; The data type field of the geometry type code belongs to the second range; If the spatial data also includes a spatial reference identifier, the value of the spatial reference identifier exists in the metadata table.

[0055] Based on any of the above embodiments, verifying the validity of the number of data in the member variables of the spatial data includes: The data quantity is considered reasonable if the number of member variables in the spatial data meets the following conditions: The amount of data for the point coordinates is related to the geometry type code; The number of data in the element information array is a multiple of three; The number of data in the coordinate array is related to the first data in the element information array; If the number of member variables in the spatial data is unreasonable, the verification result includes location information for locating erroneous data.

[0056] Based on any of the above embodiments, verifying the legality of the spatial data further includes: when the spatial data includes an element information array and a coordinate array, verifying whether the data of the element information array and the coordinate array are correct; The verification of whether the data in the element information array and the coordinate array are correct includes: The data in the element information array is correct if it meets the following conditions: The first data of each ternary array in the element information array is the offset of the first coordinate of the corresponding element stored in the coordinate array; The second data of each ternary array in the element information array is the type of the corresponding element stored in the coordinate array and is associated with the geometry type code; The third data of each ternary array in the element information array is related to the second data, and both the third data and the second data are greater than or equal to 0; The coordinate array is considered correct if it satisfies the following conditions: The data in the coordinate array is divided according to the offset represented by the first data of each ternary array in the element information array.

[0057] Based on any of the above embodiments, if the content of the element information array is incorrect, the verification result includes first position information, which is used to locate the erroneous data in the element information array; if the content of the coordinate array is incorrect, the verification result includes second position information, which is used to locate the erroneous data in the coordinate array.

[0058] The spatial data processing apparatus for the database provided in this application embodiment can be used to execute the spatial data processing method for the database provided in any of the above embodiments, and has corresponding functions and beneficial effects.

[0059] Figure 4 A schematic diagram of an electronic device 10, which can be used to implement embodiments of this application, is shown. The electronic device 10 is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device 10 may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, user equipment, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the application described and / or claimed herein.

[0060] like Figure 4 As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded from storage unit 18 into the RAM 13. The RAM 13 can also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0061] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks and wireless networks.

[0062] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above.

[0063] In some embodiments, the methods described above can be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the methods described above can be performed. Alternatively, in other embodiments, processor 11 can be configured to perform the methods of any of the embodiments described above by any other suitable means (e.g., by means of firmware).

[0064] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0065] Computer programs used to implement the methods of this application may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0066] In the context of this application, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium can be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0067] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device 10, which includes: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device 10. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0068] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or middleware components (e.g., application servers), or frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.

[0069] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.

[0070] This application also provides a computer program product, including a computer program and / or instructions, which, when executed by a processor, implement the spatial data processing method of the database as described in any of the above embodiments.

[0071] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this application can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this application can be achieved, and this is not limited herein.

[0072] The specific embodiments described above do not constitute a limitation on the scope of protection of this application. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this application should be included within the scope of protection of this application.

Claims

1. A method for processing spatial data in a database, characterized in that, include: Acquire spatial data; The validity of the spatial data is verified, including verifying whether the member variables of the spatial data are complete, whether the values ​​of the member variables of the spatial data are valid, and whether the number of data in the member variables of the spatial data is valid. Output the verification result of the validity of the spatial data.

2. The method according to claim 1, characterized in that, Verifying the completeness of the member variables of the spatial data includes: The spatial data is complete if it includes at least one of the following sets of member variables: Geometry type code and point coordinates; Geometry type code, element information array, and coordinate array.

3. The method according to claim 2, characterized in that, Verify the validity of the values ​​of the member variables of the spatial data, including: The values ​​of the member variables in the spatial data are considered reasonable if they meet the following conditions: The dimensions and linear reference system (LRS) value fields of the geometry type code belong to the first range; The data type field of the geometry type code belongs to the second range; If the spatial data also includes a spatial reference identifier, the value of the spatial reference identifier exists in the metadata table.

4. The method according to claim 2, characterized in that, Verify the validity of the number of data in the member variables of the spatial data, including: The data quantity is considered reasonable if the number of member variables in the spatial data meets the following conditions: The amount of data for the point coordinates is related to the geometry type code; The number of data in the element information array is a multiple of three; The number of data in the coordinate array is related to the maximum value of the first data in each ternary array of the element information array; If the number of member variables in the spatial data is unreasonable, the verification result includes location information for locating erroneous data.

5. The method according to claim 2, characterized in that, Verifying the legality of the spatial data further includes: if the spatial data includes an element information array and a coordinate array, verifying whether the data in the element information array and the coordinate array are correct. The verification of whether the data in the element information array and the coordinate array are correct includes: The data in the element information array is correct if it meets the following conditions: The first data of each ternary array in the element information array is the offset of the first coordinate of the corresponding element stored in the coordinate array; The second data of each ternary array in the element information array is the type of the corresponding element stored in the coordinate array and is associated with the geometry type code; The third data of each ternary array in the element information array is related to the second data, and both the third data and the second data are greater than or equal to 0; The coordinate array is considered correct if it satisfies the following conditions: The data in the coordinate array is divided according to the offset represented by the first data of each ternary array in the element information array.

6. The method according to claim 5, characterized in that, If the content of the element information array is incorrect, the verification result includes first position information, which is used to locate the erroneous data in the element information array. If the contents of the coordinate array are incorrect, the verification result includes second position information, which is used to locate the erroneous data in the coordinate array.

7. A spatial data processing device for a database, characterized in that, include: The acquisition module is used to acquire spatial data; The verification module is used to verify the legality of the spatial data, including verifying whether the member variables of the spatial data are complete, verifying whether the values ​​of the member variables of the spatial data are valid, and verifying whether the number of data in the member variables of the spatial data is valid. The output module is used to output the verification result of the legality of the spatial data.

8. An electronic device, characterized in that, include: At least one processor; A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform a method for processing spatial data of the database as described in any one of claims 1-6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by the processor, the program implements the method for processing spatial data of the database as described in any one of claims 1-6.

10. A computer program product comprising a computer program and / or instructions, characterized in that, When the computer program and / or instructions are executed by the processor, they implement the method for processing spatial data of the database as described in any one of claims 1-6.