Supercharge Your Innovation With Domain-Expert AI Agents!

Method and device for converting java code, storage medium, and electronic device

A storage medium and code technology, applied in the field of Java code conversion, can solve the problems of repetitive workload, error-prone, slow manual writing, etc., and achieve the effect of improving the efficiency of code writing

Inactive Publication Date: 2019-02-26
ZHEJIANG KOUBEI NETWORK TECH CO LTD
View PDF2 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0003] In related technologies, the tools used in research and development only support the conversion of java code into C language, etc. For example, in the application document with the publication number CN104463002A, a scheme for converting Java code into corresponding Native C code for reflection calling is disclosed. The solutions in related technologies cannot convert java code into schema, and general java code is directly generated by data model tools, and editing is relatively simple. If you need to edit the schema agreed between the client and the client, the workload will be repeated, and due to the lack of The grammar checker of the schema makes manual writing slow and error-prone
[0004] For the above-mentioned problems existing in related technologies, no effective solution has been found yet

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Method and device for converting java code, storage medium, and electronic device
  • Method and device for converting java code, storage medium, and electronic device
  • Method and device for converting java code, storage medium, and electronic device

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0038] The method embodiment provided in Embodiment 1 of the present application may be executed in a mobile terminal, a computer terminal, a server or a similar computing device. Taking running on a mobile terminal as an example, figure 1 It is a block diagram of the hardware structure of a mobile terminal converting java codes according to the embodiment of the present invention. like figure 1 As shown, the mobile terminal 10 may include one or more ( figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data. Optionally, the above-mentioned mobile terminal also A transmission device 106 for communication functions as well as input and output devices 108 may be included. Those of ordinary skill in the art can understand that, figure 1 The shown structure is only for illustration, and does not limit the st...

Embodiment 2

[0081] In this embodiment, a device for converting java codes is also provided. The device is used to implement the above embodiments and preferred implementation modes, including a terminal, a server, etc., which have already been described and will not be repeated. As used below, the term "module" may be a combination of software and / or hardware that realizes a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementations in hardware, or a combination of software and hardware are also possible and contemplated.

[0082] Figure 4 is a structural block diagram of a terminal for converting java codes according to an embodiment of the present invention, such as Figure 4 As shown, the device includes:

[0083] Loading module 40, for loading the data class of java code;

[0084] The processing module 42 is configured to view all attributes of the data class, and obtain the type to which each attribu...

Embodiment 3

[0128] An embodiment of the present invention also provides a storage medium, in which a computer program is stored, wherein the computer program is set to execute the steps in any one of the above method embodiments when running.

[0129] Optionally, in this embodiment, the above-mentioned storage medium may be configured to store a computer program for performing the following steps:

[0130] S1, load the data class of java code;

[0131] S2. View all attributes of the data class, and acquire the type to which each attribute belongs, wherein the types include: simple type, complex type;

[0132] S3, generating an avro schema from the data class of the java code according to the type.

[0133] Optionally, in this embodiment, the above-mentioned storage medium may include but not limited to: U disk, read-only memory (Read-Only Memory, ROM for short), random access memory (Random Access Memory, RAM for short), Various media that can store computer programs, such as removable ...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention provides a method and a device for converting a java code, a storage medium and an electronic device, wherein, the method comprises the following steps of: loading a data class of a javacode; All attributes of the data class are viewed, and the types to which each attribute belongs are obtained, wherein, the types include simple types and complex types; Generating a schema of avro from the data class of the java code according to the type. The invention solves the technical problem that the java code cannot be converted into schema in the related art.

Description

technical field [0001] The invention relates to the field of computers, in particular to a method and device for converting java codes, a storage medium and an electronic device. Background technique [0002] Avro is a sub-project in Hadoop (a big data development language) and an independent project in Apache. Avro is a high-performance middleware based on binary data transmission. Avro relies on schema and defines various data through schema. Structure, the data can be interpreted only after the schema is determined, so before the serialization and deserialization of the data, the structure of the schema must be determined first, and the Schema needs to be generated. [0003] In related technologies, the tools used in research and development only support the conversion of java code into C language, etc. For example, in the application document with the publication number CN104463002A, a scheme for converting Java code into corresponding Native C code for reflection callin...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
IPC IPC(8): G06F8/51
CPCG06F8/51
Inventor 贺三元饶俊学
Owner ZHEJIANG KOUBEI NETWORK TECH CO LTD
Features
  • R&D
  • Intellectual Property
  • Life Sciences
  • Materials
  • Tech Scout
Why Patsnap Eureka
  • Unparalleled Data Quality
  • Higher Quality Content
  • 60% Fewer Hallucinations
Social media
Patsnap Eureka Blog
Learn More