CN116594683A - Code annotation information generation method, device, equipment and storage medium - Google Patents

Code annotation information generation method, device, equipment and storage medium Download PDF

Info

Publication number
CN116594683A
CN116594683A CN202310530303.3A CN202310530303A CN116594683A CN 116594683 A CN116594683 A CN 116594683A CN 202310530303 A CN202310530303 A CN 202310530303A CN 116594683 A CN116594683 A CN 116594683A
Authority
CN
China
Prior art keywords
information
code
field
annotation
annotation information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310530303.3A
Other languages
Chinese (zh)
Inventor
石忠德
叶齐娇
任瑜平
李天骐
彭基羿
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Industrial and Commercial Bank of China Ltd ICBC
Original Assignee
Industrial and Commercial Bank of China Ltd ICBC
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Industrial and Commercial Bank of China Ltd ICBC filed Critical Industrial and Commercial Bank of China Ltd ICBC
Priority to CN202310530303.3A priority Critical patent/CN116594683A/en
Publication of CN116594683A publication Critical patent/CN116594683A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/73Program documentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/28Databases characterised by their database models, e.g. relational or object models
    • G06F16/284Relational databases
    • G06F16/288Entity relationship models
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The present disclosure provides a method, an apparatus, a device, and a storage medium for generating code annotation information, which can be applied to the field of software development and the field of financial technology. The method comprises the following steps: responding to a received code annotation service request, and acquiring code field information to be annotated, wherein the code field information to be annotated comprises field type information and field content information; determining a query strategy according to the field type information; based on the query strategy, obtaining a plurality of candidate annotation information by querying a database according to the field content information, wherein the database comprises an information service architecture model and a business architecture model; the information service architecture model is constructed according to the association relation between the functional services realized by the codes, the business architecture model is constructed according to the association relation between the flow tasks in the business flow, and the flow tasks are in one-to-one correspondence with the functional services realized by the codes; and generating code annotation information according to the plurality of candidate annotation information.

Description

