Administrative region division data updating method and device, computer equipment and storage medium

By regularly monitoring changes in administrative division data, analyzing and updating files and generating simplified codes, updating administrative division tables and synchronizing business data, the problem of difficult to guarantee the integrity of historical data when administrative division data is updated, and the smooth transition and data integrity of the system under the new division structure is achieved.

CN119646004APending Publication Date: 2025-03-18ZHEJIANG ZHESHANG TEZI TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411685421.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-22
Publication Date
2025-03-18

AI Technical Summary

Technical Problem

When administrative division data is updated, the integrity of historical data is difficult to ensure, resulting in errors and adverse effects when the system transitions to a new division structure.

Method used

By monitoring changes in administrative division data regularly, analyzing and updating files to obtain administrative division data, generating simplified codes, and updating the data to the predefined administrative division table, synchronously updating the data and enable status, asynchronously updating the business table and generating change reminders.

Benefits of technology

Ensure the integrity of historical data, achieve a smooth transition of the system under the new zoning structure, and reduce errors and adverse effects during data updates.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119646004A_ABST
    Figure CN119646004A_ABST
Patent Text Reader

Abstract

The invention discloses an administrative region division data updating method and device, computer equipment and a storage medium. The method comprises the following steps: regularly monitoring the change condition of administrative division data, and obtaining related files when updating exists; the related files are analyzed to obtain administrative region data, and the administrative region data comprise administrative region codes and name information; generating a simplified code according to the administrative region code; the administrative region data and the simplified codes are updated into a predefined second administrative division table, and data synchronization and starting state updating of the first administrative division table are carried out through the predefined first administrative division table and the predefined second administrative division table; and according to the data in the first administrative division table and the starting state, asynchronously and circularly updating the service table, generating an administrative division change prompt, and sending the administrative division change prompt to the client. By implementing the method provided by the invention, the integrity of historical data can be ensured when the administrative division data is updated, and the system can be ensured to be smoothly transited to a new division structure.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a data processing method, and more specifically to an administrative area division data updating method, device, computer equipment and storage medium. Background Art

[0002] Administrative division data plays an important role in many industries and systems, such as express delivery, market analysis, and geographic information display. In these systems, administrative division codes are often used as basic data for positioning, classification, analysis, and processing. If the administrative division code remains unchanged, the system only needs to update the latest administrative division code to complete data synchronization. However, every year, there may be situations such as the abolition of counties and the change of districts, the abolition of counties and the change of cities, and administrative division adjustments. These changes may affect the existing historical data and in-transit businesses in the system.

[0003] When the latest administrative division data is used for replacement, the old administrative division codes and historical data may become invalid or cannot be displayed correctly, which has an adverse impact on business processes. For example, user addresses in express delivery systems and regional divisions in market analysis may lead to incorrect queries and data displays due to administrative division changes, which in turn affects decision-making and service quality.

[0004] Therefore, it is necessary to design a new method to ensure the integrity of historical data when updating administrative division data and ensure that the system can smoothly transition to the new division structure. Summary of the invention

[0005] The purpose of the present invention is to overcome the defects of the prior art and provide a method, device, computer equipment and storage medium for updating administrative area division data.

[0006] To achieve the above object, the present invention adopts the following technical solution: a method for updating administrative area division data, comprising:

[0007] Regularly monitor changes in administrative division data and obtain relevant files when administrative division data is updated;

[0008] Parsing the relevant files to obtain administrative district data, wherein the administrative district data includes administrative district code and name information;

[0009] generating a simplified code according to the administrative region code;

[0010] The administrative district data and the simplified code are updated into a predefined second administrative district table, and the predefined first administrative district table and the second administrative district table are used to synchronize the data and update the activation status of the first administrative district table, wherein the first administrative district table is used to store the currently used administrative district data and simplified code, and the predefined second administrative district table is used to store the administrative district data and simplified code obtained after each analysis;

[0011] The business table is updated asynchronously in a loop according to the data in the first administrative division table and the startup status, and an administrative division change reminder is generated and sent to the client.

[0012] A further technical solution is: the relevant files are parsed to obtain administrative district data, wherein the administrative district data includes administrative district code and name information, including:

[0013] The relevant files are parsed using jsoup to obtain a set of administrative district codes and name information fields to form administrative district data.

[0014] A further technical solution is: generating a simplified code according to the administrative area code comprises:

[0015] Simplifying the administrative region code according to the set simplification rules to obtain a simplified code;

[0016] The simplified rules include that for administrative division codes above the county level, when the last seven digits of the administrative division code are all 0, the simplified code is the first two digits; when the last five digits of the administrative division code are all 0, and the first 3rd and 4th digits are different and are both 0, the simplified code is the first four digits;

[0017] The administrative codes for county level and below are fixed at 9 digits. When the first six digits of the administrative code are XX0000, the simplified code is the first two digits. When the first six digits of the administrative code are XXXX00, the simplified code is the first four digits. When the first six digits of the administrative code are XXXXXX, the simplified code is the first six digits. Except for the first digit, any consecutive two digits cannot be 00 at the same time. The above-mentioned simplification of administrative codes for county level and below will be simplified in descending order of priority.

[0018] A further technical solution is: updating the administrative district data and the simplified code into a predefined second administrative district table, and using the predefined first administrative district table and the second administrative district table to synchronize the data of the first administrative district table and update the activation status, including:

[0019] Compare the administrative division codes of the first administrative division table and the second administrative division table, and deactivate the activation status mark of the administrative division codes that exist in the first administrative division table but do not exist in the second administrative division table;

[0020] Add the administrative division codes that exist in the second administrative division table but do not appear in the first administrative division table to the first administrative division table, and set the startup status to enabled.

[0021] A further technical solution is: the business table is updated asynchronously and cyclically according to the data in the first administrative division table and the startup status, and an administrative division change reminder is generated and sent to the client, including:

[0022] Get the business table and count the fields related to administrative divisions in the business table;

[0023] Searching the first administrative division table for administrative divisions whose activation status is deactivated to obtain a first query result;

[0024] Searching the business table for data related to the first query result to obtain a second query result;

[0025] Record the second query result in the revocation reminder table;

[0026] Record change history and generate specific change records;

[0027] Generate change reminder information according to the change record, and update relevant fields in the administrative division change reminder table;

[0028] Send change reminder information to the client.

[0029] Its further technical solution is: after generating the simplified code according to the administrative area code, it also includes:

[0030] The simplified code is used to query the relevant data of the specified province, city, and district.

[0031] Its further technical solution is: the administrative district data and the simplified code are updated to a predefined second administrative district table, and the predefined first administrative district table and the second administrative district table are used to synchronize the data and update the activation status of the first administrative district table, wherein the first administrative district table is used to store the currently used administrative district data and simplified code, and the predefined second administrative district table is used to store the administrative district data and simplified code obtained after each analysis, including:

[0032] When the specified administrative district data is queried, the administrative district data and the corresponding startup status are displayed on the display interface.

[0033] The present invention also provides an administrative region division data updating device, comprising:

[0034] An acquisition unit, used to regularly monitor changes in administrative division data, and acquire relevant files when the administrative division data is updated;

[0035] A parsing unit, used for parsing the relevant file to obtain administrative district data, wherein the administrative district data includes administrative district code and name information;

[0036] A simplification unit, used for generating a simplified code according to the administrative area code;

[0037] a first updating unit, used for updating the administrative district data and the simplified code into a predefined second administrative district table, and using the predefined first administrative district table and the second administrative district table to perform data synchronization and update the activation status of the first administrative district table, wherein the first administrative district table is used to store the currently used administrative district data and simplified code, and the predefined second administrative district table is used to store the administrative district data and simplified code obtained after each parsing;

[0038] The second updating unit is used to update the business table in an asynchronous loop according to the data in the first administrative division table and the startup status, and generate an administrative division change reminder and send it to the client.

[0039] The present invention further provides a computer device, which includes a memory and a processor. The memory stores a computer program, and the processor implements the above method when executing the computer program.

[0040] The present invention also provides a storage medium, wherein the storage medium stores a computer program, and the computer program implements the above method when executed by a processor.

[0041] Compared with the prior art, the beneficial effects of the present invention are as follows: the present invention periodically monitors the changes in administrative division data, parses update files and obtains administrative district data; generates simplified codes based on administrative district codes, and updates the administrative district data and simplified codes to the second administrative division table, while synchronously updating the data and activation status of the first administrative division table; based on the data and activation status of the first administrative division table, asynchronously updates the business table and generates administrative division change reminders, which are sent to the client; by periodically monitoring and parsing administrative division update files, the new and old division data and simplified codes are synchronously updated to the second administrative division table, and the data consistency of the first administrative division table is maintained; the data synchronization mechanism of the first and second administrative division tables is utilized to ensure the integrity of historical data, while asynchronously updating the business table and generating change reminders to ensure a smooth transition of the system to the new division structure, and overall ensuring the integrity of historical data when updating administrative division data, and ensuring that the system can smoothly transition to the new division structure.

[0042] The present invention is further described below in conjunction with the accompanying drawings and specific embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying any creative work.

[0044] Figure 1 A schematic diagram of an application scenario of the administrative region division data updating method provided by an embodiment of the present invention;

[0045] Figure 2 A schematic diagram of a flow chart of a method for updating administrative region division data provided by an embodiment of the present invention;

[0046] Figure 3 A schematic diagram of a sub-process of a method for updating administrative area division data provided by an embodiment of the present invention;

[0047] Figure 4 A schematic diagram of a sub-process of a method for updating administrative area division data provided by an embodiment of the present invention;

[0048] Figure 5 A schematic block diagram of an administrative region division data updating device provided by an embodiment of the present invention;

[0049] Figure 6 A schematic block diagram of a first updating unit of the administrative region division data updating device provided in an embodiment of the present invention;

[0050] Figure 7A schematic block diagram of a second updating unit of the administrative region division data updating device provided by an embodiment of the present invention;

[0051] Figure 8 A schematic block diagram of a computer device provided for an embodiment of the present invention;

[0052] Fig. 9 A schematic diagram of a database table provided in an embodiment of the present invention;

[0053] Fig.10 A schematic diagram of parsing stored table data provided by an embodiment of the present invention;

[0054] Fig.11 Schematic diagram of simplified code query provided by an embodiment of the present invention Figure 1

[0055] Fig.12 Schematic diagram of simplified code query provided by an embodiment of the present invention Figure 2 ; DETAILED DESCRIPTION

[0056] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0057] It should be understood that when used in this specification and the appended claims, the terms "include" and "comprises" indicate the presence of described features, integers, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.

[0058] It should also be understood that the terms used in this specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the specification of the present invention and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.

[0059] It should be further understood that the term "and / or" used in the present description and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0060] See also Figure 1 and Figure 2 , Figure 1A schematic diagram of an application scenario of the administrative region division data updating method provided in an embodiment of the present invention. Figure 2 A schematic flow chart of a method for updating administrative division data provided by an embodiment of the present invention. The method for updating administrative division data is applied to a server. The server interacts with the client for data. When an administrative division change is announced, the latest administrative division HTML file is downloaded and uploaded to the operation system. The system automatically parses the data in the HTML file and inserts it into a table specifically used to store administrative division data. It should be noted that this table is not the table actually used by the program, but is used for temporary storage and comparison. After the data is successfully inserted, the system will compare it with the actual administrative division table, identify the newly added or revoked administrative division items, and update them to the formally used administrative division table. This process realizes a one-click update of administrative division data. Since the business data usually stores the codes (code values) of the administrative divisions, and the addition or revocation of administrative divisions is not distinguished during the query, the user cannot directly see the changes in the administrative divisions when the historical data is echoed. In order to solve this problem, the system designs an "enable status (enable_flag)" field to distinguish between currently enabled and disabled administrative divisions. When querying historical data, the system will backtrack based on the code value of the administrative division. Whether it is a revoked administrative division or a newly added administrative division, they will coexist in the official administrative division table, but their enabled status will be distinguished by the enable_flag flag. Therefore, when displaying historical data, it will accurately reflect the actual situation of the administrative division at that time and will not be affected by the addition or revocation.

[0061] When the administrative division of the registered address of the user's company changes, the system will intelligently remind the user. When the user logs in to the system, if the administrative division of the registered place has changed, the system will pop up a message reminder, prompting the user "The administrative division of the registered place has changed, please update the registered place in time." In this way, users can know the changes in administrative divisions in time and make corresponding adjustments. This message reminder function is a regular function in the system. Its design follows the specifications and structured format of the message system to ensure that the message can be accurately and promptly conveyed to users.

[0062] In addition to intelligent reminders, the system will automatically track and record all business tables involving administrative divisions. On the second day after the administrative division is updated, the system will display the business data changes related to the administrative division in the "Administrative Division Business Change List". The list will list all affected business numbers, the specific administrative division information of the change, and provide recommended modified administrative divisions for each change record. In this way, the business department can intuitively see which data needs to be updated and make adjustments in a timely manner.

[0063] The present invention solves the problems of updating administrative division data, backtracking historical data and reminding business data changes. Specifically, it simplifies the complexity of manual operations by automatically parsing and updating administrative division data; by enabling the status identification (enable_flag) field, it ensures that historical data accurately reflects the administrative divisions at that time; when the user's registered place changes, the system automatically pushes message reminders to ensure that the user is informed of and modifies the information in a timely manner; and provides an administrative division change list to help relevant departments clearly view all changed business data.

[0064] It provides efficient support for administrative division management and business data maintenance, ensuring the timeliness and accuracy of data while optimizing the user experience.

[0065] Figure 2 FIG. 1 is a flow chart of a method for updating administrative area division data provided by an embodiment of the present invention. Figure 2 As shown, the method includes the following steps S110 to S150.

[0066] S110. Regularly monitor changes in administrative division data, and obtain relevant files when the administrative division data is updated.

[0067] In this embodiment, the system will use automation technology to regularly monitor the administrative division data. If the system detects any update to the administrative division data, it will automatically obtain the latest administrative division HTML file published by the Civil Affairs Network and perform data extraction and processing.

