A data classification updating method, an updating device and a terminal device
By introducing a status field and a pre-defined thesaurus for fuzzy matching in the database, combined with distributed locks and caching mechanisms, the problem of low efficiency in data classification and updating is solved, achieving efficient and accurate data classification and updating.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHENZHEN ZHONGDIAN INT INFORMATION TECH CO LTD
- Filing Date
- 2022-06-27
- Publication Date
- 2026-06-12
AI Technical Summary
Existing technologies have low efficiency in data classification and updating, requiring the traversal of all data in the database for update processing, which is extremely inefficient, especially with large data volumes.
By introducing a status field in the database to identify data that has not yet been classified and updated, a pre-defined thesaurus is used to fuzzy match the current classification as the standard classification, a distributed lock is used to prevent update conflicts, and updated data is cached to improve efficiency.
It improves the efficiency of data classification and updating, reduces the need for full-scale retrieval, optimizes processing volume, prevents data loss and update conflicts, and ensures the accuracy and consistency of classification and updating.
Smart Images

Figure CN115145932B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the technical field of databases, and in particular relates to a data classification and updating method, updating device and terminal equipment. Background Technology
[0002] A database is an organized, shareable collection of data that is stored permanently on a computer. Because databases typically store massive amounts of data, the data is usually categorized to facilitate CRUD operations such as adding, deleting, modifying, and querying.
[0003] However, in some database applications, data classification needs to be updated frequently. Traditional classification update methods often require traversing all data in the database and updating only the data whose classification needs to be updated. Obviously, since only a portion of the data needs to be classified and updated, the update efficiency is low. Summary of the Invention
[0004] In view of this, embodiments of this application provide a data classification update method, update apparatus, and terminal device to solve the technical problem of low data classification update efficiency.
[0005] The first aspect of this application provides a data classification update method, including:
[0006] Extract the data to be updated from the database whose status field has a first value; the first value of the status field indicates that the data to be updated has not completed the category update; the data to be updated includes the current category corresponding to the data to be updated.
[0007] The standard category corresponding to the current category is fuzzily matched in the preset vocabulary.
[0008] The current category of the data to be updated is updated to the standard category, and the status field is updated to the second value to obtain the updated data to be updated; the second value is used to indicate that the data to be updated has completed the category update.
[0009] Furthermore, the step of fuzzy matching the standard category corresponding to the current category in the preset thesaurus includes:
[0010] The category with the longest consecutive identical character among all categories in the preset dictionary is taken as the standard category corresponding to the current category; the longest consecutive identical character refers to the longest consecutive character that is the same as the character in the current category.
[0011] Furthermore, before selecting the category with the longest consecutive identical characters from all categories in the preset vocabulary as the standard category corresponding to the current category, the method further includes:
[0012] Obtain the original lexicon, initialize the original lexicon to obtain the preset lexicon; the initialization process refers to checking whether all categories in the original lexicon have been updated, and performing corresponding update processing.
[0013] Further, after updating the current category of the data to be updated to the standard category and updating the status field to the second value to obtain the updated data to be updated, the method further includes:
[0014] When the data to be updated needs to be updated again, retrieve the data to be updated from the cache of the non-relational database;
[0015] If the data to be updated is not found in the cache, then the data to be updated is retrieved from the relational database.
[0016] Further, updating the current category of the data to be updated to the standard category and updating the status field to the second value to obtain the updated data to be updated includes:
[0017] Based on the distributed lock in the non-relational database, the current update permission is locked;
[0018] Based on the update permission, the current category of the data to be updated is updated to the standard category, and the status field is updated to the second value, thus obtaining the updated data to be updated.
[0019] Furthermore, the method also includes:
[0020] If the first category in the preset thesaurus changes, the status field of the data corresponding to the first category in the relational database or non-relational database will be updated to the first value.
[0021] Further, the step of extracting the data to be updated from the database whose status field has a first value includes:
[0022] Obtain the current category of the data to be updated;
[0023] According to the preset pagination value, the data to be updated under the current category is retrieved sequentially from the relational database; the preset pagination value refers to the number of data retrieved each time.
[0024] A second aspect of this application provides a data classification update apparatus, comprising:
[0025] An extraction unit is used to extract data to be updated from the database whose status field has a first value; the first value of the status field indicates that the data to be updated has not been classified and updated; the data to be updated includes the current category corresponding to the data to be updated.
[0026] The matching unit is used to perform fuzzy matching of the standard category corresponding to the current category in a preset lexicon;
[0027] An update unit is used to update the current classification of the data to be updated to the standard classification and update the status field to a second value to obtain the updated data to be updated; the second value is used to indicate that the data to be updated has completed the classification update.
[0028] A third aspect of this application provides a terminal device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the method described in the first aspect.
[0029] A fourth aspect of this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the method described in the first aspect.
[0030] The beneficial effects of this application embodiment compared with the prior art are as follows: In this invention, data to be updated with a status field of a first value is extracted from the database; the first value of the status field indicates that the data to be updated has not completed classification update; the data to be updated includes the current category corresponding to the data to be updated; a standard category corresponding to the current category is matched in a preset vocabulary; the current category of the data to be updated is updated to the standard category, and the status field is updated to a second value, resulting in updated data to be updated; the second value indicates that the data to be updated has completed classification update. Since the above solution can specifically extract data to be updated that has not completed classification update from the database, it is not necessary to perform a full search in the database (i.e., traverse all data in the database), but only needs to perform classification update within the range of the first value of the status field. Furthermore, this invention matches a unified standard category to the data to be updated based on preset vocabulary, updates the current category of the data to be updated to the standard category, and then updates the status field to the second value. In subsequent classification updates, it is not necessary to traverse the data to be updated, thus improving the efficiency of classification updates. Attached Figure Description
[0031] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0032] Figure 1A schematic flowchart of a data classification update method provided in this application is shown;
[0033] Figure 2 A schematic flowchart illustrating step 101 of a data classification update method provided in this application is shown.
[0034] Figure 3 A schematic flowchart illustrating step 102 of a data classification update method provided in this application is shown.
[0035] Figure 4 A schematic flowchart illustrating step 103 of a data classification update method provided in this application is shown.
[0036] Figure 5 A schematic flowchart of another data classification update method provided in this application is shown;
[0037] Figure 6 A schematic flowchart of another data classification update method provided in this application is shown;
[0038] Figure 7 A schematic diagram of a data classification update device provided in this application is shown;
[0039] Figure 8 This is a schematic diagram of a terminal device provided in an embodiment of the present invention. Detailed Implementation
[0040] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.
[0041] To better understand the technical solution of this invention, the background technology is explained below:
[0042] Existing techniques often require traversing all data in the database and updating the data whose categories need updating. The update process is as follows: First, the maximum and minimum IDs are retrieved. Then, a certain value, such as 500, is added to the minimum ID. Next, the data whose categories need updating is extracted within this range, and the categories are updated. This process is repeated until the IDs reach the maximum ID limit.
[0043] The drawback of existing technology is that searching for data to be updated in a category using the maximum and minimum IDs increases unnecessary database lookups. This has a relatively small impact on small datasets, but it significantly reduces the efficiency of the update process for large datasets.
[0044] In view of this, embodiments of this application provide a data classification update method, update apparatus, terminal device, and computer-readable storage medium to solve the technical problem of low data classification update efficiency.
[0045] First, this application provides a method for updating data classification. Please see [link to relevant documentation]. Figure 1 , Figure 1 A schematic flowchart of a data classification update method provided in this application is shown. Figure 1 As shown, this query method may include the following steps:
[0046] Step 101: Extract the data to be updated from the database whose status field has a first value; the first value of the status field is used to indicate that the data to be updated has not completed the category update; the data to be updated includes the current category corresponding to the data to be updated.
[0047] In some exemplary application scenarios, such as material data stored in a database, the classification of material data needs to be changed based on factors such as warehouse changes or seasonal changes. However, updating all categories of massive amounts of material data is inefficient. Therefore, this invention adds a status field to the database to indicate whether each data entry has been updated. This allows the terminal device to retrieve the unupdated data under a specific category from the database without having to traverse every single data entry.
[0048] The status field includes, but is not limited to, two types of field values: a first value and a second value. The first value indicates that the data to be updated has not yet been categorized and updated, while the second value indicates that the data to be updated has been categorized and updated.
[0049] Databases include relational databases and non-relational databases. Relational databases include, but are not limited to, one or a combination of databases such as SQL, DB2, or Oracle. Non-relational databases include, but are not limited to, one or a combination of databases such as Redis and NoSQL.
[0050] Each execution of steps 101 to 103 involves updating a specific category. It's understood that the terminal device retrieves the data to be updated from the relational database based on two judgment logics: ① whether it belongs to the current category (the current category refers to the category that needs updating) and ② whether the status field is the first value. Only when the data belongs to the current category and the status field is the first value is the data confirmed as data to be updated and extracted.
[0051] Specifically, step 101 further includes steps 1011 to 1012. Figure 2 A schematic flowchart illustrating step 101 of a data classification update method provided in this application is shown. Figure 2 As shown, step 101 includes steps 1011 to 1012:
[0052] Step 1011: Obtain the current category of the data to be updated.
[0053] Since each execution of steps 101 to 103 is an update for a single category, it is necessary to first determine the current category of the data to be updated.
[0054] Step 1012: According to the preset pagination value, retrieve the data to be updated under the current category from the relational database in sequence; the preset pagination value refers to the number of data retrieved each time.
[0055] Retrieving all data corresponding to the current category from the database at once involves a large processing volume and is prone to data loss. Therefore, this invention pre-sets a preset pagination value for each data retrieval, where the preset pagination value refers to the number of data items retrieved each time. Data is retrieved from the database in stages according to the preset pagination value until the number of remaining unretrieved data items is less than the preset pagination value.
[0056] In this embodiment, data to be updated is extracted by pre-setting pagination values, which can avoid data loss and optimize processing volume.
[0057] Step 102: Perform fuzzy matching of the standard category corresponding to the current category in the preset vocabulary.
[0058] Because the data stored in the database comes from diverse and disorganized sources, some data is classified irregularly, failing to meet current classification standards. To address this disorganization, this invention utilizes a pre-defined lexicon to standardize the irregular classifications, mapping them to standard categories. The pre-defined lexicon stores standard categories. During step 102, the current category is fuzzily matched with the standard categories in the pre-defined lexicon to obtain the corresponding standard category. The fuzzy matching process is as follows:
[0059] Specifically, step 102 further includes steps 1021 to 1022. Figure 3 A schematic flowchart illustrating step 102 of a data classification update method provided in this application is shown. Figure 3 As shown, step 102 includes steps 1021 to 1022:
[0060] Step 1021: Obtain the original lexicon and initialize it to obtain the preset lexicon; the initialization process refers to checking whether all categories in the original lexicon have been updated and performing corresponding update processing.
[0061] To prevent discrepancies between the updated categories and the actual categories in the dictionary, a pre-initialization process is required before using the dictionary. This involves checking if any categories in the original dictionary have been updated. If any categories in the original dictionary require updating, the original dictionary is updated to obtain the pre-set dictionary. Otherwise, all categories in the original dictionary do not require updating, and the original dictionary is used directly as the pre-set dictionary.
[0062] Step 1022: Take the category with the longest consecutive identical characters among all categories in the preset dictionary as the standard category corresponding to the current category; the longest consecutive identical characters refer to the longest consecutive characters that are the same as the characters in the current category.
[0063] Fuzzy matching refers to determining whether two pairs of characters are partially or completely identical. The category with the longest consecutive identical characters is used as the standard category corresponding to the current category.
[0064] The terminal device compares all categories in the preset dictionary with the current category and selects the category with the longest consecutive identical characters as the standard category corresponding to the current category. The longest consecutive identical characters refer to the longest consecutive characters similar to the current category.
[0065] For example, assuming the current category is "phone panel," the preset dictionary includes categories such as casing, physical buttons, circuit board, and screen panel. There are 0 consecutive similar characters between "phone panel" and "phone casing," 0 consecutive similar characters between "physical buttons" and "phone panel," 1 consecutive similar character between "circuit board" and "phone panel," and 2 consecutive similar characters between "screen panel" and "phone panel." Therefore, "phone panel" has the longest consecutive similar character count, and is thus chosen as the standard category. It is understood that the above process is merely an example, and no limitations are placed on the names and number of entries in the dictionary or the current category.
[0066] As an optional embodiment of the present invention, after fuzzy matching of the standard category corresponding to the current category in the preset dictionary, the mapping relationship between the current category and the standard category can be stored in the cache for use in the next category update. That is, when the current category is updated next time, there is no need to repeat fuzzy matching in the preset dictionary; it can be retrieved directly from the cache.
[0067] This embodiment avoids discrepancies in the classification of data to be updated by initializing the original lexicon before fuzzy matching.
[0068] Step 103: Update the current category of the data to be updated to the standard category, and update the status field to the second value to obtain the updated data to be updated; the second value is used to indicate that the data to be updated has completed the category update.
[0069] To avoid retracing the updated data during subsequent category updates, the terminal device updates the status field to the second value.
[0070] Specifically, step 103 further includes steps 1031 to 1032. Figure 4 A schematic flowchart illustrating step 103 of a data classification update method provided in this application is shown. Figure 4 As shown, step 103 includes steps 1031 to 1032:
[0071] Step 1031: Lock the current update permission based on the distributed lock in the non-relational database.
[0072] Since databases are often distributed, multiple users exist. If multiple users perform category updates simultaneously, update conflicts or errors can easily occur. Therefore, to avoid the above situation, this application uses distributed locks in non-relational databases to lock the current update permissions.
[0073] Step 1032: Based on the update permission, update the current category of the data to be updated to the standard category, and update the status field to the second value to obtain the updated data to be updated.
[0074] This embodiment uses a distributed lock to lock the current update permissions, effectively preventing update conflicts or errors.
[0075] In this embodiment, data to be updated with a status field of a first value is extracted from the database. The first value of the status field indicates that the data to be updated has not yet completed its classification update. The data to be updated includes the current classification corresponding to the data to be updated. A standard classification corresponding to the current classification is matched using a preset vocabulary. The current classification of the data to be updated is updated to the standard classification, and the status field is updated to a second value, resulting in updated data to be updated. The second value indicates that the data to be updated has completed its classification update. Since the above scheme can specifically extract data to be updated that has not yet completed its classification update from the database, it is not necessary to perform a full search of the database (i.e., traverse all data in the database), but only needs to perform classification updates within the range of data with the first value of the status field. Furthermore, this invention matches a unified standard classification to the data to be updated based on a preset vocabulary, updates the current classification of the data to be updated to the standard classification, and then updates the status field to the second value. In subsequent classification updates, it is not necessary to traverse the data to be updated, thus improving the efficiency of classification updates.
[0076] Optionally, steps 104 to 105 are included after step 103. See also... Figure 5 , Figure 5 A schematic flowchart of another data classification update method provided in this application is shown.
[0077] Step 101: Extract the data to be updated from the database whose status field has a first value; the first value of the status field is used to indicate that the data to be updated has not completed the category update; the data to be updated includes the current category corresponding to the data to be updated.
[0078] Step 102: Perform fuzzy matching of the standard category corresponding to the current category in the preset vocabulary.
[0079] Step 103: Update the current category of the data to be updated to the standard category, and update the status field to the second value to obtain the updated data to be updated; the second value is used to indicate that the data to be updated has completed the category update.
[0080] Step 104: When the data to be updated needs to be updated again, retrieve the data to be updated from the cache of the non-relational database.
[0081] To further improve the efficiency of data classification updates, this embodiment caches the updated data to be updated in a non-relational database and persists it in a relational database. This allows the updated data to be retrieved directly from the cache during the next update. Compared to relational databases, non-relational databases have higher read efficiency, thus improving update efficiency.
[0082] As an optional embodiment of the present invention, during subsequent updates, the data to be updated can be retrieved first from the cache of the non-relational database. If the data to be updated is not retrieved from the cache, then the data to be updated is retrieved from the relational database.
[0083] When the data to be updated needs to be updated again, retrieve the data to be updated from the cache of the non-relational database.
[0084] Step 105: If the data to be updated is not found in the cache, retrieve the data to be updated from the relational database.
[0085] Since the storage time of the cache in a non-relational database is limited, if the data to be updated is not retrieved from the cache, the data to be updated is retrieved from the relational database.
[0086] In this embodiment, by caching the updated data to be updated in a non-relational database, the update efficiency can be improved because the non-relational database has higher read efficiency compared to the relational database.
[0087] Optionally, step 106 may be included before or after any step. See also... Figure 6 , Figure 6 A schematic flowchart of another data classification update method provided in this application is shown.
[0088] Step 101: Extract the data to be updated from the database whose status field has a first value; the first value of the status field is used to indicate that the data to be updated has not completed the category update; the data to be updated includes the current category corresponding to the data to be updated.
[0089] Step 102: Perform fuzzy matching of the standard category corresponding to the current category in the preset vocabulary.
[0090] Step 103: Update the current category of the data to be updated to the standard category, and update the status field to the second value to obtain the updated data to be updated; the second value is used to indicate that the data to be updated has completed the category update.
[0091] Step 106: If the first category in the preset lexicon changes, the status field of the data corresponding to the first category in the relational database or non-relational database is updated to the first value.
[0092] To ensure consistency across all categories in the database, this invention updates the status field of the data corresponding to the first category in either the relational or non-relational database to a first value when the first category changes. This means the data re-enters the unupdated state for update processing. The first value indicates that the data to be updated has not yet undergone category updating.
[0093] It is understandable that, regarding the execution order of step 106, step 106 can be executed before or after any other step, and is not affected by other steps.
[0094] In this embodiment, by updating the status field to the first value when the first category changes, the consistency of all categories in the database can be guaranteed.
[0095] like Figure 7 This application provides a data classification update device 7, please refer to [link to device 7]. Figure 7 , Figure 7 A schematic diagram of a data classification update device provided in this application is shown, such as... Figure 7 The data classification update device shown includes:
[0096] Extraction unit 71 is used to extract data to be updated from the database whose status field has a first value; the first value of the status field is used to indicate that the data to be updated has not completed the category update; the data to be updated includes the current category corresponding to the data to be updated;
[0097] Matching unit 72 is used to perform fuzzy matching of the standard category corresponding to the current category in a preset lexicon;
[0098] The update unit 73 is used to update the current classification of the data to be updated to the standard classification and update the status field to the second value to obtain the updated data to be updated; the second value is used to indicate that the data to be updated has completed the classification update.
[0099] This application provides a data classification update device that extracts data to be updated from a database with a status field having a first value. The first value of the status field indicates that the data to be updated has not yet completed classification updates. The data to be updated includes the current category corresponding to the data to be updated. A standard category corresponding to the current category is matched using fuzzy matching in a preset vocabulary. The current category of the data to be updated is updated to the standard category, and the status field is updated to a second value to obtain the updated data to be updated. The second value indicates that the data to be updated has completed classification updates. Because the above solution can specifically extract data to be updated that has not yet completed classification updates from the database, it is not necessary to perform a full search in the database (i.e., traverse all data in the database), but only needs to perform classification updates within the range of the first value of the status field. Furthermore, this invention matches a unified standard category to the data to be updated based on a preset vocabulary, updates the current category of the data to be updated to the standard category, and then updates the status field to the second value. In subsequent classification updates, it is not necessary to traverse the data to be updated, thus improving the efficiency of classification updates.
[0100] Figure 8This is a schematic diagram of a terminal device provided in an embodiment of the present invention. Figure 8 As shown, a terminal device 8 in this embodiment includes: a processor 80, a memory 81, and a computer program 82 stored in the memory 81 and executable on the processor 80, such as a data classification update method program. When the processor 80 executes the computer program 82, it implements the steps in the various embodiments of the data classification update method described above, for example... Figure 1 Steps 101 to 103 are shown. Alternatively, when the processor 80 executes the computer program 82, it implements the functions of each unit in the above-described device embodiments, for example... Figure 7 The functions of units 71 to 73 are shown.
[0101] For example, the computer program 82 can be divided into one or more units, which are stored in the memory 81 and executed by the processor 80 to complete the present invention. The one or more units can be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of the computer program 82 in the terminal device 8. For example, the specific functions of each unit of the computer program 82 can be divided as follows:
[0102] An extraction unit is used to extract data to be updated from the database whose status field has a first value; the first value of the status field indicates that the data to be updated has not been classified and updated; the data to be updated includes the current category corresponding to the data to be updated.
[0103] The matching unit is used to perform fuzzy matching of the standard category corresponding to the current category in a preset lexicon;
[0104] An update unit is used to update the current classification of the data to be updated to the standard classification and update the status field to a second value to obtain the updated data to be updated; the second value is used to indicate that the data to be updated has completed the classification update.
[0105] The terminal device includes, but is not limited to, a processor 80 and a memory 81. Those skilled in the art will understand that... Figure 8 This is merely an example of a terminal device 8 and does not constitute a limitation on a terminal device 8. It may include more or fewer components than shown, or combine certain components, or different components. For example, the terminal device may also include input / output devices, network access devices, buses, etc.
[0106] The processor 80 can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor.
[0107] The memory 81 can be an internal storage unit of the terminal device 8, such as a hard disk or memory of the terminal device 8. The memory 81 can also be an external storage device of the terminal device 8, such as a plug-in hard disk, Smart Media Card (SMC), Secure Digital (SD) card, or Flash Card equipped on the terminal device 8. Furthermore, the memory 81 can include both internal and external storage units of the terminal device 8. The memory 81 is used to store the computer program and other programs and data required by the roaming control device. The memory 81 can also be used to temporarily store data that has been output or will be output.
[0108] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0109] It should be noted that the information interaction and execution process between the above-mentioned devices / units are based on the same concept as the method embodiments of this application. For details on their specific functions and technical effects, please refer to the method embodiments section, and they will not be repeated here.
[0110] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments 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. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0111] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps described in the various method embodiments above.
[0112] This application provides a computer program product that, when run on a mobile terminal, enables the mobile terminal to implement the steps described in the above-described method embodiments.
[0113] 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, all or part of the processes in the methods of the above embodiments of this application can be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include at least: any entity or device capable of carrying computer program code to a photographic device / terminal device, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium. Examples include USB flash drives, portable hard drives, magnetic disks, or optical disks. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electrical carrier signals or telecommunication signals.
[0114] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0115] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0116] In the embodiments provided in this application, it should be understood that the disclosed apparatus / network devices and methods can be implemented in other ways. For example, the apparatus / network device 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 devices or units may be electrical, mechanical, or other forms.
[0117] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; they may be located in one place or distributed across multiple network units.
[0118] It should be understood that, when used in this application specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or a collection thereof.
[0119] It should also be understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0120] As used in this application specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrase "if determined" or "if [the described condition or event] is detected" may be interpreted, depending on the context, as "once determined," "in response to determination," "once [the described condition or event] is detected," or "in response to detection of [the described condition or event]."
[0121] Furthermore, in the description of this application and the appended claims, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0122] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.
[0123] The above-described 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, and should all be included within the protection scope of this application.
Claims
1. A method of updating a data classification, characterized by, The update method includes: Extract the data to be updated from the database whose status field has a first value; the first value of the status field indicates that the data to be updated has not completed the category update; the data to be updated includes the current category corresponding to the data to be updated. The standard category corresponding to the current category is fuzzily matched in the preset vocabulary. The current category of the data to be updated is updated to the standard category, and the status field is updated to the second value to obtain the updated data to be updated; the second value is used to indicate that the data to be updated has completed the category update. The step of fuzzy matching the standard category corresponding to the current category in the preset lexicon includes: The category with the longest consecutive identical character among all categories in the preset vocabulary is taken as the standard category corresponding to the current category; the longest consecutive identical character refers to the longest consecutive character that is the same as the character in the current category; The step of selecting the category with the longest consecutive identical characters from all categories in the preset vocabulary as the standard category corresponding to the current category further includes: Obtain the original lexicon, initialize the original lexicon to obtain the preset lexicon; the initialization process refers to checking whether all categories in the original lexicon have been updated, and performing corresponding update processing; If the first category in the preset thesaurus changes, the status field of the data corresponding to the first category in the relational database or non-relational database will be updated to the first value.
2. The update method as described in claim 1, characterized in that, After updating the current category of the data to be updated to the standard category and updating the status field to the second value to obtain the updated data to be updated, the process further includes: When the data to be updated needs to be updated again, retrieve the data to be updated from the cache of the non-relational database; If the data to be updated is not found in the cache, then the data to be updated is retrieved from the relational database.
3. The update method as described in claim 1, characterized in that, The step of updating the current category of the data to be updated to the standard category and updating the status field to the second value to obtain the updated data to be updated includes: Based on the distributed lock in the non-relational database, the current update permission is locked; Based on the update permission, the current category of the data to be updated is updated to the standard category, and the status field is updated to the second value, thus obtaining the updated data to be updated.
4. The update method as described in claim 1, characterized in that, The step of retrieving the data to be updated from the database whose status field has the first value includes: Obtain the current category of the data to be updated; According to the preset pagination value, the data to be updated under the current category is retrieved sequentially from the relational database; the preset pagination value refers to the number of data retrieved each time.
5. A data classification and updating device, characterized in that, The updating device includes: An extraction unit is used to extract data to be updated from the database whose status field has a first value; the first value of the status field indicates that the data to be updated has not been classified and updated; the data to be updated includes the current category corresponding to the data to be updated. The matching unit is used to perform fuzzy matching of the standard category corresponding to the current category in a preset lexicon; An update unit is used to update the current classification of the data to be updated to the standard classification, and update the status field to a second value, thereby obtaining the updated data to be updated; the second value is used to indicate that the data to be updated has completed the classification update; The matching unit is further configured to take the category with the longest consecutive identical characters among all categories in the preset vocabulary as the standard category corresponding to the current category; the longest consecutive identical characters refer to the longest consecutive characters that are the same as the characters in the current category; The matching unit is also used to obtain the original lexicon, initialize the original lexicon to obtain the preset lexicon; the initialization process refers to checking whether all categories in the original lexicon have been updated and performing corresponding update processing. The update unit is further configured to update the status field of the data corresponding to the first category in the relational database or non-relational database to the first value if the first category in the preset lexicon changes.
6. A terminal device, comprising a camera module, a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method as described in any one of claims 1 to 4.
7. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method as described in any one of claims 1 to 4.