Tax authority matching method and device, storage medium and electronic equipment
Through the method of matching tax authorities with address information, the three-level matching rule table and tax authorities code table are used to solve the matching error problem caused by users entering complex information, and the tax authorities matching is achieved that simplifies operations and improves accuracy.
Patent Information
- Application Number
- CN202510421524.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-03
- Publication Date
- 2025-07-11
AI Technical Summary
In the prior art, users need to input complex information when matching tax authorities, which are prone to errors, resulting in inaccurate matching and inconvenience to users.
By obtaining the user's address information, using preset query statements and the three-level matching rule table to match, generate matching scores, determine target records, and associate the tax authority code records in the tax authority code table to generate tax authority information.
无需用户输入复杂信息即可准确匹配税务机关,降低错误概率,提高匹配准确率,简化用户操作。
Smart Images

Figure CN120296104A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and particularly to a tax authority matching method, device, storage medium and electronic device. Background Art
[0002] In the existing online tax service system, when users handle tax-related business, they need to determine the jurisdiction tax authority by manual selection or information matching. The traditional technical solution for matching tax authorities for users is to match tax authorities based on information such as the taxpayer identification number, unified social credit code, and address provided by users.
[0003] The traditional way of matching tax authorities requires users to input complex information. Users need to remember a large amount of information and are extremely prone to input errors when inputting complex information, resulting in incorrect tax authorities being matched for users. Users cannot handle tax-related business, which brings inconvenience to users in handling tax-related business. Summary of the Invention
[0004] In view of this, the embodiments of the present application provide a tax authority matching solution. By applying the solution provided by the present application, the address information provided by the user can be used to match the tax authority for the user, without the user inputting complex information, reducing the probability of outputting incorrect information and improving the accuracy of matching tax authorities.
[0005] To achieve the above object, the embodiments of the present application provide the following technical solutions:
[0006] The first aspect of the present application provides a tax authority matching method, including:
[0007] Obtain the address information of the user;
[0008] Use a preset query statement to match the address information with each third-level administrative division record in a preset three-level matching rule table, and generate a matching score for the address information and each third-level administrative division record; the third-level administrative division record includes the administrative division at the third level and the codes, names, and matching rules of the administrative divisions at the second level and the first level to which the administrative division at the third level belongs;
[0009] Based on the matching scores of each third-level administrative division record, determine a target record among each third-level administrative division record;
[0010] Associate a tax authority code record corresponding to the target record in a preset tax authority code table, and generate tax authority information using the associated tax authority code record. The tax authority information includes the name and code of the tax authority matched for the user.
[0011] The second aspect of the present application provides a tax authority matching device, including:
[0012] An acquisition unit, configured to acquire the address information of a user;
[0013] A matching unit, configured to use a preset query statement to match the address information with each third-level administrative division record in a preset three-level matching rule table, and generate a matching score between the address information and each third-level administrative division record; the third-level administrative division record includes the administrative division at the third level, and the codes, names, and matching rules of the administrative divisions at the second level and the first level to which the third-level administrative division belongs;
[0014] A determination unit, configured to determine a target record from each of the third-level administrative division records based on the matching scores of each of the third-level administrative division records;
[0015] A generation unit, configured to associate a tax authority code record corresponding to the target record in a preset tax authority code table, and generate tax authority information using the associated tax authority code record, where the tax authority information includes the name and code of the tax authority matched for the user.
[0016] A third aspect of the present application provides a storage medium, where the storage medium includes stored instructions, and when the instructions are running, the device where the storage medium is located is controlled to execute the tax authority matching method as described above.
[0017] A fourth aspect of the present application provides an electronic device, including a memory, and one or more instructions, where one or more instructions are stored in the memory and are configured to be executed by one or more processors to implement the tax authority matching method as described above.
[0018] Compared with the prior art, the present application has the following advantages:
[0019] The present application provides a tax authority matching method, device, storage medium, and electronic device, including: acquiring the address information of a user; using a query statement to match the address information with each third-level administrative division record in a three-level matching rule table, so as to determine a target record from each third-level administrative division record; associating a tax authority code record corresponding to the target record in a tax authority code table, and then generating tax authority information including the name and code of the tax authority matched for the user using the associated tax authority code record; the entire process only requires the user to input the address information, and a simple tax authority matching method can be provided for the user without inputting complex information, reducing the complexity of the information input by the user, thereby reducing the probability of the user inputting incorrect information, and thus improving the accuracy of matching the tax authority. Description of the Drawings
[0020] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the accompanying drawings required for the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only the embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other accompanying drawings can also be obtained based on the provided drawings.
[0021] Figure 1 It is a flowchart of a tax authority matching method provided by an embodiment of the present application;
[0022] Figure 2 It is a flowchart of configuring a three-level matching plan table provided by an embodiment of the present application;
[0023] Figure 3 It is a flowchart of matching address information with each three-level administrative division record in a preset three-level matching rule table using a preset query statement and generating a matching score for the address information and each three-level administrative division record provided by an embodiment of the present application;
[0024] Figure 4 It is a scenario example diagram of tax authority matching provided by an embodiment of the present application;
[0025] Figure 5 It is a structural schematic diagram of a tax authority matching device provided by an embodiment of the present application;
[0026] Figure 6 It is a structural schematic diagram of an electronic device provided by an embodiment of the present application. Detailed implementation manners
[0027] The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of them. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of protection of the present invention.
[0028] In the present application, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed, or further includes elements inherent to such process, method, article or device. Without further limitations, the element defined by the statement "including one..." does not exclude the existence of another identical element in the process, method, article or device including the said element.
[0029] As can be seen from the background art, when traditionally matching tax authorities for users, users need to input cumbersome information. Moreover, when there are regional aliases or abbreviations in the address entered by the user, the traditional matching method cannot match the correct tax authority for the user.
[0030] To solve the above problems, the embodiments of the present application provide a tax authority matching solution. The user provides address information, uses the address information to determine the target third-level administrative division record in the three-level matching rule table, and determines the tax authority code record associated with the target third-level administrative division record among the tax authority representatives. Then, the tax authority code record is used to generate tax authority information, thereby matching a tax authority for the user. Throughout the process, the user only needs to input the address information to match the tax authority, without the user providing complex information, reducing the probability of the user inputting incorrect information and increasing the probability of accurately matching the tax authority for the user.
[0031] The solution provided by the present application can be applied to tax authority systems or numerous general or special computing device environments or configurations. For example: personal computers, server computers, handheld devices or portable devices, tablet devices, multi-processor devices, distributed computing environments including any of the above devices or equipment, and so on.
[0032] Refer to Figure 1 , which is a flowchart of a tax authority matching method provided by the embodiments of the present application, and is specifically described as follows:
[0033] S101. Obtain the address information of the user.
[0034] The users of the present application are various taxpayers such as individuals and enterprises, or users who need to handle tax-related business in the tax system.
[0035] The address information of the user is the address associated when the user handles tax-related business. Exemplarily, when the user is an enterprise, the address information is the production and operation address of the enterprise; the address information includes information on provincial-level administrative divisions, municipal-level administrative divisions, and district-level administrative divisions.
[0036] The user can input the address information on the operation interface of the tax system, and the user can also provide the address information to the tax system through a device interacting with the tax system. The device interacting with the tax system can be intelligent devices such as mobile phones and tablets.
[0037] S102. Use a preset query statement to match the address information with each third-level administrative division record in the preset three-level matching rule table, and generate a matching score for the address information and each third-level administrative division record; the third-level administrative division record includes the administrative division at the third level and the codes, names, and matching rules of the administrative divisions at the second and first levels to which the administrative division belongs.
[0038] The three-level matching rule table contains multiple third-level administrative division records, including the third-level administrative division and the codes, names, matching rules and other information of the second-level administrative divisions and the first-level administrative divisions to which the third-level administrative division belongs; one third-level administrative division record corresponds to one third-level administrative division; further, the three-level matching rule table contains information on matching rules for a total of 2,865 district-level and county-level administrative divisions in my country, and the three-level matching rule table contains 2,865 third-level administrative division records.
[0039] The three-level matching rule table is obtained by processing the administrative division code table. The first level is higher than the second level, and the second level is higher than the third level.
[0040] The query statement used in this application is an SQL query statement, which uses a regular expression search function to match the third-level administrative division record for the address information in the three-level matching rule table, and obtains the matching score between the address information and the third-level administrative division record; exemplarily, when the three-level matching rule table contains 2865 administrative division records, after using the query statement, the matching score between the address information and each third-level administrative division record can be obtained, that is, 2865 matching scores are obtained.
[0041] S103. Determine a target record in each of the third-level administrative division records based on the matching scores of each of the third-level administrative division records.
[0042] It should be noted that the third-level administrative division record with the highest matching score is determined; when there is only one third-level administrative division record with the highest matching score, the third-level administrative division record with the highest matching score is determined as the target record; when there are multiple third-level administrative division records with the highest matching score, any one of the third-level administrative division records with the highest matching score is determined as the target record.
[0043] S104. Associate the tax authority code record corresponding to the target record in the preset tax authority code table, and use the associated tax authority code record to generate tax authority information, where the tax authority information includes the name and code of the tax authority matched for the user.
[0044] In the method provided by the implementation of this application, the tax authority code table contains multiple tax authority code records, and the tax authority code record contains the name, code and administrative division code of the tax authority. The code of the tax authority in the tax authority record can also be called the tax authority code, which is globally unique; the administrative division code in the tax authority record is the code of the administrative division associated with the tax authority.
[0045] In the method provided by the embodiments of the present application, address information of a user is obtained; a query statement is used to match the address information with each third-level administrative division record in the third-level matching rule table, so as to determine a target record among each third-level administrative division record; a tax authority code record corresponding to the target record is associated in the tax authority code table, and then the associated tax authority code record is used to generate tax authority information including the name and code of the tax authority matched for the user; the entire process only requires the user to input address information, and complex information does not need to be input to match the tax authority for the user, providing a simple tax authority matching method, reducing the complexity of the information input by the user, thereby reducing the probability of the user entering incorrect information, and thus improving the accuracy of matching the tax authority.
[0046] In another embodiment provided by the present application, the process of configuring the third-level matching plan table is described, and the specific process is referred to Figure 2 , and the relevant description is as follows.
[0047] S201. Obtain an administrative division code table, where the administrative division code table includes attribute information of multiple administrative divisions.
[0048] Preferably, the administrative division code table can be obtained through the tax system. The administrative division code table contains multiple administrative division records. One administrative division corresponds to one administrative division record, and the administrative division record contains attribute information of the administrative division. The attribute information includes information of multiple attribute fields, and each attribute field includes but is not limited to the code field, name field, administrative division level field, selection flag field, valid identification field of the administrative division, and the code field of the superior administrative division of the administrative division.
[0049] Referring to Table 1, it is an example table of the administrative division code table provided by the embodiments of the present application.
[0050] Table 1
[0051] Administrative Division Code Administrative Division Name Superior Administrative Division Code Administrative Division Level Selection Flag Valid Flag 330000 Zhejiang Province 1 Y Y 330100 Hangzhou City 330000 2 Y Y 330102 Shangcheng District 330100 3 Y Y 330103 Xiacheng District 330100 3 Y Y 330104 Jianggan District 330100 3 Y Y
[0052] Table 1 contains administrative division records of some administrative divisions. Since the number of administrative divisions is large, the present application only gives examples of administrative division records of some administrative divisions for illustration.
[0053] As shown in Table 1, it shows the administrative division records of five administrative divisions: Zhejiang Province, Hangzhou City, Shangcheng District, Xiacheng District, and Jianggan District. Zhejiang Province is the administrative division with the highest level, and the content of the superior administrative division code field in its administrative division record is empty.
[0054] As can be seen from Table 1, the data granularity of the administrative division records stored in the administrative division code table is inconsistent. That is, there is a record in the code table for each level of administrative division. The administrative division code table distinguishes the data granularity of each record through the "administrative division level" field. When the value of the administrative division level field is equal to 1, it indicates a provincial or municipal administrative division; when the value is equal to 2, it indicates a prefecture-level administrative division; when the value is equal to 3, it indicates a district or county-level administrative division. And the superior-subordinate relationship between data of different granularities is established through the "superior administrative division code" field. Preferably, when the value of the administrative division level field is 1, it means that the level or grade of the administrative division is the first level, that is, the administrative division is at the provincial level; when the value of the administrative division level field is 2, it means that the level or grade of the administrative division is the second level, that is, the administrative division is at the municipal level; when the value of the administrative division level field is 3, it means that the level or grade of the administrative division is the third level, that is, the administrative division is at the district or county level.
[0055] There are corresponding records for the district / county-level, prefecture-level, and provincial / municipal-level administrative divisions in the administrative division code table, resulting in inconsistent data granularity in the administrative division code table. When directly using the prefecture-level and provincial / municipal-level administrative divisions to which the district / county-level administrative division in the administrative division code table belongs, it is necessary to query twice to determine. That is, first query in the table for the prefecture-level administrative division to which the district / county-level administrative division belongs, and then query for the provincial / municipal-level administrative division to which this prefecture-level administrative division belongs. Multiple queries increase the complexity of the solution, consume too much computing resources, and also reduce the performance of data retrieval.
[0056] S202. Flatten each administrative division in the administrative division code table to obtain a flattened administrative division table. The flattened administrative division table contains multiple flattened records of the third-level administrative divisions. The flattened records include the third-level administrative division and the names and codes of the second-level and first-level administrative divisions to which this administrative division belongs.
[0057] When flattening each administrative division in the administrative division code table, process each administrative division with the value of the administrative division level field in the administrative division code table equal to 3 to obtain a flattened administrative division table. This flattened administrative division table contains multiple flattened records with the third-level administrative division as the granularity. The flattened records contain the third-level administrative division and the names and codes of the second-level and first-level administrative divisions to which this third-level administrative division belongs; the data granularity in the flattened administrative division table is divided by the district / county-level administrative division. Therefore, the data granularity in the flattened administrative division table is consistent.
[0058] Referring to Table 2, it is an example table of the flattened administrative division table provided by the embodiment of the present application.
[0059] Table 2
[0060] District / County Administrative Division Code District / County Administrative Division Name City Administrative Division Code City Administrative Division Name Province / City Administrative Division Code Province / City Administrative Division Name 330102 Shangcheng District 330100 Hangzhou City 330000 Zhejiang Province 330103 Xiacheng District 330100 Hangzhou City 330000 Zhejiang Province 330104 Jianggan District 330100 Hangzhou City 330000 Zhejiang Province
[0061] Table 2 contains flattened records of some third - level administrative divisions. Since the number of third - level administrative divisions is large, this application only gives examples of the flattened records of some third - level administrative divisions for illustration.
[0062] The flattened records contain information on each flattened field of multiple third - level administrative divisions. Each flattened field includes, but is not limited to, the name field and code field of the third - level administrative division, the name field and code field of the second - level administrative division to which the third - level administrative division belongs, and the name field and code field of the first - level administrative division to which the third - level administrative division belongs.
[0063] Furthermore, the code field of the third - level administrative division can be called the district and county administrative division code field; the name field of the third - level administrative division can be called the district and county administrative division name field; the code field of the second - level administrative division to which the third - level administrative division belongs can be called the city administrative division code field; the name field of the first - level administrative division to which the third - level administrative division belongs can be called the province and city administrative division name field; the code field of the first - level administrative division to which the third - level administrative division belongs can be called the province and city administrative division code field.
[0064] S203. For each flattened record in the flattened administrative division table, based on the name of each administrative division in the flattened record, determine the matching rule for each administrative division, and add the matching rule for each administrative division to the flattened record.
[0065] As can be seen from the description of S202, there are three administrative divisions in each flattened record. At this time, it is necessary to determine the matching rule for each administrative division according to the name of each administrative division in the flattening, and then add the matching rule for each administrative division to the flattened record, so as to convert the flattened record into a three - level administrative division record.
[0066] It should be noted that for each administrative division in the flattened record, a matching rule field for each administrative division needs to be added to the flattened record, and then the matching rule for each administrative division is stored in the corresponding matching rule field.
[0067] It should be noted that when determining the matching rule of an administrative division according to the name of the administrative division, the alias or abbreviation of the administrative division can be determined according to the name of the administrative division, and then the alias or abbreviation of the administrative division is used as the matching rule. There may be multiple aliases or abbreviations of the administrative division.
[0068] S204. After all the flattened records in the flattened administrative division table are converted into three-level administrative division records, a three-level matching rule table is obtained.
[0069] Referring to Table 3, it is an example table of the three-level matching rule table provided by this application.
[0070] Table 3
[0071] District / County Administrative Division Code District / County Administrative Division Name District / County Matching Rule City Administrative Division Code City Administrative Division Name City Matching Rule Province / City Administrative Division Code Province / City Administrative Division Name Province / City Matching Rule 652801 Korla City Korla 652800 Bayingolin Mongol Autonomous Prefecture Bayingolin|Bay Prefecture 650000 Xinjiang Uygur Autonomous Region Xinjiang 652901 Aksu City Aksu 652900 Aksu Prefecture Aksu 650000 Xinjiang Uygur Autonomous Region Xinjiang 653001 Artux City Artux 653000 Kizilsu Kirgiz Autonomous Prefecture Kizilsu Kirgiz|Kizilsu|Kiz Prefecture 650000 Xinjiang Uygur Autonomous Region Xinjiang
[0072] Table 3 contains some three-level administrative division records. Since the number of third-level administrative division records is large, only some three-level administrative division records are exemplified in this application for illustration.
[0073] The three-level administrative division records include multiple record fields, and each record field includes but is not limited to the district / county administrative division code field, the district / county administrative division name field, the district / county matching rule field, the city administrative division code field, the city administrative division name field, the city matching rule field, the province / city administrative division code field, the province / city administrative division name field, and the province / city matching rule field. The relevant descriptions of the district / county administrative division code field, the district / county administrative division name field, the city administrative division code field, the city administrative division name field, the province / city administrative division code field, and the province / city administrative division name field in this table can refer to the relevant descriptions in Table 2 above, and will not be elaborated here.
[0074] The district / county matching rule field in the three-level administrative division records can also be called the matching rule field of the administrative division at the third level, the city administrative division matching rule field can also be called the matching rule field of the administrative division at the second level to which the administrative division at the third level belongs, and the province / city administrative division matching rule field can also be called the matching rule field of the administrative division at the first level to which the administrative division at the third level belongs.
[0075] Further, the matching rules for generating administrative divisions are further described. When generating matching rules based on the names of administrative divisions, the names of administrative divisions are processed following the search rules of regular expressions in SQL statements to obtain the matching rules for administrative divisions. Preferably, the aliases and abbreviations of administrative divisions are used as the matching rules for administrative divisions. When an administrative division has multiple aliases or abbreviations, there are multiple matching rules for the administrative division. When the name of an administrative division contains multiple matching rules, the multiple matching rules in the matching rule field of the administrative division are separated by special characters. Taking the administrative division of "Kizilsu Kirgiz Autonomous Prefecture" in Table 3 as an example, this administrative division can have three abbreviations (or aliases): Kizilsu Kirgiz, Kizilsu, and Kizilsu Prefecture. When the database management system applied in this application is the Oracle database management system, the assignment in the matching rule field of this administrative division is: "Kizilsu Kirgiz|Kizilsu|Kizilsu Prefecture". The three abbreviations are separated by "|" because it is implemented in the Oracle database management system, and this is a special character in the regular expression in Oracle. When other database management systems are applied in this application, adjustments need to be made according to the actual situation.
[0076] Further, before processing the names of administrative divisions following the search rules of regular expressions in SQL statements, some fixed keywords in the names of administrative divisions can be batch cleared. For example, keywords at the end such as "Province", "City", "County", "Region", "District", "XXX Autonomous Region", "XXX Autonomous Prefecture", "XXX Autonomous County", etc. in the names are cleared, and only the place name information is retained; when clearing keywords, the order of clearing keywords needs to be sorted to avoid incorrect deletion or incomplete clearing. For example, the clearing of "XXX Autonomous Region" should be carried out before the clearing of "District", so as to process the name of the administrative division.
[0077] For the names of some special administrative divisions, they can be processed manually, which can avoid the situation where the names of some special administrative divisions cannot be processed or the processed results are incorrect, so as to obtain the processed names of administrative divisions.
[0078] Then, the processed names of administrative divisions are processed following the search rules of regular expressions in SQL statements to obtain the respective matching rules of administrative divisions.
[0079] This application converts the administrative division code table with inconsistent data granularity into a three - level matching rule table with consistent data granularity, and the three - level matching rule table covers the three - level administrative division records of each third - level administrative division in the country. The three - level administrative division records contain the information of the third - level administrative division and the first - level and second - level administrative divisions to which this administrative division belongs. The data of each three - level administrative division record is very comprehensive, facilitating subsequent query of tax authorities.
[0080] The data granularity in the three - level matching rule table is consistent, and the granularity of the data saved in each record is the same. When querying the prefecture - level and provincial - level administrative divisions of the county - level administrative division, it can be directly determined through one query. Therefore, the query times can be effectively reduced, the data acquisition efficiency can be improved, the occupation of computing resources can be reduced, and the complexity of the scheme can be reduced.
[0081] In another implementation provided by this application, the process of matching the address information with each three - level administrative division record in the preset three - level matching rule table and generating the matching scores of the address information and each three - level administrative division record is described. The specific process refers to Figure 3 , and the relevant description is as follows.
[0082] S301: Through the query statement, use the search function of the regular expression to match the address information with the matching rules of each administrative division in each three - level administrative division record.
[0083] Through the SQL query statement, use the search function of the regular expression to match the address information with each matching rule of each administrative division in each three - level administrative division record.
[0084] S302: Generate a matching result record of the address information and each three - level administrative division record. The matching result record includes the matching results of the address information and the matching rules of each administrative division of the three - level administrative division.
[0085] The matching result record contains the matching results of each administrative division of the three - level administrative division and the address information. When there are 3 administrative divisions in the three - level administrative division, there are 3 matching results in the matching result record.
[0086] For each administrative division in each three - level administrative division record, when the address information matches any one of the matching rules of the administrative division, generate a matching result corresponding to the administrative division to represent the match. When the address information does not match all the matching rules of the administrative division, generate a matching result corresponding to the administrative division to represent the non - match.
[0087] S303: For each matching result in each matching result record, determine the level of the administrative division corresponding to the matching result, and determine the score of the matching result based on the scoring rule of this level.
[0088] Administrative divisions at different levels have different scoring rules. Exemplarily, the scoring rule for administrative divisions at the first level is: when the matching result indicates a match, 7 points are obtained; when the matching result indicates a non-match, 0 points are obtained. The scoring rule for administrative divisions at the second level is: when the matching result indicates a match, 5 points are obtained; when the matching result indicates a non-match, 0 points are obtained. The scoring rule for administrative divisions at the third level is: when the matching result indicates a match, 3 points are obtained; when the matching result indicates a non-match, 0 points are obtained. The scoring rule can be set according to actual needs. It should be noted that when the matching result indicates a match, the scoring of administrative divisions at different levels needs to follow the rule that the sum of the scores of any two administrative divisions is greater than the score of the other administrative division.
[0089] S304. For each matching result record, sum up the scores of the respective matching results in the matching result record to obtain the matching score of the matching result record.
[0090] The matching score can be understood as the matching score between the address information and the three-level administrative division record, and this matching score can represent the adaptability between the address information and the three-level administrative division record.
[0091] After obtaining the matching scores between the address information and each three-level administrative division record, determine the highest matching score. When there are multiple highest matching scores, arbitrarily determine any one of the three-level administrative division records corresponding to the respective highest matching scores as the target record; when the highest matching score is only one, determine the three-level administrative division record corresponding to this highest matching score as the target record.
[0092] It should be noted that when the level of the administrative division in the address information input by the user is incomplete or incorrect, there will be a situation where there are multiple highest matching scores. For example, when the address information input by the user does not include the administrative division at the third level, among the obtained respective matching result records, there are multiple matching result records indicating that the address information matches the administrative divisions at the first and second levels in the three-level administrative division record but does not match the administrative division at the third level, and the matching scores of such matching result records are the highest.
[0093] After determining the target record, first determine the administrative division level of the address information according to the matching result record of the target record; determine the code of the administrative division corresponding to the administrative division level in the target record as the target code, and traverse each tax authority code record in the tax authority code table with the target code; for each of the tax authority code records in the tax authority code table, when the administrative division matching code in the tax authority code record is the same as the target code, associate the tax authority code record with the target record.
[0094] It should be noted that the matching result corresponding to the administrative division at the lowest level that is characterized as matching in the matching result record of the target record is determined as the target result, and then the level of the administrative division corresponding to the target result is determined as the administrative division level of the address information; specifically, for example, when the matching results corresponding to the administrative divisions at the first level, the second level, and the third level in the matching result record of the target record are all characterized as matching, the matching result corresponding to the administrative division at the third level in the target record is determined as the target result, and the administrative division level of the address information is further determined to be the third level; another example is that when the matching results corresponding to the administrative divisions at the first level and the second level in the matching result record of the target record are both characterized as matching, while the matching result corresponding to the administrative division at the third level is characterized as not matching, the matching result corresponding to the administrative division at the second level in the target record is determined as the target result, and the administrative division level of the address information is further determined to be the second level.
[0095] The purpose of determining the administrative division level of the address information in this application is to match the corresponding tax authorities for the address information in the follow-up. Since tax authorities also correspond to different levels and there are many tax authorities at different levels currently, in order to match a more accurate tax authority for the user, the administrative division level of the address information is determined at this time to determine which level of tax authority to match for this address information, and then a more accurate tax authority is matched for the address information at this level in the follow-up.
[0096] Specifically, when the administrative division level of the address information is the second level, the tax authority matched for this address information in the follow-up is also the tax authority at the second level.
[0097] Referring to Table 4, it is an example table of the tax authority code table provided by the embodiment of this application.
[0098] Table 4
[0099] Tax Authority Code Tax Authority Name Administrative Division Matching Code 14452020000 Tax Bureau of Rongcheng District, Jieyang City, State Taxation Administration 445202 14452040000 Tax Bureau of Jieyang Industrial Transfer Industrial Park, State Taxation Administration 445203 14452220000 Tax Bureau of Jiexi County, State Taxation Administration 445222 14452240000 Tax Bureau of Huilai County, State Taxation Administration 445224
[0100] Each tax authority has a corresponding tax authority code record in the tax authority code table. Table 4 contains the tax authority code records of some tax authorities. Since there are many tax authorities, only some tax authorities are exemplified in this application for explanation.
[0101] The tax authority code record includes information of multiple tax attribute fields, and each tax attribute field includes but is not limited to a tax authority code field, a tax authority name field, and an administrative division matching code field.
[0102] It should be noted that the tax authority code can be regarded as the identification code of the tax authority and has global uniqueness.
[0103] Further, first use the matching result record of the target record to determine the administrative division level of the address information, and determine the code of the administrative division corresponding to this administrative division level in the target record as the target code; for each tax authority code record in the tax authority code table, match the target code with the administrative division matching code in this tax authority code record. When the target code is consistent with the administrative division matching code in this tax authority code record, associate this tax authority code record with the target record. When the target code is inconsistent with the administrative division matching code in this tax authority code record, do not associate this tax authority code record with the target record; after traversing each tax authority code record in the tax authority code table, finally, a tax authority code record can be associated with the target record.
[0104] As can be seen from Table 4, the administrative division matching code corresponding to each tax authority is different. That is, through the tax authority code table, the administrative authority uniquely corresponding to the code of the administrative division can be associated. At this point, the unique tax authority can be matched according to the production and operation address provided by the user, and this tax authority can be pushed to the user to facilitate the user to provide corresponding business handling information to this tax authority. Preferably, when pushing the associated tax authority to the user, information such as the address of this tax authority, the tax services that this tax authority can provide, and the working hours of the tax authority can also be pushed to the user.
[0105] Refer to Figure 4 , which is a scenario example diagram of tax authority matching provided by the embodiment of this application. As shown in the figure, the user inputs the production and operation address, and the system matches the production and operation address in the three-level matching rule table obtained by processing with the administrative division code table; for the input production and operation address, the system uses the SQL query statement (select statement) and the search function of the regular expression to match each matching rule in the three fields of the district matching rule field, the city matching rule field, and the province and city matching rule field in each three-level administrative division record in the three-level matching rule table. If a match is found, it is set to Y, otherwise it is set to N. Therefore, for an input production and operation address, there will be 2,865 matching result records in the SQL query result. Each matching result record has matching result fields of "whether the district matching rule is matched", "whether the city matching rule is matched", and "whether the province and city matching rule is matched". When a match is found, the value in the matching result field is Y, and when no match is found, the value in the matching result field is N.
[0106] After obtaining multiple matching result records, it is necessary to calculate the matching score of each matching result record, specifically as follows:
[0107] When the value in the matching result field of "whether the district / county matching rule is matched" is Y, this matching result field gets 3 points; when the value in this matching result field is N, this matching result field gets 0 points;
[0108] When the value in the matching result field of "whether the city matching rule is matched" is Y, this matching result field gets 5 points; when the value in this matching result field is N, this matching result field gets 0 points;
[0109] When the value in the matching result field of "whether the province / municipality matching rule is matched" is Y, this matching result field gets 7 points; when the value in this matching result field is N, this matching result field gets 0 points;
[0110] For each matching result record, sum up the scores of each matching result field in this matching result record to obtain the matching score of this matching result record; determine the three-level administrative division record corresponding to the highest matching score as the target record.
[0111] Further, when using the method provided by this application to determine the target record, when there is a spelling error in the production and operation address input by the user, a most suitable target record can be matched for the user, which is convenient for subsequent matching of tax authorities for the user.
[0112] Exemplarily, the production and operation address input by the user is "Yangqu County, Taiyuan City, Shanxi Province, Beijing-Kunming Line (Suihua Logistics Park)", and the user miswrites "Shanxi Province" as "Shaanxi Province". Using the traditional tax authority matching method, it is impossible to match the tax authority for the user. However, when applying the solution provided by this application, there are keywords of different administrative divisions in the production and operation address input by the user. For the production and operation address of "Yangqu County, Taiyuan City, Shaanxi Province, Beijing-Kunming Line (Suihua Logistics Park)" input by the user, the three-level administrative division record can be matched for the user in the three-level matching rule table, and each matching result record of this production and operation address can be obtained. Among each matching result record, there are at least the following situations:
[0113] 1. There is a matching result record indicating that the production and operation address does not match all the administrative divisions in the three-level administrative division record;
[0114] 2. There is a matching result record indicating that the production and operation address matches the administrative division at the first level in the three-level administrative division record, but does not match the administrative divisions at the second and third levels in the three-level administrative division record;
[0115] 3. There is a matching result record indicating that the production and operation address does not match the administrative division at the first level in the three-level administrative division record, but matches the administrative divisions at the second and third levels in the three-level administrative division record;
[0116] 4. There is a matching result record indicating that the production and business operation address does not match the administrative division at the first level and the administrative region at the second level in the three-level administrative division record, but matches the administrative division at the third level in the three-level administrative division record;
[0117] 5. There is a matching result record indicating that the production and business operation address does not match the administrative division at the first level and the administrative division at the third level in the three-level administrative division record, but matches the administrative division at the second level in the three-level administrative division record.
[0118] Preferably, the matching scores of each matching result record are determined based on the above scoring method, and then the matching result record with the highest score is determined; when there are multiple matching result records with the highest score and the same score, any one of the multiple matching result records with the highest score and the same score is determined as the target record; when there is only one matching result record with the highest score, the three-level administrative division record corresponding to the matching result record is determined as the target record.
[0119] According to the address "Jingkun Line (Suihua Logistics Park), Yangqu County, Taiyuan City, Shaanxi Province" input by the user above, a matching result record with the highest matching score can be obtained. The matching result of the administrative division at the first level in this matching result record indicates non-matching, and the matching results of the administrative divisions at the second level and the third level both indicate matching; the three-level administrative division record corresponding to the matching result record is determined as the target record; the matching result of the administrative division at the third level in the target record indicates matching. Subsequently, the code of the administrative division at the third level is used to match the corresponding tax authority in the tax authority code, and thus, the most suitable tax authority can be matched for the address information provided by the user.
[0120] Associate the tax authority code record corresponding to the target record in the tax authority code table, that is, associate the tax authority, and then generate tax authority information based on the tax authority code record associated with the target record. This can solve the problem that the tax authority cannot be matched due to the incorrect production and business operation address input by the user.
[0121] This application is a pure SQL solution and does not adopt Chinese word segmentation technology, which is easy to implement in the internal network environment of the tax system. The traditional tax authority matching method requires a corresponding operating environment. In the internal network environment of the tax system, deploying these algorithm packages and their dependent operating environments requires applying for additional resources, and the additional resources will pose a threat to the information security of the tax system. However, the solution provided by this application is a pure SQL solution, which does not require applying for additional resources and provides a secure usage environment for the tax system. And from the perspective of the entire system, the pure SQL implementation solution of this application is more concise, efficient, and adaptable than using various algorithms, and the desired result can be obtained through a single SQL query.
[0122] There is a database management system in the tax internal network environment. The difference lies only in the type of the management system, whether it is Oracle, MySQL, or some other big data platform. For the pure SQL solution, it only needs to adaptively transform the SQL script according to the corresponding database management system. This application can be applicable to the tax system using various database management systems.
[0123] The process of using the three - level matching rule table to match with the tax authorities in this application ensures that the output of this solution has high accuracy. Compared with the prior art, the prior art uses a forward matching method, that is, taking the address as the target, and after processing the address through techniques such as manual word segmentation, it retrieves and matches in various different places. While this solution is a reverse matching, that is, taking 2865 fixed district - level administrative divisions as the target, after processing their aliases / abbreviations, it matches the address, and takes the one with the highest score as the matching result. Compared with the prior - art solutions, this solution is more simple and efficient.
[0124] Although the present invention depicts the operations in a specific order, this should not be construed as requiring these operations to be performed in the specific order shown or in a sequential order. In certain environments, multitasking and parallel processing may be advantageous.
[0125] It should be understood that the various steps recorded in the method embodiments of the present disclosure can be executed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this regard.
[0126] Relative to Figure 1 the method shown, the embodiment of this application further provides a tax authority matching device, which is used to support Figure 1 the implementation of the method shown.
[0127] Referring to Figure 5 , which is a schematic structural diagram of a tax authority matching device provided by the embodiment of this application, and is specifically described as follows:
[0128] An obtaining unit 501, configured to obtain the address information of the user;
[0129] A matching unit 502, configured to use a preset query statement to match the address information with each three - level administrative division record in a preset three - level matching rule table, and generate a matching score between the address information and each three - level administrative division record; the three - level administrative division record includes the administrative division at the third level and the codes, names, and matching rules of the administrative divisions at the second level and the first level to which the administrative division at the third level belongs.
[0130] A determination unit 503, configured to determine a target record from each of the third-level administrative division records based on the matching scores recorded for each of the third-level administrative divisions;
[0131] A generation unit 504, configured to associate a tax authority code record corresponding to the target record in a preset tax authority code table, and generate tax authority information using the associated tax authority code record, where the tax authority information includes the name and code of the tax authority matched for the user.
[0132] In the apparatus provided by the embodiments of the present application, the address information of the user is obtained; a query statement is used to match the address information with each of the third-level administrative division records in the third-level matching rule table, so as to determine a target record from each of the third-level administrative division records; a tax authority code record corresponding to the target record is associated in the tax authority code table, and then the associated tax authority code record is used to generate tax authority information including the name and code of the tax authority matched for the user; the entire process only requires the user to input the address information, and a simple tax authority matching method can be provided for the user without inputting complex information, reducing the complexity of the information input by the user, thereby reducing the probability of the user inputting incorrect information, and thus improving the accuracy of matching the tax authority.
[0133] In another embodiment provided by the present application, the matching unit 502 of the apparatus performs the process of using a preset query statement to match the address information with each of the third-level administrative division records in the preset third-level matching rule table, including:
[0134] Using the find function of the regular expression through the query statement to match the address information with the matching rules of each administrative division in each of the third-level administrative division records;
[0135] Generating a matching result record of the address information and each of the third-level administrative division records, where the matching result record includes the matching results of the address information with the matching rules of each administrative division of the third-level administrative division.
[0136] In another embodiment provided by the present application, the matching unit 502 of the apparatus performs the process of generating the matching score of the address information and each of the third-level administrative division records, including:
[0137] For each matching result in each of the matching result records, determine the level of the administrative division corresponding to the matching result, and determine the score of the matching result based on the scoring rule of the level;
[0138] For each of the matching result records, perform a summation process on the scores of the respective matching results of the matching result record to obtain the matching score of the matching result record.
[0139] In another embodiment provided by the present application, the generating unit 504 of the device executes the process of associating a tax authority code record corresponding to the target record in a preset tax authority code table, including:
[0140] Based on the matching result record of the target record, determine the administrative division level of the address information;
[0141] Determine the code of the administrative division corresponding to the administrative division level in the target record as the target code, and traverse each tax authority code record in the tax authority code table with the target code;
[0142] For each tax authority code record in the tax authority code table, when the administrative division matching code in the tax authority code record is consistent with the target code, associate the tax authority code record with the target record.
[0143] In another embodiment provided by the present application, the device further includes a configuration unit, and the configuration unit is used to configure a three-level matching rule table, specifically including:
[0144] Obtain an administrative division code table, where the administrative division code table includes attribute information of multiple administrative divisions;
[0145] Flatten each administrative division in the administrative division code table to obtain a flattened administrative division table, where the flattened administrative division table contains flattened records of multiple third-level administrative divisions, and the flattened records include the names and codes of the third-level administrative divisions and the second-level and first-level administrative divisions to which the third-level administrative divisions belong;
[0146] For each flattened record in the flattened administrative division table, based on the name of each administrative division in the flattened record, determine the matching rule of each administrative division, and add the matching rule of each administrative division to the flattened record to convert the flattened record into a three-level administrative division record;
[0147] After all the flattened records in the flattened administrative division table are converted into three-level administrative division records, a three-level matching rule table is obtained.
[0148] An embodiment of the present invention also provides a storage medium, where the storage medium includes stored instructions, and when the instructions run, the device where the storage medium is located is controlled to execute the above-mentioned tax authority matching method.
[0149] An embodiment of the present invention also provides an electronic device, and its structural schematic diagram is as Figure 6As shown, it specifically includes a memory 601 and one or more instructions 602, where one or more instructions 602 are stored in the memory 601 and are configured to be executed by one or more processors 603 to perform the following operations on the one or more instructions 602:
[0150] Obtain the address information of the user;
[0151] Use a preset query statement to match the address information with each three-level administrative division record in a preset three-level matching rule table, and generate a matching score for the address information and each three-level administrative division record; the three-level administrative division record includes the administrative division at the third level and the codes, names, and matching rules of the administrative divisions at the second level and the first level to which the administrative division at the third level belongs.
[0152] Based on the matching scores of each three-level administrative division record, determine a target record among each three-level administrative division record;
[0153] Associate a tax authority code record corresponding to the target record in a preset tax authority code table, and use the associated tax authority code record to generate tax authority information, where the tax authority information includes the name and code of the tax authority matched for the user.
[0154] It should be noted that the information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use, and processing of relevant data need to comply with the relevant laws, regulations, and standards in the relevant regions.
[0155] The specific implementation processes and their derivative methods of the above various embodiments are all within the protection scope of the present invention.
[0156] Each embodiment in this specification is described in a progressive manner. For the same or similar parts among the embodiments, reference can be made to each other, and the key point of each embodiment is to illustrate the differences from other embodiments. In particular, for a system or a system embodiment, since it is basically similar to a method embodiment, the description is relatively simple, and reference can be made to the relevant part of the method embodiment for the relevant content. The systems and system embodiments described above are merely illustrative. The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. A person of ordinary skill in the art can understand and implement it without creative efforts.
[0157] Those skilled in the art can further realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described according to functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present invention.
[0158] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present invention. Various modifications to these embodiments will be obvious to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but will be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A tax authority matching method, characterized in that, Including: Obtaining the address information of the user; Using a preset query statement to match the address information with each third-level administrative division record in a preset third-level matching rule table, and generating a matching score for the address information and each of the third-level administrative division records; the third-level administrative division records include the administrative divisions at the third level, as well as the codes, names, and matching rules of the administrative divisions at the second level and the first level to which the administrative divisions at the third level belong; Based on the matching scores of each of the third-level administrative division records, determining a target record among each of the third-level administrative division records; Associating a tax authority code record corresponding to the target record in a preset tax authority code table, and using the associated tax authority code record to generate tax authority information, where the tax authority information includes the name and code of the tax authority matched for the user.
2. The method according to claim 1, wherein The step of using a preset query statement to match the address information with each third-level administrative division record in a preset third-level matching rule table includes: Through the query statement, using the search function of regular expressions to match the address information with the matching rules of each administrative division in each of the third-level administrative division records; Generating a matching result record for the address information and each third-level administrative division record, where the matching result record includes the matching results of the address information with the matching rules of each administrative division of the third-level administrative division.
3. The method according to claim 2, characterized in that The step of generating a matching score for the address information and each third-level administrative division record includes: For each matching result in each of the matching result records, determining the level of the administrative division corresponding to the matching result, and determining the score of the matching result based on the scoring rule of that level; For each of the matching result records, summing up the scores of each matching result in the matching result record to obtain the matching score of the matching result record.
4. The method according to claim 2, wherein The step of associating a tax authority code record corresponding to the target record in a preset tax authority code table includes: Based on the matching result record of the target record, determining the administrative division level of the address information; Determining the code of the administrative division corresponding to the administrative division level in the target record as the target code, and traversing each tax authority code record in the tax authority code table with the target code; For each tax authority code record in the tax authority code table, when the administrative division matching code in the tax authority code record is consistent with the target code, associating the tax authority code record with the target record.
5. The method according to claim 1, wherein The process of configuring the third-level matching rule table includes: Obtaining an administrative division code table, where the administrative division code table includes the attribute information of multiple administrative divisions; Flattening each administrative division in the administrative division code table to obtain a flattened administrative division table, where the flattened administrative division table contains flattened records of multiple third-level administrative divisions, and the flattened records include the names and codes of the third-level administrative divisions and the second-level and first-level administrative divisions to which the third-level administrative divisions belong; For each flattened record in the flattened administrative division table, based on the name of each administrative division in the flattened record, determine the matching rule for each administrative division, and add the matching rule for each administrative division to the flattened record to convert the flattened record into a three-level administrative division record; After all the flattened records in the flattened administrative division table are converted into three-level administrative division records, a three-level matching rule table is obtained.
6. A tax authority matching device, characterized in that, It includes: An acquisition unit for acquiring the address information of the user; A matching unit for using a preset query statement to match the address information with each three-level administrative division record in the preset three-level matching rule table, and generating a matching score between the address information and each three-level administrative division record; the three-level administrative division record includes the administrative division at the third level and the codes, names, and matching rules of the administrative divisions at the second level and the first level to which the administrative division at the third level belongs; A determination unit for determining a target record among each three-level administrative division record based on the matching scores of each three-level administrative division record; A generation unit for associating a tax authority code record corresponding to the target record in a preset tax authority code table, and generating tax authority information using the associated tax authority code record, where the tax authority information includes the name and code of the tax authority matched for the user.
7. The device according to claim 6, wherein The process of the matching unit executing the step of using a preset query statement to match the address information with each three-level administrative division record in the preset three-level matching rule table includes: Through the query statement, using the search function of the regular expression to match the address information with the matching rules of each administrative division in each three-level administrative division record; Generating a matching result record between the address information and each three-level administrative division record, where the matching result record includes the matching results of the address information with the matching rules of each administrative division of the three-level administrative division.
8. The device according to claim 6, characterized in that, The process of the matching unit executing the step of generating the matching score between the address information and each three-level administrative division record includes: For each matching result in each matching result record, determine the level of the administrative division corresponding to the matching result, and determine the score of the matching result based on the scoring rule of the level; For each matching result record, sum up the scores of each matching result in the matching result record to obtain the matching score of the matching result record.
9. A storage medium, characterized in that, The storage medium includes stored instructions, wherein when the instructions are running, they control the device where the storage medium is located to execute the tax authority matching method according to any one of claims 1-5.
10. An electronic device, characterized in that, It includes a memory, and one or more instructions, wherein one or more instructions are stored in the memory and are configured to be executed by one or more processors to implement the tax authority matching method according to any one of claims 1-5.