Configurable service uniqueness verification method and device, equipment and medium
By configuring unique fields for different types of databases and performing extended validation, the problem of low efficiency in business uniqueness validation in existing technologies is solved, and flexible and efficient business uniqueness validation is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- 特赞(上海)信息科技有限公司
- Filing Date
- 2026-01-20
- Publication Date
- 2026-05-19
AI Technical Summary
In existing technologies, business uniqueness verification is inefficient and requires modification of the source code to adapt to changes in business requirements, which can easily introduce human error.
This paper provides a configurable business uniqueness verification method. By configuring unique fields for different types of databases, receiving operation processing requests, detecting and performing extended verification, it achieves flexible business uniqueness verification.
It can adapt to different database architectures without modifying the core verification logic, improving the efficiency of business uniqueness verification and reducing human error.
Smart Images

Figure CN122064577A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of this disclosure relate to the field of computer technology, and more specifically, to a configurable business uniqueness verification method, apparatus, device, and medium. Background Technology
[0002] Business uniqueness verification is an important means to ensure the accuracy, integrity and consistency of business data. It can ensure the uniqueness of business data in specific scenarios, which is of great significance for avoiding data redundancy, preventing business conflicts and improving the overall reliability of the system.
[0003] In related technologies, business uniqueness verification is mainly achieved through hard-coded verification logic. For example, in user registration scenarios, uniqueness verification is performed by writing uniqueness judgment logic for fields such as username and mobile phone number into the code.
[0004] However, when business requirements change, such as the need to add validation fields, the source code must be modified, recompiled, and deployed. The whole process is time-consuming and laborious, and is prone to introducing new bugs due to human error, resulting in low validation efficiency. Summary of the Invention
[0005] The embodiments described herein provide a configurable business uniqueness verification method, apparatus, device, and medium that overcomes the aforementioned problems.
[0006] Firstly, based on the content of this disclosure, a configurable business uniqueness verification method is provided, including: Configure corresponding unique fields for the stored content in different types of databases; Receive operation processing requests for target data content; If the operation processing request for the target data content is used to describe an instruction to add content to the target data content, then the existence of a unique field for the target data content is detected in the corresponding database; if it exists, the metadata of the unique field is obtained, and the corresponding unique identifier value is extracted based on the metadata; if the unique identifier value is detected to be absent in the corresponding database, then the database-specific extended verification is performed on the unique identifier value to obtain the corresponding unique verification result. If the operation processing request for the target data content is used to describe an instruction to update the target data content, then the content update field of the target data content is obtained, and a unique update value is extracted based on the content update field; if it is detected that the unique update value is inconsistent with the unique identifier value corresponding to the target data content, then a database-specific extended verification is performed on the unique update value to obtain the corresponding uniqueness verification result.
[0007] Secondly, according to the content of this disclosure, a configurable business uniqueness verification device is provided, comprising: The configuration module is used to configure the corresponding unique fields for the stored content in different types of databases; The receiving module is used to receive operation processing requests for the target data content; The first verification module is used to detect whether a unique field of the target data content exists in the corresponding database if the operation processing request of the target data content describes an instruction to add content to the target data content; if it exists, the module obtains the metadata of the unique field and extracts the corresponding unique identifier value based on the metadata; if the module detects that the unique identifier value does not exist in the corresponding database, the module performs a database-specific extended verification on the unique identifier value to obtain the corresponding unique verification result. The second verification module is used to obtain the content update field of the target data content if the operation processing request of the target data content is used to describe the content update instruction of the target data content, and extract a unique update value based on the content update field; if it is detected that the unique update value is inconsistent with the unique identifier value corresponding to the target data content, then perform a corresponding database-specific extended verification on the unique update value to obtain the corresponding uniqueness verification result.
[0008] Thirdly, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the configurable business uniqueness verification method as described in any of the above embodiments.
[0009] Fourthly, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, it implements the steps of the configurable business uniqueness verification method as described in any of the above embodiments.
[0010] The configurable business uniqueness verification method provided in this application configures corresponding unique fields for stored content in different types of databases; receives operation processing requests for target data content; if the operation processing request for target data content describes an instruction to add content to the target data content, it checks whether a unique field for the target data content exists in the corresponding database; if it exists, it obtains the metadata of the unique field and extracts the corresponding unique identifier value based on the metadata; if the unique identifier value is detected as not existing in the corresponding database, it performs database-specific extended verification on the unique identifier value to obtain the corresponding uniqueness verification result; if the operation processing request for target data content describes an instruction to update the target data content, it obtains the content update field of the target data content and extracts the unique update value based on the content update field; if the unique update value is detected as inconsistent with the unique identifier value corresponding to the target data content, it performs database-specific extended verification on the unique update value to obtain the corresponding uniqueness verification result. Thus, by configuring corresponding unique fields for different types of databases, when facing databases with different architectures, there is no need to modify the core verification logic; only specific extended verification rules need to be adapted to them to flexibly implement business uniqueness verification, effectively improving the efficiency of business uniqueness verification.
[0011] The above description is merely an overview of the technical solutions of the embodiments of this application. In order to better understand the technical means of the embodiments of this application and to implement them in accordance with the contents of the specification, and to make the above and other objects, features and advantages of the embodiments of this application more obvious and understandable, specific implementation methods of this application are described below. Attached Figure Description
[0012] To more clearly illustrate the technical solutions of the embodiments of this disclosure, the accompanying drawings of the embodiments will be briefly described below. It should be understood that the drawings described below only relate to some embodiments of this disclosure and are not intended to limit this disclosure, wherein: Figure 1 This is a flowchart illustrating a configurable business uniqueness verification method provided in this publication.
[0013] Figure 2 This is a schematic diagram of a configurable business uniqueness verification device provided in this disclosure.
[0014] Figure 3 This is a schematic diagram of the structure of a computer device provided in this disclosure.
[0015] It should be noted that the elements in the attached diagram are schematic and not drawn to scale. Detailed Implementation
[0016] To make the objectives, technical solutions, and advantages of the embodiments of this disclosure clearer, the technical solutions of the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this disclosure. All other embodiments obtained by those skilled in the art based on the described embodiments of this disclosure without creative effort are also within the scope of protection of this disclosure.
[0017] Unless otherwise defined, all terms used herein (including technical and scientific terms) shall have the same meaning as commonly understood by one of ordinary skill in the art to which this subject matter pertains. It will be further understood that terms such as those defined in commonly used dictionaries shall be interpreted as having the meaning consistent with their meaning in the context of the specification and in the relevant art, and shall not be interpreted in an idealized or overly formal form unless otherwise explicitly defined herein. As used herein, the statement of “connecting” or “coupling” two or more parts together shall mean that these parts are directly joined together or joined through one or more intermediate components.
[0018] The term "embodiment" as used herein means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of the phrase "embodiment" in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0019] In this document, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can mean: A exists, A and B exist simultaneously, or B exists. Additionally, the character " / " generally indicates that the preceding and following related objects have an "or" relationship. Terms such as "first" and "second" are only used to distinguish one component (or part of a component) from another component (or another part of a component).
[0020] In the description of this application, unless otherwise stated, "multiple" means two or more (including two), and similarly, "multiple groups" means two or more (including two groups).
[0021] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings.
[0022] Figure 1 This is a flowchart illustrating a configurable business uniqueness verification method provided in this embodiment of the disclosure, such as... Figure 1As shown, the specific process of the configurable business uniqueness verification method includes: S110. Configure the corresponding unique field for the stored content in different types of databases.
[0023] The database can correspond to various types, including but not limited to product databases, celebrity databases, and recipe databases. In the product database, the "product number" can be configured as a unique field to ensure that each product has a unique identifier in the system; the celebrity database can use the "stage name" as a unique field to avoid the duplicate storage of the same celebrity's information; and the recipe database can set the "dish name" as a unique field to prevent the same recipe from being entered multiple times.
[0024] The following examples illustrate the configuration options for different types of databases.
[0025] --------------------------------------------------------------------- JS / / Product library configuration {"libraryType": "product_cloud","uniqueBizCode": "fg_code", / / FG code as a unique identifier "extraInfo": {"uniqueScope": "global", / / Globally unique "uniqueType": "single" / / Single field unique}} / / Celebrity library configuration {"libraryType": "star_library","uniqueBizCode": "nebula_name", / / Name as a unique identifier "extraInfo": {"uniqueScope": "global","uniqueType":"single"}} / / Recipe library configuration {"libraryType": "recipe_cloud","uniqueBizCode": "recipe_name", / / Recipe name as a unique identifier "extraInfo": {"uniqueScope": "library", / / Unique within the library "uniqueType": "composite", / / Unique combination (name + language) "uniqueFields": ["recipe_name", "primary_language"]}} -------------------------------------------------------------------- Accordingly, the database table structure is shown in the example below.
[0026] --------------------------------------------------------------------- SQL -- Unified Content Table (Core) CREATE TABLE `nebula_content` ( `id` bigint PRIMARY KEY, `library_type` varchar(20) NOT NULL, `content_type` varchar(20) NOT NULL, `biz_id` varchar(50) COMMENT 'Unique Business Identifier', -- Key Field `name` varchar(255), `content_info` longtext, `create_user` bigint, `create_time` datetime, `status` tinyint, KEY `idx_biz_id` (`biz_id`), -- Unique query index UNIQUE KEY `uk_library_type_biz_id` (`library_type`, `biz_id`) -- Optional unique constraint ); -- Library configuration table CREATE TABLE `nebula_library_config` ( `id` bigint PRIMARY KEY, `library_type` varchar(20) NOT NULL UNIQUE, `unique_biz_code` varchar(50) COMMENT 'Unique field encoding',-- Key configuration The `extra_info` text COMMENT 'Extended Information (JSON)', ... ); --------------------------------------------------------------------- In addition, the uniqueness strategies in this embodiment include: global uniqueness of a single field, uniqueness of a single field within the database, uniqueness of combined fields, and conditional uniqueness.
[0027] The logic for achieving global uniqueness for a single field is as follows.
[0028] --------------------------------------------------------------------- JSON {"uniqueBizCode": "sku","extraInfo": {"uniqueScope": "global","uniqueType": "single"}} --------------------------------------------------------------- The query condition is "WHERE biz_id = ?".
[0029] The unique implementation logic within the single-field library is as follows.
[0030] --------------------------------------------------------------------- JSON {"uniqueBizCode": "name","extraInfo": {"uniqueScope": "library","uniqueType": "single"}} -------------------------------------------------------------------- The query condition is "WHERE library_type = ? AND biz_id = ?".
[0031] The unique implementation logic for combined fields is as follows.
[0032] --------------------------------------------------------------------- JSON {"uniqueBizCode": "name_language","extraInfo": {"uniqueScope": "library","uniqueType": "composite","uniqueFields": ["name", "primary_language"]}} --------------------------------------------------------------------- The query condition is "WHERE library_type = ? AND biz_id = ?", and the extraction logic is "bizId =name + "_" + language".
[0033] The logic for achieving a unique condition is as follows.
[0034] --------------------------------------------------------------------- JSON {"uniqueBizCode": "name","extraInfo": {"uniqueScope": "library","uniqueType": "conditional","uniqueCondition": "content_status = 2" / / Only published content names are unique}} -------------------------------------------------------------------- The query criteria are "WHERE library_type = ? AND biz_id = ? AND content_status =2".
[0035] S120, Receive the operation processing request for the target data content.
[0036] The operation processing request can be used to describe an instruction to add or update target data content. The target data content can be data content already stored in the database. For example, if the operation processing request describes an instruction to add content, the target data content can be a brand new data record to be added to the database, which has not yet been stored in the database when the operation processing request is received; if the operation processing request describes an instruction to update content, the target data content can be an existing data record in the database that needs to be updated.
[0037] S130. If the operation processing request for the target data content is used to describe an instruction to add content to the target data content, then check whether a unique field of the target data content exists in the corresponding database; if it exists, then obtain the metadata of the unique field and extract the corresponding unique identifier value based on the metadata; if it is detected that the unique identifier value does not exist in the corresponding database, then perform the corresponding database-specific extended validation on the unique identifier value to obtain the corresponding uniqueness validation result.
[0038] The metadata for unique fields may include: field name, data type, and validation rule identifier. The validation rule identifier can be used to associate with preset extended validation logic. The extended validation logic corresponds to the data type of the unique identifier value. For example, for a string-type unique identifier value, the extended validation logic may be an exact match validation after removing leading and trailing spaces, or a fuzzy match validation ignoring uppercase and lowercase letters; for a numeric-type unique identifier value, the extended validation logic may be a numeric range validity validation and a formatted duplicate validation.
[0039] In some embodiments, extracting the corresponding unique identifier value based on metadata includes: if the unique identifier field defined in the metadata is a single field, then extracting the field value corresponding to the single field from the target data content; and determining the field value corresponding to the single field as the unique identifier value; if the unique identifier field defined in the metadata is a composite field, then using the predefined subfield concatenation rules in the metadata, concatenating the field values corresponding to each subfield in the composite field in an orderly manner to obtain a composite string; and determining the composite string as the unique identifier value.
[0040] For example, if a single field is "User ID" and the value of this field in the target data is "X111", then "X111" is directly extracted as the unique identifier. If the combined field consists of "Order Date" and "Order Sequence Number", and the metadata predefined subfield concatenation rule is "Order Date - Order Sequence Number", and the value of "Order Date" in the target data is "0101" and the value of "Order Sequence Number" is "67890", then "0101" and "67890" are concatenated in order according to the "-" concatenation rule to obtain the combined string "0101-67890", and "0101-67890" is determined as the unique identifier. Therefore, for single or combined fields, it is convenient to accurately and efficiently extract unique identifiers that conform to the metadata definition from the target data content.
[0041] In some embodiments, performing database-specific extended verification on the unique identifier value to obtain the corresponding uniqueness verification result includes: determining an extended verification rule base that matches the business database type corresponding to the target data content based on the business database type corresponding to the target data content; selecting a verification unit from the extended verification rule base that matches the database corresponding to the unique identifier value; and performing extended verification on the unique identifier value through the verification unit that matches the database corresponding to the unique identifier value to obtain the corresponding uniqueness verification result.
[0042] The extended validation rule base includes dedicated validation logic for different business database types. For example, when the business database type is a product database, the extended validation rule base can include product coding format validation logic, such as verifying whether the unique identifier value conforms to the specific length of the product code (e.g., 10 characters). When the business database type is a celebrity database, the extended validation rule base can include celebrity coding format validation logic, such as verifying whether the unique identifier value conforms to the specific length of the celebrity code (e.g., 12 characters). When the business database type is a recipe database, the extended validation rule base can include recipe coding format validation logic, such as verifying whether the unique identifier value conforms to the specific length of the recipe code (e.g., 15 characters). Therefore, by configuring dedicated validation logic for different business database types, the extended validation can better meet the actual needs of various business scenarios.
[0043] In some embodiments, the method further includes: generating a first warning prompt if a unique identifier value is detected to already exist in the corresponding database; and / or: if a unique field for the target data content is detected not to exist in the corresponding database, mapping and storing the unique field and the target data content in a unified content table of the corresponding database.
[0044] The first warning message can include specific information about the unique identifier, related data of existing records (such as creation time), and suggested handling methods (such as checking whether it is a duplicate entry), so as to facilitate quick location of the problem and take corresponding measures.
[0045] In addition, an indexing mechanism can be established for the unified content table to facilitate subsequent data retrieval through the content index, thereby improving the efficiency of data query and verification.
[0046] S140. If the operation processing request for the target data content is used to describe the content update instruction for the target data content, then obtain the content update field of the target data content and extract the unique update value based on the content update field; if it is detected that the unique update value is inconsistent with the unique identifier value corresponding to the target data content, then perform the corresponding database-specific extended verification on the unique update value to obtain the corresponding uniqueness verification result.
[0047] Among them, the unique update value is the key field value used to identify the uniqueness of the data to be updated in the content update operation. For example, if the update request contains a user's ID number field and this field is configured as a unique update verification field, then the new value of the ID number is the unique update value.
[0048] In some embodiments, extracting a unique update value based on a content update field includes: if the content update field belongs to a unique identifier related field, then the field value corresponding to the content update field is determined to be a unique update value; if the content update field corresponds to multiple associated fields, then the field values corresponding to each associated field are concatenated into strings according to a preset field combination order to obtain a unique update value.
[0049] For example, if the content update field is "User Account" and this field is pre-configured as a unique identifier, then the new value of the "User Account" field in the update request (such as "X222") can be directly determined as the unique update value. If the content update field involves two related fields, "Device Type" and "Device Number", and the preset field combination order is "Device Type + Device Number", then when the value of the "Device Type" field in the update request is "333" and the value of the "Device Number" field is "PLC2023001", these two field values will be concatenated in order to form "3332023001", which will be used as the unique update value.
[0050] In some embodiments, performing database-specific extended verification on the unique updated value to obtain the corresponding uniqueness verification result includes: determining an extended verification rule base that matches the business database type corresponding to the target data content based on the business database type corresponding to the target data content; selecting a verification unit from the extended verification rule base that matches the database corresponding to the unique updated value; and performing extended verification on the unique updated value through the verification unit that matches the database corresponding to the unique updated value to obtain the corresponding uniqueness verification result.
[0051] Specifically, if the target data content corresponds to a product database, the matching verification unit can perform targeted verification of unique updated values based on the product database's unique data structure and field constraints. If the business database type is a celebrity database, the matching verification unit can perform fuzzy matching verification for unique updated values of text-based categories such as celebrity names and stage names. For example, it can detect whether there are records of celebrity names with the same pronunciation but different characters or similar shapes, to avoid uniqueness conflicts caused by input errors. If the target data content corresponds to a recipe database, the matching verification unit can verify unique updated values by combining key information such as the core ingredient combinations and cooking methods of the recipes, thereby avoiding the problem of recipe data that is essentially the same but is entered repeatedly due to naming differences.
[0052] In some embodiments, the method further includes generating a second warning message if a unique update value is detected to be consistent with a unique identifier value corresponding to the target data content.
[0053] The second alert can include detailed comparison information between the unique update value and the unique identifier value, such as the field names of the unique update value and the unique identifier value, so that business personnel can quickly locate conflicting data. Furthermore, the second alert can provide differentiated handling suggestions based on different business scenarios to avoid the loss or corruption of important data due to accidental operations.
[0054] In this embodiment, a unique field is configured for the stored content in different types of databases; an operation request for the target data content is received; if the operation request describes an instruction to add content to the target data content, the existence of a unique field for the target data content is checked in the corresponding database; if it exists, the metadata of the unique field is obtained, and the corresponding unique identifier value is extracted based on the metadata; if the unique identifier value is not found in the corresponding database, a database-specific extended validation is performed on the unique identifier value to obtain the corresponding uniqueness validation result; if the operation request describes an instruction to update the target data content, the content update field of the target data content is obtained, and the unique update value is extracted based on the content update field; if the unique update value is inconsistent with the unique identifier value corresponding to the target data content, a database-specific extended validation is performed on the unique update value to obtain the corresponding uniqueness validation result. Thus, by configuring corresponding unique fields for different types of databases, when facing databases with different architectures, there is no need to modify the core validation logic; only specific extended validation rules need to be adapted to implement business uniqueness validation flexibly, effectively improving the efficiency of business uniqueness validation.
[0055] In addition, this embodiment uses a product database as an example for detailed explanation as follows.
[0056] Step 1: The administrator logs into the backend and edits the unique field of the product database according to the following configuration logic.
[0057] --------------------------------------------------------------------- SQL UPDATE nebula_library_config SET unique_biz_code = 'sku', extra_info = '{"uniqueScope":"global","uniqueType":"single"}'WHERElibrary_type = 'product_cloud'; -------------------------------------------------------------------- Step 2: The user creates a product and fills in the SKU: SKU-12345. The system then executes the following logic.
[0058] --------------------------------------------------------------------- Java / / 1. Get configuration String uniqueBizCode = "sku"; / / Read from library configuration / / 2. Extract the unique value String bizId = getUniqueBizValue(...); / / Returns "SKU-12345" / / 3. Check if NebulaContentPO exists: existProduct=contentService.getByBizId("SKU-12345"); if (existProduct != null) { / / 4. Throw an exception: throw new TezignException("Business identifier already exists: SKU-12345"); } / / 5. Save the product product.setBizId("SKU-12345"); contentService.save(product); -------------------------------------------------------------------- Step 3: The user changes the SKU from SKU-12345 to SKU-67890, and the system executes the following logic.
[0059] --------------------------------------------------------------------- Java / / 1. Extract the new SKU: String newBizId = "SKU-67890"; / / 2. Compare with the original SKU if (!newBizId.equals(originProduct.getBizId())) { / / 3. Check if the new SKU already exists. int count = contentService.count( new LambdaQueryWrapper <nebulacontentpo>() .eq(NebulaContentPO::getBizId, newBizId) .ne(NebulaContentPO::getId, originProduct.getId()) ); if (count>0) { throw new TezignException("Business identifier already exists: SKU-67890"); } / / 4. Update bizId originProduct.setBizId(newBizId); } contentService.updateById(originProduct); -------------------------------------------------------------------- Figure 2 This is a schematic diagram of a configurable service uniqueness verification device provided in this embodiment. The configurable service uniqueness verification device may include: Configuration module 210 is used to configure corresponding unique fields for stored content in different types of databases.
[0060] The receiving module 220 is used to receive operation processing requests for the target data content.
[0061] The first verification module 230 is used to detect whether a unique field of the target data content exists in the corresponding database if the operation processing request for the target data content describes an instruction to add content to the target data content; if it exists, it obtains the metadata of the unique field and extracts the corresponding unique identifier value based on the metadata; if it detects that the unique identifier value does not exist in the corresponding database, it performs a database-specific extended verification on the unique identifier value to obtain the corresponding unique verification result.
[0062] The second verification module 240 is used to obtain the content update field of the target data content if the operation processing request of the target data content describes the content update instruction of the target data content, and extract the unique update value according to the content update field; if the unique update value is detected to be inconsistent with the unique identifier value corresponding to the target data content, the module performs the corresponding database-specific extended verification on the unique update value to obtain the corresponding uniqueness verification result.
[0063] In this embodiment, optionally, the first verification module 230 is specifically used for: If the unique identifier field defined in the metadata is a single field, then the field value corresponding to the single field is extracted from the target data content; and the field value corresponding to the single field is determined as the unique identifier value; if the unique identifier field defined in the metadata is a composite field, then the field values corresponding to each subfield in the composite field are concatenated in an orderly manner according to the predefined subfield concatenation rules in the metadata to obtain the composite string; and the composite string is determined as the unique identifier value.
[0064] In this embodiment, optionally, the first verification module 230 is specifically used for: Based on the business database type corresponding to the target data content, determine the extended verification rule base that matches the business database type corresponding to the target data content; select the verification unit that matches the database corresponding to the unique identifier value from the extended verification rule base; perform extended verification on the unique identifier value through the verification unit that matches the database corresponding to the unique identifier value to obtain the corresponding uniqueness verification result.
[0065] In this embodiment, optionally, the second verification module 240 is specifically used for: If the content update field is a unique identifier related field, then the field value corresponding to the content update field is determined to be a unique update value; if the content update field corresponds to multiple related fields, then the field values corresponding to each related field are concatenated into a string according to a preset field combination order to obtain a unique update value.
[0066] In this embodiment, optionally, the second verification module 240 is specifically used for: Based on the business database type corresponding to the target data content, determine an extended verification rule base that matches the business database type corresponding to the target data content; select a verification unit from the extended verification rule base that matches the database corresponding to the unique updated value; perform extended verification on the unique updated value through the verification unit that matches the database corresponding to the unique updated value to obtain the corresponding uniqueness verification result.
[0067] In this embodiment, optionally, a first processing module may also be included.
[0068] The first processing module is used to generate a first warning prompt if a unique identifier value is detected to already exist in the corresponding database; and / or, if a unique field for the target data content is detected not to exist in the corresponding database, to map the unique field to the target data content and store it in the unified content table of the corresponding database.
[0069] In this embodiment, optionally, a second processing module may also be included.
[0070] The second processing module is used to generate a second early warning prompt if the detected unique update value matches the unique identifier value corresponding to the target data content.
[0071] The configurable business uniqueness verification device provided in this disclosure can execute the above method embodiments. Its specific implementation principle and technical effects can be found in the above method embodiments, and will not be repeated here.
[0072] This application also provides a computer device. Please refer to the following for details. Figure 3 , Figure 3 This is a basic structural block diagram of the computer device in this embodiment.
[0073] The computer device includes a memory 310 and a processor 320 that are interconnected via a system bus. It should be noted that only a computer device with memory 310 and processor 320 is shown in the figure; however, it should be understood that it is not required to implement all the components shown, and more or fewer components may be implemented alternatively. Those skilled in the art will understand that the computer device described herein is a device capable of automatically performing numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes, but is not limited to, microprocessors, application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), digital signal processors (DSPs), embedded devices, etc.
[0074] Computer devices can include desktop computers, laptops, handheld computers, and cloud servers. These devices allow for human-computer interaction with users through keyboards, mice, remote controls, touchpads, or voice-activated devices.
[0075] The memory 310 includes at least one type of readable storage medium, including non-volatile memory or volatile memory, such as flash memory, hard disk, multimedia card, card-type memory (e.g., SD or DX memory), random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disk, etc. RAM may include static RAM or dynamic RAM. In some embodiments, the memory 310 may be an internal storage unit of a computer device, such as the hard disk or memory of the computer device. In other embodiments, the memory 310 may also be an external storage device of the computer device, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, or flash card equipped on the computer device. Of course, the memory 310 may include both internal storage units and external storage devices of the computer device. In this embodiment, the memory 310 is typically used to store the operating system and various application software installed on the computer device, such as the program code of the method described above. In addition, the memory 310 can also be used to temporarily store various types of data that have been output or will be output.
[0076] Processor 320 is typically used to perform overall operations of a computer device. In this embodiment, memory 310 is used to store program code or instructions, including computer operation instructions, and processor 320 is used to execute the program code or instructions stored in memory 310 or process data, such as program code that runs the methods described above.
[0077] In this article, the bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. This bus system can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used to represent it in the diagram, but this does not mean that there is only one bus or one type of bus.
[0078] Another embodiment of this application also provides a computer-readable medium, which may be a computer-readable signal medium or a computer-readable medium. A processor in a computer reads computer-readable program code stored in the computer-readable medium, enabling the processor to execute the functional actions specified in each step or combination of steps in the above method; and to generate means for implementing the functional actions specified in each block or combination of blocks in the block diagram.
[0079] Computer-readable media include, but are not limited to, electronic, magnetic, optical, electromagnetic, infrared memory or semiconductor systems, devices or apparatuses, or any suitable combination thereof, wherein the memory is used to store program code or instructions, the program code including computer operation instructions, and the processor is used to execute the program code or instructions of the above-described methods stored in the memory.
[0080] The definitions of memory and processor can be found in the description of the foregoing computer device embodiments, and will not be repeated here.
[0081] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0082] In the various embodiments of this application, the functional units or modules 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. The integrated unit can be implemented in hardware or as a software functional unit.
[0083] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, 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. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0084] In the claims, any reference signs placed between parentheses should not be construed as limiting the claims. The word "comprising" as described in this application does not exclude the presence of elements or steps not listed in the claims. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. This application can be implemented by means of hardware comprising several different elements and by means of a suitably programmed computer. In the unit claims listing several means, several units of these means may be embodied by the same item of hardware. The use of "first," "second," and "third," etc., does not indicate any order and these words should be interpreted as names. Unless otherwise specified, the steps in the above embodiments should not be construed as limiting the order of execution.
[0085] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.< / nebulacontentpo>
Claims
1. A configurable business uniqueness verification method, characterized in that, include: Configure corresponding unique fields for the stored content in different types of databases; Receive operation processing requests for target data content; If the operation processing request for the target data content is used to describe an instruction to add content to the target data content, then the existence of a unique field for the target data content is detected in the corresponding database; if it exists, the metadata of the unique field is obtained, and the corresponding unique identifier value is extracted based on the metadata; if the unique identifier value is detected to be absent in the corresponding database, then the database-specific extended verification is performed on the unique identifier value to obtain the corresponding unique verification result. If the operation processing request for the target data content is used to describe an instruction to update the target data content, then the content update field of the target data content is obtained, and a unique update value is extracted based on the content update field; if it is detected that the unique update value is inconsistent with the unique identifier value corresponding to the target data content, then a database-specific extended verification is performed on the unique update value to obtain the corresponding uniqueness verification result.
2. The method according to claim 1, characterized in that, Extract the corresponding unique identifier value based on the metadata, including: If the unique identifier field defined in the metadata is a single field, then the field value corresponding to the single field is extracted from the target data content; and the field value corresponding to the single field is determined as the unique identifier value. If the unique identifier field defined in the metadata is a composite field, then the predefined subfield concatenation rules in the metadata are used to concatenate the field values corresponding to each subfield in the composite field in an orderly manner to obtain a composite string; and the composite string is determined to be the unique identifier value.
3. The method according to claim 1, characterized in that, Perform a database-specific extended validation on the unique identifier value to obtain the corresponding uniqueness validation result, including: Based on the business database type corresponding to the target data content, determine an extended verification rule base that matches the business database type corresponding to the target data content; A verification unit matching the corresponding database of the unique identifier value is selected from the extended verification rule base; the unique identifier value is extended and verified by the verification unit matching the corresponding database of the unique identifier value to obtain the corresponding uniqueness verification result.
4. The method according to claim 1, characterized in that, Extract unique update values from the updated fields based on the content, including: If the content update field belongs to a unique identifier related field, then the field value corresponding to the content update field is determined to be a unique update value; If the content update field corresponds to multiple associated fields, then the field values corresponding to each associated field are concatenated into strings according to a preset field combination order to obtain a unique update value.
5. The method according to claim 1, characterized in that, Perform a database-specific extended validation on the unique updated value to obtain the corresponding uniqueness validation result, including: Based on the business database type corresponding to the target data content, determine an extended verification rule base that matches the business database type corresponding to the target data content; A verification unit matching the database corresponding to the unique updated value is selected from the extended verification rule base; the unique updated value is then subjected to extended verification using the verification unit matching the database corresponding to the unique updated value, and the corresponding uniqueness verification result is obtained.
6. The method according to claim 1, characterized in that, Also includes: If the unique identifier value is detected to already exist in the corresponding database, a first warning message is generated; And / or; if a unique field for the target data content is detected to not exist in the corresponding database, then the unique field is mapped and stored in the unified content table of the corresponding database along with the target data content.
7. The method according to claim 1, characterized in that, Also includes: If the unique update value is detected to be consistent with the unique identifier value corresponding to the target data content, a second warning prompt is generated.
8. A configurable business uniqueness verification device, characterized in that, include: The configuration module is used to configure the corresponding unique fields for the stored content in different types of databases; The receiving module is used to receive operation processing requests for the target data content; The first verification module is used to detect whether a unique field of the target data content exists in the corresponding database if the operation processing request of the target data content describes an instruction to add content to the target data content; if it exists, the module obtains the metadata of the unique field and extracts the corresponding unique identifier value based on the metadata; if the module detects that the unique identifier value does not exist in the corresponding database, the module performs a database-specific extended verification on the unique identifier value to obtain the corresponding unique verification result. The second verification module is used to obtain the content update field of the target data content if the operation processing request of the target data content is used to describe the content update instruction of the target data content, and extract a unique update value based on the content update field; if it is detected that the unique update value is inconsistent with the unique identifier value corresponding to the target data content, then perform a corresponding database-specific extended verification on the unique update value to obtain the corresponding uniqueness verification result.
9. A computer device, characterized in that, It includes a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the configurable business uniqueness verification method as described in any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When a computer program is executed by a processor, it implements the configurable business uniqueness verification method as described in any one of claims 1 to 7.