Code annotation information generation method, device, equipment and storage medium
Technical Field
The present disclosure relates to the field of software development and financial technology, and in particular, to a method, apparatus, device, medium, and program product for generating code annotation information.
Background
As enterprise development technologies increase, business architecture is also being complicated. Most enterprise projects are performed involving multiple institutions and departments, with each institution or department being performed in a line linkage. The code architecture is designed according to the service architecture, and the lack of coding prompts in the code architecture can cause great difficulty and high risk of code change of developers. Code annotation is important to enterprise business architecture design and code architecture design. The current code annotation is generally manually injected by a developer, the efficiency is low, and the problem of incomplete annotation content exists.
Disclosure of Invention
In view of the foregoing, the present disclosure provides code annotation information generation methods, apparatuses, devices, media, and program products.
According to a first aspect of the present disclosure, there is provided a code annotation information generation method including: and responding to the received code annotation service request, acquiring code field information to be annotated, wherein the code field information to be annotated comprises field type information and field content information. And determining a query strategy according to the field type information. Based on the query strategy, a plurality of candidate annotation information is obtained by querying a database according to the field content information, wherein the database comprises an information service architecture model and a business architecture model. The information service architecture model is constructed according to the association relation between the functional services realized by the codes, the business architecture model is constructed according to the association relation between the flow tasks in the business flow, and the flow tasks are in one-to-one correspondence with the functional services realized by the codes. And generating code annotation information according to the plurality of candidate annotation information.
According to an embodiment of the present disclosure, determining a query policy according to field type information includes:
and under the condition that the field type information is determined to be the code parameter, determining the query strategy to query based on the information service architecture model. And under the condition that the field type information is determined to be the code use case, determining the query strategy to query based on the business architecture model and the information service architecture model.
According to an embodiment of the present disclosure, a plurality of candidate annotation information is obtained by querying a database according to field content information based on a query policy, including:
and extracting key fields in the field content information. And according to the key fields, obtaining a plurality of candidate annotation information by querying a business architecture model and an information service architecture model.
According to an embodiment of the present disclosure, according to a key field, a plurality of candidate annotation information is obtained by querying a business architecture model and an information service architecture model, including:
obtaining flow task information by inquiring a business architecture model according to the key field; and determining the target function service according to the flow task. And obtaining a plurality of candidate annotation information by querying the information service architecture model according to the target function service.
According to an embodiment of the present disclosure, generating code annotation information from a plurality of candidate annotation information includes:
the target candidate annotation information is determined from the plurality of candidate annotation information based on a predetermined selection policy. Code annotation information is generated based on the target candidate annotation information.
According to an embodiment of the present disclosure, generating code annotation information from target candidate annotation information includes:
searching a target annotation template from the annotation template library according to a preset information assembly rule; code annotation information is generated according to the target candidate annotation information according to the target annotation template.
According to an embodiment of the present disclosure, the code field information to be annotated further includes field location information, and the method further includes:
determining the display position of the code annotation information according to the field position information; and displaying the code annotation information through a visual interface at the display position.
A second aspect of the present disclosure provides a code annotation information generating apparatus including: the device comprises a first acquisition module, a determination module, a second acquisition module and a generation module. The first acquisition module is used for responding to the received code annotation service request and acquiring code field information to be annotated, wherein the code field information to be annotated comprises field type information and field content information. And the determining module is used for determining the query strategy according to the field type information. The second acquisition module is used for acquiring a plurality of candidate annotation information by inquiring a database based on an inquiry strategy according to field content information, wherein the database comprises an information service architecture model and a business architecture model; the information service architecture model is constructed according to the association relation between the functional services realized by codes, and the business architecture model is constructed according to the association relation between the flow tasks in the business flow; the constructed flow tasks are in one-to-one correspondence with the functional services realized by the codes. And the generation module is used for generating code annotation information according to the plurality of candidate annotation information.
According to an embodiment of the present disclosure, the determining module includes a first querying element and a second querying element. And the first query unit is used for determining that the query strategy is based on the information service architecture model for query under the condition that the field type information is determined to be the code parameter. And the second query unit is used for determining the query strategy to query based on the business architecture model and the information service architecture model under the condition that the field type information is determined to be the code use case.
According to an embodiment of the present disclosure, the second acquisition module includes an extraction unit and an acquisition unit. The extraction unit is used for extracting key fields in the field content information. And the acquisition unit is used for acquiring a plurality of candidate annotation information by querying the business architecture model and the information service architecture model according to the key field.
According to an embodiment of the present disclosure, the acquisition unit includes a first acquisition subunit, a determination subunit, and a second acquisition subunit. Wherein the first acquisition subunit. And the method is used for obtaining the flow task information by inquiring the business architecture model according to the key field. And the determining subunit is used for determining the target function service according to the flow task. And the second acquisition subunit is used for acquiring a plurality of candidate annotation information by querying the information service architecture model according to the target function service.
According to an embodiment of the present disclosure, the generating module comprises a search first determining unit and a generating unit. Wherein the first determining unit is configured to determine target candidate annotation information from the plurality of candidate annotation information based on a predetermined selection policy. And the generating unit is used for generating code annotation information according to the target candidate annotation information.
According to an embodiment of the present disclosure, the generation unit includes a search subunit and a generation subunit. And the searching subunit is used for searching the target annotation template from the annotation template library according to the preset information assembly rule. And the generation subunit is used for generating code annotation information according to the target annotation template and the target candidate annotation information.
According to an embodiment of the disclosure, the first acquisition module comprises a second determination unit and a display unit. And the second determining unit is used for determining the display position of the code annotation information according to the field position information. And the display unit is used for displaying the code annotation information at the display position through the visual interface.
A third aspect of the present disclosure provides an electronic device, comprising: one or more processors; and a memory for storing one or more programs, wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to perform the method described above.
A fourth aspect of the present disclosure also provides a computer-readable storage medium having stored thereon executable instructions that, when executed by a processor, cause the processor to perform the above-described method.
A fifth aspect of the present disclosure also provides a computer program product comprising a computer program which, when executed by a processor, implements the above method.
According to the code annotation information generation method, device, equipment, medium and program product, code field information to be annotated is obtained by responding to a received code annotation service request, wherein the code field information to be annotated comprises field type information and field content information. And then determining the query strategy according to the field type information. Based on the query strategy, obtaining a plurality of candidate annotation information by querying a database according to the field content information, wherein the database comprises an information service architecture model and a business architecture model; the information service architecture model is constructed according to the association relation between the functional services realized by the codes, the business architecture model is constructed according to the association relation between the flow tasks in the business flow, and the flow tasks are in one-to-one correspondence with the functional services realized by the codes. And finally, generating code annotation information according to the plurality of candidate annotation information. According to the code field to be annotated, a plurality of candidate annotation information is obtained by inquiring the association relation between the function services realized by the codes in the database and the association relation between the flow tasks in the business flow, and the code annotation information is generated according to the plurality of candidate annotation information. Therefore, the problem of incomplete annotation content is at least partially solved, and the code annotation generation efficiency is improved.
Drawings
The foregoing and other objects, features and advantages of the disclosure will be more apparent from the following description of embodiments of the disclosure with reference to the accompanying drawings, in which:
FIG. 1 schematically illustrates an application scenario diagram of a code annotation information generation method, apparatus, device, medium and program product according to an embodiment of the present disclosure;
FIG. 2 schematically illustrates a flow chart of a code annotation information generation method according to an embodiment of the disclosure;
FIG. 3 schematically illustrates a schematic diagram of an information services architecture model according to an embodiment of the present disclosure;
FIG. 4 schematically illustrates a schematic diagram of a business architecture model according to an embodiment of the present disclosure;
FIG. 5 schematically illustrates a flow chart of determining a query strategy according to an embodiment of the disclosure;
fig. 6 schematically shows a block diagram of a code annotation information generation apparatus according to an embodiment of the present disclosure; and
fig. 7 schematically illustrates a block diagram of an electronic device adapted to implement a code annotation information generation method according to an embodiment of the disclosure.
Detailed Description
Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. It should be understood that the description is only exemplary and is not intended to limit the scope of the present disclosure. In the following detailed description, for purposes of explanation, numerous specific details are set forth in order to provide a thorough understanding of the embodiments of the present disclosure. It may be evident, however, that one or more embodiments may be practiced without these specific details. In addition, in the following description, descriptions of well-known structures and techniques are omitted so as not to unnecessarily obscure the concepts of the present disclosure.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. The terms "comprises," "comprising," and/or the like, as used herein, specify the presence of stated features, steps, operations, and/or components, but do not preclude the presence or addition of one or more other features, steps, operations, or components.
All terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art unless otherwise defined. It should be noted that the terms used herein should be construed to have meanings consistent with the context of the present specification and should not be construed in an idealized or overly formal manner.
Where expressions like at least one of "A, B and C, etc. are used, the expressions should generally be interpreted in accordance with the meaning as commonly understood by those skilled in the art (e.g.," a system having at least one of A, B and C "shall include, but not be limited to, a system having a alone, B alone, C alone, a and B together, a and C together, B and C together, and/or A, B, C together, etc.).
In the technical scheme of the disclosure, the related data (such as including but not limited to personal information of a user) are collected, stored, used, processed, transmitted, provided, disclosed, applied and the like, all conform to the regulations of related laws and regulations, necessary security measures are adopted, and the public welcome is not violated.
The current code annotation is generally manually injected by a developer, the efficiency is low, and the problem of incomplete annotation content exists. In view of this, an embodiment of the present disclosure provides a code annotation information generating method including: and acquiring code field information to be annotated in response to the received code annotation service request, wherein the code field information to be annotated comprises field type information and field content information. And then determining the query strategy according to the field type information. Based on the query strategy, obtaining a plurality of candidate annotation information by querying a database according to the field content information, wherein the database comprises an information service architecture model and a business architecture model; the information service architecture model is constructed according to the association relation between the functional services realized by the codes, the business architecture model is constructed according to the association relation between the flow tasks in the business flow, and the flow tasks are in one-to-one correspondence with the functional services realized by the codes. And finally, generating code annotation information according to the plurality of candidate annotation information.
Fig. 1 schematically illustrates an application scenario diagram of a code annotation information generation method according to an embodiment of the present disclosure.
As shown in fig. 1, an application scenario 100 according to this embodiment may include a first terminal device 101, a second terminal device 102, a third terminal device 103, a network 104, and a server 105. The network 104 is a medium used to provide a communication link between the first terminal device 101, the second terminal device 102, the third terminal device 103, and the server 105. The network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
The user may interact with the server 105 through the network 104 using at least one of the first terminal device 101, the second terminal device 102, the third terminal device 103, to receive or send messages, etc. Various communication client applications, such as a shopping class application, a web browser application, a search class application, an instant messaging tool, a mailbox client, social platform software, etc. (by way of example only) may be installed on the first terminal device 101, the second terminal device 102, and the third terminal device 103.
The first terminal device 101, the second terminal device 102, the third terminal device 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smartphones, tablets, laptop and desktop computers, and the like.
The server 105 may be a server providing various services, such as a background management server (by way of example only) providing support for websites browsed by the user using the first terminal device 101, the second terminal device 102, and the third terminal device 103. The background management server may analyze and process the received data such as the user request, and feed back the processing result (e.g., the web page, information, or data obtained or generated according to the user request) to the terminal device.
It should be noted that, a code annotation information generating method provided by the embodiments of the present disclosure may be generally executed by the server 105. Accordingly, a code annotation information generating apparatus provided by the embodiments of the present disclosure may be generally provided in the server 105. A code annotation information generation method provided by the embodiments of the present disclosure may also be performed by a server or a server cluster that is different from the server 105 and is capable of communicating with the first terminal device 101, the second terminal device 102, the third terminal device 103, and/or the server 105. Accordingly, a code annotation information generating apparatus provided by the embodiments of the present disclosure may also be provided in a server or a server cluster that is different from the server 105 and is capable of communicating with the first terminal device 101, the second terminal device 102, the third terminal device 103, and/or the server 105.
It should be understood that the number of terminal devices, networks and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
A code annotation information generation method of the disclosed embodiment will be described in detail below with reference to fig. 2 to 5 based on the scenario described in fig. 1.
Fig. 2 schematically illustrates a flowchart of a code annotation information generation method according to an embodiment of the present disclosure.
As shown in fig. 2, a code annotation information generation method of this embodiment includes operations S210 to S240.
In operation S210, code field information to be annotated is acquired in response to the received code annotation service request.
In operation S220, a query policy is determined according to the field type information.
In operation S230, a plurality of candidate annotation information is obtained by querying a database according to field content information based on a query policy.
In operation S240, code annotation information is generated from the plurality of candidate annotation information.
According to embodiments of the present disclosure, a code annotation service request refers to a code annotation service request that may be sent by a developer after selecting a code field. For example: the developer opens the program file in the integrated development environment, and triggers the code annotation service request when the cursor is placed on a certain interface or method body or the name of the method is selected.
According to an embodiment of the present disclosure, the code field information to be annotated includes field type information and field content information.
For example: the field type information may be the type of code parameter, original requirements, etc. The type of code parameter may be an interface type, an affiliated method name, a program name, and the like. The original requirement refers to the service type corresponding to the code field information, and can be newly added deposit service and the like. The field content information refers to specific information content of parameters, and may be that the class name to which the interface belongs is com. The integrated development environment can provide an interactive interface to support a developer to input interface names, method names, service types and the like.
According to an embodiment of the present disclosure, a database includes an information service architecture model and a business architecture model; the information service architecture model is constructed according to the association relation between the functional services realized by codes, the business architecture model is constructed according to the association relation between the flow tasks in the business flow, and the flow tasks are in one-to-one correspondence with the functional services realized by codes
For example: the information service architecture model is a model which corresponds to a business architecture model and structurally describes business from top to bottom through program codes, and comprises a plurality of information service sub-models with different granularities. FIG. 3 is a schematic diagram of an information services architecture model in which the functional services are the smallest units, and are mapped one-to-one with the flow tasks of the business architecture model flow model.
For example: the business architecture model is a model for describing business of an enterprise structurally from top to bottom, and comprises a flow model, a product model and text description and association relation of a solid model which are used in the enterprise at present.
FIG. 4 is a schematic diagram of a business architecture model, wherein the flow model includes a business domain including value flows, the value flows including activities, the activities including flow tasks; the products include a product line including a product group including a base product including a marketable product; the entities include business objects including core entities, lifecycles, subordinate entities, business object relationships, and constraints.
According to an embodiment of the present disclosure, code field information to be annotated is acquired by responding to a received code annotation service request, wherein the code field information to be annotated includes field type information and field content information. And then determining the query strategy according to the field type information. Based on the query strategy, obtaining a plurality of candidate annotation information by querying a database according to the field content information, wherein the database comprises an information service architecture model and a business architecture model; the information service architecture model is constructed according to the association relation between the functional services realized by the codes, the business architecture model is constructed according to the association relation between the flow tasks in the business flow, and the flow tasks are in one-to-one correspondence with the functional services realized by the codes. And finally, generating code annotation information according to the plurality of candidate annotation information. According to the code field to be annotated, a plurality of candidate annotation information is obtained by inquiring the association relation between the function services realized by the codes in the database and the association relation between the flow tasks in the business flow, and the code annotation information is generated according to the plurality of candidate annotation information. Therefore, the problem of incomplete annotation content is at least partially solved, and the code annotation generation efficiency is improved.
Fig. 5 schematically illustrates a flow chart of determining a query strategy according to an embodiment of the disclosure.
As shown in fig. 5, a code annotation information generation method of this embodiment includes operations S510 to S520.
In operation S510, in case that it is determined that the field type information is a code parameter, it is determined that the query policy is to query based on the information service architecture model.
In operation S520, in case that the field type information is determined to be a code use case, the query policy is determined to be a query based on the business architecture model and the information service architecture model.
For example: the code parameters may be interface type, name of the method to which they belong, program name, etc. The code use case refers to an original requirement, and the original requirement comprises deposit, loan, withdrawal and other businesses. The field type information may be an API interface for querying based on the information services architecture model. The field type information may be a newly added deposit service, which is an original demand, and is queried based on a service architecture model and an information service architecture model.
For example: and according to the interface name, the method name or the program name, the database of the information service architecture model can be searched through SQL, and the relevant information of the corresponding flow task of the code can be obtained.
According to the embodiment of the disclosure, different query strategies are selected according to whether the field type information is the code parameter or the code use case, so that the accuracy and the integrity of the code annotation can be improved.
According to an embodiment of the present disclosure, a plurality of candidate annotation information is obtained by querying a database according to field content information based on a query policy, including:
extracting key fields in the field content information; and according to the key fields, obtaining a plurality of candidate annotation information by querying a business architecture model and an information service architecture model.
For example: the key fields in the extracted field content information are the text fields comprising the original requirements of deposit business transaction and the class name to which the interface belongs. Inquiring a service architecture model according to 'deposit service handling' in the key field to obtain activity information of personal deposit service handling; and inquiring the information service architecture model according to the class name information of the interface in the key field to obtain service information about personal deposit business processing.
According to the embodiment of the disclosure, the key fields in the text content information are extracted, so that the speed and accuracy of query can be improved.
According to an embodiment of the present disclosure, according to a key field, a plurality of candidate annotation information is obtained by querying a business architecture model and an information service architecture model, including:
Obtaining flow task information by inquiring a business architecture model according to the key field; determining a target function service according to the flow task; and obtaining a plurality of candidate annotation information by querying the information service architecture model according to the target function service.
For example: according to the 'deposit business handling' inquiry business architecture model in the key field, obtaining the activity information of the personal deposit business handling, and obtaining the flow task information of the activity, wherein the flow task information comprises deposit information registration, deposit business auditing, deposit business handling and the like. And determining related target function services according to the flow task information, and obtaining a plurality of candidate annotation information according to a one-to-one mapping relation between the flow task in the business architecture model and the function services in the information service architecture model.
According to the embodiment of the disclosure, the correlation between the functional services realized by the codes in the database and the correlation between the flow tasks in the business flow are queried through the key fields, so that a plurality of candidate annotation information is obtained, and the integrity of code annotation generation can be improved.
According to an embodiment of the present disclosure, generating code annotation information from a plurality of candidate annotation information includes:
Determining target candidate annotation information from the plurality of candidate annotation information based on a predetermined selection policy; code annotation information is generated based on the target candidate annotation information.
According to embodiments of the present disclosure, the predetermined selection policy may be to select the first three candidate annotation information pushed or to autonomously select one candidate annotation information by the developer.
For example: and according to the keyword, inquiring the business architecture model, matching one or more business architecture models and pushing to a developer. The business architecture model pushed to the developer may be as follows:
task 1- > activity X- > value flow X- > business domain;
task 2- > activity X- > value flow X- > business domain ].
Finally, the developer selects 1 candidate annotation information to generate code annotation information.
According to the embodiment of the disclosure, the setting of the preset selection strategy can be set according to the enterprise requirements, so that the setting of the enterprise business architecture is facilitated, the selection of candidate annotation information by developers is facilitated, and the accuracy of code annotation can be improved.
According to an embodiment of the present disclosure, generating code annotation information from target candidate annotation information includes:
searching a target annotation template from the annotation template library according to a preset information assembly rule; code annotation information is generated according to the target candidate annotation information according to the target annotation template.
According to an embodiment of the present disclosure, the predetermined information assembly rule is as shown in table 1, and different attributes correspond to different assembly rules.
For example: the code annotation information of the maintainer A can find that the target annotation template is [ maintainer- > developer ID- >00000001] from the annotation template library. And then generating code annotation information [ maintainer- > ID- >0000000A of developer A ] according to the target candidate annotation information.
For example: the assembly rule of the service name may be automatically extracted from the annotation text of the interface or method.
According to the embodiment of the disclosure, the code annotation information is generated through the predetermined information assembly rule, so that the efficiency of generating the code annotation information is improved, and the application of developers is facilitated.
According to an embodiment of the present disclosure, the code field information to be annotated further includes field location information, and the method further includes:
determining the display position of the code annotation information according to the field position information; and displaying the code annotation information through a visual interface at the display position.
According to an embodiment of the present disclosure, the field location information refers to the location where the code field to be annotated is located, here the presentation location of the code annotation information.
For example: the visual display is a chained display of information service architecture, a chained display of business architecture and a list display of original requirements.
The chained presentation of the information service architecture may be service application. If the assembly rule is "I x Arc: the chained presentation of the information service architecture of the service name- > application "may be [ I x Arc: query project department service I00 x 01- > internal management x 002].
The chained presentation of the business architecture may be task activity value flow business domain. If the assembly rule "B x Arc: the chained presentation of the business architecture of task- > activity- > value flow- > business domain "may be [ B x Arc: query project department B0 x 001- > subject application a002- > technological subject C0002- > technological administration x 001].
According to the embodiment of the disclosure, the code annotation information is visually displayed at the field position, so that service architecture information, information service architecture information, original requirements and the like related to codes are conveniently checked, code change of developers is facilitated, and the reliability of the codes is improved.
Based on the code annotation information generation method, the disclosure also provides a code annotation information generation device. The device will be described in detail below in connection with fig. 6.
Fig. 6 schematically shows a block diagram of a code annotation information generation apparatus according to an embodiment of the present disclosure.
As shown in fig. 6, a code annotation information generating apparatus 600 of this embodiment includes a first acquisition module 610, a determination module 620, a second acquisition module 630, and a generation module 640.
The first obtaining module 610 is configured to obtain code field information to be annotated in response to a received code annotation service request. In an embodiment, the first obtaining module 610 may be configured to perform the operation S210 described above, which is not described herein.
A determining module 620, configured to determine a query policy according to the field type information. In an embodiment, the determining module 620 may be configured to perform the operation S220 described above, which is not described herein.
The second obtaining module 630 is configured to obtain a plurality of candidate annotation information by querying the database according to the field content information based on the query policy. In an embodiment, the second obtaining module 630 may be configured to perform the operation S230 described above, which is not described herein.
The generating module 640 is configured to generate code annotation information according to the plurality of candidate annotation information. In an embodiment, the generating module 640 may be configured to perform the operation S240 described above, which is not described herein.
According to an embodiment of the present disclosure, the determining module includes a first querying element and a second querying element. And the first query unit is used for determining that the query strategy is based on the information service architecture model for query under the condition that the field type information is determined to be the code parameter. And the second query unit is used for determining the query strategy to query based on the business architecture model and the information service architecture model under the condition that the field type information is determined to be the code use case.
According to an embodiment of the present disclosure, the second acquisition module includes an extraction unit and an acquisition unit. The extraction unit is used for extracting key fields in the field content information. And the acquisition unit is used for acquiring a plurality of candidate annotation information by querying the business architecture model and the information service architecture model according to the key field.
According to an embodiment of the present disclosure, the acquisition unit includes a first acquisition subunit, a determination subunit, and a second acquisition subunit. Wherein the first acquisition subunit. And the method is used for obtaining the flow task information by inquiring the business architecture model according to the key field. And the determining subunit is used for determining the target function service according to the flow task. And the second acquisition subunit is used for acquiring a plurality of candidate annotation information by querying the information service architecture model according to the target function service.
According to an embodiment of the present disclosure, the generating module comprises a search first determining unit and a generating unit. Wherein the first determining unit is configured to determine target candidate annotation information from the plurality of candidate annotation information based on a predetermined selection policy. And the generating unit is used for generating code annotation information according to the target candidate annotation information.
According to an embodiment of the present disclosure, the generation unit includes a search subunit and a generation subunit. And the searching subunit is used for searching the target annotation template from the annotation template library according to the preset information assembly rule. And the generation subunit is used for generating code annotation information according to the target annotation template and the target candidate annotation information.
According to an embodiment of the disclosure, the first acquisition module comprises a second determination unit and a display unit. And the second determining unit is used for determining the display position of the code annotation information according to the field position information. And the display unit is used for displaying the code annotation information at the display position through the visual interface.
Any of the first acquisition module 610, the determination module 620, the second acquisition module 630, and the generation module 640 may be combined in one module to be implemented, or any of the modules may be split into a plurality of modules, according to embodiments of the present disclosure. Alternatively, at least some of the functionality of one or more of the modules may be combined with at least some of the functionality of other modules and implemented in one module. According to embodiments of the present disclosure, at least one of the first acquisition module 610, the determination module 620, the second acquisition module 630, and the generation module 640 may be implemented at least in part as hardware circuitry, such as a Field Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), a system on a chip, a system on a substrate, a system on a package, an Application Specific Integrated Circuit (ASIC), or may be implemented in hardware or firmware in any other reasonable manner of integrating or packaging the circuitry, or in any one of or a suitable combination of three of software, hardware, and firmware. Alternatively, at least one of the first acquisition module 610, the determination module 620, the second acquisition module 630, and the generation module 640 may be at least partially implemented as a computer program module, which when executed, may perform the corresponding functions.
Fig. 7 schematically illustrates a block diagram of an electronic device adapted to implement a code annotation information generation method according to an embodiment of the disclosure.
As shown in fig. 7, an electronic device 700 according to an embodiment of the present disclosure includes a processor 701 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 702 or a program loaded from a storage section 708 into a Random Access Memory (RAM) 703. The processor 701 may include, for example, a general purpose microprocessor (e.g., a CPU), an instruction set processor and/or an associated chipset and/or a special purpose microprocessor (e.g., an Application Specific Integrated Circuit (ASIC)), or the like. The processor 701 may also include on-board memory for caching purposes. The processor 701 may comprise a single processing unit or a plurality of processing units for performing different actions of the method flows according to embodiments of the disclosure.
In the RAM 703, various programs and data necessary for the operation of the electronic apparatus 700 are stored. The processor 701, the ROM 702, and the RAM 703 are connected to each other through a bus 704. The processor 701 performs various operations of the method flow according to the embodiments of the present disclosure by executing programs in the ROM 702 and/or the RAM 703. Note that the program may be stored in one or more memories other than the ROM 702 and the RAM 703. The processor 701 may also perform various operations of the method flow according to embodiments of the present disclosure by executing programs stored in the one or more memories.
According to an embodiment of the present disclosure, the electronic device 700 may further include an input/output (I/O) interface 705, the input/output (I/O) interface 705 also being connected to the bus 704. The electronic device 700 may also include one or more of the following components connected to an input/output (I/O) interface 705: an input section 706 including a keyboard, a mouse, and the like; an output portion 707 including a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, a speaker, and the like; a storage section 708 including a hard disk or the like; and a communication section 709 including a network interface card such as a LAN card, a modem, or the like. The communication section 709 performs communication processing via a network such as the internet. The drive 710 is also connected to an input/output (I/O) interface 705 as needed. A removable medium 711 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 710 as necessary, so that a computer program read therefrom is mounted into the storage section 708 as necessary.
The present disclosure also provides a computer-readable storage medium that may be embodied in the apparatus/device/system described in the above embodiments; or may exist alone without being assembled into the apparatus/device/system. The computer-readable storage medium carries one or more programs which, when executed, implement methods in accordance with embodiments of the present disclosure.
According to embodiments of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium, which may include, for example, but is not limited to: a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this disclosure, a computer-readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. For example, according to embodiments of the present disclosure, the computer-readable storage medium may include ROM 702 and/or RAM 703 and/or one or more memories other than ROM 702 and RAM 703 described above.
Embodiments of the present disclosure also include a computer program product comprising a computer program containing program code for performing the methods shown in the flowcharts. The program code, when executed in a computer system, causes the computer system to implement the item recommendation method provided by embodiments of the present disclosure.
The above-described functions defined in the system/apparatus of the embodiments of the present disclosure are performed when the computer program is executed by the processor 701. The systems, apparatus, modules, units, etc. described above may be implemented by computer program modules according to embodiments of the disclosure.
In one embodiment, the computer program may be based on a tangible storage medium such as an optical storage device, a magnetic storage device, or the like. In another embodiment, the computer program may also be transmitted, distributed over a network medium in the form of signals, downloaded and installed via the communication section 709, and/or installed from the removable medium 711. The computer program may include program code that may be transmitted using any appropriate network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the foregoing.
In such an embodiment, the computer program may be downloaded and installed from a network via the communication portion 709, and/or installed from the removable medium 711. The above-described functions defined in the system of the embodiments of the present disclosure are performed when the computer program is executed by the processor 701. The systems, devices, apparatus, modules, units, etc. described above may be implemented by computer program modules according to embodiments of the disclosure.
According to embodiments of the present disclosure, program code for performing computer programs provided by embodiments of the present disclosure may be written in any combination of one or more programming languages, and in particular, such computer programs may be implemented in high-level procedural and/or object-oriented programming languages, and/or assembly/machine languages. Programming languages include, but are not limited to, such as Java, c++, python, "C" or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, partly on a remote computing device, or entirely on the remote computing device or server. In the case of remote computing devices, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., connected via the Internet using an Internet service provider).
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
Those skilled in the art will appreciate that the features recited in the various embodiments of the disclosure and/or in the claims may be provided in a variety of combinations and/or combinations, even if such combinations or combinations are not explicitly recited in the disclosure. In particular, the features recited in the various embodiments of the present disclosure and/or the claims may be variously combined and/or combined without departing from the spirit and teachings of the present disclosure. All such combinations and/or combinations fall within the scope of the present disclosure.
The embodiments of the present disclosure are described above. However, these examples are for illustrative purposes only and are not intended to limit the scope of the present disclosure. Although the embodiments are described above separately, this does not mean that the measures in the embodiments cannot be used advantageously in combination. The scope of the disclosure is defined by the appended claims and equivalents thereof. Various alternatives and modifications can be made by those skilled in the art without departing from the scope of the disclosure, and such alternatives and modifications are intended to fall within the scope of the disclosure.

