CN108509199A - Automatically generate the method, apparatus, equipment and storage medium of Chinese annotation - Google Patents

Automatically generate the method, apparatus, equipment and storage medium of Chinese annotation Download PDF

Info

Publication number
CN108509199A
CN108509199A CN201810199487.9A CN201810199487A CN108509199A CN 108509199 A CN108509199 A CN 108509199A CN 201810199487 A CN201810199487 A CN 201810199487A CN 108509199 A CN108509199 A CN 108509199A
Authority
CN
China
Prior art keywords
java
chinese annotation
chinese
name
code
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
CN201810199487.9A
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.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen Co Ltd
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 Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN201810199487.9A priority Critical patent/CN108509199A/en
Priority to PCT/CN2018/094102 priority patent/WO2019169814A1/en
Publication of CN108509199A publication Critical patent/CN108509199A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/43Checking; Contextual analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/73Program documentation

Abstract

The invention discloses a kind of methods automatically generating Chinese annotation, the described method comprises the following steps:Database structure table is created according to the instruction received, obtains the database structure table information;When receiving conversion instruction, corresponding field type mapping table is extracted, and the structure table information is converted to by JAVA entity category codes according to the field type mapping table extracted;By the correspondence of the structure table information, corresponding Chinese annotation name is obtained, and the Chinese annotation name extracted is added in the JAVA entity category codes being converted to.The invention also discloses a kind of device automatically generating Chinese annotation, equipment and computer readable storage mediums.The present invention can reduce the code development time, improve code development efficiency, improve the accuracy of Chinese annotation.

Description

