A region coding method, apparatus, device and medium

CN123013846APending Publication Date: 2026-10-30CHINA PING AN PROPERTY INSURANCE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610971252.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-06-30
Publication Date
2026-10-30

AI Technical Summary

Technical Problem

[0004]本发明实施例提供一种区域编码方法、装置、设备及介质,以解决现有技术中区域编码效率与准确性难以兼顾的问题

Benefits of technology

[0009]上述区域编码方法、装置、设备及介质所实现的方案中,通过响应于区域编码请求,确定待编码区域的区域标识信息和目标编码格式;若预设规则库中不存在与区域标识信息和目标编码格式匹配的编码规则,则从预设标准位置信息库中确定与区域标识信息匹配的候选标准位置信息;对候选标准位置信息进行置信度计算,得到信息置信度;若存在信息置信度达到预设置信度阈值的候选标准位置信息,则将信息置信度最高的候选标准位置信息确定为目标位置信息,并基于目标位置信息和目标编码格式,生成待编码区域的区域编码;若不存在信息置信度达到预设置信度阈值的候选标准位置信息,则对区域标识信息进行格式识别,得到标识信息格式,并基于标识信息格式和目标编码格式,生成区域编码。本发明通过预设规则库匹配与预设标准位置信息库候选确定相结合的处理方式,在保障常见场景编码处理效率的同时,覆盖了无规则匹配的编码场景,提升了方案的适配范围;通过置信度计算区分匹配结果的可靠程度,针对不同置信度场景采用差异化的编码生成逻辑,有效提高了区域编码的准确性;实现了区域编码的自动化处理,能够适配不同输入场景下的编码需求。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123013846A_ABST
    Figure CN123013846A_ABST
Patent Text Reader

Abstract

The application relates to the technical field of regional coding, and discloses a regional coding method, device, equipment and medium, which comprises the following steps: in response to a regional coding request, determining regional identification information and a target coding format of a region to be coded; if there is no coding rule matched with the regional identification information and the target coding format in a preset rule library, determining candidate standard position information matched with the regional identification information from a preset standard position information library; performing confidence calculation on the candidate standard position information to obtain information confidence; if there is candidate standard position information with information confidence reaching a preset confidence threshold, determining the candidate standard position information with the highest information confidence as target position information, and generating regional coding of the region to be coded based on the target position information and the target coding format; if there is no candidate standard position information with information confidence reaching the preset confidence threshold, performing format identification on the regional identification information to obtain identification information format, and generating regional coding based on the identification information format and the target coding format. The application can be applied to the urban regional coding scene in the field of smart cities, and improves the regional coding efficiency and the accuracy of regional coding.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of regional coding and smart city technology, and in particular to a regional coding method, apparatus, device and medium. Background Technology

[0002] Administrative division coding is a crucial foundational data area for social governance and business analytics. Regional coding, in particular, refers to unique identifiers assigned to administrative regions at all levels according to standardized coding rules. These codes are used to identify and distinguish different administrative regions in various information systems, serving as the fundamental support for geographic information association and regional statistical analysis of data. They are widely applied in various business scenarios that require organizing data by administrative region. With the deepening of digital transformation, various industries are placing higher demands on the automated processing capabilities of administrative division coding.

[0003] Existing technologies typically employ manual verification or simple rule matching for region coding mapping. However, this approach suffers from two main problems. Firstly, it's difficult to balance matching accuracy and processing efficiency. While manual matching offers relatively high accuracy, it's slow, costly, and unsuitable for encoding large volumes of data. Secondly, automated rule matching, though faster, is prone to errors when dealing with semantically ambiguous or similarly named regions, and it struggles with diverse input data formats. Therefore, a region coding method that can simultaneously achieve both accuracy and efficiency is urgently needed. Summary of the Invention

[0004] This invention provides a region coding method, apparatus, device, and medium to solve the problem that it is difficult to balance region coding efficiency and accuracy in the prior art.

[0005] Firstly, this disclosure provides a region coding method, including: In response to a region coding request, determine the region identification information and target coding format of the region to be coded; If there is no encoding rule in the preset rule base that matches the area identification information and the target encoding format, then candidate standard location information that matches the area identification information is determined from the preset standard location information base. The confidence level of the candidate standard location information is calculated to obtain the information confidence level. If there are candidate standard location information whose information confidence reaches the preset confidence threshold, then the candidate standard location information with the highest information confidence is determined as the target location information, and a region code for the area to be encoded is generated based on the target location information and the target encoding format; If there is no candidate standard location information whose information confidence reaches the preset confidence threshold, the format of the regional identification information is identified to obtain the identification information format, and a regional code is generated based on the identification information format and the target coding format.

[0006] Secondly, this disclosure provides a region coding device, comprising: The request-response module is used to respond to a region encoding request and determine the region identifier information and target encoding format of the region to be encoded. The information matching module is used to determine candidate standard location information that matches the area identification information from the preset standard location information database if there is no encoding rule in the preset rule base that matches the area identification information and the target encoding format. The confidence level determination module is used to calculate the confidence level of candidate standard location information to obtain the information confidence level. The first encoding module is used to determine the candidate standard location information with the highest information confidence as the target location information if there is candidate standard location information with information confidence reaching a preset confidence threshold, and to generate the area code of the area to be encoded based on the target location information and the target encoding format. The second encoding module is used to identify the format of the regional identification information if there is no candidate standard location information whose information confidence reaches a preset confidence threshold, obtain the identification information format, and generate the regional code based on the identification information format and the target encoding format.

[0007] Thirdly, this disclosure provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the aforementioned region encoding method when executing the computer program.

[0008] Fourthly, this disclosure provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the aforementioned region encoding method.

[0009] In the aforementioned scheme implemented by the area coding method, apparatus, device, and medium, in response to an area coding request, the area identification information and target coding format of the area to be coded are determined; if no coding rule matching the area identification information and target coding format exists in the preset rule base, candidate standard location information matching the area identification information is determined from the preset standard location information base; the confidence level of the candidate standard location information is calculated to obtain the information confidence level; if there is candidate standard location information whose information confidence level reaches a preset confidence threshold, the candidate standard location information with the highest information confidence level is determined as the target location information, and the area code of the area to be coded is generated based on the target location information and the target coding format; if there is no candidate standard location information whose information confidence level reaches a preset confidence threshold, the format of the area identification information is identified to obtain the identification information format, and the area code is generated based on the identification information format and the target coding format. This invention combines a pre-defined rule base matching method with a pre-defined standard location information database candidate determination method. This ensures efficient coding processing for common scenarios while covering coding scenarios without rule matching, thus expanding the applicability of the solution. By calculating confidence levels to differentiate the reliability of matching results, and employing differentiated coding generation logic for different confidence level scenarios, the accuracy of regional coding is effectively improved. Furthermore, it achieves automated processing of regional coding, enabling it to adapt to coding requirements under different input scenarios. Attached Figure Description

[0010] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0011] Figure 1 This is a schematic diagram of a scenario of a region coding method according to an embodiment of the present invention; Figure 2 This is a flowchart of a region coding method in one embodiment of the present invention; Figure 3 This is another flowchart of a region coding method in one embodiment of the present invention; Figure 4 This is another flowchart of a region coding method in one embodiment of the present invention; Figure 5 This is another flowchart of a region coding method in one embodiment of the present invention; Figure 6 This is another flowchart of a region coding method in one embodiment of the present invention; Figure 7 This is another flowchart of a region coding method in one embodiment of the present invention; Figure 8 This is another flowchart of a region coding method in one embodiment of the present invention; Figure 9 This is a schematic block diagram of a region coding device in one embodiment of the present invention; Figure 10 This is a schematic block diagram of a computer device according to an embodiment of the present invention. Detailed Implementation

