Disclosure of Invention
Based on the technical problems, the invention provides a coding system and a coding method based on unified building coding standards, which ensure the unification and standardization of data coding of all service systems by constructing a full-province unified coding system and comprehensively implementing the coding standards, thereby improving the data management level and the service cooperation efficiency and solving the complexity problem caused by inconsistent coding in large-scale data management and service integration.
In a first aspect, a coding system based on a unified building construction coding standard includes the following modules:
the standardized coding engine module generates a unique identification code conforming to the specification according to the unified standard and the predefined rule, and stores the generated identification code and related information in a unified relational database;
The storage and verification module is used for storing and rapidly verifying the generated identification code through the relational database;
the flow control module is used for executing logic judgment, check and error processing in the coding flow;
and the log and audit module records the whole process of the coding operation and supports system tracing and data audit.
The identification code and the related information comprise the generated identification code, service attributes and area information.
The identification code quick verification comprises the steps of generating a unique Hash value according to the graphic information, and carrying out quick verification and retrieval based on an elastic search server.
On the other hand, the coding method based on the unified building coding standard is realized based on the coding system based on the unified building coding standard, and comprises the following steps of:
Step S1, a calling party sends a coding request to a system and calls a standardized coding engine module;
s2, the system performs strict check on the necessary field of the input data, ensures that the field is complete and meets the format requirement, and regenerates the shared code when each call is made;
step S3, inquiring whether a unique Hash value of the graphic information exists or not;
and S4, after the effective code value is obtained, calling a related data interface for processing according to the service logic, if the processing is successful, returning success information, and if the processing is failed, recording errors and returning detailed failure information.
Specifically, the step S3 specifically includes:
if the unique Hash value of the graphic information exists, confirming the code value according to whether the code is transmitted;
if the unique Hash value of the graphic information does not exist, generating a new identification code according to the business rule, and inquiring a database to verify the uniqueness.
Specifically, the code confirmation code value is specifically:
If the code value in the relational database is consistent with the code value of the input code, the code value in the relational database is returned, and if the code value is inconsistent with the code value of the input code, the code conflict error is fed back;
If no code is entered, existing codes in the relational database are returned directly.
Specifically, the generating a new identification code according to the business rule further includes:
if the generated new identification code relational database does not exist, storing and returning the identification code;
if the generated new identification code relational database exists, the system automatically decrements the serial number and regenerates the serial number, and if the conflict still exists, the system reports errors and terminates the operation.
Specifically, the system automatically decrements the sequence number a maximum of 10 times.
The invention has the beneficial effects that the invention provides a coding system and a coding method based on unified building coding standards, which are used for solving the problem of data management caused by inconsistent building data coding. The system provides standardized identification code generating and managing capability for all the services needing to be coded through provincial unified coding service, and ensures the consistency and uniqueness of the codes.
Detailed Description
For a clearer understanding of technical features, objects, and effects of the present invention, a specific embodiment of the present invention will be described with reference to the accompanying drawings.
The invention provides a coding system and a coding method based on a unified building coding standard, in a preferred embodiment, the first aspect is a coding system based on the unified building coding standard, comprising the following modules:
and the standardized coding engine module generates a unique identification code conforming to the specification according to the unified standard and the predefined rule, and stores the generated identification code and related information in a unified relational database.
In this embodiment, the unified criteria and predefined rules include:
the house building codes are composed of 18 digits, wherein 1-6 digits are county administrative division codes, seventh digits are year and month classification codes, 8-13 digits are permitted year and month or established year and month codes, and 14-18 digits are sequence codes.
The administrative division code of the county is the administrative division code of the house building, and the code length is 6 bits. The code accords with the specification of the current national standard ' code of the administrative division of the people's republic ' GB/T2260.
The year and month classifying code refers to the value type of the code of the permitted year and month or the established year and month, and the code length is 1 bit. The code values are 1, 2, 3,4 and 5.
In this embodiment, the identification code includes a classification code:
1. When the license year and month or the build year and month code is a construction project planning license and the country construction planning license year and month, the year and month classification code is 1;
2. When the license year and month or the building year and month code is the year and month of the construction license of the building engineering, the year and month classification code is 2;
3. when the license year and month or the build year and month code is the completion acceptance year and month, the year and month classification code is 3;
4. When the year and month of permission or the year and month of construction code is the year of completion, the year and month classification code is 4;
5. When the license year and month or the build year and month code is the completion year, the year and month classification code is 5.
Also included are licensed year and month or build year and month codes:
1. The new building construction license year and month or the building year and month code should be given in the construction project planning license stage, the code should be the construction project planning license, the country construction planning license year and month, the code length is 6 bits, the format is 'yyyymm', wherein 'yyyy' refers to the year, and 'mm' refers to the month.
2. And (3) assigning codes for new building construction without codes in the construction project planning permission stage, wherein the codes are assigned in the construction permission stage, the codes are the construction license year and month, the code length is 6 bits, and the format is yyyymm.
3. For the existing house building, the code of the permitted year and month or the established year and month should be the construction project planning license, the country construction planning license year and month, the code length is 6 bits, and the format is 'yyyymm'.
When the construction project planning license and the country construction planning license are ambiguous in year and month, the license year and month or the construction year and month code is the construction project construction license year and month, the code length is 6, the format is 'yyyymm', and when the construction project construction license is ambiguous in year and month, the license year and month or the construction year and month code is the completion acceptance year and month, the code length is 6, and the format is 'yyyymm'.
When the completion acceptance month is ambiguous, the license year, month or the build year, month code should be the completion year, 6 digits long, and the format is "yyyy00". When the year of completion is ambiguous, the license year, month, or year, month, code should be the year of completion, 6 digits long, in the format "yyy000".
The sequence code is 5 bits in length and ranges from 00001 to 99999, is automatically generated by a computer program, ensures that house building codes are not repeated, and is preferably coded from 00001 every year.
And the storage and verification module is used for storing and rapidly verifying the generated identification code through the relational database. In this embodiment, the relational database is a database system that employs a relational model to organize data. In a relational database, data is organized into tables, each table consisting of rows and columns, where rows represent records and columns represent fields. The tables are related to each other by specific relationships (e.g., primary and foreign keys) to form a complete data model. In addition to other important components, indexing, views, stored procedures, triggers, relational integrity constraints.
The flow control module is used for executing logic judgment, check and error processing in the coding flow;
and the log and audit module records the whole process of the coding operation and supports system tracing and data audit.
In the embodiment, the identification code and related information comprise the generated identification code, service attributes and area information, and the quick verification of the identification code comprises the steps of generating a unique Hash value according to graphic information and carrying out quick verification and retrieval based on an elastic search server.
On the other hand, in the embodiment, correspondingly, a coding method based on the unified building construction coding standard is provided, which comprises the following steps:
Step S1, a calling party sends a coding request to a system and calls a standardized coding engine module;
s2, the system performs strict check on the necessary field of the input data, ensures that the field is complete and meets the format requirement, and regenerates the shared code when each call is made;
step S3, inquiring whether a unique Hash value of the graphic information exists or not;
and S4, after the effective code value is obtained, calling a related data interface for processing according to the service logic, if the processing is successful, returning success information, and if the processing is failed, recording errors and returning detailed failure information.
In this embodiment, step S3 specifically includes:
if the unique Hash value of the graphic information exists, confirming the code value according to whether the code is transmitted;
if the unique Hash value of the graphic information does not exist, generating a new identification code according to the business rule, and inquiring a database to verify the uniqueness.
The code confirmation code value is specifically:
If the code value in the relational database is consistent with the code value of the input code, the code value in the relational database is returned, and if the code value is inconsistent with the code value of the input code, the code conflict error is fed back;
If no code is entered, existing codes in the relational database are returned directly.
Generating a new identification code according to the business rule further comprises:
if the generated new identification code relational database does not exist, storing and returning the identification code;
if the generated new identification code relational database exists, the system automatically decrements the serial number and regenerates the serial number, and if the conflict still exists, the system reports errors and terminates the operation. In this embodiment, the system automatically decrements the sequence number a maximum of 10 times.
In another embodiment, the coding system based on the unified building construction coding standard provides standardized identification code generation and management capability for all the services needing coding through provincial unified coding service, and ensures the consistency and uniqueness of the coding. In this embodiment, as shown in fig. 1, the coding system is implemented based on a data layer, a service layer, an implementation layer and a call layer, where the data layer sets a relational database to support data storage, the call layer provides a call interface, the service layer provides a server required by the system, such as an elastic search server, a Redis open source memory database, and the like, and the implementation layer sets a system core module including:
And the standardized coding engine module generates a unique identification code conforming to the specification according to the unified standard and the predefined rule. All business systems that need coding must invoke this service to ensure standardization and uniqueness of the coding. The system generates unique identification codes according to different service combinations (such as areas and service types), and stores the generated identification codes and related information in a unified relational database.
And the storage and verification module is used for storing and rapidly verifying the identification codes through the relational database, so that the uniqueness and consistency of the codes are ensured. The Hash value of the pattern spot is a unique Hash value generated according to the pattern information and is used for quick check and search.
And the identification codes and the associated information thereof are used for storing the generated identification codes, service attributes, regional information and the like, so that the data integrity and traceability are ensured.
The records are stored in the elastic search, and the query efficiency and the search speed of the data are improved by utilizing the inverted index and the distributed query function of the ES.
And the flow control module is used for executing logic judgment, check and error processing in the coding flow and ensuring the stability of the system in various scenes.
And the log and audit module records the whole process of the coding operation and supports system tracing and data audit.
In this embodiment, a coding flow is provided, as shown in fig. 2, including:
1. And (3) field verification and preprocessing, namely, the system firstly performs strict verification on the necessary field of the incoming data, so that the fields are complete and meet the format requirements. The shared code is regenerated at each call without making a repeatability decision.
2. The graphic information checks whether the plaque Hash value entered by the system through the elastesearch query already exists. In the present embodiment, if graphic information (Hash value) exists, then:
If the code is transmitted, checking whether the code value in the database is consistent with the transmitted code value, returning the code value in the database if the code value is consistent with the transmitted code value, and returning the code conflict error if the code value is inconsistent with the transmitted code value.
If no code is entered, existing codes in the database are returned directly.
If the graphic information does not exist, then:
The system generates new identification code according to the business rule, queries the database to verify the uniqueness, stores and returns the generated code if the generated code does not exist, and automatically decrements the serial number and regenerates the serial number if the generated code exists for at most 10 times. If there is still a conflict, the system reports an error and terminates the operation.
3. And (3) data processing and returning, namely after the effective code value is obtained, the system calls the related data interface to process according to the service logic. If the processing is successful, returning success information, and if the processing is failed, the system records errors and returns detailed failure information.
In the embodiment, the system is based on the high-efficiency verification of the elastic search, and the coding system relies on the inverted index and the distributed query capability of the elastic search, so that the high-efficiency verification and management of the identification code are realized, and the uniqueness and the accuracy of the coding are ensured.
And setting conflict processing of a decremental algorithm, adopting a decremental sequence strategy to avoid coding conflict, and ensuring the reliability of the system in a large-scale data environment.
And the stable system architecture is realized, namely the stable performance of the system can be kept under the condition of medium and high concurrency through reasonable business process design and high-efficiency query of elastic search, and the coding conflict and response delay are reduced.
The system is strictly designed according to the unified coding standard, so that the standardization of data coding in the whole province range is realized, and the system integration difficulty caused by inconsistent coding is greatly reduced.
In the embodiment, the system supports real-time check and search of the identification code by utilizing the quick search function of the elastic search, so that the overall efficiency of coding operation is greatly improved, and the response time of inquiry is reduced.
Through a predefined check rule and a decremental sequence algorithm, the system can effectively process coding conflict and provide clear error feedback under abnormal conditions, thereby enhancing the stability and reliability of the system.
The whole process of each coding operation is recorded in detail, so that data tracing and system audit are facilitated. This transparency supports the investigation and improvement of subsequent problems.
The invention provides an efficient and reliable full-province unified coding system based on unified standards and combined with the quick retrieval and verification capability of the elastic search, and successfully solves the problem of inconsistent data coding between cross-regional and cross-service systems. The system has reasonable design and stable performance, and has wide application value and popularization prospect.
The foregoing has shown and described the basic principles and features of the invention and the advantages of the invention. It will be understood by those skilled in the art that the present invention is not limited to the embodiments described above, and that the above embodiments and descriptions are merely illustrative of the principles of the present invention, and various changes and modifications may be made without departing from the spirit and scope of the invention, which is defined in the appended claims. The scope of the invention is defined by the appended claims and equivalents thereof.