Automatically generate the method, apparatus, equipment and storage medium of Chinese annotation
Technical field
The present invention relates to software technology field more particularly to a kind of method, apparatus automatically generating Chinese annotation, equipment and Computer readable storage medium.
Background technology
With the mankind it is various application and hardware chip technology development, various application software become increasingly complex with it is huge, Application software is usually to be made of by the file that the hardware processing element that compiler converts can identify program code.Complicated Software needs to develop a large amount of complicated program code, thus program code problem of management oneself become increasingly conspicuous through becoming, program generation Code is usually text formatting, and program code contains annotation generally for the readability and maintainability for increasing code, annotates Typically to the explanation and illustration of program code.Annotation and program code store and process as a whole.Annotation is Readable program code and maintainable key factor.
Currently, user needs user to write Chinese annotation manually when writing or generating code by database, from certain Lead to waste of human resource in degree, and development efficiency can be caused to reduce, influences the accuracy of Chinese annotation.
Invention content
It is a primary object of the present invention to propose a kind of method, apparatus, equipment and computer automatically generating Chinese annotation Readable storage medium storing program for executing, it is intended to solve existing Chinese annotation method, development efficiency can be caused to reduce, influence the accurate of Chinese annotation Property, the technical issues of leading to waste of human resource.
To achieve the above object, the present invention provides a kind of method automatically generating Chinese annotation, the method includes:
Database structure table is created according to the instruction received, obtains the database structure table information;
When receiving conversion instruction, corresponding field type mapping table is extracted, and according to the field class extracted The structure table information is converted to JAVA entity category codes by type mapping table;
By the correspondence of the structure table information, corresponding Chinese annotation name is obtained, and the Chinese extracted is noted Name is released to be added in the JAVA entity category codes being converted to.
Optionally, the corresponding field type mapping table of the extraction, and corresponded to and closed according to the field type extracted It is that the step of structure table information is converted to JAVA entity category codes by table includes:
Extract corresponding field type mapping table, and by the mapping table by structure table information MAP at JAVA types;
Database table name is converted into the form of big hump or small hump, as JAVA entity class names;
According to the JAVA types of mapping, the corresponding JAVA entities category code of the structure table information is extracted, and will be described JAVA entity class names fill the corresponding position into JAVA entity category codes.
Optionally, the step Chinese annotation name extracted being added in the JAVA entity category codes being converted to Including:
The code for traversing generation in order obtains the same code in the JAVA entity category codes of generation;
Corresponding Chinese annotation name is extracted, when there are same codes for the corresponding JAVA entities category code of the Chinese annotation name When, the Chinese annotation name is added in the code first appeared;
When same code is not present in the corresponding JAVA entities category code of the Chinese annotation name, by the Chinese annotation name It is added in the JAVA entity category codes being converted to.
Optionally, the step Chinese annotation name extracted being added in the JAVA entity category codes being converted to Further include:
Each display page code is traversed in order, is obtained identical in the JAVA entity category codes in each display page Code;
Extraction shows the corresponding Chinese annotation name of JAVA entity category codes in the page, when the Chinese annotation name is corresponding The Chinese annotation name is added to there are when same code in the code that the display page first appears by JAVA entities category code;
When same code is not present in the corresponding JAVA entities category code of the Chinese annotation name, by the Chinese annotation name It is added in the JAVA entity category codes being converted to.
Optionally, the correspondence by the structure table information, the step of obtaining corresponding Chinese annotation name it Before, further include:
Receive Chinese annotation name input by user;
Or, by the JAVA entity category codes being converted to, obtain multiple comprising JAVA entities category code Chinese note The database released;
The JAVA entities category code being converted to and the JAVA entity category codes in database are compared, according to comparison As a result corresponding Chinese annotation name is extracted.
Optionally, the JAVA entities category code by the JAVA entities category code being converted to and database carries out pair Than including according to the step of comparing result extraction corresponding Chinese annotation name:
The JAVA entities category code being converted to and the JAVA entity category codes in database are compared, code is obtained Between similarity;
By the Chinese annotation of the highest JAVA entities category code of similarity, as the JAVA entity category codes being converted to Chinese annotation name.
Optionally, the JAVA entity category codes by being converted to obtain multiple comprising in JAVA entity category codes After the step of database of text annotation, further include:
Obtain the degree of adopting of each database;
Using the highest database of degree of adopting as the database of extraction Chinese annotation;
Chinese corresponding with the JAVA entity category codes being converted to is extracted from the database of the extraction Chinese annotation Annotation, the Chinese annotation name as the JAVA entity category codes being converted to.
In addition, to achieve the above object, the present invention also provides a kind of device automatically generating Chinese annotation, described device packets It includes:
Acquisition module obtains the database structure table letter for creating database structure table according to the instruction received Breath;
Conversion module, for when receiving conversion instruction, extracting corresponding field type mapping table, and according to carrying The structure table information is converted to JAVA entity category codes by the field type mapping table got;
Add module obtains corresponding Chinese annotation name, and will carry for the correspondence by the structure table information The Chinese annotation name got is added in the JAVA entity category codes being converted to.
In addition, to achieve the above object, the present invention also provides a kind of equipment automatically generating Chinese annotation, the automatic life Equipment at Chinese annotation includes automatically generating the program of Chinese annotation, the program for automatically generating Chinese annotation by it is described from The dynamic equipment for generating Chinese annotation realizes the step of automatically generating the method for Chinese annotation as described above when executing.
In addition, to achieve the above object, it is described computer-readable the present invention also provides a kind of computer readable storage medium The program for automatically generating Chinese annotation is stored on storage medium, the program for automatically generating Chinese annotation is executed by processor Shi Shixian automatically generates the step of method of Chinese annotation as described above.
The method, apparatus, equipment and computer readable storage medium proposed by the present invention for automatically generating Chinese annotation, according to The instruction received creates database structure table, obtains the database structure table information;When receiving conversion instruction, extraction Corresponding field type mapping table, and converted the structure table information according to the field type mapping table extracted For JAVA entity category codes;By the correspondence of the structure table information, corresponding Chinese annotation name is obtained, and will extract Chinese annotation name be added in the JAVA entity category codes being converted to, by the above-mentioned means, can be automatically by Chinese annotation It is added in corresponding code, does not need user and be added manually, to improve development efficiency, and improve the standard of Chinese annotation True property.
Description of the drawings
Fig. 1 is the flow diagram for the method first embodiment that the present invention automatically generates Chinese annotation;
Fig. 2 is to extract corresponding field type in the method second embodiment of the invention for automatically generating Chinese annotation to correspond to pass It is table, and the structure table information is converted to the step of JAVA entity category codes according to the field type mapping table extracted Rapid refinement flow diagram;
Fig. 3 is to add the Chinese annotation name extracted in the method 3rd embodiment of the invention for automatically generating Chinese annotation To the refinement flow diagram of the step in the JAVA entity category codes being converted to;
Fig. 4 is to add the Chinese annotation name extracted in the method fourth embodiment of the invention for automatically generating Chinese annotation To the refinement flow diagram of the step in the JAVA entity category codes being converted to;
Fig. 5 is the device structure schematic diagram for the hardware running environment that the embodiment of the present invention is related to.
The embodiments will be further described with reference to the accompanying drawings for the realization, the function and the advantages of the object of the present invention.
Specific implementation mode
It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, it is not intended to limit the present invention.
The primary solutions of the embodiment of the present invention are:Database structure table is created according to the instruction received, obtains institute State database structure table information;When receiving conversion instruction, corresponding field type mapping table is extracted, and according to extraction To field type mapping table the structure table information is converted into JAVA entity category codes;Pass through the structure table information Correspondence, obtain corresponding Chinese annotation name, and it is real that the Chinese annotation name extracted is added to the JAVA that is converted to In body category code, by the above-mentioned means, Chinese annotation can be added in corresponding code automatically, does not need user and carry out manually Addition, to improve development efficiency, and improves the accuracy of Chinese annotation.
The present invention provides a kind of method automatically generating Chinese annotation.
Referring to Fig.1, Fig. 1 is the flow diagram for the method first embodiment that the present invention automatically generates Chinese annotation.
In the present embodiment, this method includes:
Step S10 creates database structure table according to the instruction received, obtains the database structure table information;
In the present embodiment, JAVA entity category codes are generated by the way of by database structure table, do not need user It is write manually, improves the efficiency of written in code, can specifically pass through the extensible markup of the Notes of PowerDesigner Language (XML, Extensible MarkupLanguage) format is created.And establish expansion inquiry file, expansion inquiry The filename expansion inquiry file that uniquely mapping one is pre-created, expansion inquiry file are that the structuring of multilist correlation inquiry is looked into Ask language (SQL Structured Query Language) message file.Such as the table cust_test_info for test, The database structure table information is obtained, the structure table information may include table name, field name, Chinese annotation name, field class Type and field length etc.;For example assume that field name can be test_name, field type is varchar (10), is not for sky Not null, Chinese annotation are entitled " test name ".
Step S20 extracts corresponding field type mapping table when receiving conversion instruction, and according to extracting Field type mapping table the structure table information is converted into JAVA entity category codes;
Specifically, when receiving conversion instruction, corresponding expand of filename reading is inquired according to above-mentioned expansion first and is looked into Ask file, wherein include in above-mentioned expansion inquiry file:Update sentences and expansion are inquired into ginseng field.Conversion equipment is upper Under the instruction for stating update sentences, is inquired according to the structure table information of acquisition and above-mentioned expansion and generate input field into ginseng field Domain:According to above-mentioned input field domain and preset first update function templates, the update functions for expanding inquiry are generated.Into one Step, above-mentioned expansion, which is inquired in file, to include:Select sentences expand query result field and are used to indicate unirecord The instruction information of inquiry or more record queries.Database manipulation code generating unit is under the instruction of above-mentioned select sentences, root Output field domain is generated according to the structure table information of acquisition and above-mentioned expansion query result field:If above-mentioned instruction information instruction is More record queries generate the more notes for expanding inquiry then according to above-mentioned output field domain and preset more record queries function templates Record query function:If above-mentioned instruction information instruction is unirecord inquiry, according to above-mentioned output field domain and preset single note Record inquiry field type mapping table, generates the unirecord query function for expanding inquiry.Above-mentioned unirecord inquiry refers to adjusting Be closed with vernier after the completion, above-mentioned more record queries refer to vernier is opened when calling for the first time and read data fill it is given Structural array, if the structural array once fills endless, recursive call takes for the last time until filling the structural array Data will turn off vernier, or while not taking data shows and closes vernier;By searching for field domain and field Field name in database structure table is converted to JAVA entity category codes by type mapping table.
Step S30 obtains corresponding Chinese annotation name, and will extract by the correspondence of the structure table information Chinese annotation name be added in the JAVA entity category codes being converted to.
After structure table information is converted to JAVA entity category codes, by the correspondence of the structure table information, For example, according to table name, corresponding Chinese annotation name etc. is searched, obtains corresponding Chinese annotation name, and the Chinese extracted is noted It releases name to be added in the JAVA entity category codes being converted to, specifically, the Chinese annotation name extracted is added to and is converted To JAVA entity category codes in method can be, for the corresponding Chinese note extracted of each JAVA entity category code addition Name, or the transformed JAVA entities category code of traversal are released, the repeat statement in code is obtained, then in duplicated code sentence The code addition Chinese annotation name occurred first need not all add Chinese note in each sentence in duplicated code sentence It releases, to reduce memory space, or traverses all JAVA entity category codes in pre-set space, such as each display page In JAVA entity category codes, obtain pre-set space in repeat code statement, the weight then first appeared in pre-set space Multiplexed code sentence adds Chinese annotation name, to reduce memory space, while being read convenient for user, it is, of course, also possible to using it Chinese annotation name is added to JAVA entity category codes by his mode, is not limited herein.
The method for automatically generating Chinese annotation that the present embodiment proposes creates database structure according to the instruction received Table obtains the database structure table information;When receiving conversion instruction, corresponding field type mapping table is extracted, And the structure table information is converted to by JAVA entity category codes according to the field type mapping table extracted;By described The correspondence of structure table information obtains corresponding Chinese annotation name, and the Chinese annotation name extracted is added to and is converted To JAVA entity category codes in, by the above-mentioned means, Chinese annotation can be added in corresponding code automatically, need not use Family is added manually, to improve development efficiency, and improves the accuracy of Chinese annotation.
Further, with reference to Fig. 2, the method first embodiment that Chinese annotation is automatically generated based on the present invention proposes the present invention Automatically generate the method second embodiment of Chinese annotation.
In the present embodiment, the step S20 includes:
Step S21, extracts corresponding field type mapping table, and by the mapping table by structure table information It is mapped to JAVA types;
In the present embodiment, after extraction obtains corresponding field type mapping table, you can pass through the correspondence Relation table by structure table information MAP at JAVA types, such as, it is assumed that in field type mapping table, structure table information type For BIGINT, corresponding JAVA types are Long, then when structure table information is BIGINT, are corresponded to and closed according to the field type It is that table is mapped as Long;
Database table name is converted into the form of big hump or small hump by step S22, as JAVA entity class names;
After by all structure table information MAPs for corresponding JAVA types, further database table name is converted into The form of big hump or small hump, hump form is revised as JAVA entity class names, such as test_name TestName, as JAVA entity class names.
Step S23 extracts the corresponding JAVA entities category code of the structure table information according to the JAVA types of mapping, and The JAVA entities class name is filled into the corresponding position into JAVA entity category codes.
Then the JAVA types mapped directly extract the corresponding JAVA entities category code of structure table information, and according to structure The sequence of table information arranges transformed JAVA entities category code, and by the JAVA entities class name fill to Corresponding position in JAVA entity category codes, such as when the title of the entitled whole section of entity category code of the JAVA entity class, Then the JAVA entities class name is filled to whole section of entity category code, the entity class name as whole section of entity category code Claim.
Further, with reference to Fig. 3, the method first embodiment that Chinese annotation is automatically generated based on the present invention proposes the present invention Automatically generate the method 3rd embodiment of Chinese annotation.
In the present embodiment, " the Chinese annotation name extracted is added to the JAVA being converted in the step S30 In entity category code " include:
Step S31 traverses the code of generation in order, obtains the same code in the JAVA entity category codes of generation;
In the present embodiment, when there are when identical code statement, may be used in the generation repeated in transformed code In code sentence, the mode that Chinese annotation name is added in part is added Chinese annotation name, therefore, it is necessary first to search the generation of repetition Code sentence specifically traverses the code of generation in order first, obtains the same code in the JAVA entity category codes of generation, It can specifically be traversed according to the priority of code arrangement, the same code in JAVA entity category codes to obtain generation;
Step S32 extracts corresponding Chinese annotation name, when the corresponding JAVA entities category code of the Chinese annotation name exists When same code, the Chinese annotation name is added in the code first appeared;
After traversal is completed, you can corresponding Chinese annotation name is extracted, when the corresponding JAVA of the Chinese annotation name is real The Chinese annotation name is added in the code first appeared by body category code there are when same code, identical when subsequently occurring Code statement when, need not be annotated, to reduce memory space;
Step S33, when same code is not present in the corresponding JAVA entities category code of the Chinese annotation name, in described Text annotation name is added in the JAVA entity category codes being converted to.
When same code is not present in the corresponding JAVA entities category code of the Chinese annotation name, by the Chinese annotation name It is added in the JAVA entity category codes being converted to, i.e., when there is no identical code statement, for the JAVA being converted to The each sentence of entity category code all adds corresponding Chinese annotation name, consequently facilitating user reads.
The method for automatically generating Chinese annotation that the present embodiment proposes obtains life by traversing the code of generation in order At JAVA entity category codes in same code;Then corresponding Chinese annotation name is extracted, when the Chinese annotation name corresponds to JAVA entities category code there are when same code, the Chinese annotation name is added in the code first appeared;When described When same code is not present in the corresponding JAVA entities category code of Chinese annotation name, the Chinese annotation name is added to and is converted to JAVA entity category codes in, realize flexibly addition Chinese annotation, to reduce memory space, and read convenient for user.
Further, with reference to Fig. 4, the method first embodiment that Chinese annotation is automatically generated based on the present invention proposes the present invention Automatically generate the method fourth embodiment of Chinese annotation.
In the present embodiment, " the Chinese annotation name extracted is added to the JAVA being converted in the step S30 In entity category code " further include:
Step S34 traverses each display page code in order, obtains the JAVA entity category codes in each display page In same code;
In the present embodiment, it can also use in each display page, carry out the mode that Chinese annotation is added in part, tool Body, each display page code is traversed in order, obtains the identical generation in the JAVA entity category codes in each display page Code;JAVA entity category codes can specifically be traversed according to the sequence that the page is shown, to obtain in each display page JAVA entity category codes in same code;
Step S35, extraction shows the corresponding Chinese annotation name of JAVA entity category codes in the page, when the Chinese annotation The Chinese annotation name is added to what the display page first appeared by the corresponding JAVA entities category code of name there are when same code In code;
After traversal is completed, you can extraction shows the corresponding Chinese annotation name of JAVA entity category codes in the page, works as institute The corresponding JAVA entities category code of Chinese annotation name is stated there are when same code, the Chinese annotation name is added to the display page In the code first appeared, i.e., in the code statement that current page is shown, when follow-up appearance is consistent with Chinese annotation name has been added Code statement when, Chinese annotation name need not be added again, to reduce memory space, while also allow for user reading;
Step S36, when same code is not present in the corresponding JAVA entities category code of the Chinese annotation name, in described Text annotation name is added in the JAVA entity category codes being converted to.
When same code is not present in the corresponding JAVA entities category code of the Chinese annotation name, by the Chinese annotation name It is added in the JAVA entity category codes being converted to, i.e., when there is no identical code statement, for the JAVA being converted to The each sentence of entity category code all adds corresponding Chinese annotation name, consequently facilitating user reads.
Further, the method first embodiment that Chinese annotation is automatically generated based on the present invention proposes that the present invention automatically generates The 5th embodiment of method of Chinese annotation.
In the present embodiment, the step S10 includes:
Receive Chinese annotation name input by user;
In the present embodiment, Chinese annotation name can be inputted by user, then protects Chinese annotation name input by user It deposits into database structure table, to obtain Chinese annotation name;
Or, by the JAVA entity category codes being converted to, obtain multiple comprising JAVA entities category code Chinese note The database released;
Or the JAVA entity category codes by being converted to, it obtains multiple comprising JAVA entities category code Chinese note The database released, i.e., by the JAVA entities category code, it includes the JAVA entities category code to search, and includes in corresponding to The database of text annotation;
The JAVA entities category code being converted to and the JAVA entity category codes in database are compared, according to comparison As a result corresponding Chinese annotation name is extracted.
Specifically, the JAVA entities category code by the JAVA entities category code being converted to and database carries out pair Than extracting corresponding Chinese annotation name according to comparing result and can specifically include:
The JAVA entities category code being converted to and the JAVA entity category codes in database are compared, code is obtained Between similarity;
By the Chinese annotation of the highest JAVA entities category code of similarity, as the JAVA entity category codes being converted to Chinese annotation name.
The JAVA entities category code that will be converted to is compared with the JAVA entity category codes in database, according to right Extract corresponding Chinese annotation name than result, with specific reference to the similarity between code, by with the JAVA entity class that is converted to The Chinese annotation of JAVA entity category codes in the highest database of code similarity, as the JAVA entity class generations being converted to The Chinese annotation name of code is manually entered Chinese annotation without user, reduces the workload of User Exploitation code, and raising is opened Send out efficiency.
Further, the 5th embodiment of method that Chinese annotation is automatically generated based on the present invention proposes that the present invention automatically generates The method sixth embodiment of Chinese annotation.
In the present embodiment, the JAVA entity category codes by being converted to, it includes JAVA entity class to obtain multiple After the step of database of code Chinese annotation, further include:
Obtain the degree of adopting of each database;
After obtaining multiple databases comprising JAVA entity category code Chinese annotations, each number can be further obtained According to the degree of adopting in library, i.e., adopt number and frequency etc. by other users;
Using the highest database of degree of adopting as the database of extraction Chinese annotation;
Chinese corresponding with the JAVA entity category codes being converted to is extracted from the database of the extraction Chinese annotation Annotation, the Chinese annotation name as the JAVA entity category codes being converted to.
Then the degree of adopting of each database is subjected to comparison sequence, obtains the highest database of degree of adopting, and will adopt Spend database of the highest database as extraction Chinese annotation;And it extracts and turns from the database of the extraction Chinese annotation The corresponding Chinese annotation of JAVA entity category codes got in return, the Chinese annotation as the JAVA entity category codes being converted to Name.
The embodiment of the present invention further provides for a kind of device automatically generating Chinese annotation, and described device includes:
Acquisition module obtains the database structure table letter for creating database structure table according to the instruction received Breath;
Conversion module, for when receiving conversion instruction, extracting corresponding field type mapping table, and according to carrying The structure table information is converted to JAVA entity category codes by the field type mapping table got;
Add module obtains corresponding Chinese annotation name, and will carry for the correspondence by the structure table information The Chinese annotation name got is added in the JAVA entity category codes being converted to.
The present invention automatically generates the specific embodiment of the device of Chinese annotation and the above-mentioned method for automatically generating Chinese annotation Each embodiment is essentially identical, and therefore not to repeat here.
The embodiment of the present invention further provides for a kind of equipment automatically generating Chinese annotation.
With reference to Fig. 5, Fig. 5 is the device structure schematic diagram for the hardware running environment that the embodiment of the present invention is related to.
As shown in figure 5, the equipment for automatically generating Chinese annotation may include:Processor 1001, such as CPU, network connect Mouth 1002, user interface 1003, memory 1004.Connection communication between these components can be realized by communication bus.Net Network interface 1002 may include optionally the wireline interface (for connecting cable network) of standard, (such as WI-FI connects wireless interface Mouth, blue tooth interface, infrared interface etc., for connecting wireless network).User interface 1003 may include display screen (Display), input unit such as keyboard (Keyboard), optional user interface 1003 can also include the wireline interface of standard (such as connecting wired keyboard, wire mouse etc.) and/or wireless interface (such as connecting Wireless Keyboard, wireless mouse Mark).Memory 1004 can be high-speed RAM memory, can also be stable memory (non-volatile memory), Such as magnetic disk storage.Memory 1004 optionally can also be the storage device independently of aforementioned processor 1001.
Optionally, which can also include camera, (Radio Frequency, are penetrated RF Frequently circuit), sensor, voicefrequency circuit, WiFi module etc..
It will be understood by those skilled in the art that the device structure for automatically generating Chinese annotation shown in figure is not constituted pair The restriction for automatically generating the equipment of Chinese annotation may include components more more or fewer than diagram, or combine certain components, Or different component arrangement.
As shown in figure 5, as may include that operating system, network are logical in a kind of memory 1004 of computer storage media Believe module, Subscriber Interface Module SIM and the program for automatically generating Chinese annotation.Wherein, operating system is that management and control are automatic raw At the device hardware of Chinese annotation and the program of software resource, in supporting network communication module, Subscriber Interface Module SIM, automatically generating The operation of the program and other programs or software of text annotation;Network communication module is for managing and controlling network interface 1002; Subscriber Interface Module SIM is for managing and controlling user interface 1003.
In the equipment for automatically generating Chinese annotation shown in Fig. 5, network interface 1002 is mainly used for connecting database, with Database is into row data communication;User interface 1003 is mainly used for connecting client (can be understood as user terminal), with client Into row data communication, information is such as shown to client by window, or receives the operation information that client is sent;And processor 1001 can be used for executing the program for automatically generating Chinese annotation stored in memory 1004, to realize such as above-mentioned automatic life The step of embodiment each at the method for Chinese annotation.
The present invention also provides a kind of computer readable storage medium, there are one the computer-readable recording medium storages Or multiple programs, one or more of programs can be executed by one or more processor, with realize as it is above-mentioned from The step of dynamic method for generating Chinese annotation each embodiment.
It should also be noted that, herein, the terms "include", "comprise" or its any other variant are intended to non- It is exclusive to include, so that process, method, article or device including a series of elements include not only those elements, But also include other elements that are not explicitly listed, or further include solid by this process, method, article or device Some elements.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that including There is also other identical elements in the process of the element, method, article or device.
Through the above description of the embodiments, those skilled in the art can be understood that above-described embodiment side Method can add the mode of required general hardware platform to realize by software, naturally it is also possible to by hardware, but in many cases The former is more preferably embodiment.Based on this understanding, technical scheme of the present invention substantially in other words does the prior art Going out the part of contribution can be expressed in the form of software products, which is stored in a storage medium In (such as ROM/RAM, magnetic disc, CD), including some instructions are used so that a station terminal equipment (can be mobile phone, computer, clothes Be engaged in device, air conditioner or the network equipment etc.) method that executes each embodiment of the present invention.
It these are only the preferred embodiment of the present invention, be not intended to limit the scope of the invention, it is every to utilize this hair Equivalent structure or equivalent flow shift made by bright specification and accompanying drawing content is applied directly or indirectly in other relevant skills Art field, is included within the scope of the present invention.