[0012] The region coding method provided in this embodiment of the invention can be applied to, for example... Figure 1 In this application environment, the client communicates with the server via a network. The server can receive the area coding request sent by the client, determine the area identifier information and target coding format of the area to be coded; determine the target location information by combining a preset rule base matching method with a preset standard location information database candidate determination method; generate the area code of the area to be coded based on the target location information and the target coding format, and return the area coding result to the client. This invention can be applied to urban area coding scenarios in the field of smart cities, and can improve the efficiency and accuracy of area coding. The client can be, but is not limited to, various personal computers, laptops, smartphones, tablets, and portable wearable devices. The server can be implemented using a standalone server or a server cluster consisting of multiple servers. The invention will be described in detail below through specific embodiments.

[0013] In one embodiment, such as Figure 2 As shown, a region encoding method is provided. Taking the application of this method on the server side as an example, it includes the following steps: S101, in response to the area coding request, determine the area identification information and target coding format of the area to be coded; S102, if there is no encoding rule in the preset rule base that matches the area identification information and the target encoding format, then determine the candidate standard location information that matches the area identification information from the preset standard location information base; S103, calculate the confidence level of the candidate standard location information to obtain the information confidence level; S104, if there are candidate standard location information whose information confidence reaches the preset confidence threshold, then the candidate standard location information with the highest information confidence is determined as the target location information, and a region code for the area to be encoded is generated based on the target location information and the target encoding format; S105 If there is no candidate standard location information whose information confidence reaches the preset confidence threshold, then the format of the regional identification information is identified to obtain the identification information format, and a regional code is generated based on the identification information format and the target coding format.

[0014] As an example, in step S101, after receiving the area coding request, the server first parses the area identification information and target coding format of the area to be coded from the request. The area coding request is the request instruction that triggers the area coding process; it can be initiated by the client or automatically triggered by the system. The area identification information is the information used to identify the area to be coded, and can take various forms such as area name, area code, coordinate information, and boundary geometric information. The target coding format refers to the expected format type of the area code to be generated, such as a national standard coding format, a company-defined coding format, or a map service coding format.

[0015] In one optional embodiment, the region identification information and target encoding format can be obtained by receiving a region encoding request submitted by the client. Users can submit region encoding requests in various ways, such as manual input, batch file upload, and system integration.

[0016] In an alternative embodiment, the region data to be encoded can be obtained by calling the application programming interface (API) of the business system, thereby enabling automatic encoding processing of cross-system data.

[0017] For example, in a smart city scenario, the business system needs to convert the regional names in a batch of historical data into national standard administrative division codes. After receiving the regional coding request, the server parses the regional name to be coded from the request as regional identification information, and determines that the target coding format is the national standard GB / T2260 coding format, laying the foundation for subsequent coding processing.

[0018] For example, taking the enterprise master data management scenario, the enterprise needs to uniformly map the custom regional codes in the Customer Relationship Management (CRM) system to the standard code. After receiving the regional code request, the server parses the custom code of the CRM system from the request as the regional identification information, and at the same time determines that the target code format is the national standard code format, so as to achieve the unification of the coding system between different systems.

[0019] As an example, in step S102, after determining the region identification information and the target encoding format, the system first queries a preset rule base to determine if there is an encoding rule that matches the region identification information and the target encoding format. If no matching encoding rule exists, candidate standard location information that matches the region identification information is determined from a preset standard location information database. Here, the preset rule base refers to a pre-configured set of rules containing multiple encoding rules, each defining a conversion rule from a specific input format to the target encoding format; the preset standard location information database refers to a pre-built database storing standard region location information, including standard names, standard codes, spatial locations, etc., for administrative regions at all levels; candidate standard location information refers to standard location information that may match the region identification information selected from the preset standard location information database, serving as candidate results for further verification. It should be understood that the preset rule base contains encoding rules corresponding to the preset standard information in the preset standard location information database.

[0020] In one optional embodiment, the encoding rules in the preset rule base can be implemented by regular expression matching. By defining the regular expression pattern of the encoding rules, the structural features of the input encoding are automatically identified and mapped.

[0021] In one optional embodiment, when determining candidate standard location information from a preset standard location information database, various matching methods such as keyword matching, semantic matching, and fuzzy matching can be used, and a suitable matching strategy can be selected based on the characteristics of the regional identification information.

[0022] For example, taking the enterprise-defined code mapping scenario, when the input area identification information is the enterprise-defined code "SH001" and the target code format is the national standard code, the system first queries the preset rule base. If there is a mapping rule from "SH001" to the national standard code in the rule base, the code is generated directly by applying the rule. If there is no matching code rule in the rule base, the system searches for candidate standard location information that may match "SH001" from the preset standard location information database, such as possible candidate results like Shenzhen and Shanghai, for further matching and verification in subsequent steps.

[0023] For example, taking the fuzzy matching scenario of place names as an example, when the input area identification information is "Nanshan" and the target encoding format is the national standard encoding, the system first queries the preset rule base. If there is no direct mapping rule corresponding to "Nanshan" in the rule base, it searches for candidate standard location information containing the keyword "Nanshan" from the preset standard location information base, such as multiple candidate results such as Nanshan District, Nanshan Street, and Nanshan Town, for subsequent steps to calculate confidence and filter.

[0024] As an example, in step S103, after determining the candidate standard location information, a confidence score is calculated for each candidate standard location information to obtain the information confidence score corresponding to each candidate. The information confidence score refers to the reliability of the match between the candidate standard location information and the identifier information of the region to be encoded. The higher the confidence score, the more reliable the matching result. The confidence score calculation can comprehensively consider multiple dimensions such as semantic similarity, hierarchical matching degree, and spatial matching degree, and obtain a comprehensive confidence score through multi-dimensional fusion.

[0025] In one optional embodiment, a weighted summation method can be used to fuse multi-dimensional confidence scores, assigning corresponding weights to the matching degree of each dimension, and obtaining a comprehensive confidence score through weighted calculation.

[0026] In one alternative embodiment, a machine learning model can be used to calculate the confidence score. By using a trained classification or regression model, the matching features of each dimension are input, and the final confidence score is output.

[0027] For example, taking a place name matching scenario, for the area identifier "Nanshan", the candidate standard location information may include multiple results such as "Nanshan District", "Nanshan Subdistrict", and "Nanshan Town". The system calculates the confidence score for each candidate. For example, the confidence score for "Nanshan District" is 0.92, the confidence score for "Nanshan Subdistrict" is 0.78, and the confidence score for "Nanshan Town" is 0.65. The confidence score values ​​can intuitively reflect the matching reliability of each candidate result.

[0028] For example, taking the encoding mapping scenario, for the region identifier information "SH001", the candidate standard location information may include multiple results such as "Shenzhen", "Shanghai", and "Shantou". The system calculates the confidence score of each candidate. For example, the confidence score of "Shenzhen" is 0.88, the confidence score of "Shanghai" is 0.75, and the confidence score of "Shantou" is 0.52. By sorting by confidence score, the most likely matching result can be quickly located.