Claims (11)

1. A code annotation information generation method, comprising:
responding to a received code annotation service request, and acquiring code field information to be annotated, wherein the code field information to be annotated comprises field type information and field content information;
Determining a query strategy according to the field type information;
based on the query strategy, obtaining a plurality of candidate annotation information by querying a database according to the field content information, wherein the database comprises an information service architecture model and a business architecture model; the information service architecture model is constructed according to the association relation between the functional services realized by codes, the business architecture model is constructed according to the association relation between the flow tasks in the business flow, and the flow tasks are in one-to-one correspondence with the functional services realized by the codes; and
and generating the code annotation information according to the candidate annotation information.
2. The method of claim 1, wherein the determining a query policy based on the field type information comprises:
under the condition that the field type information is determined to be a code parameter, determining the query strategy to query based on the information service architecture model; and
and under the condition that the field type information is determined to be a code use case, determining the query strategy to query based on the business architecture model and the information service architecture model.
3. The method of claim 1, wherein the obtaining a plurality of candidate annotation information by querying a database based on the query policy according to the field content information comprises:
extracting key fields in the field content information;
and according to the key field, obtaining the candidate annotation information by inquiring the business architecture model and the information service architecture model.
4. The method of claim 3, wherein the obtaining the plurality of candidate annotation information by querying the business architecture model and the information service architecture model according to the key field comprises:
obtaining flow task information by inquiring the business architecture model according to the key field;
determining a target function service according to the flow task; and
and according to the target function service, obtaining a plurality of candidate annotation information by inquiring the information service architecture model.
5. The method of claim 1, wherein the generating the code annotation information from the plurality of candidate annotation information comprises:
determining target candidate annotation information from the plurality of candidate annotation information based on a predetermined selection policy;
And generating the code annotation information according to the target candidate annotation information.
6. The method of claim 5, wherein the generating the code annotation information from the target candidate annotation information comprises:
searching a target annotation template from the annotation template library according to a preset information assembly rule;
and generating the code annotation information according to the target candidate annotation information according to the target annotation template.
7. The method of claim 1, the code field information to be annotated further comprising field location information, the method further comprising:
determining the display position of the code annotation information according to the field position information; and
and displaying the code annotation information through a visual interface at the display position.
8. A code annotation information generating apparatus comprising:
the system comprises an acquisition module, a code annotation module and a storage module, wherein the acquisition module is used for responding to a received code annotation service request and acquiring code field information to be annotated, wherein the code field information to be annotated comprises field type information and field content information;
the first determining module is used for determining a query strategy according to the field type information;
the query module is used for obtaining a plurality of candidate annotation information by querying a database according to the field content information based on the query strategy; and
And the generation module is used for generating the code annotation information according to the plurality of candidate annotation information.
9. An electronic device, comprising:
one or more processors;
storage means for storing one or more programs,
wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to perform the method of any of claims 1-7.
10. A computer readable storage medium having stored thereon executable instructions which, when executed by a processor, cause the processor to perform the method according to any of claims 1-7.
11. A computer program product comprising a computer program which, when executed by a processor, implements the method according to any one of claims 1 to 7.
CN202310530303.3A 2023-05-11 2023-05-11 Code annotation information generation method, device, equipment and storage medium Pending CN116594683A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310530303.3A CN116594683A (en) 2023-05-11 2023-05-11 Code annotation information generation method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310530303.3A CN116594683A (en) 2023-05-11 2023-05-11 Code annotation information generation method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116594683A true CN116594683A (en) 2023-08-15