Claims (10)

1. a kind of method automatically generating Chinese annotation, which is characterized in that the described method comprises the following steps:
Database structure table is created according to the instruction received, obtains the database structure table information;
When receiving conversion instruction, corresponding field type mapping table is extracted, and according to the field type pair extracted Answer relation table that the structure table information is converted to JAVA entity category codes;
By the correspondence of the structure table information, corresponding Chinese annotation name, and the Chinese annotation name that will be extracted are obtained It is added in the JAVA entity category codes being converted to.
2. the method as described in claim 1 for automatically generating Chinese annotation, which is characterized in that described to extract corresponding field class Type mapping table, and the structure table information is converted to by JAVA entity class according to the field type mapping table extracted The step of code includes:
Extract corresponding field type mapping table, and by the mapping table by structure table information MAP at JAVA classes Type;
Database table name is converted into the form of big hump or small hump, as JAVA entity class names;
According to the JAVA types of mapping, the corresponding JAVA entities category code of the structure table information is extracted, and the JAVA is real Body class name fills the corresponding position into JAVA entity category codes.
3. the method as described in claim 1 for automatically generating Chinese annotation, which is characterized in that described to note the Chinese extracted Releasing the step that name is added in the JAVA entity category codes being converted to includes:
The code for traversing generation in order obtains the same code in the JAVA entity category codes of generation;
Corresponding Chinese annotation name is extracted, when the corresponding JAVA entities category code of the Chinese annotation name is there are when same code, The Chinese annotation name is added in the code first appeared;
When same code is not present in the corresponding JAVA entities category code of the Chinese annotation name, the Chinese annotation name is added Into the JAVA entity category codes being converted to.
4. the method as described in claim 1 for automatically generating Chinese annotation, which is characterized in that described to note the Chinese extracted Releasing the step that name is added in the JAVA entity category codes being converted to further includes:
Each display page code is traversed in order, obtains the identical generation in the JAVA entity category codes in each display page Code;
Extraction shows the corresponding Chinese annotation name of JAVA entity category codes in the page, as the corresponding JAVA of the Chinese annotation name The Chinese annotation name is added to there are when same code in the code that the display page first appears by entity category code;
When same code is not present in the corresponding JAVA entities category code of the Chinese annotation name, the Chinese annotation name is added Into the JAVA entity category codes being converted to.
5. the method as described in claim 1 for automatically generating Chinese annotation, which is characterized in that described to be believed by the structure table The correspondence of breath further includes before the step of obtaining corresponding Chinese annotation name:
Receive Chinese annotation name input by user;
Or, by the JAVA entity category codes being converted to, multiple data for including JAVA entity category code Chinese annotations are obtained Library;
The JAVA entities category code being converted to and the JAVA entity category codes in database are compared, according to comparing result Extract corresponding Chinese annotation name.
6. the method as claimed in claim 5 for automatically generating Chinese annotation, which is characterized in that the JAVA that will be converted to Entity category code is compared with the JAVA entity category codes in database, and corresponding Chinese annotation name is extracted according to comparing result The step of include:
The JAVA entities category code being converted to and the JAVA entity category codes in database are compared, between acquisition code Similarity;
By the Chinese annotation of the highest JAVA entities category code of similarity, the Chinese as the JAVA entity category codes being converted to Annotate name.
7. the as claimed in claim 5 method for automatically generating Chinese annotation, which is characterized in that described by being converted to JAVA entity category codes further include after the step of obtaining multiple databases comprising JAVA entity category code Chinese annotations:
Obtain the degree of adopting of each database;
Using the highest database of degree of adopting as the database of extraction Chinese annotation;
Chinese annotation corresponding with the JAVA entity category codes being converted to is extracted from the database of the extraction Chinese annotation, Chinese annotation name as the JAVA entity category codes being converted to.
8. a kind of device automatically generating Chinese annotation, which is characterized in that described device includes:
Acquisition module obtains the database structure table information for creating database structure table according to the instruction received;
Conversion module, for when receiving conversion instruction, extracting corresponding field type mapping table, and according to extracting Field type mapping table the structure table information is converted into JAVA entity category codes;
Add module obtains corresponding Chinese annotation name, and will extract for the correspondence by the structure table information Chinese annotation name be added in the JAVA entity category codes being converted to.
9. a kind of equipment automatically generating Chinese annotation, which is characterized in that the equipment for automatically generating Chinese annotation includes place Device, network interface, user interface and memory are managed, the program for automatically generating Chinese annotation is stored in the memory;It is described Processor is used to execute the program for automatically generating Chinese annotation, to realize oneself as described in any one of claim 1 to 7 The step of dynamic method for generating Chinese annotation.
10. a kind of computer readable storage medium, which is characterized in that be stored with automatic life on the computer readable storage medium It is realized at the program of Chinese annotation, when the program for automatically generating Chinese annotation is executed by processor as in claim 1 to 7 Any one of them automatically generates the step of method of Chinese annotation.
CN201810199487.9A 2018-03-09 2018-03-09 Automatically generate the method, apparatus, equipment and storage medium of Chinese annotation Pending CN108509199A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201810199487.9A CN108509199A (en) 2018-03-09 2018-03-09 Automatically generate the method, apparatus, equipment and storage medium of Chinese annotation
PCT/CN2018/094102 WO2019169814A1 (en) 2018-03-09 2018-07-02 Method, apparatus and device for automatically generating chinese annotation, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810199487.9A CN108509199A (en) 2018-03-09 2018-03-09 Automatically generate the method, apparatus, equipment and storage medium of Chinese annotation