[0029] As an example, in step S104, after obtaining the information confidence levels of each candidate standard location information, it is determined whether there are any candidates whose information confidence levels reach a preset confidence threshold. If so, the candidate standard location information with the highest information confidence level is selected from all candidates that reach the threshold as the target location information. Then, based on the target location information and the target encoding format, a regional code for the area to be encoded is generated. Here, the preset confidence threshold refers to a pre-set confidence threshold used to determine whether the matching result is reliable, which can be configured according to business needs; the target location information refers to the standard location information that best matches the area to be encoded after confidence level filtering; and the regional code refers to the final encoding result generated according to the target encoding format, used to identify and distinguish different administrative regions.

[0030] In one optional embodiment, when there are multiple candidate standard location information that reach the confidence threshold, the candidate standard location information with the highest confidence can be selected as the target location information, or multiple high-confidence candidates can be returned for manual confirmation according to business needs.

[0031] In one optional embodiment, when generating a regional code based on the target location information and the target encoding format, the standard code corresponding to the target location information can be obtained directly from a preset standard location information database, or the code of the target format can be generated in real time according to the encoding rules.

[0032] For example, taking a high-confidence direct matching scenario, the preset confidence threshold is set to 0.85. When the confidence of the candidate "Nanshan District" is 0.92, reaching the preset confidence threshold, and is the result with the highest confidence among all candidate standard location information, then "Nanshan District" is determined as the target location information. Then, based on the target location information "Nanshan District" and the target encoding format "National Standard Encoding", the corresponding regional code "440305" is generated.

[0033] For example, taking a multi-candidate return scenario, the preset confidence threshold is set to 0.7. When the confidence of candidate "Nanshan District" is 0.92 and the confidence of candidate "Nanshan Street" is 0.78, both reaching the confidence threshold, the system can return multiple high-confidence candidates and their corresponding coding results for business personnel to manually confirm, ensuring the coding accuracy in key scenarios.

[0034] As an example, in step S105, if the confidence level of all candidate standard location information fails to reach the preset confidence threshold, it indicates that the semantic matching method cannot obtain reliable matching results, and further processing is required. First, the regional identification information is formatted to determine its format. Then, corresponding processing logic is applied based on different format types. Finally, a regional code is generated based on the identification information format and the target encoding format. The identification information format refers to the data form of the regional identification information, which can include various types such as name format, coordinate format, encoding format, and boundary geometry format. Format identification refers to the process of determining the format type of the regional identification information through feature analysis, providing a basis for selecting the appropriate processing strategy.

[0035] In one alternative embodiment, format recognition can be achieved through regular expression matching, which determines the format type of the input data based on the characteristic patterns of different formats.

[0036] In one optional embodiment, differentiated encoding generation strategies can be adopted for regional identification information in different formats. For example, spatial boundary verification can be used for coordinate formats, and geocoding conversion can be used for name formats.

[0037] For example, taking a coordinate input scenario, when the input area identification information is a set of latitude and longitude coordinates, and the confidence of the candidate results based on semantic matching is all below the threshold, the format of the area identification information can be identified as coordinate format first. Then, based on the processing logic of the coordinate format, the administrative region to which the coordinates belong can be determined by spatial boundary verification, and the corresponding area code can be generated.

[0038] For example, taking the fuzzy name scenario, when the input area identification information is a fuzzy abbreviation of a place name, and the confidence of the candidate results based on semantic matching is all below the threshold, the format of the area identification information can be identified as a name format first, and then the fuzzy place name can be converted into coordinate information through geocoding service. Then, the administrative region to which it belongs can be determined through spatial boundary verification, and the corresponding area code can be generated.

[0039] This invention provides a region coding method, comprising: responding to a region coding request, determining region identification information and a target coding format for the region to be coded; if no coding rule matching the region identification information and the target coding format exists in a preset rule base, determining candidate standard location information matching the region identification information from a preset standard location information base; calculating the confidence level of the candidate standard location information to obtain an information confidence level; if there is candidate standard location information with an information confidence level reaching a preset confidence threshold, determining the candidate standard location information with the highest information confidence level as the target location information, and generating a region code for the region to be coded based on the target location information and the target coding format; if there is no candidate standard location information with an information confidence level reaching a preset confidence threshold, recognizing the format of the region identification information to obtain an identification information format, and generating a region code based on the identification information format and the target coding format. This method combines matching from a pre-defined rule base with candidate determination from a pre-defined standard location information database. While ensuring efficient coding in common scenarios, it also covers coding scenarios without rule matching, thus expanding the applicability of regional coding. By calculating confidence levels to differentiate the reliability of matching results and employing differentiated coding generation logic for scenarios with different confidence levels, it effectively improves the accuracy of regional coding. Furthermore, by performing format recognition and boundary verification for low-confidence scenarios, it achieves compatible processing of input data in multiple formats, expanding the applicability of the solution and improving both the processing efficiency and accuracy of regional coding.

[0040] In one embodiment, such as Figure 3 As shown, the preset standard location information database includes multiple updated versions; step S102, which involves determining candidate standard location information that matches the area identification information from the preset standard location information database, includes: S201, determine the time parameters carried in the area coding request, and obtain the version update information of the preset standard location information database; S202, based on time parameters and version update information, determines the target update version from multiple update versions; S203, based on the preset standard location information database corresponding to the target update version, determine the candidate standard location information that matches the area identification information.

[0041] As an example, in step S201, the time parameter carried in the area coding request is first determined, and the version update information of the preset standard location information database is obtained. The time parameter refers to the time point or time range corresponding to the area to be coded, indicating the time dimension to which the area to be coded belongs; the version update information refers to the information recording the metadata of each historical version of the preset standard location information database, including the release time, effective time, changes, version number, etc., used for version selection and tracing.

[0042] In an optional embodiment, the time parameter can be time information explicitly carried in the request, or time information inferred from the request context, such as inferred from the data creation time, the time of the business occurrence, etc.

[0043] In an optional embodiment, the version update information of the preset standard location information database can be stored in a dedicated version management table, recording the effective start and end time of each version, change description, data snapshot and other information, supporting quick query and version switching.

[0044] For example, taking the historical data backtracking scenario as an example, when processing the historical data encoding request for 2020, the time parameter carried in the request is "2020-06-30". The server obtains the version update information of the preset standard location information database and learns that the standard database contains multiple updated versions such as 2018 version, 2020 version, and 2023 version, each version corresponding to the administrative division division of different periods.

[0045] For example, in a real-time data processing scenario, when processing the encoding request for the current real-time data, the time parameter is not explicitly carried in the request. The server automatically determines the time parameter as the current date based on the current system time, and then obtains the version update information of the preset standard location information database to find the latest version that is currently in effect.

[0046] As an example, in step S202, based on the time parameter carried in the regional coding request and the version update information of the preset standard location information database, a target update version matching the time parameter is selected from multiple update versions. The target update version refers to the preset standard location information database version that corresponds to the time parameter and is effective at that time point; the target update version can be the latest version effective at that time parameter point, ensuring that the coding result is consistent with the actual administrative division situation during that period.

[0047] In one optional embodiment, version selection can be performed using a time interval matching method, where each version corresponds to an effective time interval, and the target version is determined based on which version's effective time interval the time parameter falls into.