[0068] Through automated monitoring and data capture, the latest information on administrative division changes can be obtained in a timely manner, ensuring the timeliness and accuracy of the data and avoiding delays and errors in manual operations.

[0069] Automated data acquisition and analysis greatly reduces the complexity of manual operations and the risk of errors, improves work efficiency and reduces labor costs.

[0070] The automated system can accurately capture HTML files, ensuring that all administrative division data is updated according to official information, reducing errors caused by manual misoperation or omissions.

[0071] With the dynamic adjustment of administrative divisions, enterprises and institutions can be notified and update data in the shortest time possible to avoid compliance risks caused by administrative division changes.

[0072] It can be expanded to automatically acquire and update data on various administrative divisions, not only limited to the Civil Affairs Network, but can also be adapted to other official data sources to enhance the versatility and flexibility of the system.

[0073] S120. Parse the relevant files to obtain administrative district data, wherein the administrative district data includes administrative district code and name information.

[0074] In this embodiment, after obtaining the latest administrative division HTML file, the system will automatically transfer it to the background processing system. The background uses the Jsoup library in the Java programming language to parse the HTML file and extract two key information fields: administrative division code (divisionCode) and administrative division name (divisionName).

[0075] The administrative division code (divisionCode) is a unique identifier for administrative divisions in the national administrative division system. Each administrative division corresponds to a specific code, usually composed of numbers, which can uniquely identify an administrative area. For example, "110000" is the code for Beijing, and "110101" is the code for Dongcheng District, Beijing.

[0076] Administrative division name (divisionName): It is the name of the administrative region corresponding to the administrative division code, usually the official name of the region. For example, the administrative division name of Beijing is "Beijing City", and the name of Dongcheng District is "Dongcheng District".

[0077] Jsoup will extract the code and name of each administrative region from the HTML file according to its structure, and organize it into an object collection, for example:

[0078]

[0079] This collection contains the codes and names of all administrative divisions and can be further processed and stored for subsequent operations.

[0080] Through Jsoup's automatic parsing of HTML files, the required data can be efficiently extracted from the web page, avoiding the tedious process of manual extraction and organization of data, and improving the efficiency and accuracy of data processing.

[0081] The administrative division code (divisionCode) and administrative division name (divisionName) are standardized fields. The divisionCode is a standard code that uniquely identifies a region, and the divisionName is the standardized name of the region, ensuring the consistency and accuracy of administrative division data throughout the system.

[0082] Possible errors in manual operations (such as code omissions, name errors, etc.) are greatly reduced through automatic parsing and extraction, ensuring the high accuracy of the data.

[0083] Once the set of administrative division codes and names is obtained, the backend system can more easily perform subsequent processing, such as inserting it into the database, performing update comparison, and displaying it to users. The data structure is clear and standardized, which facilitates further operations.

[0084] Obtaining data by parsing HTML files can more flexibly respond to administrative division changes. It only needs to extract new data from the latest HTML file, without relying on fixed database update logic, thus reducing problems in the update process.

[0085] After parsing the administrative division data into code and name formats, the system can be easily expanded to support the extraction of other relevant information (for example, the province or city to which it belongs, administrative level, etc.), and can filter and process this information to meet different needs.

[0086] This method is not limited to obtaining the first-level administrative divisions (such as provinces, municipalities, etc.), but can also be extended to more detailed second-level and third-level administrative divisions (such as cities, districts, streets, etc.). Further hierarchical management through divisionCode is conducive to handling more complex administrative division hierarchical structures.

[0087] By using automation technology and Jsoup to parse HTML files, the code and name data of administrative divisions can be extracted efficiently and accurately, providing strong support for subsequent system processing, data updates and user prompts.

[0088] S130. Generate a simplified code according to the administrative region code.

[0089] In this embodiment, the simplified code is processed by the administrative division code, and the length of the administrative division code is shortened according to specific rules to facilitate operations such as partitioning, query, classification and statistics. Simplified codes are usually used in some systems to represent the hierarchical relationship of administrative divisions, but their essential purpose is to improve query efficiency and simplify data management.

[0090] Specifically, simplifying the administrative region code according to the set simplification rule to obtain a simplified code;

[0091] Among them, the simplified rules include that for administrative division codes above the county level, when the last seven digits of the administrative division code are all 0, the simplified code is the first two digits; when the last five digits of the administrative division code are all 0, and the first 3rd and 4th digits are different and are 0, the simplified code is the first four digits.

[0092] The administrative division code for the county level and below is fixed to 9 digits. When the first six digits of the administrative division code are XX0000, the simplified code is the first two digits; when the first six digits of the administrative division code are XXXX00, the simplified code is the first four digits; when the first six digits of the administrative division code are XXXXXX, the simplified code is the first six digits; it should be noted that, except for the first digit, any consecutive two digits (XX) must not be 00 at the same time; the above three situations are simplified from high to low according to the priority. For example, if the first six digits of the administrative division code are 300101, then except for the first digit, any consecutive two digits are 00, 01, 10, 01. At this time, not all of them are zero at the same time, so 300101 is retained. If the first six digits of the administrative division code are 300100, then when the first six digits of the administrative division code are XXXX00, the simplified code is the first four digits, which is 3001.

[0093] In this embodiment, according to the composition of the administrative division code, the simplified code is generated by the following rules:

[0094] The administrative code of Province A is "330000000" and the simplified code is "33".

[0095] The administrative code of City B is "330100000" and the simplified code is "3301".

[0096] The county-level administrative divisions under Province A are as follows: "330100000", and the simplified code is still "3301".

[0097] Example description:

[0098] The simplified code for Province A (330000000) is 33;

[0099] The simplified code for City B (330100000) is 3301;

[0100] The simplified code for Province C (130000000) is 13;

[0101] The simplified code for City D (130600000) is 1306;

[0102] The simplified code for district and county-level administrative areas (130603000) is 130603;

[0103] This simplified approach provides the system with concise and hierarchical administrative division information, facilitating regional division and management.

[0104] After the above step S130, the method further includes: using the simplified code to query relevant data of the specified province, city, or district.

[0105] The main purpose of simplified codes is to facilitate the management of administrative divisions across the country, and to facilitate quick query, statistics and screening. For example, when querying all provinces and municipalities, you only need to find records with simpleCode of 2 digits; when querying all cities under a province, you only need to find 4-digit simpleCode prefixed with the first two digits of the province.

[0106] By simplifying the code, users can quickly query the administrative divisions at a specific level as needed, for example:

[0107] To query all provinces (or municipalities) in the country, you only need to query the records whose simpleCode length is 2.

[0108] To query all cities in a province, you only need to query the records whose simpleCode starts with the first two digits of the province.

[0109] For county-level queries, query records whose simpleCode is prefixed with a certain city.

[0110] Using simplified codes can avoid using long administrative division codes when searching, which can greatly improve the efficiency of data query. For example, if you want to query all cities in Province C, you only need to use the first 4 digits (starting with 13) as the query condition, without having to query the entire 9-digit code, which simplifies the processing flow.

[0111] Simplified codes also facilitate statistics and analysis of regions at different levels. For example, the number of national, provincial, and municipal areas can be counted based on simplified codes to help analyze the distribution of administrative regions at all levels.

[0112] Among them, the original database table design is as follows Fig. 9 As shown, the parsed data is as follows Fig.10 As shown in the figure, during the query process, the simplified code is used to divide provinces, cities and districts. If you want to know how many provinces and (municipalities) there are in the country, you can directly check that the length of simple_code is equal to 2. The query result is as follows Fig.11 As shown, taking Province C as an example, to query all cities in Province C, the condition is that the simple_code is a 4-digit number starting with 13. The query results are as follows Fig.12 shown.

[0113] S140. Update the administrative district data and the simplified code into a predefined second administrative district table, and use the predefined first administrative district table and the second administrative district table to synchronize the data and update the activation status of the first administrative district table, wherein the first administrative district table is used to store the currently used administrative district data and simplified code, and the predefined second administrative district table is used to store the administrative district data and simplified code obtained after each parsing.

[0114] In one embodiment, see Figure 3 , the above-mentioned step S140 may include steps S141 to S142.

[0115] S141, comparing the administrative division codes in the first administrative division table and the second administrative division table, and deactivating the activation status mark of the administrative division code that exists in the first administrative division table but does not exist in the second administrative division table;

[0116] S142. Add the administrative division code that exists in the second administrative division table but does not appear in the first administrative division table to the first administrative division table, and set the startup status to enabled.

[0117] In addition, when the designated administrative district data is queried, the administrative district data and the corresponding startup status are displayed on the display interface.

[0118] In this embodiment, the first administrative division table is recorded as Table A, and the second administrative division table is recorded as Table B. Table A (the administrative division table used by the system) records the detailed information of each administrative division, including the administrative division code, division name, enablement status (enable_flag), etc. The enablement status (enable_flag) may have two values:

[0119] 1: Enabled state, indicating that the administrative division is valid in the system.

[0120] 0: Disabled status, indicating that the administrative division has been disabled in the system and can no longer be used for new operations.

[0121] Table B (latest administrative division table) is used to parse the latest administrative division data and stores the latest administrative division data. This table is updated from an external HTML file or other data source each time, and the original data is cleared before updating.

[0122] Before parsing, all data in table B will be cleared first. This is to ensure that each time a new HTML file is parsed, the data in table B is up to date and is not affected by historical data.

[0123] Query the administrative division data in Table A whose enabled status is 1 (i.e., currently enabled in the system).

[0124] Query all the data in table B, that is, all the data parsed from the latest HTML file.

[0125] Check whether the administrative division code in table A also exists in table B:

[0126] If the administrative division code in table A cannot find a corresponding entry in table B, it means that the administrative division may no longer exist or need to be disabled. Therefore, the enable status (enable_flag) of these administrative divisions that are in table A but not found in table B is set to disabled (0).

[0127] If there are administrative division codes in Table B that are not in Table A (that is, administrative divisions newly added in the latest administrative division data), then these new administrative divisions will be inserted into Table A and the default enabling status will be set to Enable (1).

[0128] By parsing and clearing old data from the latest HTML file, the data in Table B is always kept up to date. Table A automatically adjusts the enabled state based on the data in Table B to ensure that the system data and external data are consistent. By comparing Table A with Table B, it can be ensured that the system data (Table A) is synchronized with the latest administrative division data (Table B). If an administrative division disappears from the external data, the system will automatically deactivate the administrative division.

[0129] By setting enable_flag to 1 (enabled) or 0 (disabled), you can dynamically manage which administrative divisions are valid in the system and which are no longer in use. This helps to clearly manage administrative divisions at different levels and prevent administrative divisions that no longer exist or are invalid from affecting system operations. To avoid manual maintenance of the enabled status, the system automatically updates the enabled status of Table A based on the data in Table B, reducing human errors and maintenance costs.

[0130] As administrative divisions are adjusted (for example, new cities and counties are added), new administrative divisions will be automatically identified and inserted into Table A, and enabled by default, ensuring data updates and scalability of the system. Each time Table B is updated, the system can dynamically adjust Table A based on the latest data in Table B, without the need to manually modify the enabled status of each administrative division.

[0131] Parsing the HTML file each time after Table B is cleared can prevent old data from affecting new data and ensure that no redundant historical data remains in Table B. This makes the data clearer and helps with subsequent management and query. Only the currently enabled administrative divisions will appear in Table A, ensuring that there is only valid data in the system, which is very important for operations such as query and report generation.

[0132] No manual intervention is required to adjust the enabled status, the system automatically handles the update of the enabled status. This reduces operational complexity and potential errors while improving efficiency. As administrative divisions are adjusted, new divisions are automatically included in Table A, and the system does not require complex manual operations, making it easy to expand and maintain.

[0133] By comparing Table B with Table A, the latest administrative division data is ensured to be consistent with the data in the system, avoiding errors or conflicts caused by data asynchrony. The automated activation / deactivation mechanism reduces human intervention, thereby reducing the risk of operational errors and ensuring system stability and data consistency.

[0134] This design not only realizes the automatic update and management of administrative division data, but also ensures the real-time and accuracy of system data through the enable / disable mechanism. Through automated update and synchronization, the need for manual operations is reduced, data consistency is improved, and the system is ensured to respond quickly to new, deleted or changed administrative divisions, thereby supporting efficient administrative division management. This approach makes data maintenance easier and can effectively respond to changes in administrative divisions, with high scalability and flexibility.

[0135] In addition, the administrative division table (Table A) stores the full amount of administrative division data, including the administrative divisions that have been revoked. In Table A, each administrative division is marked with enable_flag to indicate its enabled state. The revoked administrative division will be marked with enable_flag = 0 (disabled state), while the administrative division that is still in use will be marked with enable_flag = 1 (enabled state).

[0136] When querying administrative division data, the system will directly query the data in Table A based on the administrative division code without additional filtering for revoked administrative divisions. That is, query results will be returned regardless of whether the administrative division is enabled or revoked. After the administrative division name is echoed, the system will determine whether the word "revoked" needs to be displayed based on the value of enable_flag. If the enable_flag of the administrative division is 0 (i.e., revoked), the front end will display a line of small words "revoked" after the administrative division name.

[0137] This design ensures that even if some administrative divisions have been revoked, their data will still be retained in the system, ensuring the integrity and historical traceability of the system data. This is very important for future data analysis, auditing, and historical queries. Since the revoked administrative divisions are not deleted from the database, but marked by the enabled status, this can avoid omissions or data loss. There is no need for additional filtering of administrative divisions when querying, and both enabled and revoked divisions can be obtained through the same query method. This greatly simplifies the query logic of the front-end and back-end, making the query process easier. The revoked divisions and enabled divisions in the query results are consistent, avoiding incomplete or incorrect data due to ignoring the revoked divisions during the query.

[0138] Even if the revoked administrative division still exists in the query results, the front end displays the word "revoked" so that users can intuitively understand the current status of the administrative division. This design provides clear feedback to help users avoid selecting revoked administrative divisions. The small word "revoked" is used as a prompt without affecting the normal user experience too much. Users can still see the name and code of the administrative division without worrying about misoperation.

[0139] If an administrative division is revoked but not deleted from the system, if the division needs to be restored or reactivated in the future, the system can directly modify its enable_flag status without re-importing the data. This avoids the difficulty of recovery caused by deleting data. Retaining the revoked administrative division data can provide the system with historical analysis capabilities, such as statistically analyzing the changing trends of certain divisions, to help managers make more accurate decisions. Since the revoked divisions are still retained in the system, if similar administrative division operations such as revocation / restore occur in the future, the system can handle them flexibly without making additional data structure adjustments. This design makes the system more stable and scalable when facing administrative division adjustments. There is no need to create a separate table or perform complex status management for the revoked administrative divisions. All data is uniformly stored in table A, avoiding the problems of multi-table queries and data dispersion. Unified management helps simplify system design and maintenance.

[0140] The core advantage of this design is that it combines full data storage with front-end prompts, which not only preserves the integrity of historical data, but also clearly displays the status of the revoked divisions on the user interface. The query and data echo logic is concise and efficient, and does not require additional filtering or complex processing. It also improves the consistency, traceability and flexibility of the data, which helps the system to operate stably and provide clear user feedback when dealing with changes in administrative divisions.

[0141] S150. Update the business table in an asynchronous loop according to the data in the first administrative division table and the startup status, generate an administrative division change reminder, and send it to the client.

[0142] In one embodiment, see Figure 4 , the above-mentioned step S150 may include steps S151 to S157.

[0143] S151. Obtain the business table and count the fields in the business table that are related to administrative divisions.

[0144] In this embodiment, all business tables containing administrative division information are counted, and the relevant administrative division fields in each table are recorded. Because the names of administrative division fields may be different in different scenarios, it is necessary to count the administrative division fields in each table one by one. For example, some tables may use field names such as province, city, and district, while other tables may use field names such as area_code and region. Therefore, it is necessary to count and map the table field names according to the actual situation during design.

[0145] In the early morning of the second day after the administrative division data is updated, the system performs checks through distributed scheduled tasks to ensure timely discovery of revoked administrative division codes and perform related data processing operations.

[0146] S152. Query the first administrative division table for administrative divisions whose activation status is deactivated to obtain a first query result.

[0147] First, find all currently valid (enable_flag = 1) administrative division codes from Table A. Cancelled administrative divisions will be marked as no longer enabled, and the system needs to filter these canceled administrative divisions from the historical records. Cancellation here includes changes in divisions, such as some areas being cancelled, new divisions being merged or replaced.

[0148] For example, suppose that District A1, District A2, and City A3 of Province A are abolished, and District A4 and District A5 are newly added. This change will be marked as a district change in the system, and subsequent adjustments will be required.

[0149] S153: Search the business table for data related to the first query result to obtain a second query result.

[0150] In this embodiment, SQL is used to jointly query the relevant data in all business tables (such as C, D, and E) containing administrative division fields to check whether the revoked administrative divisions are used. In order to improve query efficiency, multiple business tables can be jointly queried to find the administrative division data involved in the revocation.

[0151] Query the list of revoked administrative division codes. Query each business table to determine whether the province, city, and district in the table match the revoked administrative division code.

[0152] Assuming that District a1, District a2, and City a3 of Province A are abolished, and District a4 and District a5 are newly added, it is necessary to search these business tables to see whether there is data using these abolished administrative divisions.

[0153] S154: Record the second query result into the revocation reminder table.

[0154] In this embodiment, if some records involving revoked administrative divisions are found in the query results, the system inserts the information of these records into the administrative division revocation reminder table. The revocation reminder table contains the following important fields, as shown in Table 1.

[0155] Table 1. Cancellation reminder table

[0156]

[0157] S155. Record the change history and generate a specific change record.

[0158] S156. Generate change reminder information according to the change record, and update relevant fields in the administrative division change reminder table.

[0159] In this embodiment, the retrieved data are inserted into the administrative division reminder table. In addition to inserting it into the administrative division table, the first step is to publish the change information of the administrative division and insert it into the administrative division change table according to the change information. The important fields of the table structure are shown in Table 2.

[0160] Table 2. Administrative division changes

[0161]

[0162]

[0163] Usually provinces rarely change. The reason why all provinces, cities and districts are listed here is to better remind people which specific province, city and district the administrative division to be changed is.

[0164] By associating the administrative division change table with the revoked data set found in the business change, we can find out which new areas are recommended, and insert the provinces, cities and districts that can be found to have administrative changes into the advise_province, advise_city and advise_district fields in the business reminder table.

[0165] S157: Send the change reminder information to the client.

[0166] In this embodiment, important business is placed in personal messages according to business agreements. For example, if the company's registered place is changed, a message reminder will be sent. For example, the administrative divisions used in the city company registration table A. If it is found that there are revoked administrative divisions in this table, then the information is assembled, the company's personal message interface is called, and a reminder message is sent.

[0167] In order to ensure that users can effectively use administrative division information, three types of components are developed on the front end to cooperate with the back end:

[0168] Query component: This component is used to query the administrative divisions involved in the collateral. Since there may be revoked administrative divisions, all divisions (including those in enabled and disabled states) must be used for search during the query to ensure data integrity.

[0169] Newly added component: When users add new business data and select administrative divisions, the front end only allows the selection of administrative divisions that are currently enabled, thereby ensuring that the newly set administrative divisions are valid and comply with the current national administrative division standards.

[0170] Editing components: The editing function is slightly more complicated and can be divided into the following three cases:

[0171] Editing non-administrative division information: If you modify other information, the front end will display the enabled administrative divisions first according to the administrative division code. If there is no matching item in the enabled state, it will fall back to the full division for query and display.

[0172] Edit administrative division information: At this time, the drop-down box only displays the enabled administrative divisions, and users cannot select the revoked administrative divisions. If the user clicks Cancel, the administrative division will be restored to the original value.

[0173] Update administrative division information: If you do not click Cancel, the new administrative division you select will replace the original value, and ensure that the new value is an enabled administrative division code. When editing existing business, ensure that the administrative division is correctly reversed and allows correction to the latest valid division when necessary. If the user selects a revoked administrative division, the original value can be displayed in a reversed box and a cancel function can be provided to ensure data consistency.

[0174] Automatic detection of revoked administrative divisions and reminders to related businesses can ensure that the administrative division data in the system always reflects the current actual situation and avoid the use of revoked divisions. Through background automation processing, database query and message push, the system can reduce the workload of manual inspection and correction and improve efficiency. After the change, it can promptly remind relevant personnel or systems to process data to prevent errors or non-compliant operations caused by the use of invalid administrative divisions. By prompting the business systems that may be affected in advance, it reduces business interruptions or legal compliance issues caused by administrative division changes and ensures the continuity of business processes. The front-end component design fully considers the needs of different operation scenarios (query, add, edit), ensures that administrative division information can be used and displayed correctly in different situations, and provides a flexible user experience. By standardizing administrative division fields and business data processing processes, it ensures the consistency of each business system in using administrative divisions and reduces the differences between different business tables.

[0175] This design effectively solves potential problems caused by administrative division changes through automated background processes, data reminder mechanisms, and the coordination of front-end components. Its main advantage is that it ensures the accuracy and consistency of business data through automatic detection and reminders, reduces manual intervention and potential business risks, and improves the overall efficiency and stability of the system.

[0176] Specifically, users can perceive in real time whether administrative divisions have changed in the business, ensuring that they are aware of relevant adjustments in a timely manner. When administrative divisions change, developers do not need to manually organize and update the full amount of data, as the system will automatically handle these changes. Historical data is stored persistently to ensure that it will not be lost. Changes in administrative division data can be detected in a timely manner, and related data can be automatically updated synchronously. The system is compatible with historical data to ensure that the user experience is not affected after administrative divisions change. All data is persistently stored to avoid data loss and ensure the long-term availability of data.

[0177] The above-mentioned administrative division data updating method periodically monitors the changes in administrative division data, parses the update file and obtains the administrative district data; generates a simplified code based on the administrative district code, and updates the administrative district data and the simplified code to the second administrative division table, and synchronously updates the data and activation status of the first administrative division table; based on the data and activation status of the first administrative division table, asynchronously updates the business table and generates an administrative division change reminder, and sends it to the client; by periodically monitoring and parsing the administrative division update file, the new and old division data and the simplified code are synchronously updated to the second administrative division table, and the data consistency of the first administrative division table is maintained; the data synchronization mechanism of the first and second administrative division tables is utilized to ensure the integrity of historical data, and the business table is asynchronously updated and a change reminder is generated to ensure a smooth transition of the system to the new division structure, so as to ensure the integrity of historical data when updating the administrative division data as a whole, and ensure that the system can smoothly transition to the new division structure.

[0178] Figure 5 FIG. 3 is a schematic block diagram of an administrative region division data updating device 300 provided in an embodiment of the present invention. Figure 5 As shown, corresponding to the above administrative region division data updating method, the present invention also provides an administrative region division data updating device 300. The administrative region division data updating device 300 includes a unit for executing the above administrative region division data updating method, and the device can be configured in a server. Figure 5 The administrative region division data updating device 300 includes an acquisition unit 301, a parsing unit 302, a simplification unit 303, a first updating unit 304 and a second updating unit 305.

[0179] The acquisition unit 301 is used to periodically monitor the changes in the administrative division data, and to obtain relevant files when the administrative division data is updated; the parsing unit 302 is used to parse the relevant files to obtain the administrative district data, wherein the administrative district data includes the administrative district code and name information; the simplification unit 303 is used to generate a simplified code based on the administrative district code; the first update unit 304 is used to update the administrative district data and the simplified code to a predefined second administrative division table, and use the predefined first administrative division table and the second administrative division table to synchronize the data and update the activation status of the first administrative division table, wherein the first administrative division table is used to store the currently used administrative district data and simplified codes, and the predefined second administrative division table is used to store the administrative district data and simplified codes obtained after each parsing; the second update unit 305 is used to asynchronously cyclically update the business table according to the data in the first administrative division table and the startup status, and generate an administrative division change reminder and send it to the client.

[0180] In one embodiment, the parsing unit 302 is used to parse the relevant file using jsoup to obtain a set of administrative district codes and name information fields to form administrative district data.

[0181] In one embodiment, the simplification unit 303 is used to simplify the administrative region code according to a set simplification rule to obtain a simplified code;

[0182] Among them, the simplified rules include that for administrative division codes above the county level, when the last seven digits of the administrative division code are all 0, the simplified code is the first two digits; when the last five digits of the administrative division code are all 0, and the first 3rd and 4th digits are different and are 0, the simplified code is the first four digits.

[0183] In one embodiment, if Figure 6 As shown, the first updating unit 304 includes a first marking subunit 3041 and a second marking subunit 3042 .

[0184] The first marking subunit 3041 is used to compare the administrative division codes of the first administrative division table and the second administrative division table, and to disable the startup status mark of the administrative division codes that exist in the first administrative division table but do not exist in the second administrative division table; the second marking subunit 3042 is used to add the administrative division codes that exist in the second administrative division table but do not appear in the first administrative division table to the first administrative division table, and set the startup status to enabled.

[0185] In one embodiment, if Figure 7As shown, the second updating unit 305 includes a statistics subunit 3051 , a first query subunit 3052 , a second query subunit 3053 , a first recording subunit 3054 , a second recording subunit 3055 , an updating subunit 3056 and a sending subunit 3057 .

[0186] The statistical sub-unit 3051 is used to obtain the business table and count the fields related to the administrative divisions in the business table; the first query sub-unit 3052 is used to query the administrative divisions with a startup status of disabled in the first administrative division table to obtain a first query result; the second query sub-unit 3053 is used to search the business table for data related to the first query result to obtain a second query result; the first recording sub-unit 3054 is used to record the second query result in the revocation reminder table; the second recording sub-unit 3055 is used to record the change history and generate a specific change record; the update sub-unit 3056 is used to generate change reminder information according to the change record and update the relevant fields in the administrative division change reminder table; the sending sub-unit 3057 is used to send the change reminder information to the client.

[0187] In one embodiment, the simplification unit 303 is further used to query relevant data of a specified province, city, or district using the simplified code.

[0188] The first updating unit 304 is further configured to display the administrative district data and the corresponding startup status on the display interface when querying the designated administrative district data.

[0189] It should be noted that technical personnel in the relevant field can clearly understand that the specific implementation process of the above-mentioned administrative area division data updating device 300 and each unit can refer to the corresponding description in the aforementioned method embodiment, and for the convenience and conciseness of the description, it will not be repeated here.

[0190] The above-mentioned administrative region division data updating device 300 can be implemented in the form of a computer program. The computer program can be implemented in the form of a computer program such as Figure 8 Runs on the computer device shown.

[0191] See also Figure 8 , Figure 8 5 is a schematic block diagram of a computer device provided in an embodiment of the present application. The computer device 500 may be a server, wherein the server may be an independent server or a server cluster composed of multiple servers.

[0192] See also Figure 8 The computer device 500 includes a processor 502 , a memory and a network interface 505 connected via a system bus 501 , wherein the memory may include a non-volatile storage medium 503 and an internal memory 504 .

[0193] The non-volatile storage medium 503 can store an operating system 5031 and a computer program 5032. The computer program 5032 includes program instructions, and when the program instructions are executed, the processor 502 can execute a method for updating administrative area division data.

[0194] The processor 502 is used to provide computing and control capabilities to support the operation of the entire computer device 500 .

[0195] The internal memory 504 provides an environment for the operation of the computer program 5032 in the non-volatile storage medium 503. When the computer program 5032 is executed by the processor 502, the processor 502 can execute a method for updating administrative area division data.

[0196] The network interface 505 is used to communicate with other devices over the network. Figure 8 The structure shown in the figure is merely a block diagram of a portion of the structure related to the solution of the present application, and does not constitute a limitation on the computer device 500 to which the solution of the present application is applied. The specific computer device 500 may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0197] The processor 502 is used to run the computer program 5032 stored in the memory to implement the following steps:

[0198] Regularly monitor the changes in administrative division data, and obtain relevant files when the administrative division data is updated; parse the relevant files to obtain administrative district data, wherein the administrative district data includes administrative district code and name information; generate a simplified code based on the administrative district code; update the administrative district data and the simplified code to a predefined second administrative division table, and use the predefined first administrative division table and the second administrative division table to synchronize the data and update the activation status of the first administrative division table, wherein the first administrative division table is used to store the currently used administrative district data and simplified code, and the predefined second administrative division table is used to store the administrative district data and simplified code obtained after each analysis; update the business table in an asynchronous loop based on the data in the first administrative division table and the startup status, and generate an administrative division change reminder and send it to the client.

[0199] In one embodiment, when the processor 502 implements the step of parsing the relevant file to obtain administrative district data, wherein the administrative district data includes administrative district code and name information, the processor 502 specifically implements the following steps:

[0200] The relevant files are parsed using jsoup to obtain a set of administrative district codes and name information fields to form administrative district data.

[0201] In one embodiment, when the processor 502 implements the step of generating a simplified code according to the administrative area code, the processor 502 specifically implements the following steps:

[0202] Simplifying the administrative region code according to the set simplification rules to obtain a simplified code;

[0203] The simplified rules include that for administrative division codes above the county level, when the last seven digits of the administrative division code are all 0, the simplified code is the first two digits; when the last five digits of the administrative division code are all 0, and the first 3rd and 4th digits are different and are both 0, the simplified code is the first four digits;

[0204] The simplified rules include that for administrative division codes above the county level, when the last seven digits of the administrative division code are all 0, the simplified code is the first two digits; when the last five digits of the administrative division code are all 0, and the first 3rd and 4th digits are different and are both 0, the simplified code is the first four digits;

[0205] The administrative codes for county level and below are fixed at 9 digits. When the first six digits of the administrative code are XX0000, the simplified code is the first two digits. When the first six digits of the administrative code are XXXX00, the simplified code is the first four digits. When the first six digits of the administrative code are XXXXXX, the simplified code is the first six digits. Except for the first digit, any consecutive two digits cannot be 00 at the same time. The above-mentioned simplification of administrative codes for county level and below will be simplified in descending order of priority.

[0206] In one embodiment, when the processor 502 implements the step of updating the administrative district data and the simplified code into a predefined second administrative district table, and using the predefined first administrative district table and the second administrative district table to perform data synchronization and update the activation status of the first administrative district table, the processor 502 specifically implements the following steps:

[0207] Compare the administrative division codes of the first administrative division table and the second administrative division table, and mark the startup status of the administrative division codes that exist in the first administrative division table but not in the second administrative division table as disabled; add the administrative division codes that exist in the second administrative division table but do not appear in the first administrative division table to the first administrative division table, and set the startup status to enabled.

[0208] In one embodiment, when the processor 502 implements the step of asynchronously looping and updating the business table according to the data in the first administrative division table and the startup status, and generating an administrative division change reminder and sending it to the client, it specifically implements the following steps:

[0209] Obtain the business table and count the fields related to administrative divisions in the business table; query the administrative divisions whose startup status is disabled in the first administrative division table to obtain a first query result; search the business table for data related to the first query result to obtain a second query result; record the second query result in a revocation reminder table; record the change history and generate specific change records; generate change reminder information based on the change records, and update the relevant fields in the administrative division change reminder table; send the change reminder information to the client.

[0210] In one embodiment, after implementing the step of generating a simplified code according to the administrative area code, the processor 502 further implements the following steps:

[0211] The simplified code is used to query the relevant data of the specified province, city, and district.

[0212] In one embodiment, the processor 502 implements the updating of the administrative district data and the simplified code into a predefined second administrative division table, and uses the predefined first administrative division table and the second administrative division table to synchronize the data and update the activation status of the first administrative division table, wherein the first administrative division table is used to store the currently used administrative district data and simplified code, and the predefined second administrative division table is used to store the administrative district data and simplified code obtained after each parsing, and specifically implements the following steps:

[0213] When the specified administrative district data is queried, the administrative district data and the corresponding startup status are displayed on the display interface.

[0214] It should be understood that in the embodiment of the present application, the processor 502 may be a central processing unit (CPU), and the processor 502 may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0215] It can be understood by those skilled in the art that all or part of the processes in the method for implementing the above embodiment can be completed by instructing the relevant hardware through a computer program. The computer program includes program instructions, and the computer program can be stored in a storage medium, which is a computer-readable storage medium. The program instructions are executed by at least one processor in the computer system to implement the process steps of the embodiment of the above method.

[0216] Therefore, the present invention also provides a storage medium. The storage medium may be a computer-readable storage medium. The storage medium stores a computer program, wherein when the computer program is executed by a processor, the processor executes the following steps:

[0217] Regularly monitor the changes in administrative division data, and obtain relevant files when the administrative division data is updated; parse the relevant files to obtain administrative district data, wherein the administrative district data includes administrative district code and name information; generate a simplified code based on the administrative district code; update the administrative district data and the simplified code to a predefined second administrative division table, and use the predefined first administrative division table and the second administrative division table to synchronize the data and update the activation status of the first administrative division table, wherein the first administrative division table is used to store the currently used administrative district data and simplified code, and the predefined second administrative division table is used to store the administrative district data and simplified code obtained after each analysis; update the business table in an asynchronous loop based on the data in the first administrative division table and the startup status, and generate an administrative division change reminder and send it to the client.

[0218] In one embodiment, when the processor executes the computer program to implement the step of parsing the relevant files to obtain administrative district data, wherein the administrative district data includes administrative district code and name information, the processor specifically implements the following steps:

[0219] The relevant files are parsed using jsoup to obtain a set of administrative district codes and name information fields to form administrative district data.

[0220] In one embodiment, when the processor executes the computer program to implement the step of generating a simplified code according to the administrative area code, the processor specifically implements the following steps:

[0221] Simplifying the administrative region code according to the set simplification rules to obtain a simplified code;

[0222] The simplified rules include that for administrative division codes above the county level, when the last seven digits of the administrative division code are all 0, the simplified code is the first two digits; when the last five digits of the administrative division code are all 0, and the first 3rd and 4th digits are different and are both 0, the simplified code is the first four digits;

[0223] The administrative codes for county level and below are fixed at 9 digits. When the first six digits of the administrative code are XX0000, the simplified code is the first two digits. When the first six digits of the administrative code are XXXX00, the simplified code is the first four digits. When the first six digits of the administrative code are XXXXXX, the simplified code is the first six digits. Except for the first digit, any consecutive two digits cannot be 00 at the same time. The above-mentioned simplification of administrative codes for county level and below will be simplified in descending order of priority.

[0224] In one embodiment, when the processor executes the computer program to implement the step of updating the administrative district data and the simplified code into a predefined second administrative district table, and using the predefined first administrative district table and the second administrative district table to perform data synchronization and update the activation status of the first administrative district table, the processor specifically implements the following steps:

[0225] Compare the administrative division codes in the first administrative division table and the second administrative division table, and deactivate the activation status mark of the administrative division codes that exist in the first administrative division table but do not exist in the second administrative division table;

[0226] Add the administrative division codes that exist in the second administrative division table but do not appear in the first administrative division table to the first administrative division table, and set the startup status to enabled.

[0227] In one embodiment, when the processor executes the computer program to implement the step of asynchronously looping and updating the business table according to the data in the first administrative division table and the startup status, and generating an administrative division change reminder and sending it to the client, the processor specifically implements the following steps:

[0228] Obtain the business table and count the fields related to administrative divisions in the business table; query the administrative divisions whose startup status is disabled in the first administrative division table to obtain a first query result; search the business table for data related to the first query result to obtain a second query result; record the second query result in a revocation reminder table; record the change history and generate specific change records; generate change reminder information based on the change records, and update the relevant fields in the administrative division change reminder table; send the change reminder information to the client.

[0229] In one embodiment, after executing the computer program to implement the step of generating a simplified code according to the administrative area code, the processor further implements the following steps:

[0230] The simplified code is used to query the relevant data of the specified province, city, and district.

[0231] In one embodiment, the processor implements the updating of the administrative district data and the simplified code into a predefined second administrative district table when executing the computer program, and uses the predefined first administrative district table and the second administrative district table to synchronize the data and update the activation status of the first administrative district table, wherein the first administrative district table is used to store the currently used administrative district data and simplified code, and the predefined second administrative district table is used to store the administrative district data and simplified code obtained after each parsing, and the following steps are specifically implemented:

[0232] When the specified administrative district data is queried, the administrative district data and the corresponding startup status are displayed on the display interface.

[0233] The storage medium may be a USB flash drive, a mobile hard disk, a read-only memory (ROM), a magnetic disk, or an optical disk, etc., which are computer-readable storage media that can store program codes.

[0234] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0235] In the several embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of each unit is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed.

[0236] The steps in the method of the embodiment of the present invention can be adjusted in order, combined and deleted according to actual needs. The units in the device of the embodiment of the present invention can be combined, divided and deleted according to actual needs. In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0237] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, terminal, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention.

[0238] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present invention, and these modifications or replacements should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.

Claims

1. A method for updating administrative area division data, characterized in that: include: Regularly monitor changes in administrative division data and obtain relevant files when administrative division data is updated; Parsing the relevant files to obtain administrative district data, wherein the administrative district data includes administrative district code and name information; generating a simplified code according to the administrative region code; The administrative district data and the simplified code are updated into a predefined second administrative district table, and the predefined first administrative district table and the second administrative district table are used to synchronize the data and update the activation status of the first administrative district table, wherein the first administrative district table is used to store the currently used administrative district data and simplified code, and the predefined second administrative district table is used to store the administrative district data and simplified code obtained after each analysis; The business table is updated asynchronously in a loop according to the data in the first administrative division table and the startup status, and an administrative division change reminder is generated and sent to the client.

2. The method for updating administrative area division data according to claim 1, characterized in that: The relevant files are parsed to obtain administrative district data, wherein the administrative district data includes administrative district code and name information, including: The relevant files are parsed using jsoup to obtain a set of administrative district codes and name information fields to form administrative district data.

3. The method for updating administrative area division data according to claim 1, characterized in that: The generating a simplified code according to the administrative area code comprises: Simplifying the administrative region code according to the set simplification rules to obtain a simplified code; The simplified rules include that for administrative division codes above the county level, when the last seven digits of the administrative division code are all 0, the simplified code is the first two digits; when the last five digits of the administrative division code are all 0, and the first 3rd and 4th digits are different and are both 0, the simplified code is the first four digits; The administrative codes for county level and below are fixed at 9 digits. When the first six digits of the administrative code are XX0000, the simplified code is the first two digits. When the first six digits of the administrative code are XXXX00, the simplified code is the first four digits. When the first six digits of the administrative code are XXXXXX, the simplified code is the first six digits. Except for the first digit, any consecutive two digits cannot be 00 at the same time. The above-mentioned simplification of administrative codes for county level and below will be simplified in descending order of priority.

4. The method for updating administrative area division data according to claim 1, characterized in that: The updating of the administrative district data and the simplified code into a predefined second administrative district table, and using the predefined first administrative district table and the second administrative district table to synchronize data and update the activation status of the first administrative district table, includes: Compare the administrative division codes in the first administrative division table and the second administrative division table, and deactivate the activation status mark of the administrative division codes that exist in the first administrative division table but do not exist in the second administrative division table; Add the administrative division codes that exist in the second administrative division table but do not appear in the first administrative division table to the first administrative division table, and set the startup status to enabled.

5. The method for updating administrative area division data according to claim 1, characterized in that: The asynchronously looping updating of the business table according to the data in the first administrative division table and the startup status, and generating an administrative division change reminder, and sending it to the client, comprises: Get the business table and count the fields related to administrative divisions in the business table; Searching the first administrative division table for administrative divisions whose activation status is deactivated to obtain a first query result; Searching the business table for data related to the first query result to obtain a second query result; Record the second query result in the revocation reminder table; Record change history and generate specific change records; Generate change reminder information according to the change record, and update relevant fields in the administrative division change reminder table; Send change reminder information to the client.

6. The method for updating administrative area division data according to claim 1, characterized in that: After generating the simplified code according to the administrative area code, the method further includes: The simplified code is used to query the relevant data of the specified province, city, and district.

7. The method for updating administrative area division data according to claim 1, characterized in that: The updating of the administrative district data and the simplified code into a predefined second administrative district table, and using the predefined first administrative district table and the second administrative district table to synchronize the data of the first administrative district table and update the activation status, wherein the first administrative district table is used to store the currently used administrative district data and simplified code, and the predefined second administrative district table is used to store the administrative district data and simplified code obtained after each parsing, includes: When the specified administrative district data is queried, the administrative district data and the corresponding startup status are displayed on the display interface.

8. The administrative area division data updating device is characterized by: include: An acquisition unit is used to regularly monitor changes in administrative division data and acquire relevant files when the administrative division data is updated; A parsing unit, used for parsing the relevant file to obtain administrative district data, wherein the administrative district data includes administrative district code and name information; A simplification unit, used for generating a simplified code according to the administrative area code; a first updating unit, used for updating the administrative district data and the simplified code into a predefined second administrative district table, and using the predefined first administrative district table and the second administrative district table to perform data synchronization and update the activation status of the first administrative district table, wherein the first administrative district table is used to store the currently used administrative district data and simplified code, and the predefined second administrative district table is used to store the administrative district data and simplified code obtained after each parsing; The second updating unit is used to update the business table in an asynchronous loop according to the data in the first administrative division table and the startup status, and generate an administrative division change reminder and send it to the client.

9. A computer device, characterized in that: The computer device comprises a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the method according to any one of claims 1 to 7 is implemented.

10. A storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.

Citation Information

Cited By

  • Method and device for solving data association failure

    CN120631985A