A layer publishing method, device, equipment and storage medium
By exporting the target hierarchy files and publishing layers according to the configuration files, the security risks and workload problems of map resources released in the pine wood nematode disease management platform are solved, and batch release of national forestry small class data is realized, and the release efficiency is improved. Avoid security risks.
Patent Information
- Application Number
- CN202311444302.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-01
- Publication Date
- 2024-11-12
- Estimated Expiration
- 2043-11-01
AI Technical Summary
In the existing technology In the refined management platform of pine wood nematode disease, the release of map resources has security risks and huge workload caused by manual release, especially the provincial original .gdbtable file is too large and cannot be published directly, and needs to be published by city or county. Release, resulting in huge workload in publishing layers.
By exporting the target hierarchy files in the geodatabase, sending the target identifier to GeoServer, obtaining configuration files and publishing layers based on them, including creating workspaces, data storage and publishing styles, and publishing them if the layer does not exist, publish them, and further through WFS services Extract and insert business database to achieve batch release.
It avoids the security risks of the platform's external exposure of ports, saves a lot of duplicate page operations, greatly shortens the platform's online time, and improves publishing efficiency.
Smart Images

Figure CN117421283B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of computer information processing technology, and in particular to a layer publishing method, device, equipment and storage medium. Background Art
[0002] At present, the pine wood nematode disease refined management platform planned by the State Forestry Administration needs to publish and manage more than 90 million forestry sub-class data on a national forestry map. Generally, GeoServer (system software for rapid sharing of spatial geographic information) based on Java, open source, and following the open standards of the Open Geospatial Consortium (OGC) is used as the map server. According to the project hardware planning, four independent servers will be used for the deployment of GeoServer.
[0003] The existing technology can publish map resources through the GeoServer web management page, but there may be the following problems: 1. The construction of the pine wood nematode disease refined management platform has high security requirements. It is inconvenient to open the GeoServer internal management port that is not related to the platform business to the outside world, resulting in the inability to remotely access the GeoServer management page for small class data deployment; 2. The number of small classes in each province, city and county is uneven, and the original provincial .gdbtable file is too large to be published directly, and needs to be published by city or even county. Manually publishing to GeoServer will result in a huge workload for publishing layers. Summary of the invention
[0004] The embodiments of the present invention provide a layer publishing method, device, equipment and storage medium to realize the batch publishing of national forestry small class data, avoid the security risks of the platform's externally exposed ports, save a large number of repetitive page operations in most districts and counties across the country, greatly shorten the platform's online time, and improve publishing efficiency.
[0005] In a first aspect, an embodiment of the present invention provides a layer publishing method, comprising:
[0006] Exporting a target level file in a geographic database, wherein the target level file carries a target identification;
[0007] Send the target level file to the GeoServer corresponding to the target identifier;
[0008] Obtaining a first configuration file corresponding to the target level file;
[0009] The layer corresponding to the target level file is published according to a first configuration file, wherein the first configuration file includes: a workspace name, a storage name, a full path of the target level file, a layer name, and a style name.
[0010] Optionally, publishing the layer corresponding to the target level file according to the first configuration file includes:
[0011] Create a workspace based on the workspace name;
[0012] Create a data store according to the storage name and the full path of the target level file;
[0013] Determine the publishing style based on the style name;
[0014] If the layer corresponding to the layer name does not exist in the workspace, the layer corresponding to the target level file is published according to the workspace, data storage and publishing style.
[0015] Optionally, after publishing the layer corresponding to the target level file according to the first configuration file, the method further includes:
[0016] Obtain a second configuration file, wherein the second configuration file includes: a GeoServer address, a start feature tag, a feature length, a GeoServer port, a layer name, configuration information of a business database, and a table name;
[0017] Call the WFS service according to the GeoServer address, GeoServer port, layer name, starting feature tag, and feature length to obtain the data to be extracted;
[0018] Insert the data to be extracted into the table corresponding to the table name in the business database according to the configuration information and table name of the business database.
[0019] Optionally, sending the target level file to the GeoServer corresponding to the target identifier includes:
[0020] Convert the target layer file into a shapefile file.
[0021] The target level file in the shapefile format is sent to the GeoServer corresponding to the target identifier.
[0022] Optionally, after generating a publishing layer corresponding to the target layer file according to the first configuration file and the target layer file, the method further includes:
[0023] Receive a data extraction request sent by the first GeoServer, wherein the data extraction request includes: the first GeoServer address, the first GeoServer port, the layer name, the start element tag, and the element length;
[0024] Update the second configuration file according to the first GeoServer address, the first GeoServer port, the layer name, the start feature tag, and the feature length;
[0025] Call the WFS service according to the first GeoServer address, the first GeoServer port, the layer name, the start feature tag, and the feature length to obtain the data to be extracted;
[0026] Insert the data to be extracted into the table corresponding to the table name in the business database according to the configuration information and table name of the business database.
[0027] Optionally, the target identifier is a province identifier.
[0028] In a second aspect, an embodiment of the present invention provides a layer publishing device, including:
[0029] An export module, used for exporting a target level file in a geographic database, wherein the target level file carries a target identifier;
[0030] A sending module, used for sending the target level file to the GeoServer corresponding to the target identifier;
[0031] A first acquisition module, used to acquire a first configuration file corresponding to the target level file;
[0032] A publishing module is used to publish the layer corresponding to the target level file according to a first configuration file, wherein the first configuration file includes: a workspace name, a storage name, a full path of the target level file, a layer name, and a style name.
[0033] In a third aspect, an embodiment of the present invention provides an electronic device, the electronic device comprising:
[0034] at least one processor; and
[0035] a memory communicatively connected to the at least one processor; wherein,
[0036] The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the layer publishing method described in any embodiment of the present invention.
[0037] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the layer publishing method described in any embodiment of the present invention when executed.
[0038] The embodiment of the present invention exports a target level file in a geographic database, wherein the target level file carries a target identifier; sends the target level file to a GeoServer corresponding to the target identifier; obtains a first configuration file corresponding to the target level file; and publishes a layer corresponding to the target level file according to the first configuration file, wherein the first configuration file includes: a workspace name, a storage name, a full path of the target level file, a layer name, and a style name, thereby solving the problem in the prior art that manual publishing to GeoServer leads to a huge workload for publishing layers, and realizes batch publishing of national forestry small class data, avoids the security risk of the platform exposing ports to the outside, saves a large number of repeated page operations in most districts and counties across the country, greatly shortens the platform launch time, and improves publishing efficiency.
[0039] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.
[0041] Figure 1 A flowchart of a layer publishing method provided in Embodiment 1 of the present invention;
[0042] Figure 2 A flowchart of a layer publishing method provided in Embodiment 2 of the present invention;
[0043] Figure 3 A flowchart of a program for automatically publishing forestry small class data provided by the second embodiment of the present invention;
[0044] Figure 4 A flowchart of a procedure for batch extraction and storage of basic element data of a small class provided in the second embodiment of the present invention;
[0045] Figure 5 An overall processing flow chart of layer publishing provided in the second embodiment of the present invention;
[0046] Figure 6 A schematic diagram of the structure of a layer publishing device provided in Embodiment 3 of the present invention;
[0047] Figure 7 A schematic diagram of the structure of an electronic device that can be used to implement an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0048] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0049] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0050] It is understandable that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, scope of use, usage scenarios, etc. of the personal information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.
[0051] Embodiment 1
[0052] Figure 1 This is a flow chart of a layer publishing method provided in the first embodiment of the present invention. This embodiment is applicable to the case of publishing national forestry small class data. The method can be executed by the layer publishing device in the embodiment of the present invention. The device can be implemented in software and / or hardware. Figure 1 As shown, the method specifically comprises the following steps:
[0053] S110, exporting a target level file in a geographic database, wherein the target level file carries a target identifier.
[0054] The geographic database may refer to the file geographic database of forestry classes in each province; the target level file may refer to the file corresponding to GeoServer exported from the geographic database; the target identifier may refer to the identifier that can correspond to GeoServer. Specifically, the geographic database stores multiple forestry class data of each province in the form of tables, and users can export multiple table files in sequence; the table contains an "attribute" column, which may include provinces, cities, districts and counties; when exporting, you can export by province first, but due to file size restrictions, you can export by city if you cannot export by province, and you can export by district and county if you cannot export by city.
[0055] In this embodiment, the user can use ArcGis software to open the file geographic database of the forestry classes in each province, and export it by province if it can be exported, by city if it cannot be exported, and by district and county if it still cannot be exported, and export the target level file for subsequent processing; among which, the exported target level file carries the provincial identifier of a certain province.
[0056] S120: Send the target level file to the GeoServer corresponding to the target identifier.
[0057] Among them, GeoServer can be divided by province, and small class data of different provinces can be published on different GeoServers. In addition, the number of GeoServers can be set manually. For example, 4 GeoServers can be planned manually, and small class data of corresponding provinces can be published on the 4 GeoServers respectively.
[0058] In this embodiment, the target level file can be sent to the GeoServer corresponding to the target identifier according to the target level file.
[0059] S130: Obtain a first configuration file corresponding to the target level file.
[0060] The first configuration file may include multiple program parameters for modification before executing the program, and the program may be a program that can automatically publish national forestry small class data. Specifically, writing a program that automatically publishes national forestry small class data may include: establishing a java maven project, importing the GeoServer-Manager component, and using the component to encapsulate the GeoServer RestAPI to realize the storage of forestry small class data shp files of various provinces, cities and districts, and the publication of layers and styles.
[0061] In this embodiment, the program parameters of the program for automatically publishing national forestry small class data can be stored in the first configuration file for modification before executing the program.
[0062] S140, publishing a layer corresponding to the target level file according to a first configuration file, wherein the first configuration file includes: a workspace name, a storage name, a full path of the target level file, a layer name, and a style name.
[0063] Among them, layer can refer to the film containing text or graphic elements; workspace name can be understood as the name of the folder; storage name can be understood as the name of the subfolder under the folder; target level file full path can refer to the logical location of the file or folder on the hard disk, and contains the file name of the target level file; style name can refer to the name of the published style. Layer name can refer to the name of the layer.
[0064] In this embodiment, the exported target level files of forestry classes in different provinces, cities, districts and counties can be uploaded to the corresponding GeoServer, and the programs for automatically publishing the national forestry class data can be deployed on the corresponding GeoServer respectively, and the scripts for starting the programs can be written; according to the first configuration file, the parameters can be modified on the corresponding GeoServer and then the script can be executed to start the program, and the national forestry class data can be automatically published on the GeoServer server.
[0065] The technical solution of this embodiment is to export the target level file in the geographic database, wherein the target level file carries the target identifier; send the target level file to the GeoServer corresponding to the target identifier; obtain the first configuration file corresponding to the target level file; and publish the layer corresponding to the target level file according to the first configuration file, wherein the first configuration file includes: workspace name, storage name, full path of the target level file, layer name and style name, so as to solve the problem of huge workload of publishing layers caused by manual publishing to GeoServer in the prior art, realize batch publishing of national forestry small class data, avoid the security risk of the platform exposing ports to the outside world, save a large number of repeated page operations in most districts and counties across the country, greatly shorten the platform launch time, and improve publishing efficiency.
[0066] Optionally, sending the target level file to the GeoServer corresponding to the target identifier includes:
[0067] Convert the target layer file into a shapefile file.
[0068] The target level file in the shapefile format is sent to the GeoServer corresponding to the target identifier.
[0069] The shapefile format may refer to a format of a non-topological entity vector data structure that describes the geometry and attribute characteristics of spatial data.
[0070] In this embodiment, the target level file can be converted into a target level file in shapefile format; and then the target level file in shapefile format is sent to the GeoServer corresponding to the target identifier, so that the format conversion is simpler and more convenient, thereby improving the efficiency of completing the release of national forestry small class data.
[0071] Optionally, the target level identifier is a province identifier.
[0072] Among them, the provincial logo can refer to the logo corresponding to each province.
[0073] In this embodiment, the target level file can be sent to the GeoServer corresponding to the provincial identifier according to the provincial identifier carried by the target level file, so as to ensure the accurate release of national forestry small class data.
[0074] Embodiment 2
[0075] Figure 2 This is a flowchart of a layer publishing method provided in the second embodiment of the present invention. The technical solution of this embodiment is further refined on the basis of the above embodiment. Figure 2 As shown, the method includes:
[0076] S210, exporting a target level file in a geographic database, wherein the target level file carries a target level identifier.
[0077] S220: Send the target level file to the GeoServer corresponding to the target level identifier.
[0078] S230, obtaining a first configuration file corresponding to the target level file, wherein the first configuration file includes: a workspace name, a storage name, a full path of the target level file, a layer name, and a style name.
[0079] S240: Create a workspace according to the workspace name.
[0080] In this embodiment, Figure 3 A flowchart of a program for automatically publishing forestry class data provided by the second embodiment of the present invention, such as Figure 3As shown, after reading the first configuration file, it is necessary to first determine whether there is a shapefile to be published (i.e., a target level file in shapefile format). If not, the process ends directly; if yes, it is necessary to find and determine whether a workspace exists. If it exists, it will not be created, and the next step is to determine the data storage; if it does not exist, a workspace can be created according to the name of the GeoServer workspace in the first configuration file. Specifically, it can be determined whether a workspace exists according to its name.
[0081] S250: Create data storage according to the storage name and the full path of the target level file.
[0082] The data storage may refer to a collection of data that is persistently stored and managed by a repository, for example, a simple file may be stored.
[0083] In this embodiment, Figure 3 As shown in the figure, after creating a workspace, it is necessary to determine whether the data store exists. If it does, it will not be created, and the next step is to determine whether the style (layer publishing style) exists; if it does not exist, the storage is created in the workspace according to the storage name and the full path of the target layer file. Specifically, you can determine whether the data store exists according to the storage name.
[0084] S260, determining the publishing style according to the style name.
[0085] In this embodiment, Figure 3 As shown in the figure, after creating the data storage, it is necessary to determine whether the style exists. If it exists, it will not be created, and the next step is to determine whether the layer exists; if it does not exist, the layer publishing style can be determined based on the style name. Specifically, it can be determined whether the style exists based on the style name.
[0086] S270: If the layer corresponding to the layer name does not exist in the workspace, the layer corresponding to the target level file is published according to the workspace, data storage and publishing style.
[0087] Specifically, Figure 3 As shown in the figure, after determining the layer publishing style, you need to determine whether the layer exists. If it exists, publish it directly; if it does not exist, you can publish the layer corresponding to the target hierarchical file according to the workspace, data storage and publishing style. Specifically, you can determine whether the layer exists based on the layer name.
[0088] In this embodiment, a workspace can be created according to the name of the GeoServer workspace in the first configuration file; a storage is created in the workspace according to the storage name and the full path of the target level file, and the exported target level file is stored in the data storage to obtain the storage path; the storage path of the exported target level file in the workspace is determined according to the storage name; the publishing style is determined according to the style name; the workspace is queried according to the layer name; if the corresponding layer does not exist in the workspace, the layer corresponding to the target level file is published based on the workspace, data storage path, and publishing style. The national forestry small class data is efficiently published by remotely deploying automatic publishing programs, modifying program configuration parameters, and batch script execution, which greatly shortens the platform launch time and avoids the security risks of the platform's externally exposed ports.
[0089] Optionally, after publishing the layer corresponding to the target level file according to the first configuration file, the method further includes:
[0090] Obtain a second configuration file, wherein the second configuration file includes: a GeoServer address, a start feature tag, a feature length, a GeoServer port, a layer name, configuration information of a business database, and a table name;
[0091] Call the WFS service according to the GeoServer address, GeoServer port, layer name, starting feature tag, and feature length to obtain the data to be extracted;
[0092] Insert the data to be extracted into the table corresponding to the table name in the business database according to the configuration information and table name of the business database.
[0093] Among them, the second configuration file may include multiple program parameters for modification before executing the program, and the program may be a program for realizing batch extraction and storage of basic element data of small classes. GeoServer address may refer to the IP address of GeoServer; the starting element mark may refer to the mark of the starting element data; the element length may refer to the length of the element data; the GeoServer port may refer to the management port of GeoServer; the configuration information of the business database may refer to the information for configuring the business database, which is fixed; the table name may be understood as the province name corresponding to the table stored in the business database, which is fixed); the WFS service may refer to the Web feature service; the data to be extracted may refer to the basic element data of small classes; specifically, writing a batch extraction and storage program of basic element data of small classes may include: batch calling the Restful API provided by GeoServer to support the Web feature service (WebFeatureService, WFS) specification, parsing the returned forestry small class basic element data in json format and then storing it in the database.
[0094] Specifically, Figure 4 A flowchart of a small class basic element data batch extraction and storage program provided in the second embodiment of the present invention, such as Figure 4 As shown, read the configuration file (second configuration file) to obtain the GeoServer address, starting feature tag, feature length, GeoServer port, layer name, business database configuration information and table name in the second configuration file. A batch extraction and storage program is deployed in GeoServer. The WFS service of GeoServer can be called in batches according to the GeoServer address, GeoServer port, layer name, starting feature tag and feature length, and the Restful API provided by the specification is standardized; parse the returned forestry small class basic feature data in json format (data to be extracted). According to the configuration information and table name of the business database, the data to be extracted is inserted into the table corresponding to the table name in the business database.
[0095] In this embodiment, the warehousing operation of the basic elements of small classes is efficiently completed by batch extracting the basic elements of small classes into the warehousing program, modifying the program configuration parameters, and executing batch scripts, which greatly shortens the platform launch time and improves the platform deployment efficiency.
[0096] Optionally, after generating a publishing layer corresponding to the target layer file according to the first configuration file and the target layer file, the method further includes:
[0097] Receive a data extraction request sent by the first GeoServer, wherein the data extraction request includes: the first GeoServer address, the first GeoServer port, the layer name, the start element tag, and the element length;
[0098] Update the second configuration file according to the first GeoServer address, the first GeoServer port, the layer name, the start feature tag, and the feature length;
[0099] Call the WFS service according to the first GeoServer address, the first GeoServer port, the layer name, the start feature tag, and the feature length to obtain the data to be extracted;
[0100] Insert the data to be extracted into the table corresponding to the table name in the business database according to the configuration information and table name of the business database.
[0101] The first GeoServer may refer to a GeoServe on which no batch extraction and storage program is deployed.
[0102] Specifically, if the first GeoServer is not deployed with a batch extraction and storage program, a data extraction request is sent to the GeoServer with the batch extraction and storage program deployed, and the GeoServer with the batch extraction and storage program deployed receives the data extraction request, which includes: the first GeoServer address, the first GeoServer port, the layer name, the starting element mark, and the element length; the second configuration file is updated according to the first GeoServer address, the first GeoServer port, the layer name, the starting element mark, and the element length; the WFS service of GeoServer is called in batches according to the first GeoServer address, the first GeoServer port, the layer name, the starting element mark, and the element length included in the updated second configuration file, and the Restful API provided by the specification is provided; the basic element data of the forestry class in json format returned is parsed (data to be extracted). The data to be extracted is inserted into the table corresponding to the table name in the business database according to the configuration information and table name of the business database.
[0103] In this embodiment, if the batch extraction and warehousing program is not deployed in GeoServer, a data extraction request is sent to update the second configuration file, and the data to be extracted is extracted according to the updated configuration file, thereby ensuring the batch extraction and warehousing operation of the basic element data of the small class, improving the deployment efficiency of the platform, and avoiding the security risks of the platform's externally exposed ports.
[0104] Exemplary, exemplary, Figure 5 This is a flowchart of the overall processing of layer publishing provided by the second embodiment of the present invention. Figure 5 As shown, the specific processing flow can be:
[0105] 1. Plan the correspondence between the data released by each province (i.e. forestry small class data) and GeoServer.
[0106] 2. Use ArcGis software to open the file geographic database (i.e. geographic database) of the forestry classes in each province, and convert and export it into shapefile format files (i.e. target level files in shapefile format) by province, city, and district (due to file size limitations, those that can be exported by province should be exported by province, those that cannot be exported by city, and those that still cannot be exported by county, and the file names can be named according to administrative codes) for subsequent processing.
[0107] 3. Write a program to automatically publish national forestry small class data. The details are as follows: establish a java maven project, import the GeoServer-Manager component, and use this component to encapsulate the GeoServer RestAPI to realize the storage of forestry small class data shp files of various provinces, cities and districts, and the publication of layers and styles.
[0108] 4. Upload the Shapefiles of forestry classes in different provinces, cities, districts and counties to the corresponding GeoServer according to the plan, and deploy the program for automatically publishing national forestry class data on the four servers, and write the script to start the program. Modify the parameters on the four servers and then execute the startup script of the program for automatically publishing national forestry class data, and automatically publish the national forestry class data to the GeoServer server.
[0109] 5. Write a program for batch extraction and storage of basic element data of small forestry classes, batch call the Restful API provided by GeoServer to support the WFS (Web Feature Service) specification, parse the returned basic element data of small forestry classes in json format and store them in the database.
[0110] 6. Deploy the batch extraction and storage program for basic elements of forestry classes on one of the GeoServers and write a script to start the program. Modify the parameters and then execute the startup script of the batch extraction and storage program for basic elements of forestry classes to batch extract and merge the basic elements of forestry classes nationwide into the business database.
[0111] See also Figure 5 In this embodiment, the program for automatically publishing the national forestry small class data and the batch extraction and storage program of the basic elements of the forestry small class data are remotely deployed, the program configuration parameters are modified, and the batch script execution is performed, which efficiently completes the release of the national forestry small class data, eliminating a large number of repetitive page operations in most districts and counties across the country; as well as the storage operation of the basic elements of the forestry small class data, greatly shortening the platform launch time, improving the platform deployment efficiency, and avoiding the security risks of the platform's externally exposed ports.
[0112] Embodiment 3
[0113] Figure 6 This is a schematic diagram of the structure of a layer publishing device provided in Embodiment 3 of the present invention. Figure 6 As shown, the device comprises:
[0114] An export module 310 is used to export a target level file in a geographic database, wherein the target level file carries a target level identifier;
[0115] A sending module 320, configured to send the target level file to the GeoServer corresponding to the target level identifier;
[0116] A first acquisition module 330 is used to acquire a first configuration file corresponding to the target level file;
[0117] The publishing module 340 is used to publish the layer corresponding to the target level file according to the first configuration file, wherein the first configuration file includes: a workspace name, a storage name, a full path of the target level file, a layer name and a style name.
[0118] Optionally, the publishing module 340 is specifically configured to:
[0119] Create a workspace based on the workspace name;
[0120] Create a data store according to the storage name and the full path of the target level file;
[0121] Determine the publishing style based on the style name;
[0122] If the layer corresponding to the layer name does not exist in the workspace, the layer corresponding to the target level file is published according to the workspace, data storage and publishing style.
[0123] Optionally, the layer publishing device further includes:
[0124] A second acquisition module is used to acquire a second configuration file, wherein the second configuration file includes: a GeoServer address, a start element tag, an element length, a GeoServer port, a layer name, configuration information of a business database, and a table name;
[0125] The first extraction module is used to call the WFS service according to the GeoServer address, GeoServer port, layer name, start feature tag and feature length to obtain the data to be extracted;
[0126] The first inserting module is used to insert the data to be extracted into a table corresponding to the table name in the business database according to the configuration information and the table name of the business database.
[0127] Optionally, the sending module 320 is specifically configured to:
[0128] Convert the target layer file into a shapefile file.
[0129] The target level file in the shapefile format is sent to the GeoServer corresponding to the target identifier.
[0130] Optionally, the layer publishing device further includes:
[0131] A receiving module, configured to receive a data extraction request sent by a first GeoServer, wherein the data extraction request includes: a first GeoServer address, a first GeoServer port, a layer name, a start element tag, and an element length;
[0132] An update module, used for updating the second configuration file according to the first GeoServer address, the first GeoServer port, the layer name, the start feature tag, and the feature length;
[0133] The second extraction module is used to call the WFS service according to the first GeoServer address, the first GeoServer port, the layer name, the start feature tag and the feature length to obtain the data to be extracted;
[0134] The second inserting module is used to insert the data to be extracted into the table corresponding to the table name in the business database according to the configuration information and the table name of the business database.
[0135] Optionally, the target identifier is a province identifier.
[0136] The layer publishing device provided in the embodiment of the present invention can execute the layer publishing method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0137] Embodiment 4
[0138] Figure 7 A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device 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 can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0139] like Figure 7 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0140] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0141] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as the layer publishing method.
[0142] In some embodiments, the layer publishing method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the layer publishing method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to execute the layer publishing method in any other appropriate manner (e.g., by means of firmware).
[0143] Various implementations 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 chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0144] Computer programs for implementing the methods of the present invention 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, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0145] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0146] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: 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 a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0147] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0148] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0149] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0150] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A layer publishing method, characterized in that: include: Exporting a target level file in a geographic database, wherein the target level file carries a target identifier; Send the target level file to the GeoServer corresponding to the target identifier; Obtaining a first configuration file corresponding to the target level file; Publishing the layer corresponding to the target level file according to the first configuration file, wherein the first configuration file includes: a workspace name, a storage name, a full path of the target level file, a layer name, and a style name; Wherein, the first configuration file stores program parameters for automatically publishing national forestry small class data program; The target identifier is a province identifier; After the layer corresponding to the target level file is published according to the first configuration file, the method includes: Obtain a second configuration file, wherein the second configuration file includes: a GeoServer address, a start feature tag, a feature length, a GeoServer port, a layer name, configuration information of a business database, and a table name; Call the WFS service according to the GeoServer address, GeoServer port, layer name, starting feature tag, and feature length to obtain the data to be extracted; Insert the data to be extracted into the table corresponding to the table name in the business database according to the configuration information and table name of the business database; After generating a publishing layer corresponding to the target layer file according to the first configuration file and the target layer file, the method further includes: If the batch extraction and storage program is not deployed in the first GeoServer, a data extraction request is sent to the GeoServer deployed with the batch extraction and storage program, and the GeoServer deployed with the batch extraction and storage program receives the data extraction request, wherein the data extraction request includes: the first GeoServer address, the first GeoServer port, the layer name, the start element tag, and the element length; Update the second configuration file according to the first GeoServer address, the first GeoServer port, the layer name, the start feature tag, and the feature length; According to the first GeoServer address, the first GeoServer port, the layer name, the start feature tag, and the feature length included in the updated second configuration file, the WFS service of GeoServer is called in batches to obtain the data to be extracted; Insert the data to be extracted into the table corresponding to the table name in the business database according to the configuration information and table name of the business database; The first GeoServer refers to a GeoServe that is not deployed with a batch extraction and storage program.
2. The method according to claim 1, characterized in that Publishing a layer corresponding to the target level file according to the first configuration file includes: Create a workspace based on the workspace name; Create a data store according to the storage name and the full path of the target level file; Determine the publishing style based on the style name; If the layer corresponding to the layer name does not exist in the workspace, the layer corresponding to the target level file is published according to the workspace, data storage and publishing style.
3. The method according to claim 1, characterized in that: Sending the target level file to the GeoServer corresponding to the target identifier includes: Convert the target layer file into a shapefile file. The target level file in the shapefile format is sent to the GeoServer corresponding to the target identifier.
4. A layer publishing device, characterized in that: include: An export module, used for exporting a target level file in a geographic database, wherein the target level file carries a target identifier; A sending module, used for sending the target level file to the GeoServer corresponding to the target identifier; A first acquisition module, used to acquire a first configuration file corresponding to the target level file; A publishing module, used for publishing the layer corresponding to the target level file according to a first configuration file, wherein the first configuration file includes: a workspace name, a storage name, a full path of the target level file, a layer name, and a style name; Wherein, the first configuration file stores program parameters for automatically publishing national forestry small class data program; The target identifier is a province identifier; The layer publishing device comprises: A second acquisition module is used to acquire a second configuration file, wherein the second configuration file includes: a GeoServer address, a start element tag, an element length, a GeoServer port, a layer name, configuration information of a business database, and a table name; The first extraction module is used to call the WFS service according to the GeoServer address, GeoServer port, layer name, start feature tag and feature length to obtain the data to be extracted; A first inserting module, used for inserting the data to be extracted into a table corresponding to the table name in the business database according to the configuration information and table name of the business database; The layer publishing device further includes: A receiving module is used for sending a data extraction request to a GeoServer with a batch extraction and storage program deployed if the batch extraction and storage program is not deployed in the first GeoServer, and the GeoServer with the batch extraction and storage program deployed receives the data extraction request, wherein the data extraction request includes: the first GeoServer address, the first GeoServer port, the layer name, the start element tag, and the element length; An update module, used for updating the second configuration file according to the first GeoServer address, the first GeoServer port, the layer name, the start feature tag, and the feature length; The second extraction module is used to batch call the WFS service of GeoServer according to the first GeoServer address, the first GeoServer port, the layer name, the start feature tag and the feature length included in the updated second configuration file to obtain the data to be extracted; A second insertion module is used to insert the data to be extracted into a table corresponding to the table name in the business database according to the configuration information and table name of the business database; The first GeoServer refers to a GeoServe that is not deployed with a batch extraction and storage program.
5. The device according to claim 4, characterized in that Release module, specifically used for: Create a workspace based on the workspace name; Create a data store according to the storage name and the full path of the target level file; Determine the publishing style based on the style name; If the layer corresponding to the layer name does not exist in the workspace, the layer corresponding to the target level file is published according to the workspace, data storage and publishing style.
6. An electronic device, characterized in that: The electronic device comprises: at least one processor; and 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, and the computer program is executed by the at least one processor so that the at least one processor can execute the layer publishing method described in any one of claims 1-3.
7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the layer publishing method described in any one of claims 1 to 3 when executed.
Citation Information
Patent Citations
Achieving method for automatically publishing road construction quality information map based on GeoServer
CN107480211A
Remote sensing data automatic release and online process monitoring method
CN113220807A
Geological spatial data processing method and device and electronic equipment
CN116185628A