[0048] In one optional embodiment, when the time parameter is a time range, all versions involved in the time range can be processed separately, or the version corresponding to the end of the time range can be processed uniformly.

[0049] For example, taking the historical data encoding scenario as an example, the time parameter is "2020-06-30". According to the version update information, the effective time of the 2018 version was from January 2018 to March 2020, and the effective time of the 2020 version was from April 2020 to the present. Therefore, the target update version is determined to be the 2020 version. The standard location information database of this version is used for subsequent matching processing to ensure that the encoding result conforms to the actual administrative division situation in June 2020.

[0050] For example, taking a cross-year data statistics scenario, the time parameter is "the whole year of 2019". This time range spans the effective period of both the 2018 and 2020 versions. The system can use the two versions to encode the data for the corresponding time period to ensure the accuracy of the statistical results and avoid statistical deviations caused by changes in administrative divisions.

[0051] As an example, in step S203, after determining the target update version, candidate standard location information is matched and determined based on the preset standard location information database corresponding to the target update version. Version selection ensures that the preset standard location information used in the encoding process is consistent with the time dimension of the area to be encoded, avoiding encoding errors caused by changes in administrative divisions and improving the accuracy of historical data encoding.

[0052] In one alternative embodiment, the preset standard location information database for each version can be stored independently or incrementally, saving storage space by recording version differences.

[0053] In one optional embodiment, a version comparison function can be supported to compare changes in administrative divisions between different versions, providing a reference for data migration and statistical analysis.

[0054] For example, taking the scenario of administrative division change as an example, the system uses the 2020 version of the preset standard location information database to match the regional identification information "City A". Since City A has been abolished and merged into City B in the 2020 version, no independent entry for City A can be matched in this version. The system will return relevant candidate results for City B, which is consistent with the actual administrative division situation at that time.

[0055] For example, taking the establishment of a new district as an example, the system uses the 2023 version of the preset standard location information database to match the area identification information "C New District". Since the 2023 version has included the administrative division information of C New District, the system can accurately match the standard location information of C New District, ensuring that the latest administrative division adjustment can be reflected in the coding results in a timely manner.

[0056] In one embodiment, such as Figure 4 As shown, the preset standard location information database corresponding to the target update version includes multiple preset standard location information; step S203, namely, based on the preset standard location information database corresponding to the target update version, determines the candidate standard location information that matches the area identification information, including: S301, perform semantic recognition on the area identification information to obtain the area semantic features, and perform semantic recognition on the preset standard location information to obtain the standard semantic features; S302, calculate the similarity between the region semantic features and the standard semantic features to obtain the feature similarity; S303, the preset standard location information with feature similarity greater than the preset similarity threshold is determined as candidate standard location information.

[0057] As an example, in step S301, semantic recognition is performed on the region identification information and the preset standard location information respectively, and their respective semantic features are extracted. Here, semantic recognition refers to the process of converting text information into feature vectors that can reflect semantic meaning through natural language processing technology; region semantic features refer to the semantic feature vectors extracted from the identification information of the region to be encoded; standard semantic features refer to the semantic feature vectors extracted from the preset standard location information.

[0058] In an optional embodiment, a pre-trained Chinese language model, such as BERT, SimBERT, or ERNIE, can be used for semantic recognition to encode text information into high-dimensional semantic feature vectors.

[0059] In one optional embodiment, all standard location information in a preset standard location information database can be semantically encoded and stored in advance, and the pre-calculated standard semantic features can be directly read during querying to improve matching efficiency.

[0060] For example, taking the semantic encoding scenario of place names as an example, a pre-trained Chinese language model is used to semantically encode regional identification information and preset standard location information. For the regional identification information "Shenzhen Nanshan District", the corresponding regional semantic feature vector is obtained through semantic recognition; for the preset standard location information "Nanshan District", the corresponding standard semantic feature vector is obtained through semantic recognition.

[0061] For example, taking the abbreviation recognition scenario, the semantic recognition model can understand the regional identification information "Shennan" as the abbreviation of "Shenzhen Nanshan District" and extract the semantic feature vector similar to "Nanshan District", thereby supporting the matching and recognition of abbreviations, acronyms and other variant forms.

[0062] As an example, in step S302, the extracted regional semantic features and standard semantic features are similar to each other to obtain the feature similarity between them. Feature similarity is used to measure the degree of semantic similarity between two semantic features. The higher the similarity, the closer the two texts are semantically. Common vector similarity calculation methods such as cosine similarity, Euclidean distance, and Manhattan distance can be used for similarity calculation.

[0063] In an optional embodiment, a cosine similarity calculation method can be used to calculate the cosine value of the angle between two semantic feature vectors as a similarity score, with the value ranging from 0 to 1, and the larger the value, the more similar they are.

[0064] In one optional embodiment, a comprehensive similarity calculation can be performed by combining keyword matching scores and semantic similarity scores, taking into account both the degree of literal matching and the degree of semantic similarity, thereby improving the accuracy of matching.

[0065] For example, taking the place name similarity calculation scenario, the cosine similarity calculation method is used to calculate the similarity between the regional semantic features of "Shenzhen Nanshan District" and the standard semantic features of "Nanshan District"; the feature similarity between "Shenzhen Nanshan District" and "Nanshan Street" is calculated; the similarity value can quantify the degree of semantic matching between different standard location information and the identification information of the area to be encoded.

[0066] For example, taking the synonym matching scenario, for the regional identifier "Rongcheng", the feature similarity between it and "Chengdu City" can be obtained through semantic similarity calculation, thereby realizing the matching and recognition of synonyms such as aliases and alternative names.

[0067] As an example, in step S303, the feature similarity is compared with a preset similarity threshold, and preset standard location information with feature similarity greater than the preset similarity threshold is filtered out as candidate standard location information. Here, the preset similarity threshold refers to a pre-set similarity threshold used to filter candidate results, which can be adjusted according to the accuracy requirements of the business scenario; by filtering through the similarity threshold, obviously irrelevant results can be filtered out, and potentially matching candidate results can be retained for further verification.

[0068] In one optional embodiment, the similarity threshold can be dynamically adjusted according to the number of candidates to ensure that the number of returned candidate results is within a reasonable range and to avoid too many or too few candidates.

[0069] In one optional embodiment, the candidate results can be sorted in descending order of similarity, and the top N candidate standard location information with the highest similarity can be returned, taking into account both recall rate and processing efficiency.

[0070] For example, taking the candidate screening scenario, the preset similarity threshold is set to 0.7. For the regional identification information "Nanshan District, Shenzhen", the feature similarity of "Nanshan District" is 0.93, which is greater than the preset similarity threshold, and it is determined as the candidate standard location information; the feature similarity of "Nanshan Street" is 0.72, which is greater than the preset similarity threshold, and it is also determined as the candidate standard location information; while other standard location information with similarity lower than 0.7 is filtered out and does not enter the candidate set.

[0071] In one embodiment, such as Figure 5 As shown, step S103, which involves calculating the confidence level of the candidate standard location information to obtain the information confidence level, includes: S401, based on the preset regional division hierarchy, determine the first regional hierarchy corresponding to the regional identification information and the second regional hierarchy corresponding to the candidate standard location information; S402, Calculate the hierarchical matching degree between the first region hierarchy and the second region hierarchy; S403, determine the information confidence level based on feature similarity and hierarchical matching degree.

[0072] As an example, in step S401, based on a preset regional division hierarchy, the first regional level corresponding to the regional identification information and the second regional level corresponding to the candidate standard location information are determined respectively. Here, the preset regional division hierarchy refers to a predefined administrative regional classification system, such as a multi-level division including provincial, prefecture, county, and township levels; the first regional level refers to the regional level corresponding to the regional identification information to be encoded; and the second regional level refers to the regional level corresponding to the candidate standard location information.

[0073] In one optional embodiment, the regional level can be determined by keyword recognition, for example, by including keywords such as "province", "city", "district", "county", "street", and "town" to determine the corresponding administrative level.

[0074] In one optional embodiment, the regional level can be determined by parsing the encoding rules. For example, the corresponding administrative level can be determined based on the number of digits in the national standard code, such as a 6-digit code corresponding to the county level and a 9-digit code corresponding to the township level.

[0075] For example, taking the scenario of determining the hierarchical level as an example, the preset regional division hierarchy includes four levels: provincial, prefecture, county, and township. For the regional identifier information "Nanshan District", the first regional level corresponding to it is determined to be county level by using the keyword "district"; for the candidate standard location information "Nanshan Subdistrict", the second regional level corresponding to it is determined to be township level by using the keyword "subdistrict". This hierarchical determination provides a foundation for subsequent hierarchical matching degree calculation.

[0076] For example, taking the coding level recognition scenario, for the regional identifier information "440305", by parsing the coding number of bits and coding rules, it is determined that its corresponding first regional level is county level (6-bit coding); for the candidate standard location information "440305001", it is determined that its corresponding second regional level is township level (9-bit coding).

[0077] As an example, in step S402, the hierarchical matching degree between the first and second regional levels is calculated. The hierarchical matching degree measures the degree of matching between the two regions at the administrative level; the closer the levels, the higher the matching degree; the greater the difference in levels, the lower the matching degree. The calculation of the hierarchical matching degree can be quantified based on the hierarchical difference.

[0078] In one optional embodiment, the hierarchical matching degree can be calculated using a linear decay method. For example, if the levels are the same, the matching degree is 1; if they differ by one level, the matching degree is 0.8; if they differ by two levels, the matching degree is 0.5; and if they differ by three levels, the matching degree is 0.2.

[0079] In an optional embodiment, different matching degree weights can be set according to the hierarchical relationship. For example, the matching degree of the upper-level region and the lower-level region can be set to different values.

[0080] For example, taking the scenario of calculating the level matching degree as an example, the first level of the regional identification information "Nanshan District" is county level, and the second level of the candidate standard location information "Nanshan District" is also county level. Since the levels are the same, the level matching degree is 1. The second level of the candidate standard location information "Nanshan Subdistrict" is township level, which is one level lower than the county level, so the level matching degree is 0.8. The second level of the candidate standard location information "Shenzhen City" is prefecture level, which is one level lower than the county level, so the level matching degree is 0.8.

[0081] For example, taking a cross-level matching scenario, the first regional level corresponding to the regional identifier information "Guangdong" is the provincial level, and the second regional level corresponding to the candidate standard location information "Guangzhou" is the prefecture level, which is one level lower than the provincial level, with a level matching degree of 0.8; the second regional level corresponding to the candidate standard location information "Nanshan District" is the county level, which is two levels lower than the provincial level, with a level matching degree of 0.5.

[0082] As an example, in step S403, the final information confidence level is determined by comprehensively considering two dimensions: feature similarity and hierarchical matching degree. By introducing hierarchical matching degree, it is possible to effectively distinguish areas with similar names but different hierarchical levels, avoid confusion between "Nanshan District" and "Nanshan Subdistrict", and improve the accuracy of confidence level calculation.

[0083] In one alternative embodiment, the two-dimensional indicators can be merged into a comprehensive confidence score by weighted summation, and the weights of each dimension can be adjusted according to business needs.

[0084] In one optional embodiment, confidence scores can be fused by multiplication, where the scores of the two dimensions are multiplied to obtain the overall confidence score, so that the overall confidence score will be affected if the score of any dimension is low.

[0085] In one embodiment, such as Figure 6 As shown, step S104, which is to generate a region code for the region to be encoded based on the target location information and the target encoding format, includes: S501, Match the encoding rule corresponding to the target encoding format from the preset rule base; S502 generates a region code for the area to be encoded based on the target location information and encoding rules.

[0086] As an example, in step S501, encoding rules corresponding to the target encoding format are searched and matched from a preset rule base. Different target encoding formats correspond to different encoding generation rules. For example, national standard encoding formats have their specific encoding structures and rules, and enterprise-defined encoding formats also have their corresponding encoding generation logic. By matching the corresponding encoding rules, a basis is provided for subsequent encoding generation.

[0087] In one optional embodiment, the preset rule base can store encoding rules for various encoding formats, supporting mutual conversion between multiple formats such as national standard encoding, enterprise-defined encoding, and map service encoding.

[0088] In one optional embodiment, the encoding rules can be configured using a template-based approach, allowing for flexible configuration of different encoding formats by defining the components of the encoding and the value rules for each component.

[0089] For example, taking the scenario of matching enterprise-defined encoding rules as an example, when the target encoding format is "enterprise-defined encoding format", the corresponding encoding rule is matched from the preset rule library. This rule defines the generation method of enterprise-defined encoding: it is generated by combining the first letter of the pinyin of the city abbreviation and a three-digit serial number. For example, Shenzhen corresponds to "SH001", and Beijing corresponds to "BJ001", etc.

[0090] For example, taking the national standard coding rule matching scenario as an example, when the target coding format is "National Standard GB / T2260 Coding Format", the corresponding coding rule is matched from the preset rule base. This rule defines the structure of the national standard code: 2-digit provincial code, 2-digit prefecture code, and 2-digit county code, for a total of 6 digits.

[0091] As an example, in step S502, a region code for the area to be encoded is generated based on the determined target location information and the matched encoding rules. The encoding generation process involves converting the target location information into a region code of the corresponding format according to the format and logic defined by the encoding rules.

[0092] In one optional embodiment, the encoding can be generated by a lookup table mapping method, and the target format encoding corresponding to the target location information can be directly obtained from a preset standard location information database.

[0093] In one optional embodiment, the code can be generated in real time by calculating the encoding rules, and the target code can be generated in real time by assembling the various attributes of the target location information according to the encoding rules.

[0094] For example, taking the scenario of enterprise-customized code generation, the target location information is "Nanshan District", the corresponding superior city is "Shenzhen City", the coding rule is the combination of the first letter of the city abbreviation in pinyin and a three-digit serial number. The code prefix corresponding to Shenzhen City is "SH", and the serial number of Nanshan District in Shenzhen City is "005". Then the generated area code is "SH005".

[0095] For example, taking the national standard coding generation scenario as an example, the target location information is "Nanshan District", the corresponding province is "Guangdong Province" (code 44), the prefecture is "Shenzhen City" (code 03), and the county is "Nanshan District" (code 05). According to the national standard coding rules, the generated regional code is "440305" with 2 digits of provincial code, 2 digits of prefecture code and 2 digits of county code.

[0096] As an example, the default rule base can contain multiple rule versions, each with an independent effective time range, to adapt to coding standards and business rules at different times.

[0097] In one optional embodiment, when adding or modifying coding rules, rule conflict detection can be performed automatically. For example, all coding rules in the currently effective version can be traversed to check whether the new rules and existing rules overlap or contradict each other in terms of matching conditions and mapping logic. If a conflict exists, a conflict prompt message is generated, marking the conflicting rule entries and conflict type. Conflict resolution can be supported by rule priority, effective time, and applicable scope.

[0098] In one optional embodiment, each coding rule is configured with an effective start time and an effective end time. Based on the time parameter of the regional coding request, the rule version effective within the corresponding time interval can be automatically matched to ensure that the coding result is consistent with the rule requirements of the corresponding period.

[0099] For example, when an enterprise adjusts its custom coding rules, a new version of the coding rules is generated and configured to take effect on the 1st of the following month; before taking effect, conflict detection is automatically completed to confirm that there is no logical contradiction between the new rules and the historical rules; coding requests for historical data still call the old version of the rules for the corresponding period to ensure the accuracy of historical data backtracking.

[0100] In one embodiment, such as Figure 7 As shown, step S105, which generates a region code based on the identifier information format and the target encoding format, includes: S601, If ​​the identification information is in coordinate format, then perform boundary verification on the area identification information to determine the corresponding target location information; S602, If the identification information format is not a coordinate format, the area identification information is converted into a coordinate format, and the boundary of the area identification information is checked to determine the corresponding target location information; S603 generates a region code based on the target location information and the target encoding format.

[0101] As an example, in step S601, when the format of the region identification information is identified as coordinate format, it indicates that the input data is spatial location information such as latitude and longitude coordinates. At this time, the administrative region to which the coordinate point belongs is determined through boundary verification, thereby obtaining the corresponding target location information. Here, boundary verification refers to the process of determining whether the coordinate point falls within the boundary range of a certain region through spatial geometric calculation; the coordinate format region identification information can be a single coordinate point or a region range composed of multiple coordinate points.

[0102] In an alternative embodiment, the spatial query function of a spatial database can be used for boundary verification, for example, using the ST_Contains function of PostGIS to determine whether a point is inside a polygon.

[0103] In an alternative embodiment, spatial indexes such as R-Tree can be used to accelerate boundary queries and improve the processing efficiency of large-scale coordinate data.

[0104] For example, taking a single-point coordinate encoding scenario, the area identification information is the coordinate point "113.93 degrees east longitude, 22.53 degrees north latitude", in coordinate format. The server can perform boundary verification on this coordinate point and determine through spatial calculation that the coordinate point falls within the administrative boundary of Nanshan District. Therefore, the corresponding target location information is determined to be "Nanshan District".

[0105] For example, taking a multi-point coordinate area scenario, the area identification information is a set of polygon boundary coordinates in coordinate format. The server can perform boundary verification on the polygon area, calculate the proportion of its overlapping area with each administrative region, determine the administrative region with the largest overlapping area as the area to which it belongs, and then obtain the corresponding target location information.

[0106] As an example, in step S602, when it is identified that the format of the area identification information is not a coordinate format, such as a name format or other formats, the area identification information is first converted to a coordinate format, and then boundary verification is performed to determine the corresponding target location information. Through format conversion, compatible processing of multiple input formats is achieved, enabling the administrative region to be determined by spatial boundary verification for area identification information of different forms.

[0107] In one alternative embodiment, a geocoding service can be used to convert place names into corresponding latitude and longitude coordinates, thereby achieving the conversion from name format to coordinate format.

[0108] In one optional embodiment, encodings of other formats can be converted into corresponding coordinate information through an encoding parsing service, thereby realizing the conversion from encoding format to coordinate format.

[0109] For example, taking the scenario of converting a place name to coordinates as an example, the area identification information is "Shenzhen Bay Sports Center". The format is a name format, not a coordinate format. The server can first convert "Shenzhen Bay Sports Center" into the corresponding latitude and longitude coordinates through geocoding service, and then perform boundary verification on the converted coordinates to determine that the coordinate point belongs to Nanshan District. Therefore, the corresponding target location information is determined to be "Nanshan District".

[0110] For example, taking the scenario of converting address details to coordinates as an example, the area identification information is "South District of Science and Technology Park, Nanshan District, Shenzhen". The format is a detailed address format, not a coordinate format. The server can first convert the detailed address into the corresponding latitude and longitude coordinates through geocoding service, and then perform boundary verification on the coordinates to determine that the address belongs to Nanshan District. Therefore, the corresponding target location information is determined to be "Nanshan District".

[0111] As an example, when converting non-coordinate format area identification information to coordinate format, the coordinate format conversion can be achieved by calling a third-party map service interface.

[0112] In one optional embodiment, for area identification information in name format and detailed address format, the geocoding interface of the map service is called to convert the text address into corresponding latitude and longitude coordinates, and at the same time, the multi-level administrative division information of the province, city, district and street corresponding to the coordinates is returned as an auxiliary boundary verification for candidate matching results.

[0113] In one optional embodiment, the administrative division data interface of the map service can be called periodically to synchronize the latest regional boundary data and automatically update the preset regional boundary database and the preset standard location information database to ensure the timeliness of the boundary data.

[0114] In one optional embodiment, for coordinate-formatted regional identification information, the reverse geocoding interface of the map service can be called to return the multi-level administrative division name and code corresponding to the coordinate point, and cross-validate with the spatial boundary verification result to improve the coding accuracy.

[0115] For example, when the input area identifier is "South District of Science and Technology Park", the map service geocoding interface is called to obtain its latitude and longitude coordinates, and the corresponding street, district / county, and prefecture-level administrative division information is returned. After spatial boundary verification based on the coordinates, the final area code is output.

[0116] As an example, in step S603, after determining the target location information through boundary verification, a region code for the area to be encoded is generated based on the target location information and the target encoding format, according to the corresponding encoding rules. The encoding generation logic in this step is consistent with the encoding generation logic in the aforementioned embodiments, ensuring that the encoding generation results are consistent across different paths, and will not be elaborated further here.

[0117] In one optional embodiment, the target format encoding corresponding to the target location information can be directly obtained from a preset standard location information database to achieve rapid encoding generation.

[0118] In one alternative embodiment, the target format encoding can be generated in real time according to encoding rules, supporting flexible custom encoding formats.

[0119] For example, taking the coordinate-to-standard encoding scenario, if the target location information is "Nanshan District" and the target encoding format is the national standard encoding format, then the corresponding regional code generated is "440305", which is consistent with the encoding result generated through semantic matching path, ensuring the consistency of output results under different processing paths.

[0120] In one embodiment, such as Figure 8 As shown, the boundary verification of the area identification information and the determination of the corresponding target location information in steps S601 and S602 above include: S701, Based on the area identification information, determine the corresponding set of area coordinates; S702, constructs the region boundary polygon based on the region coordinate set; S703, the preset region boundary with the highest matching degree with the region boundary polygon in the preset region boundary library is determined as the target region boundary; S704, based on the target area boundary and a preset standard location information database, determines the target location information.

[0121] As an example, in step S701, the corresponding set of regional coordinates is determined based on the regional identification information. The set of regional coordinates refers to a group of coordinate points describing the spatial location of a region; it can be the coordinates of a single point or the boundary coordinates of multiple points. If the regional identification information itself is in coordinate format, the coordinate information is directly extracted to form the coordinate set; if the regional identification information is in another format such as a region name, the boundary coordinate set of the region is obtained through geocoding or boundary lookup.

[0122] In an optional embodiment, for a single coordinate point, the set of regional coordinates is the latitude and longitude coordinates of that point, which can be directly used for subsequent spatial calculations.

[0123] In an optional embodiment, for the case of a region name, the set of boundary coordinates of the region can be queried from a preset region boundary library for subsequent spatial matching calculations.

[0124] For example, taking a single-point coordinate scenario, when the area identification information is a single coordinate point, the area coordinate set is the latitude and longitude coordinates of that point, such as "113.93 degrees east longitude, 22.53 degrees north latitude", which is directly used as the area coordinate set for subsequent boundary verification.

[0125] For example, taking the scenario of a regional boundary as an example, when the regional identification information is a polygonal region, the set of regional coordinates is a series of coordinate points that constitute the boundary of the polygon. For example, the administrative boundary of Nanshan District is composed of hundreds of coordinate points connected together, and these coordinate points constitute the regional coordinate set of Nanshan District.

[0126] As an example, in step S702, a corresponding region boundary polygon is constructed based on the region coordinate set. Here, the region boundary polygon refers to a geometric polygon representing the spatial extent of a region. This is achieved by connecting points in the coordinate set sequentially to form a closed polygon, which is then used for subsequent spatial matching calculations.

[0127] In an alternative embodiment, standard formats such as GeoJSON and WKT can be used to represent the region boundary polygons, which facilitates compatibility with various spatial computing tools.

[0128] In an alternative embodiment, for a single coordinate point, a tiny polygon centered on that point can be constructed, or the point can be used directly in the calculation.

[0129] For example, taking the boundary construction scenario of Nanshan District as an example, the boundary coordinate points of Nanshan District are connected in a clockwise order to form a closed polygon. This polygon is the regional boundary polygon of Nanshan District, which accurately represents the spatial range of Nanshan District.

[0130] For example, taking a point-to-polygon scenario, for a single coordinate point, a near-circular polygon with a radius of 10 meters centered on that point can be constructed to handle the boundary verification of point data and improve the fault tolerance of matching points near the boundary.

[0131] As an example, in step S703, the constructed region boundary polygon is matched with each preset region boundary in the preset region boundary library. The matching degree between each preset region boundary and the region boundary polygon is calculated, and the preset region boundary with the highest matching degree is determined as the target region boundary. The matching degree calculation can employ spatial geometric algorithms such as determining if a point is inside a polygon or calculating the overlapping area of ​​polygons. The preset region boundary library refers to a pre-constructed database storing boundary data for administrative regions at various levels, including boundary polygon data for multiple levels of administrative regions such as provinces, cities, districts, and streets.

[0132] In one optional embodiment, when the input is a single coordinate point, it can be determined which preset area boundary the coordinate point falls within, and that area boundary is the target area boundary with the highest matching degree.

[0133] In an optional embodiment, when the input is a polygonal region, the overlap area ratio between the polygon and the boundaries of each preset region can be calculated, and the preset region boundary with the highest overlap area ratio is the target region boundary.

[0134] For example, taking a point matching scenario, when the input is a single coordinate point "113.93 degrees east longitude, 22.53 degrees north latitude", the spatial algorithm of "point inside polygon" is used to traverse the boundaries of each administrative region in the preset regional boundary database. It is determined that the coordinate point falls within the administrative boundary polygon of Nanshan District, and thus the administrative boundary of Nanshan District is determined as the boundary of the target region.

[0135] For example, taking a polygon matching scenario, when the input is a polygonal region, the overlap ratio between the polygon and the boundaries of each preset region is calculated. For instance, if the overlap ratio between the input polygon and Nanshan District is 85%, and the overlap ratio with Futian District is 15%, then the administrative boundary of Nanshan District, which has the highest matching degree, is the boundary of the target region.

[0136] As an example, in step S704, after determining the target area boundary, the corresponding target location information is determined based on the association between the target area boundary and the preset standard location information database. Each preset area boundary is associated with corresponding standard location information, and the corresponding standard location information can be quickly found through the target area boundary.

[0137] In one optional embodiment, a preset regional boundary database and a preset standard location information database can be associated using a region code as the association key, thereby achieving the correspondence between boundary data and standard location information.

[0138] In one optional embodiment, standard location information can be directly stored in a preset area boundary database to reduce cross-database queries and improve processing efficiency.

[0139] For example, taking the boundary association query scenario, the boundary of the target area is the administrative boundary polygon of Nanshan District. The standard location information associated with this boundary in the preset standard location information database is "Nanshan District", and the corresponding standard code is "440305". Therefore, the target location information is determined to be "Nanshan District" and its corresponding standard code information.

[0140] For example, taking a multi-level region return scenario, the target region boundary is the administrative boundary polygon of Nanshan District. The server can not only return the standard location information of Nanshan District, but also the standard location information of its superior region Shenzhen City and Guangdong Province, to meet the encoding requirements of different levels.

[0141] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0142] In one embodiment, a region encoding device is provided, which corresponds one-to-one with the region encoding methods described in the above embodiments. For example... Figure 9 As shown, the area encoding device includes a request-response module 801, an information matching module 802, a confidence level determination module 803, a first encoding module 804, and a second encoding module 805. Detailed descriptions of each functional module are as follows: The request response module 801 is used to respond to a region encoding request and determine the region identification information and target encoding format of the region to be encoded. The information matching module 802 is used to determine candidate standard location information that matches the area identification information from the preset standard location information database if there is no encoding rule in the preset rule base that matches the area identification information and the target encoding format. The confidence determination module 803 is used to calculate the confidence of candidate standard location information to obtain the information confidence. The first encoding module 804 is used to determine the candidate standard location information with the highest information confidence as the target location information if there is candidate standard location information with information confidence reaching a preset confidence threshold, and to generate a region code for the area to be encoded based on the target location information and the target encoding format. The second encoding module 805 is used to identify the format of the regional identification information if there is no candidate standard location information whose information confidence reaches a preset confidence threshold, obtain the identification information format, and generate a regional code based on the identification information format and the target encoding format.

[0143] In one embodiment, the preset standard location information database includes multiple updated versions; the information matching module 802 is further configured to determine the time parameters carried in the area coding request and obtain the version update information of the preset standard location information database; Based on time parameters and version update information, the target update version is determined from multiple update versions; Based on the preset standard location information database corresponding to the target updated version, candidate standard location information that matches the regional identification information is determined.

[0144] In one embodiment, the preset standard location information database corresponding to the target update version includes multiple preset standard location information; the information matching module 802 is further used to perform semantic recognition on the area identification information to obtain area semantic features, and to perform semantic recognition on the preset standard location information to obtain standard semantic features; The similarity between the region semantic features and the standard semantic features is calculated to obtain the feature similarity. Preset standard location information whose feature similarity is greater than a preset similarity threshold is identified as candidate standard location information.

[0145] In one embodiment, the confidence determination module 803 is further configured to divide the preset area into levels, determine the first area level corresponding to the area identification information, and the second area level corresponding to the candidate standard location information; Calculate the hierarchical matching degree between the first region hierarchy and the second region hierarchy; The confidence level of the information is determined based on feature similarity and hierarchical matching degree.

[0146] In one embodiment, the first encoding module 804 is further configured to match encoding rules corresponding to the target encoding format from a preset rule base; Based on the target location information and encoding rules, a region code for the area to be encoded is generated.