Family

ID=87593093

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310530303.3A Pending CN116594683A (en) 2023-05-11 2023-05-11 Code annotation information generation method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116594683A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117149140A (en) * 2023-09-14 2023-12-01 睿珀智能科技有限公司 Method, device and related equipment for generating coded architecture information

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117149140A (en) * 2023-09-14 2023-12-01 睿珀智能科技有限公司 Method, device and related equipment for generating coded architecture information
CN117149140B (en) * 2023-09-14 2024-03-12 睿珀智能科技有限公司 Method, device and related equipment for generating coded architecture information

Similar Documents

Publication Publication Date Title
CN111177231A (en) Report generation method and report generation device
US20120166319A1 (en) Method and system for language-independent search within scanned documents
US20150186808A1 (en) Contextual data analysis using domain information
WO2012102761A1 (en) Method and system for providing detailed information in an interactive manner in a short message service (sms) environment
US20110252049A1 (en) Function execution using sql
CN110737824B (en) Content query method and device
CN116594683A (en) Code annotation information generation method, device, equipment and storage medium
CN111190905A (en) Database table processing method and device and electronic equipment
CN110674117A (en) Data modeling method and device, computer readable medium and electronic equipment
US10956514B2 (en) System and method for directed analysis of content using artifical intelligence for storage and recall
CN115774672A (en) Test case generation method, test case generation device, server and storage medium
CN117009397A (en) Data query method, data query device, electronic equipment and storage medium
US9053151B2 (en) Dynamically joined fast search views for business objects
US11106526B1 (en) Architecture-based root cause analysis
US10061757B2 (en) Systems, methods, and computer-readable media for searching tabular data
CN113515713B (en) Webpage caching strategy generation method and device and webpage caching method and device
CN113342646B (en) Use case generation method, device, electronic equipment and medium
CN113392076A (en) Method, device, electronic equipment and medium for acquiring metadata quality information
CN117149651A (en) Test method, test device, test equipment and storage medium
CN115525365A (en) Method, device and equipment for determining target data entity and storage medium
CN116561803A (en) Security policy information processing method, device, equipment and storage medium
CN113177122A (en) Associated asset determination method and device and electronic equipment
CN117435616A (en) Recommendation method and device for production problem records, electronic equipment and medium
CN116306630A (en) Positioning method, device, electronic equipment, medium and program product of business architecture
CN116483954A (en) Data processing method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination