Annotation processing method, device, equipment, storage medium and program product
By automatically comparing and updating the annotation information in the entity class code and the database table, the problem of low efficiency in annotation information processing in the existing technology is solved, and the processing efficiency in the code development process is improved.
Patent Information
- Application Number
- CN202210457611.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-27
- Publication Date
- 2025-09-09
- Estimated Expiration
- 2042-04-27
AI Technical Summary
In the prior art, the processing efficiency of annotation information in entity class codes and corresponding database tables is low and requires a lot of manual intervention.
By obtaining the first annotation information associated with the field information in the entity class code and comparing it with the second annotation information in the database table, the inconsistent annotation information is automatically updated to keep the annotation information in the entity class code and the database table consistent.
It achieves automatic consistency between the annotation information in the entity class code and the database table, and improves the efficiency of annotation information processing during the code development process.
Smart Images

Figure CN114880021B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to an annotation processing method, an annotation processing device, an electronic device, a computer-readable storage medium, and a computer program product. Background Art
[0002] In the field of software development, a large amount of data and information is involved. Developers can write entity class codes that have a mapping relationship with the database table structure. When the developed system or software is put into online application, the entity class can be used to transfer data in different modules to realize the functions of the system or software.
[0003] Generally speaking, code development is not completed in one go, and the code needs to be debugged and modified. Modifications to entity class codes should also be reflected in the database table corresponding to the entity class code.
[0004] In related technologies, after developers modify entity class codes, especially annotation information in the entity class codes, they usually need to manually modify the database table corresponding to the entity class codes, which results in low efficiency in processing annotation information. Summary of the Invention
[0005] The present disclosure provides an annotation processing method, apparatus, device, storage medium, and program product to solve the problem of low efficiency in processing annotation information in entity class codes and corresponding database tables in related technologies. The technical solution of the present disclosure is as follows:
[0006] According to a first aspect of an embodiment of the present disclosure, there is provided a method for processing annotations, the method being applied to a user terminal and comprising:
[0007] Obtain a code file to be processed, wherein the code file includes entity class code, and the entity class code includes field information;
[0008] If it is determined that the entity class code contains first annotation information associated with the field information, obtaining second annotation information associated with the field information in the database table corresponding to the entity class code;
[0009] If it is determined that the second annotation information is different from the first annotation information, the non-target annotation information is updated according to the target annotation information, the target annotation information is one of the first annotation information and the second annotation information, and the non-target annotation information is the annotation information of the first annotation information and the second annotation information other than the target annotation information.
[0010] Optionally, before updating the non-target annotation information according to the target annotation information, the method further includes:
[0011] Target annotation information is determined from the first annotation information and the second annotation information.
[0012] Optionally, determining target annotation information in the first annotation information and the second annotation information includes:
[0013] Obtaining the generation time of the first annotation information and the generation time of the second annotation information;
[0014] The annotation information corresponding to the latest generation time is determined as the target annotation information.
[0015] Optionally, determining target annotation information in the first annotation information and the second annotation information includes:
[0016] Displaying annotation update prompt information, wherein the annotation update prompt information includes multiple annotation update methods;
[0017] In response to the selection operation of the annotation update method, target annotation information corresponding to the selection operation of the annotation update method is determined in the first annotation information and the second annotation information.
[0018] Optionally, the target annotation information is the first annotation information, and updating the non-target annotation information according to the target annotation information includes:
[0019] generating an annotation information update instruction according to the first annotation information;
[0020] The annotation information update instruction is sent to a database server, so that the database server updates the second annotation information associated with the field information in the database table corresponding to the entity class code according to the first annotation information in the annotation information update instruction.
[0021] Optionally, the target annotation information is the second annotation information, and updating the non-target annotation information according to the target annotation information includes:
[0022] According to the second annotation information, the first annotation information associated with the field information in the entity class code is updated.
[0023] Optionally, after determining that first annotation information associated with the field information exists in the entity class code, the method further includes:
[0024] If it is determined that the second annotation information associated with the field information does not exist in the database table corresponding to the entity class code, the first annotation information is stored in the database table to obtain the second annotation information associated with the field information.
[0025] According to a second aspect of an embodiment of the present disclosure, there is provided an annotation processing device, which is applied to a user terminal and includes:
[0026] A first acquisition module is configured to acquire a code file to be processed, wherein the code file includes entity class code, and the entity class code includes field information;
[0027] A second acquisition module is configured to acquire, if it is determined that the entity class code contains first annotation information associated with the field information, second annotation information associated with the field information in a database table corresponding to the entity class code;
[0028] The update module is configured to update the non-target annotation information according to the target annotation information if it is determined that the second annotation information is different from the first annotation information, the target annotation information is one of the first annotation information and the second annotation information, and the non-target annotation information is the annotation information of the first annotation information and the second annotation information other than the target annotation information.
[0029] Optionally, the device further includes a determining module configured to:
[0030] Target annotation information is determined from the first annotation information and the second annotation information.
[0031] Optionally, the determining module is configured to:
[0032] Obtaining the generation time of the first annotation information and the generation time of the second annotation information;
[0033] The annotation information corresponding to the latest generation time is determined as the target annotation information, and the non-target annotation information is updated according to the target annotation information.
[0034] Optionally, the determining module is configured to:
[0035] Displaying annotation update prompt information, wherein the annotation update prompt information includes multiple annotation update methods;
[0036] In response to the selection operation of the annotation update method, target annotation information corresponding to the selection operation of the annotation update method is determined in the first annotation information and the second annotation information.
[0037] Optionally, the target annotation information is the first annotation information, and the updating module is configured to:
[0038] generating an annotation information update instruction according to the first annotation information;
[0039] The annotation information update instruction is sent to a database server, so that the database server updates the second annotation information associated with the field information in the database table corresponding to the entity class code according to the first annotation information in the annotation information update instruction.
[0040] Optionally, the target annotation information is the second annotation information, and the updating module is configured to:
[0041] According to the second annotation information, the first annotation information associated with the field information in the entity class code is updated.
[0042] Optionally, the device further includes a storage module configured to:
[0043] If it is determined that the second annotation information associated with the field information does not exist in the database table corresponding to the entity class code, the first annotation information is stored in the database table to obtain the second annotation information associated with the field information.
[0044] According to a third aspect of an embodiment of the present disclosure, there is provided an electronic device, including:
[0045] processor;
[0046] a memory for storing instructions executable by the processor;
[0047] The processor is configured to execute the instructions to implement the annotation processing method as described in the first aspect.
[0048] According to a fourth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided. When instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform the annotation processing method as described in the first aspect.
[0049] According to a fifth aspect of an embodiment of the present disclosure, a computer program product is provided, comprising a computer program, wherein when the computer program is executed by a processor, the annotation processing method as described in the first aspect is implemented.
[0050] The technical solutions provided by the embodiments of the present disclosure bring at least the following beneficial effects:
[0051] The disclosed embodiments provide an annotation processing method, apparatus, device, storage medium, and program product. The annotation processing method can obtain entity class code in a code file to be processed. If there is first annotation information associated with field information in the entity class code, then second annotation information associated with the field information is obtained in the database table corresponding to the entity class code; if it is determined that the second annotation information is different from the first annotation information, then the non-target annotation information is updated according to the target annotation information. When the annotation information in the entity class code or the database table corresponding to the entity class code changes, the annotation information in the entity class code and the database table corresponding to the entity class code can be automatically kept consistent, thereby improving the processing efficiency of annotation information during code development.
[0052] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] The accompanying drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute an improper limitation of the present disclosure.
[0054] Figure 1 It is a schematic architecture diagram of an annotation processing system according to an exemplary embodiment.
[0055] Figure 2 The figure is a flowchart showing a method for processing annotations according to an exemplary embodiment.
[0056] Figure 3 The flowchart of another annotation processing method is shown according to an exemplary embodiment.
[0057] Figure 4 is a flowchart showing another annotation processing method according to an exemplary embodiment.
[0058] Figure 5 It is a block diagram of an annotation processing apparatus according to an exemplary embodiment.
[0059] Figure 6 The figure is a schematic structural diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION
[0060] In order to enable ordinary persons in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
[0061] It should be noted that the terms "first," "second," and the like in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or precedence. It should be understood that the numbers used in this manner are interchangeable where appropriate so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure as detailed in the appended claims.
[0062] An exemplary embodiment of the present disclosure provides an annotation processing system. Figure 1 The schematic architecture diagram of the annotation processing system is shown in FIG. Figure 1 As shown, the annotation processing system 100 may include a user terminal 110 and a database server 120. The user terminal 120 may be a terminal device used by a developer, such as a computer, tablet, or laptop. The database server 120 may be used to establish corresponding database tables for entity class codes in program code written by the developer. The user terminal 110 may establish a connection with the database server 120. When the developer writes program code using the user terminal 110, the database server 120 may provide relevant data storage services for the database tables corresponding to the entity class codes in the program code.
[0063] The user terminal 110 may obtain a code file to be processed, which includes an entity class code. If the user terminal 110 determines that the entity class code contains first annotation information associated with field information in the entity class code, the user terminal 110 may send an annotation information acquisition request to the database server 120. After receiving the annotation information acquisition request, the database server 120 may obtain second annotation information associated with the field information in the database table corresponding to the entity class code and send the second annotation information to the user terminal 110. The user terminal 110 may receive the second annotation information sent by the database server 120, and if it is determined that the second annotation information is different from the first annotation information, the user terminal 110 may update the non-target annotation information according to the target annotation information. The target annotation information is one of the first annotation information and the second annotation information, and the non-target annotation information is annotation information other than the target annotation information in the first annotation information and the second annotation information.
[0064] In an optional embodiment, the target annotation information is the first annotation information. The process of the user terminal 110 updating the non-target annotation information according to the target annotation information may include: generating an annotation information update instruction according to the first annotation information; and sending the annotation information update instruction to the database server 120. After the database server 120 receives the annotation information update instruction, it updates the second annotation information associated with the field information in the database table corresponding to the entity class code according to the first annotation information.
[0065] Figure 2 is a flowchart showing a method for processing annotations according to an exemplary embodiment. Figure 2 As shown, the annotation processing method is used in a user terminal, and the annotation processing method may include the following steps S201 to S203:
[0066] Step S201: Obtain the code file to be processed.
[0067] In an embodiment of the present disclosure, the code file includes entity class code; the entity class code may include an entity class name and field information, the entity class name is used to identify the entity class code of the code file, the field information may include a field name and a corresponding field type, the field name is used to indicate the information that can be recorded by the field; the field type is used to indicate the data type of the information that can be recorded by the field corresponding to the field name.
[0068] Step S202: If it is determined that the entity class code contains first annotation information associated with the field information, then second annotation information associated with the field information is obtained from the database table corresponding to the entity class code.
[0069] In the embodiment of the present disclosure, the first annotation information is the annotation information associated with the field information in the entity class code, and the second annotation information is the annotation information associated with the field information in the database table.
[0070] Step S203: If it is determined that the second annotation information is different from the first annotation information, the non-target annotation information is updated according to the target annotation information.
[0071] In the embodiment of the present disclosure, the target annotation information is one of the first annotation information and the second annotation information, and the non-target annotation information is annotation information other than the target annotation information in the first annotation information and the second annotation information.
[0072] In summary, the annotation processing method provided by the embodiments of the present disclosure can obtain entity class code in the code file to be processed. If first annotation information associated with field information exists in the entity class code, second annotation information associated with the field information is obtained in the database table corresponding to the entity class code. If it is determined that the second annotation information is different from the first annotation information, the non-target annotation information is updated according to the target annotation information. When the annotation information in the entity class code or the database table corresponding to the entity class code changes, the annotation information in the entity class code and the database table corresponding to the entity class code can be automatically kept consistent, thereby improving the efficiency of annotation information processing during code development.
[0073] In an optional embodiment, in the above step S201, the user terminal may obtain the code file to be processed.
[0074] In the disclosed embodiments, during the code development process, developers can use a user terminal to develop code and submit the written code. The user terminal can update the code submission record in response to the code submission operation and generate a code file. The code submission record is used to record code submission information, such as the code submission time, developer information, and code operation information. Code operations may include adding code, deleting code, or modifying code.
[0075] In an optional embodiment, the user terminal can monitor the code submission record. When it is determined that the code submission record is updated, the code file generated in response to the code submission operation can be obtained to obtain the code file to be processed. Furthermore, the user terminal can detect the code file and obtain the entity class code in the code file.
[0076] The process of the user terminal detecting the code file and obtaining the entity class code in the code file may include: scanning the code in the code file, and if an entity class identifier is detected, determining that the code file includes the entity class code, and obtaining the entity class code. The entity class identifier may include the entity class name or entity class identifier characters.
[0077] In an optional embodiment, in the above step S201, if the user terminal determines that first annotation information associated with field information exists in the entity class code, second annotation information associated with the field information is obtained in the database table corresponding to the entity class code.
[0078] In the embodiment of the present disclosure, the comment information is text that introduces, comments or explains the field information in the entity class code.
[0079] In an optional embodiment, the process of the user terminal determining whether there is first annotation information associated with field information in the entity class code may include: the user terminal scans the entity class code to obtain the field information in the entity class code; if it is determined that there is associated annotation information corresponding to the field information, then it is determined that there is first annotation information associated with the field information in the entity class code; if it is determined that there is no associated annotation information corresponding to the field information, then it is determined that there is no first annotation information associated with the field information in the entity class code, and the process ends.
[0080] In an optional embodiment, the database table can be stored in a database server, and a correspondence can be established between the database table and the corresponding entity class code based on the entity class name, so as to facilitate searching the database table corresponding to the entity class code in the database server. Then, the process of the user terminal obtaining the second annotation information associated with the field information in the database table corresponding to the entity class code can include: generating an annotation information acquisition request based on the entity class name and field information, and sending the annotation information acquisition request to the database server; after receiving the annotation information acquisition request, the database server can parse the annotation information acquisition request to obtain the entity class name and field information therein, determine the database table corresponding to the entity class name in the database table stored in the database server, and obtain the annotation information associated with the field information in the database table corresponding to the entity class name; if the database table corresponding to the entity class name has annotation information associated with the field information, then obtain the annotation information, obtain the second annotation information associated with the field information, and send the second annotation information associated with the field information to the user terminal; if the database table corresponding to the entity class name does not have annotation information associated with the field information, then send a prompt message indicating that the annotation information acquisition failed to be sent to the user terminal.
[0081] In an optional embodiment, after determining that first annotation information associated with field information exists in the entity class code, if the user terminal receives a prompt message from the database server indicating that annotation information retrieval failed, it determines that second annotation information associated with the field information does not exist in the database table corresponding to the entity class code, and stores the first annotation information in the database table to obtain the second annotation information associated with the field information. If the information in the database table is incomplete, the annotation information in the database table can be supplemented to ensure consistency between the entity class code and the corresponding database table.
[0082] In an optional embodiment, the database table can be stored in a database server, and the process in which the user terminal stores the first annotation information in the database table and obtains the second annotation information associated with the field information can include: the user terminal generates an annotation information adding request based on the first annotation information associated with the field information, and sends the annotation information adding request to the database server; after receiving the annotation information adding request sent by the user terminal, the database server can store the first annotation information associated with the field information in the annotation information storage field in the database corresponding to the entity class code, and obtain the second annotation information associated with the field information.
[0083] In an optional embodiment, in the above step S203, if the user terminal determines that the second annotation information is different from the first annotation information, the non-target annotation information is updated according to the target annotation information.
[0084] In the disclosed embodiments, the target annotation information is one of the first and second annotation information, and the non-target annotation information is the annotation information other than the target annotation information in the first and second annotation information. For example, if the target annotation information is the first annotation information, the non-target annotation information is the second annotation information; if the target annotation information is the second annotation information, the non-target annotation information is the first annotation information.
[0085] In an optional embodiment, before the user terminal updates the non-target annotation information based on the target annotation information, the user terminal may further determine the target annotation information from the first annotation information and the second annotation information. The first annotation information or the second annotation information may be determined as the target annotation information, so that the target annotation information can be used to update the non-target annotation information, thereby achieving flexible updating of the annotation information.
[0086] In an optional embodiment, to efficiently update annotation information in entity class code or database tables, the process by which a user terminal determines target annotation information from the first and second annotation information may include obtaining the generation time of the first and second annotation information; and determining the annotation information corresponding to the most recent generation time as the target annotation information. This allows annotation information associated with field information in the entity class code or database table to be updated to the most recent annotation information, achieving efficient updating of annotation information.
[0087] In an optional embodiment, in order to make the update of annotation information more in line with the actual needs of user code development; the process of the user terminal determining the target annotation information in the first annotation information and the second annotation information may include: displaying annotation update prompt information, the annotation update prompt information includes multiple annotation update methods; and in response to the annotation update method selection operation, determining the target annotation information corresponding to the annotation update method selection operation in the first annotation information and the second annotation information. The annotation update prompt information is used to prompt the developer to select different annotation update methods to update the annotation information. The annotation information associated with the field information in the entity class code or database table can be updated to the annotation information required by the user to meet the actual needs of code development.
[0088] It is understandable that the annotation update mode may include: a first annotation update mode and a second annotation update mode, wherein the first annotation update mode indicates that the second annotation information is updated using the first annotation information; and the second annotation update mode indicates that the first annotation information is updated using the second annotation information. If the user terminal obtains the first annotation update mode in response to the annotation update mode selection operation, the user terminal determines the first annotation information as the target annotation information and the second annotation information as the non-target annotation information; if the user terminal obtains the second annotation update mode in response to the annotation update mode selection operation, the user terminal determines the second annotation information as the target annotation information and the first annotation information as the non-target annotation information.
[0089] In an optional embodiment, the target annotation information may be first annotation information, and the database table may be stored in a database server. The process of the user terminal updating the non-target annotation information based on the target annotation information may include: generating an annotation information update instruction based on the first annotation information; and sending the annotation information update instruction to the database server, so that the database server updates second annotation information associated with the field information in the database table corresponding to the entity class code based on the first annotation information in the annotation information update instruction. The annotation information in the corresponding database table can be automatically updated based on the annotation information in the entity class code, thereby improving the efficiency of updating the annotation information in the database table.
[0090] Among them, the process of the database server updating the second annotation information associated with the field information in the database table corresponding to the entity class code according to the first annotation information in the annotation information update instruction may include: the database server can parse the annotation update instruction to obtain the first annotation information, and replace the second annotation information associated with the field information in the database table corresponding to the entity class code with the first annotation information, to obtain the updated second annotation information associated with the field information; or, use the annotation update instruction to obtain the first annotation information to modify the second annotation information associated with the field information in the database table corresponding to the entity class code, to obtain the updated second annotation information associated with the field information.
[0091] In an optional embodiment, the target annotation information may be second annotation information. The process of the user terminal updating the non-target annotation information based on the target annotation information includes: updating the first annotation information associated with the field information in the entity class code based on the second annotation information. The annotation information in the entity class code can be automatically updated based on the annotation information in the database table corresponding to the entity class code, thereby improving the efficiency of updating the annotation information in the entity class code.
[0092] Among them, according to the second annotation information, the process of updating the first annotation information associated with the field information in the entity class code may include: replacing the first annotation information associated with the field information in the entity class code with the second annotation information to obtain the updated first annotation information associated with the field information; or, using the second annotation information to modify the first annotation information associated with the field information in the entity class code to obtain the updated first annotation information associated with the field information.
[0093] It should be noted that, in the embodiment of the present disclosure, the process of the user terminal acquiring the generation time of the first annotation information may include: acquiring the generation time of the first annotation information associated with the field information in the code file to obtain the generation time of the first annotation information.
[0094] Among them, the process of determining the generation time of the first annotation information associated with the field information in the code file may include: during the time period from the last time the user terminal detected a code submission operation to the current time the code submission operation was detected, during the code development process, the user terminal may respond to the editing operation of the first annotation information associated with the field information in the entity class code, determine the generation time of the first annotation information, and mark the generation time of the first annotation information in the code file in response to the code submission operation; or, after the user terminal detected the code submission operation last time and determined the second annotation information as the target information, the user terminal updates the first annotation information associated with the field information in the entity class code according to the second annotation information, determines the update time of the first annotation information associated with the field information in the entity class code as the generation time of the first annotation information, and marks the generation time of the first annotation information in the code file.
[0095] It should be noted that, in the embodiment of the present disclosure, the process of the user terminal obtaining the generation time of the second annotation information may include: parsing the second annotation information associated with the field information sent by the database server, obtaining the second annotation information associated with the field information and the generation time of the second annotation information.
[0096] The process of the database server determining the generation time of the second annotation information associated with the field information may include: during the time period from the last time the annotation information acquisition request sent by the user terminal is received to the current time the annotation information acquisition request sent by the user terminal is received, the database server may respond to the editing operation of the second annotation information associated with the field information in the database table corresponding to the entity class code, determine the updated second annotation information associated with the field information, and the update time of the second annotation information, and after receiving the annotation information acquisition request sent by the user terminal this time, when sending the second annotation information associated with the field information to the user terminal, determine the update time of the second annotation information as the generation time of the second annotation information, and set the second annotation information as the generation time of the second annotation information. The generation time mark of the information is in the second annotation information associated with the field information; or, after the database server receives the annotation information update instruction sent by the user terminal last time, the database server updates the second annotation information associated with the field information in the database table corresponding to the entity class code according to the first annotation information in the annotation information update instruction, and determines the update time of the second annotation information as the generation time of the second annotation information, and after receiving the annotation information acquisition request sent by the user terminal this time, when sending the second annotation information associated with the field information to the user terminal, determines the update time of the second annotation information as the generation time of the second annotation information, and marks the generation time of the second annotation information in the second annotation information associated with the field information.
[0097] For example, Figure 3is a flowchart showing a method for processing annotations according to an exemplary embodiment. Figure 3 As shown, the annotation processing method can be applied to a user terminal, and the annotation processing method may include the following steps S301 to S307:
[0098] Step S301, obtaining the code file to be processed;
[0099] In the embodiment of the present disclosure, the code file includes entity class code; the entity class code may include an entity class name and field information.
[0100] Step S302: determine whether there is first annotation information associated with the field information in the entity class code;
[0101] Step S303: If it is determined that the first annotation information associated with the field information does not exist in the entity class code, the process ends;
[0102] Step S304: if it is determined that the entity class code contains first annotation information associated with the field information, then obtaining second annotation information associated with the field information from the database table corresponding to the entity class code;
[0103] Step S305, determining whether the second annotation information is the same as the first annotation information;
[0104] Step S306: If it is determined that the second annotation information is the same as the first annotation information, it is determined that there is no need to update the entity class code or the annotation information in the database table corresponding to the entity class code, and the process ends;
[0105] Step S307: If it is determined that the second annotation information is different from the first annotation information, the non-target annotation information is updated according to the target annotation information.
[0106] For example, Figure 4 is a flowchart showing another annotation processing method according to an exemplary embodiment. Figure 4 As shown, the annotation processing method can be applied to a user terminal, and the annotation processing method may include the following steps S401 to S408:
[0107] Step S401, monitoring code submission records;
[0108] Step S402: when it is determined that the code submission record is updated, obtain the code file to be processed, and determine whether there is first annotation information associated with the field information in the entity class code;
[0109] In the embodiment of the present disclosure, the code file includes entity class code; the entity class code may include an entity class name and field information.
[0110] Step S403: if it is determined that the entity class code contains first annotation information associated with the field information, then obtaining second annotation information associated with the field information from the database table corresponding to the entity class code;
[0111] Step S404, determining whether the second annotation information is the same as the first annotation information;
[0112] Step S405: If it is determined that the second annotation information is different from the first annotation information, then when it is determined that the target annotation information is the first annotation information, an annotation information update instruction is generated based on the first annotation information, and the annotation information update instruction is sent to the database server, so that the database server updates the second annotation information associated with the field information in the database table corresponding to the entity class code according to the first annotation information in the annotation information update instruction.
[0113] Figure 5 This is a block diagram of an annotation processing device according to an exemplary embodiment. The annotation processing device is applied to a user terminal, referring to Figure 5 The annotation processing device 500 includes:
[0114] The first acquisition module 501 is configured to acquire a code file to be processed, wherein the code file includes entity class code, and the entity class code includes field information;
[0115] The second acquisition module 502 is configured to acquire second annotation information associated with the field information from a database table corresponding to the entity class code if it is determined that the entity class code contains first annotation information associated with the field information;
[0116] The updating module 503 is configured to update the non-target annotation information according to the target annotation information if it is determined that the second annotation information is different from the first annotation information. The target annotation information is one of the first annotation information and the second annotation information, and the non-target annotation information is the annotation information other than the target annotation information in the first annotation information and the second annotation information.
[0117] Optional, such as Figure 5 As shown, the annotation processing apparatus 500 further includes a determination module 504 configured to:
[0118] Target annotation information is determined from the first annotation information and the second annotation information.
[0119] Optionally, the determination module 504 is configured to
[0120] Obtaining the generation time of the first annotation information and the generation time of the second annotation information;
[0121] The annotation information corresponding to the latest generation time is determined as the target annotation information, and the non-target annotation information is updated according to the target annotation information.
[0122] Optionally, the determination module 504 is configured to:
[0123] Displaying annotation update prompt information, wherein the annotation update prompt information includes multiple annotation update methods;
[0124] In response to the annotation update mode selection operation, target annotation information corresponding to the annotation update mode selection operation is determined from among the first annotation information and the second annotation information.
[0125] Optionally, the target annotation information is the first annotation information, and the updating module 503 is configured to:
[0126] generating an annotation information update instruction according to the first annotation information;
[0127] The annotation information update instruction is sent to the database server, so that the database server updates the second annotation information associated with the field information in the database table corresponding to the entity class code according to the first annotation information in the annotation information update instruction.
[0128] Optionally, the target annotation information is the second annotation information, and the updating module 503 is configured to:
[0129] According to the second annotation information, the first annotation information associated with the field information in the entity class code is updated.
[0130] Optional, such as Figure 5 As shown, the annotation processing apparatus 500 further includes a storage module 505 configured to:
[0131] If it is determined that the second annotation information associated with the field information does not exist in the database table corresponding to the entity class code, the first annotation information is stored in the database table to obtain the second annotation information associated with the field information.
[0132] Regarding the apparatus in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0133] The exemplary embodiment of the present disclosure also provides an electronic device, which may be a user terminal or a database server. Figure 6 The electronic device is described. It should be understood that the following reference Figure 6 The electronic device will be described. It should be understood that Figure 6 The electronic device 600 shown is merely an example and should not limit the functionality and scope of use of the embodiments of the present disclosure.
[0134] like Figure 6As shown, electronic device 600 is implemented as a general-purpose computing device. Components of electronic device 600 may include, but are not limited to, at least one processing unit 610, at least one storage unit 620, and a bus 630 connecting various system components (including storage unit 620 and processing unit 610).
[0135] The storage unit stores program codes, which can be executed by the processing unit 610, so that the processing unit 610 performs the steps according to various exemplary embodiments of the present invention described in the above “Exemplary Method” section of this specification. For example, the processing unit 610 can perform the following steps: Figure 2 The method steps shown, etc.
[0136] The storage unit 620 may include a volatile storage unit, such as a random access memory unit (RAM) 621 and / or a cache memory unit 622 , and may further include a read-only memory unit (ROM) 623 .
[0137] The storage unit 620 may also include a program / utility 624 having a set (at least one) of program modules 625, such program modules 625 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0138] The bus 630 may include a data bus, an address bus, and a control bus.
[0139] The electronic device 600 can also communicate with one or more external devices 700 (e.g., a keyboard, a pointing device, a Bluetooth device, etc.), and such communication can be performed through an input / output (I / O) interface 640. The electronic device 600 can also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) through a network adapter 650. As shown, the network adapter 650 communicates with other modules of the electronic device 600 via a bus 630. It should be understood that, although not shown in the figure, other hardware and / or software modules can be used in conjunction with the electronic device 600, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0140] It should be noted that although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the exemplary embodiments of the present disclosure, the features and functions of two or more modules or units described above can be concretized in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided into multiple modules or units to be concretized.
[0141] It will be appreciated by those skilled in the art that various aspects of the present disclosure may be implemented as systems, methods or program products. Therefore, various aspects of the present disclosure may be specifically implemented as the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or an implementation combining hardware and software, which may be collectively referred to herein as a "circuit", "module" or "system". Other embodiments of the present disclosure will readily occur to those skilled in the art after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses or adaptations of the present disclosure, which follow the general principles of the present disclosure and include common knowledge or customary technical means in the art that are not disclosed in the present disclosure. The specification and implementation are intended to be exemplary only, with the true scope and spirit of the present disclosure being indicated by the claims.
[0142] In addition, the present disclosure also provides a computer-readable storage medium. When instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device can execute the annotation processing method provided in the above embodiment.
[0143] In addition, the present disclosure also provides a computer program product, including computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes the annotation processing method provided in the above embodiment.
[0144] Other embodiments of the present disclosure will readily occur to those skilled in the art after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art not disclosed herein. The description and examples are to be considered as exemplary only, with the true scope and spirit of the present disclosure being indicated by the following claims.
[0145] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes can be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A method for processing annotations, characterized in that: include: Obtain a code file to be processed, wherein the code file includes entity class code, and the entity class code includes field information; If it is determined that the entity class code contains first annotation information associated with the field information, obtaining second annotation information associated with the field information in the database table corresponding to the entity class code; If it is determined that the second annotation information is different from the first annotation information, updating the non-target annotation information according to the target annotation information, the target annotation information being one of the first annotation information and the second annotation information, and the non-target annotation information being annotation information other than the target annotation information in the first annotation information and the second annotation information; Before updating the non-target annotation information according to the target annotation information, the method further includes: determining target annotation information from the first annotation information and the second annotation information; The determining target annotation information from the first annotation information and the second annotation information includes: Obtaining the generation time of the first annotation information and the generation time of the second annotation information; The annotation information corresponding to the latest generation time is determined as the target annotation information.
2. The annotation processing method according to claim 1, characterized in that The determining target annotation information from the first annotation information and the second annotation information includes: Displaying annotation update prompt information, wherein the annotation update prompt information includes multiple annotation update methods; In response to the selection operation of the annotation update method, target annotation information corresponding to the selection operation of the annotation update method is determined in the first annotation information and the second annotation information.
3. The annotation processing method according to claim 1, characterized in that The target annotation information is the first annotation information, and updating the non-target annotation information according to the target annotation information includes: generating an annotation information update instruction according to the first annotation information; The annotation information update instruction is sent to a database server, so that the database server updates the second annotation information associated with the field information in the database table corresponding to the entity class code according to the first annotation information in the annotation information update instruction.
4. The annotation processing method according to claim 1, characterized in that The target annotation information is the second annotation information, and updating the non-target annotation information according to the target annotation information includes: According to the second annotation information, the first annotation information associated with the field information in the entity class code is updated.
5. The annotation processing method according to claim 1, characterized in that After determining that first annotation information associated with the field information exists in the entity class code, the method further includes: If it is determined that the second annotation information associated with the field information does not exist in the database table corresponding to the entity class code, the first annotation information is stored in the database table to obtain the second annotation information associated with the field information.
6. An annotation processing device, characterized in that: The device is applied to a user terminal and includes: A first acquisition module is configured to acquire a code file to be processed, wherein the code file includes entity class code, and the entity class code includes field information; A second acquisition module is configured to acquire, if it is determined that the entity class code contains first annotation information associated with the field information, second annotation information associated with the field information in a database table corresponding to the entity class code; an updating module configured to update non-target annotation information according to target annotation information if it is determined that the second annotation information is different from the first annotation information, wherein the target annotation information is one of the first annotation information and the second annotation information, and the non-target annotation information is annotation information other than the target annotation information in the first annotation information and the second annotation information; a determining module, configured to: determine target annotation information in the first annotation information and the second annotation information; The determining module is configured to: obtain the generation time of the first annotation information and the generation time of the second annotation information; The annotation information corresponding to the latest generation time is determined as the target annotation information, and the non-target annotation information is updated according to the target annotation information.
7. The annotation processing device according to claim 6, characterized in that The determining module is configured to: Displaying annotation update prompt information, wherein the annotation update prompt information includes multiple annotation update methods; In response to the selection operation of the annotation update method, target annotation information corresponding to the selection operation of the annotation update method is determined in the first annotation information and the second annotation information.
8. The annotation processing device according to claim 6, characterized in that The target annotation information is the first annotation information, and the updating module is configured to: generating an annotation information update instruction according to the first annotation information; The annotation information update instruction is sent to a database server, so that the database server updates the second annotation information associated with the field information in the database table corresponding to the entity class code according to the first annotation information in the annotation information update instruction.
9. The annotation processing device according to claim 6, characterized in that The target annotation information is the second annotation information, and the updating module is configured to: According to the second annotation information, the first annotation information associated with the field information in the entity class code is updated.
10. The annotation processing device according to claim 6, characterized in that The device further includes a storage module configured to: If it is determined that the second annotation information associated with the field information does not exist in the database table corresponding to the entity class code, the first annotation information is stored in the database table to obtain the second annotation information associated with the field information.
11. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the annotation processing method according to any one of claims 1 to 5.
12. A computer-readable storage medium, characterized in that When the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the annotation processing method according to any one of claims 1 to 5.
13. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the annotation processing method according to any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Matching method and device for type and database table, equipment and medium
CN113609138A