[0147] In one embodiment, the second encoding module 805 is further configured to perform boundary verification on the region identification information and determine the corresponding target location information if the identification information format is a coordinate format. If the identification information is not in coordinate format, the area identification information will be converted to coordinate format, and boundary verification will be performed on the area identification information to determine the corresponding target location information. Based on the target location information and target encoding format, a region code is generated.

[0148] In one embodiment, the second encoding module 805 is further configured to determine the corresponding set of region coordinates based on the region identification information; Construct the region boundary polygon based on the region coordinate set; The boundary of the preset region with the highest matching degree with the region boundary polygon in the preset region boundary library is determined as the target region boundary; The target location information is determined based on the target area boundary and a preset standard location information database.

[0149] This invention provides a region coding device, comprising: a request response module, configured to respond to a region coding request and determine region identification information and a target coding format for the region to be coded; an information matching module, configured to determine candidate standard location information matching the region identification information from a preset standard location information database if no coding rule matching the region identification information and the target coding format exists in a preset rule database; a confidence level determination module, configured to calculate the confidence level of the candidate standard location information to obtain an information confidence level; a first coding module, configured to determine the candidate standard location information with the highest information confidence level as the target location information if there is candidate standard location information with an information confidence level reaching a preset confidence threshold, and generate a region code for the region to be coded based on the target location information and the target coding format; and a second coding module, configured to perform format recognition on the region identification information to obtain an identification information format if there is no candidate standard location information with an information confidence level reaching a preset confidence threshold, and generate a region code based on the identification information format and the target coding format. This device employs a processing method that combines pre-set rule base matching with pre-set standard location information database candidate determination. This ensures efficient coding processing for common scenarios while covering coding scenarios with no rule matching, thus expanding the adaptability of regional coding. By calculating confidence levels to differentiate the reliability of matching results, and employing differentiated coding generation logic for scenarios with different confidence levels, it effectively improves the accuracy of regional coding. Furthermore, by performing format recognition and boundary verification for low-confidence scenarios, it achieves compatible processing of input data in multiple formats, expanding the applicable scenarios of the solution, and simultaneously improving the processing efficiency and accuracy of regional coding.

[0150] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 10As shown, the computer device includes a processor, memory, network interface, and database connected via a system bus. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and database. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database is used for data employed in the region coding method. The network interface is used for communication with external terminals via a network connection. When the computer program is executed by the processor, it implements a region coding method.

[0151] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the aforementioned region encoding method when executing the computer program.

[0152] In one embodiment, a computer-readable storage medium is provided, the computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described region encoding method.

[0153] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. This computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0154] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is used as an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.

[0155] It should be noted that any AI models, software tools, or components not belonging to this company appearing in the embodiments of this application are merely illustrative examples and do not represent actual use. All user personal information involved in the embodiments of this application has been authorized (with the knowledge and consent) by the relevant parties or has been fully authorized by all parties, and the executing entity may obtain it through various legal and compliant means. The collection, storage, use, processing, transmission, provision, and disclosure of the information, data, and signals involved all comply with relevant laws and regulations and do not violate public order and good morals.

[0156] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included within the protection scope of the present invention.

Claims

1. A region coding method, characterized in that, include: In response to a region coding request, determine the region identification information and target coding format of the region to be coded; If there is no encoding rule in the preset rule base that matches the region identification information and the target encoding format, then candidate standard location information that matches the region identification information is determined from the preset standard location information base. The confidence level of the candidate standard location information is calculated to obtain the information confidence level. If there is candidate standard location information whose information confidence reaches a preset confidence threshold, then the candidate standard location information with the highest information confidence is determined as the target location information, and a region code for the region to be encoded is generated based on the target location information and the target encoding format. If no candidate standard location information with a confidence level reaching a preset confidence threshold exists, the format of the region identification information is identified to obtain the identification information format, and the region code is generated based on the identification information format and the target encoding format.

2. The method according to claim 1, characterized in that, The preset standard location information database includes multiple updated versions; The step of determining candidate standard location information that matches the area identification information from a preset standard location information database includes: Determine the time parameters carried in the region encoding request, and obtain the version update information of the preset standard location information database; Based on the time parameter and the version update information, a target update version is determined from the plurality of update versions; Based on the preset standard location information database corresponding to the target updated version, candidate standard location information that matches the area identification information is determined.

3. The method according to claim 2, characterized in that, The preset standard location information database corresponding to the target updated version includes multiple preset standard location information; The step of determining candidate standard location information that matches the region identification information based on the preset standard location information database corresponding to the target updated version includes: Semantic recognition is performed on the area identification information to obtain area semantic features, and semantic recognition is performed on the preset standard location information to obtain standard semantic features; The similarity between the semantic features of the region and the standard semantic features is calculated to obtain the feature similarity. The preset standard location information whose feature similarity is greater than a preset similarity threshold is determined as the candidate standard location information.

4. The method according to claim 3, characterized in that, The step of calculating the confidence level of the candidate standard location information to obtain the information confidence level includes: Based on the preset regional division hierarchy, the first regional hierarchy corresponding to the regional identification information and the second regional hierarchy corresponding to the candidate standard location information are determined. Calculate the hierarchical matching degree between the first region hierarchy and the second region hierarchy; The information confidence level is determined based on the feature similarity and the hierarchical matching degree.

5. The method according to claim 1, characterized in that, The step of generating a region code for the region to be encoded based on the target location information and the target encoding format includes: Match the encoding rules corresponding to the target encoding format from the preset rule base; Based on the target location information and the encoding rules, a region code for the region to be encoded is generated.

6. The method according to claim 1, characterized in that, The step of generating the region code based on the identification information format and the target encoding format includes: If the identification information is in coordinate format, then the boundary of the area identification information is checked to determine the corresponding target location information; If the identification information format is not a coordinate format, the area identification information is converted into a coordinate format, and the boundary of the area identification information is checked to determine the corresponding target location information; The region code is generated based on the target location information and the target encoding format.

7. The method according to claim 6, characterized in that, The step of performing boundary verification on the area identification information to determine the corresponding target location information includes: Based on the area identification information, determine the corresponding set of area coordinates; Based on the set of region coordinates, construct the region boundary polygon; The preset region boundary with the highest matching degree with the polygon of the region boundary in the preset region boundary library is determined as the target region boundary; The target location information is determined based on the target area boundary and the preset standard location information database.

8. A region coding device, characterized in that, include: The request-response module is used to respond to a region encoding request and determine the region identifier information and target encoding format of the region to be encoded. The information matching module is used to determine candidate standard location information that matches the region identification information from the preset standard location information library if there is no encoding rule in the preset rule library that matches the region identification information and the target encoding format. The confidence determination module is used to calculate the confidence level of the candidate standard location information to obtain the information confidence level. The first encoding module is used to determine the candidate standard location information with the highest information confidence as the target location information if there is candidate standard location information whose information confidence reaches a preset confidence threshold, and to generate the region code of the region to be encoded based on the target location information and the target encoding format. The second encoding module is used to identify the format of the region identification information if there is no candidate standard location information whose information confidence reaches a preset confidence threshold, obtain the identification information format, and generate the region code based on the identification information format and the target encoding format.

9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the region encoding method as described in any one of claims 1 to 7.

10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the region encoding method as described in any one of claims 1 to 7.