Publications (1)

Publication Number Publication Date
CN108509199A true CN108509199A (en) 2018-09-07

Family

ID=63377519

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810199487.9A Pending CN108509199A (en) 2018-03-09 2018-03-09 Automatically generate the method, apparatus, equipment and storage medium of Chinese annotation

Country Status (2)

Country Link
CN (1) CN108509199A (en)
WO (1) WO2019169814A1 (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109542453A (en) * 2018-11-20 2019-03-29 北京千丁互联科技有限公司 Database information recognition methods, device and terminal
CN111984670A (en) * 2020-07-27 2020-11-24 北京天健源达科技股份有限公司 Method for generating display view annotation information script
CN112148746A (en) * 2020-08-21 2020-12-29 杭州安恒信息技术股份有限公司 Method and device for generating database table structure document, electronic device and storage medium
CN112416429A (en) * 2020-11-23 2021-02-26 平安普惠企业管理有限公司 Code annotation generation method and device
CN113032360A (en) * 2021-03-04 2021-06-25 四川瀚库智数科技有限公司 Method for inferring database field meaning

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101697120A (en) * 2009-11-05 2010-04-21 河南辉煌科技股份有限公司 Relational database based generation method of J2EE code
CN102968306A (en) * 2012-11-29 2013-03-13 广东全通教育股份有限公司 Method and system for automatically generating code based on data model drive
CN105677323A (en) * 2015-12-31 2016-06-15 合肥大多数信息科技有限公司 Method for automatically generating database operation layer codes
WO2013106947A9 (en) * 2012-01-18 2017-05-04 Metrologic Instruments, Inc. Web-based scan-task enabled system. and method of and apparatus for developing and deploying the same on a client-server network
CN106873974A (en) * 2016-12-30 2017-06-20 武汉默联股份有限公司 Smart code generates automotive engine system and method
CN107479883A (en) * 2017-08-07 2017-12-15 海闻科技有限公司 A kind of code generating method and code generator

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102129365A (en) * 2010-01-20 2011-07-20 阿里巴巴集团控股有限公司 Method and device for generating code documentations
CN105824794A (en) * 2016-03-11 2016-08-03 天脉聚源(北京)教育科技有限公司 Annotation adding method and device
CN107608669A (en) * 2017-08-15 2018-01-19 山西云度知识产权服务有限公司 A kind of method based on database table structure automatic generation function and the page

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101697120A (en) * 2009-11-05 2010-04-21 河南辉煌科技股份有限公司 Relational database based generation method of J2EE code
WO2013106947A9 (en) * 2012-01-18 2017-05-04 Metrologic Instruments, Inc. Web-based scan-task enabled system. and method of and apparatus for developing and deploying the same on a client-server network
CN102968306A (en) * 2012-11-29 2013-03-13 广东全通教育股份有限公司 Method and system for automatically generating code based on data model drive
CN105677323A (en) * 2015-12-31 2016-06-15 合肥大多数信息科技有限公司 Method for automatically generating database operation layer codes
CN106873974A (en) * 2016-12-30 2017-06-20 武汉默联股份有限公司 Smart code generates automotive engine system and method
CN107479883A (en) * 2017-08-07 2017-12-15 海闻科技有限公司 A kind of code generating method and code generator

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109542453A (en) * 2018-11-20 2019-03-29 北京千丁互联科技有限公司 Database information recognition methods, device and terminal
CN111984670A (en) * 2020-07-27 2020-11-24 北京天健源达科技股份有限公司 Method for generating display view annotation information script
CN111984670B (en) * 2020-07-27 2024-03-19 北京天健源达科技股份有限公司 Method for generating script of annotation information of display view
CN112148746A (en) * 2020-08-21 2020-12-29 杭州安恒信息技术股份有限公司 Method and device for generating database table structure document, electronic device and storage medium
CN112148746B (en) * 2020-08-21 2024-03-26 杭州安恒信息技术股份有限公司 Method, device, electronic device and storage medium for generating database table structure document
CN112416429A (en) * 2020-11-23 2021-02-26 平安普惠企业管理有限公司 Code annotation generation method and device
CN113032360A (en) * 2021-03-04 2021-06-25 四川瀚库智数科技有限公司 Method for inferring database field meaning

Also Published As

Publication number Publication date
WO2019169814A1 (en) 2019-09-12

Similar Documents

Publication Publication Date Title
CN108399130A (en) Automatically generate the method, apparatus, equipment and readable storage medium storing program for executing of test cases
CN108509199A (en) Automatically generate the method, apparatus, equipment and storage medium of Chinese annotation
KR101122841B1 (en) System and method for schemaless data mapping with nested tables
US8346803B2 (en) Dynamic generation of target files from template files and tracking of the processing of target files
US8683324B2 (en) Dynamic generation of target files from template files and tracking of the processing of target files
CN108121542B (en) MyBatis-based SQL statement configuration method and system
CN103631604B (en) A kind of standardized digital education resource management method based on CELTS-41 specification
CN109299202B (en) Geological space data sharing method based on GeoSciML
CN105808428A (en) Method for performing unified performance test on distributed file system
CN104881275A (en) Electronic spreadsheet generating method and device
WO2017058047A1 (en) Method of preparing documents in markup languages
US9646004B2 (en) Hierarchical database report generation with automated query generation for placeholders
CN111309313A (en) Method for quickly generating HTML (hypertext markup language) and storing form data
CN111259067B (en) Method, device and equipment for realizing DAO interface based on Spring
CN108762743A (en) Data table operation code generation method and device
CN101625694A (en) Method and system for storing various standard geological metadata
CN107291471A (en) A kind of Meta model framework system for supporting customizable data acquisition
US10776351B2 (en) Automatic core data service view generator
CN104699758A (en) Intelligent generation system and method of graphic library-associated command document
CN112162751A (en) Automatic generation method and system of interface document
CN106776779B (en) Method for generating entity file by JSON data based on Mac platform
WO2004077268A2 (en) System and method for dynamic data binding in distributed applications
CN112698819A (en) Method, device and storage medium for designing tree-oriented object programming program
TW201525737A (en) Method for automatically generating website interactive program
CN116303359A (en) Method for realizing multi-type document export of database structure

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20180907