CN110531965A - A kind of data processing method, program operating method and equipment - Google Patents

A kind of data processing method, program operating method and equipment Download PDF

Info

Publication number
CN110531965A
CN110531965A CN201810499423.0A CN201810499423A CN110531965A CN 110531965 A CN110531965 A CN 110531965A CN 201810499423 A CN201810499423 A CN 201810499423A CN 110531965 A CN110531965 A CN 110531965A
Authority
CN
China
Prior art keywords
code
program code
program
filtered
language
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
CN201810499423.0A
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.)
Alibaba Group Holding Ltd
Original Assignee
Alibaba Group Holding 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 Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201810499423.0A priority Critical patent/CN110531965A/en
Publication of CN110531965A publication Critical patent/CN110531965A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/31Programming languages or programming paradigms
    • G06F8/315Object-oriented languages

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computing Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Devices For Executing Special Programs (AREA)

Abstract

This application provides a kind of data processing method, program operating method and equipment, wherein the data processing method includes: to obtain target program packet, wherein the program code in target program packet is write by Java language;Said program code is filtered according to default filtering rule, obtains filtered program code;It is C language code by the filtered program code translation.It solves the not high technical problem of existing java applet code safety through the above scheme, has reached effective promotion code safety, promote the technical effect for cracking difficulty.

Description

A kind of data processing method, program operating method and equipment
Technical field
The application belongs to field of computer technology more particularly to a kind of data processing method, program operating method and equipment.
Background technique
Java is widely used as current more popular one of development language by developer, for C language, Java applet has many advantages, such as: safety, versatility, stability etc..
However, this allows for the Java text after compiling since the program of Java must satisfy the bytecode specification of virtual machine Part also maintains a large amount of information, also allows for java applet and is easy to be cracked and inversely, special obscures tool although having To avoid cracking and inversely to java applet.However, these obscure work for the attacker for being familiar with Java language characteristic There is no too big preventive effects for tool.
For the low problem of Java code safety, currently no effective solution has been proposed.
Summary of the invention
The application is designed to provide a kind of data processing method, program operating method and equipment, can effectively be promoted The safety of Java code.
The application provides a kind of data processing method and equipment is achieved in that
A kind of data processing method, which comprises
Obtain the target program packet write by Java language;
Said program code is filtered, filtered program code is obtained;
By logic judgment instruction and operational order in the filtered program code, corresponding C sentence is translated into;
The code that will need to interact with JVM in the filtered program code is translated as corresponding JNI function call.
A kind of data processing method, which comprises
Obtain target program packet, wherein the program code in target program packet is write by Java language;
Said program code is filtered according to default filtering rule, obtains filtered program code;
It is C language code by the filtered program code translation.
A kind of data processing equipment, it is described including processor and for the memory of storage processor executable instruction Processor is realized when executing described instruction:
Obtain target program packet, wherein the program code in target program packet is write by Java language;
Said program code is filtered according to default filtering rule, obtains filtered program code;
It is C language code by the filtered program code translation.
A kind of data processing method, which comprises
Obtain the first program, wherein at least part program code in first program uses object oriented language It writes;
The logic judgment instruction and operational order at least part program code are translated as using procedure-oriented The logic judgment instruction and operational order that language is write, obtain the second program;
The code that the needs of second program are interacted with virtual machine is translated as local interface function call or primary connects Mouth function call, obtains object routine.
A kind of data processing method, which comprises
Obtain the first program, wherein at least part program code in first program uses object oriented language It writes;
The code that needs at least part program code are interacted with virtual machine, is translated as local interface function Calling or native interface function call, obtain the second program;
By the logic judgment instruction and operational order in second program, it is translated as writing using procedural language Logic judgment instruction and operational order, obtain object routine.
A kind of program operating method, comprising: run by JVM and utilize above-mentioned data processing method C language generation generated Code.
A kind of computer readable storage medium is stored thereon with computer instruction, and it is above-mentioned that described instruction is performed realization The step of method.
Data processing method, program operating method and equipment provided by the present application, by the part generation in java applet code Code translates into C language code, and the key code in Java bytecode is allowed to be hidden into the executable file of particular platform In, to solve the not high technical problem of existing java applet code safety, reaches effective promotion code safety, mentioned Rise the technical effect for cracking difficulty.
Detailed description of the invention
In order to illustrate the technical solutions in the embodiments of the present application or in the prior art more clearly, to embodiment or will show below There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this The some embodiments recorded in application, for those of ordinary skill in the art, in the premise of not making the creative labor property Under, it is also possible to obtain other drawings based on these drawings.
Fig. 1 is the method flow diagram of data processing method provided by the present application;
Fig. 2 is the conversion logic figure of Java to C file provided by the present application;
Fig. 3 is the flow path switch schematic diagram of Java to C file provided by the present application;
Fig. 4 is specific conversion process figure provided by the present application;
Fig. 5 is the configuration diagram of terminal device provided by the present application;
Fig. 6 is the structural block diagram of data processing equipment provided by the present application.
Specific embodiment
In order to make those skilled in the art better understand the technical solutions in the application, below in conjunction with the application reality The attached drawing in example is applied, the technical scheme in the embodiment of the application is clearly and completely described, it is clear that described implementation Example is merely a part but not all of the embodiments of the present application.Based on the embodiment in the application, this field is common The application protection all should belong in technical staff's every other embodiment obtained without creative efforts Range.
It is easy to crack in view of existing Java code is dangerous and inversely, and C code is not easy to crack and inversely, if It is C code by the code conversion important in Java or in need for promoting safety, and is able to satisfy again normal The demand of Java code parsing operation, then the safety that can will effectively promote Java code.
Fig. 1 is a kind of method flow diagram of herein described data processing method one embodiment.Although the application provides As the following examples or method operating procedure shown in the drawings or apparatus structure, but based on conventional or without creative labor Move in the method or device may include more or less operating procedure or modular unit.It is not present in logicality In the step of necessary causality or structure, the execution sequence of these steps or the modular structure of device are not limited to the application implementation Example description and execution shown in the drawings sequence or modular structure.The device in practice of the method or modular structure or end It, can be according to embodiment or the connection carry out sequence execution or simultaneously of method shown in the drawings or modular structure when holding products application Row executes (such as environment or even distributed processing environment of parallel processor or multiple threads).
Specifically as shown in Figure 1, a kind of data processing method that a kind of embodiment of the application provides may include walking as follows It is rapid:
Step 101: obtaining target program packet, wherein the program code in target program packet is write by Java language 's;
I.e., it is possible to handle java applet packet, wherein the java applet packet can be being also possible to for Dex format Jar format, wherein Dex format is applied in mobile terminal, and applying for Jar format either operates in clothes in windows system It is engaged on device.The java applet packet of both formats can be carried out handling and convert.
When realizing, if it is desired to which conversion process is identical, then the program bag of Dex format can be turned It is changed to the program bag of Jar format, is also possible to being converted to the program bag of Jar format into the program bag of Dex format, be also possible to not The conversion for carrying out program bag format, can specifically select, the application is not construed as limiting this according to actual needs.By Jar format Program bag when be converted to the program bag of Dex format, can be the dx that provides by android system for Jar format Program bag is converted to the program bag of Dex format.
Above-mentioned acquisition target program packet can be the target program packet for obtaining user's input, be also possible to from database The target program packet to be converted being stored in advance directly transferred.Specifically obtained using which kind of mode, it can be according to practical need Selection is asked, the application is not construed as limiting this.
Step 102: said program code being filtered according to default filtering rule, obtains filtered program code;
In view of when carrying out code conversion, some codes are It is not necessary to be converted into C generation in java applet code Code.For this purpose, can be filtered to program code, to filter out the Java code for not needing to carry out code conversion, for example, can Filtering rule to be arranged in the following way:
1) initial method of class is filtered out;
2) filtering code that user specifies is filtered out;
3) method that JNI variable is generated in recursive call is filtered out.
The example of above-mentioned cited filtering rule is only a kind of exemplary description, can also be with when actually realizing Filtering rule is set in other ways, for example, software developer only specifies a certain according to actual software security demand The code of fraction needs to carry out the protection of more high safety, then it is to need to turn that software developer, which can specify only this partial code, It is changed to C code, then filtering rule is exactly that all codes other than this partial code all filter out.
Specifically which kind of mode setting filtering rule using can set according to actual needs, and the application is not construed as limiting this.
Further, it is contemplated that the code for java applet packet itself (such as: Dex formatted file, Jar packet etc.) is all Through overcompression, if the code conversion if being directly based upon java applet packet itself is C code, conversion process is relatively complicated, The translation engine for needing to set is also relative complex.For this purpose, can the bytecode first to java applet packet itself parse, with life At the intermediate file similar with smali format, the intermediate file of this format is not compressed, therefore, in after parsing Between file to be converted to C language code more simple and convenient.
That is, being filtered according to default filtering rule to said program code, obtaining filtered program code be can wrap It includes: the program code in target program packet being parsed, intermediate file is obtained;Intermediate file is filtered, is filtered Program code afterwards.
Step 103: being C language code by the filtered program code translation.
Specifically, can be when by java applet code translation at C language code according to following translation rule It is translated one by one:
1) for function name, function name can be translated according to JNI format, so that the function name after translation can pass through Native code in Java calls directly;
2) for the variable in function, when translation, can find out in translation function the variable in need used, And in the statement of the C function beginning of translation and defined variable;
3) it for the code in function, can translate one by one as follows until that has translated in function all patrols Volume:
If it is logic judgment instruction or operational order (such as: if, goto, addition, position budget etc. instruction), can To translate directly into corresponding C sentence;
If it is the code that needs are interacted with JVM, corresponding JNI function call can be translated into;
If encountering has abnormality processing in Java, label the and goto sentence that can use in C language is substituted.
That is, can be when being C language code by filtered program code translation by filtered program code Middle logic judgment instruction and operational order, translate into corresponding C sentence;It will be needed in the filtered program code and JVM Interactive code is translated as corresponding JNI function call, so that the code of some keys of java applet can be converted C Language codes promote the safety of code, and the generation that wherein will need to interact with JVM so that cracking for calling program becomes trouble Code, is translated as corresponding JNI function call, so that the JVM of understanding can be called by JNI interface, so that after translation Java code can be performed.
It should be noted, however, that translation rule listed above is only a kind of illustrative rule, specific implementation When, translation rule can also be adjusted, the application is not construed as limiting this in the case of different codes.
After translating into C language code, in order to avoid JVM is when executing, repeats, need to delete originally The part code of C language code has been translated into JAVA code.That is, by the filtered program code translation at C After language codes, code corresponding with the C language code in delete target program bag.Further, in order to enable JVM can To call by JNI interface, can need to increase in Java code for having translated into the function name of the function of C language code Add identification information, wherein identification information is translated into C language code for identifying the function, for example, can close by native Key word is as identification information, that is, original Dex formatted file either Jar packet is modified, to having translated into C language code Function adds native keyword, so that JVM when operation data packet, runs to the function, based on therein Native keyword, which could be aware that, to be needed into the library function of C code to call the function.
For example, if in the program bag of script, the entitled public void foo of the function of foo function, if that will For foo function translation for C language code, the function name of the foo function in script program bag is just adjusted to public native void foo。
By filtered program code translation be C language code when, can according to but be not limited to according to such as lower section Formula is translated:
1) function name in the filtered program code is translated according to JNI format;
2) variable that the function in the filtered program code needs to use is translated, and is stated at C function beginning With the definition variable.
3) by logic judgment instruction and operational order in the filtered program code, corresponding C sentence is translated into;
4) code that will need to interact with JVM in the filtered program code is translated as corresponding JNI function tune With.
It, can be according to specific for the content after translation after Java code is converted to C language code in the manner described above Format generate C file, by the C file and change after Java file be combined, can be by having realized JNI interface JVM runs these codes, to run program.
It is worth noting that, because of the system loading for being translated as Java code from C code reconvert when can promote operation, because This, for java applet packet, which code needs to be translated as C phonetic code, which code does not need to be translated as C language generation Code can be selected with system loading according to the actual needs, and the application is not construed as limiting this.
The above method is illustrated below with reference to a specific embodiment, it is important to note, however, that the specific implementation Example does not constitute an undue limitation on the present application merely to the application is better described.
In this example, in order to increase the safety of code, the Java bytecode for being relatively easy to crack can be translated into C language Then speech, then re-starts compiling and is packaged, so that the available effective guarantor of core logic or sensitive information in program Shield.
Wherein, Java is the high-level language of an object-oriented, including the no characteristic of speech sounds of many C languages, such as: it is interior Management is deposited, is inherited, heavy duty, interface, reflection etc..The application scenarios of Java are also relatively more abundant simultaneously, such as: server-side is moved Moved end, IOT can be used.If realizing that Java to the switching between C language, will certainly just encounter procedural C language Conflicting between Java characteristic abundant.In order to protect the stability and enhanced scalability of translation post code, can choose Handle this imbalance using the JNI interface that Java is provided, wherein the operation of related to JVM (such as: Memory Allocation and Recycling, interface calling etc.) JVM is all handed to by JNI to complete.
Based on the above analysis, the content interacted in code to be translated with JVM can all be entrusted into JNI, conversely, any The JVM for realizing JM interface can run the C code after translation, be as shown in Figures 2 and 3 the processing block of the data processing method Frame may include following translation flow:
S1: user inputs Dex formatted file or Jar packet;
S2: if the Jar packet of user's input, the dx that can be provided by Android, are converted to Dex format for Jar packet File;
S3: parsing the bytecode of Dex file, to generate the similar intermediate file with smali format (in Fig. 3 IR), which is equivalent to the file after unziping it to Dex formatted file, which can make translation patrol Collecting becomes simple.
S4: being filtered intermediate file by filter, to filter out the content for not needing translation, specifically, can be with But it is not limited to be filtered according to logic below, that is, filter out following content:
* the initial method of class
* the static method of class
* the method for JNI variable is generated in recursive call
* user specifies the method to be filtered
S5: filtered content is exported to translation engine, is translated one by one by translation engine to specific instruction, and will translation Content afterwards generates C file (that is, C file) by specific format;
S6: modifying to original Dex formatted file or Jar packet, specifically, can be to have translated into C language Function add native keyword.
Above-mentioned translation engine can execute translation process according to logic as shown in Figure 4:
S1: according to JNI format, translating the function name in Java code, and the function name after translation is passed through Native code in Java calls directly;
S2: find out in the function being translated the variable in need used, and at the C function beginning of translation to these changes Amount is stated and is defined;
S3: one by one translating Java bytecode according to following logic, until having translated all logics in function:
3.1 if it is logic judgment instruct or operational order (such as: if, goto, addition, position budget etc. instruction), then directly It connects and translates into corresponding C sentence;
3.2 bytecodes interacted if it is needs with JVM, then translate into corresponding JNI function call;
S4: it if encountering has abnormality processing in Java, can be substituted with label the and goto sentence of C language.
It is illustrated below with a specific example:
Assuming that function foo function its content to be translated is as follows:
public void foo(int a){
If (a > 1) { // sentence 1
bar();// sentence 2
return;// sentence 3
Code after translation are as follows:
extern"C"JNIEXPORT void JNICALL Java_com_examp 1e_Java2C_foo(JNIEnv} Envp--, jobject r1, jint r2)
If (r2 > 1) { // sentence 1
// sentence 2bar ();
Jclass cls=
_jmethodID mid
Mono- > FindClass of env (" com/example/Java2C ");
Mono- > GetMethodID of=env (cls, " bar ", " () V ");
Mono- > CallVoidMethod of env (rl, mid);
return;// sentence 3
In translation is completed, need the public native void foo in script Java code.
In upper example, Java bytecode is automatically translated into C language code, so that the crucial generation in Java bytecode Code can be hidden into the executable file of particular platform, improve the safety of original program, and can be in several scenes The a variety of JVM of middle cooperation are used, it is, for example, possible to use in web server, in mobile terminal, IOT it is medium.
Present invention also provides a kind of data processing methods, may include steps of:
S1: the first program is obtained, wherein at least part program code in first program uses object-oriented language Speech is write;
For example, first program can be the program that the object oriented languages such as java applet, C++ program are write, the first journey Have in sequence partly or completely program code be to be write by object oriented language.
S2: by least part program code logic judgment instruction and operational order, be translated as using towards The logic judgment instruction and operational order that procedural language is write, obtain the second program;
In view of easy the problem of cracking present in object oriented language, and procedural language is not easy to be cracked, Therefore, the instruction of the logic judgment in the program code of object-oriented and operational order etc. can be converted into procedural language generation A possibility that code, the program obtained in this way is cracked, can be much lower, improves the safety of program.For example, can be converted For the language in the procedure-orienteds such as C language.
S3: the code that the needs of second program are interacted with virtual machine is translated as local interface function call or original Raw interface function calls, and obtains object routine.
Because can have some codes for needing to interact with virtual machine in the second program, it can be translated into Interface function calls or native interface function call, so that finally obtained program can be effectively executed.
When actually realizing, it is also possible to the code that first will need to interact with virtual machine in the first program, is translated as Local interface function call or native interface function call, obtain the second program, then again by the logic judgment in the second program Instruction and operational order are translated as the logic judgment write using procedural language instruction and operational order, obtain result journey Sequence.Which kind of flow path switch is specifically used, can be selected according to actual needs, the application is not construed as limiting this.
Embodiment of the method provided by the application is above-mentioned can be filled in mobile terminal, terminal or similar operation Set middle execution.For running on computer terminals, Fig. 5 is a kind of computer of data processing method of the embodiment of the present invention The hardware block diagram of terminal.As shown in figure 5, terminal 10 may include at one or more (only showing one in figure) (processor 102 can include but is not limited to the processing dress of Micro-processor MCV or programmable logic device FPGA etc. to reason device 102 Set), memory 104 for storing data and the transmission module 106 for communication function.Those of ordinary skill in the art It is appreciated that structure shown in fig. 5 is only to illustrate, the structure of above-mentioned electronic device is not caused to limit.For example, computer Terminal 10 may also include than shown in Fig. 5 more perhaps less component or with the configuration different from shown in Fig. 5.
Memory 104 can be used for storing the software program and module of application software, such as the data in the embodiment of the present invention Corresponding program instruction/the module of processing method, processor 102 by the software program that is stored in memory 104 of operation and Module realizes above-mentioned data processing method thereby executing various function application and data processing.Memory 104 can wrap Include high speed random access memory, may also include nonvolatile memory, as one or more magnetic storage device, flash memory or Other non-volatile solid state memories.In some instances, memory 104 can further comprise long-range relative to processor 102 The memory of setting, these remote memories can pass through network connection to terminal 10.The example of above-mentioned network includes But be not limited to internet, intranet, local area network, mobile radio communication and combinations thereof.
Transmission module 106 is used to that data to be received or sent via a network.Above-mentioned network specific example may include The wireless network that the communication providers of terminal 10 provide.In an example, transmission module 106 includes that a network is suitable Orchestration (Network Interface Controller, NIC), can be connected by base station with other network equipments so as to Internet is communicated.In an example, transmission module 106 can be radio frequency (Radio Frequency, RF) module, For wirelessly being communicated with internet.
In software view, above-mentioned data processing equipment can be as shown in Figure 6, comprising: obtains module 601, filtering module 602 and translation module 603, in which:
Module 601 is obtained, for obtaining target program packet, wherein the program code in target program packet is to pass through Java What language was write;
Filtering module 602 obtains filtered journey for being filtered according to default filtering rule to said program code Sequence code;
Translation module 603, for being C language code by the filtered program code translation.
In one embodiment, above-mentioned data processing equipment can also include: removing module, for by the filtering After program code translation afterwards is at C language code, generation corresponding with the C language code in the target program packet is deleted Code;Adding module, for for the function of C language code is translated into the target program packet function name increase identification information, Wherein, the identification information is translated into C language code for identifying the function.
In one embodiment, above-mentioned default filtering rule can include but is not limited at least one of: filtering class Initial method, the filtering code specified of filtering user filters the method that JNI variable is generated in recursive call.
In one embodiment, translation module 603 specifically can translate the filtered program generation according to JNI format Function name in code;The variable that the function in the filtered program code needs to use is translated, and in C function beginning sound It is bright and define the variable.
In one embodiment, above-mentioned translation module 603 specifically can be by logic in the filtered program code Decision instruction and operational order translate into corresponding C sentence;By need to interact with JVM in the filtered program code Code is translated as corresponding JNI function call.
In one embodiment, filtering module 602 specifically can according to default filtering rule to said program code into Row filtering, obtaining filtered program code includes: to parse to the program code in the target program packet, obtains centre File;The intermediate file is filtered, filtered program code is obtained.
In one embodiment, by the filtered program code translation be C language code after, can pass through Realize that the JVM of JNI interface runs the C language code.
For the terminal for running above procedure, it can be and above method C generated is utilized by JVM operation Language codes.
Data processing method, program operating method and equipment provided by the present application, by the part generation in java applet code Code translates into C language code, and the key code in Java bytecode is allowed to be hidden into the executable file of particular platform In, to solve the not high technical problem of existing java applet code safety, reaches effective promotion code safety, mentioned Rise the technical effect for cracking difficulty.
Although this application provides the method operating procedure as described in embodiment or flow chart, based on conventional or noninvasive The labour for the property made may include more or less operating procedure.The step of enumerating in embodiment sequence is only numerous steps One of execution sequence mode, does not represent and unique executes sequence.It, can when device or client production in practice executes To execute or parallel execute (such as at parallel processor or multithreading according to embodiment or method shown in the drawings sequence The environment of reason).
The device or module that above-described embodiment illustrates can specifically realize by computer chip or entity, or by having The product of certain function is realized.For convenience of description, it is divided into various modules when description apparatus above with function to describe respectively. The function of each module can be realized in the same or multiple software and or hardware when implementing the application.It is of course also possible to Realization the module for realizing certain function is combined by multiple submodule or subelement.
Method, apparatus or module described herein can realize that controller is pressed in a manner of computer readable program code Any mode appropriate is realized, for example, controller can take such as microprocessor or processor and storage can be by (micro-) The computer-readable medium of computer readable program code (such as software or firmware) that processor executes, logic gate, switch, specially With integrated circuit (Application Specific Integrated Circuit, ASIC), programmable logic controller (PLC) and embedding Enter the form of microcontroller, the example of controller includes but is not limited to following microcontroller: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20 and Silicone Labs C8051F320, Memory Controller are also implemented as depositing A part of the control logic of reservoir.It is also known in the art that in addition to real in a manner of pure computer readable program code Other than existing controller, completely can by by method and step carry out programming in logic come so that controller with logic gate, switch, dedicated The form of integrated circuit, programmable logic controller (PLC) and insertion microcontroller etc. realizes identical function.Therefore this controller It is considered a kind of hardware component, and hardware can also be considered as to the device for realizing various functions that its inside includes Structure in component.Or even, it can will be considered as the software either implementation method for realizing the device of various functions Module can be the structure in hardware component again.
Part of module in herein described device can be in the general of computer executable instructions Upper and lower described in the text, such as program module.Generally, program module includes executing particular task or realization specific abstract data class The routine of type, programs, objects, component, data structure, class etc..The application, In can also be practiced in a distributed computing environment In these distributed computing environment, by executing task by the connected remote processing devices of communication network.In distribution It calculates in environment, program module can be located in the local and remote computer storage media including storage equipment.
As seen through the above description of the embodiments, those skilled in the art can be understood that the application can It is realized by the mode of software plus required hardware.Based on this understanding, the technical solution of the application is substantially in other words The part that contributes to existing technology can be embodied in the form of software products, and can also pass through the implementation of Data Migration It embodies in the process.The computer software product can store in storage medium, such as ROM/RAM, magnetic disk, CD, packet Some instructions are included to use so that a computer equipment (can be personal computer, mobile terminal, server or network are set It is standby etc.) execute method described in certain parts of each embodiment of the application or embodiment.
Each embodiment in this specification is described in a progressive manner, the same or similar portion between each embodiment Dividing may refer to each other, and each embodiment focuses on the differences from other embodiments.The whole of the application or Person part can be used in numerous general or special purpose computing system environments or configuration.Such as: personal computer, server calculate Machine, handheld device or portable device, mobile communication terminal, multicomputer system, based on microprocessor are at laptop device System, programmable electronic equipment, network PC, minicomputer, mainframe computer, the distribution including any of the above system or equipment Formula calculates environment etc..
Although depicting the application by embodiment, it will be appreciated by the skilled addressee that the application there are many deformation and Variation is without departing from spirit herein, it is desirable to which the attached claims include these deformations and change without departing from the application's Spirit.

Claims (17)

1. a kind of data processing method, which is characterized in that the described method includes:
Obtain the target program packet write by Java language;
Said program code is filtered, filtered program code is obtained;
By logic judgment instruction and operational order in the filtered program code, corresponding C sentence is translated into;
The code that will need to interact with JVM in the filtered program code is translated as corresponding JNI function call.
2. being obtained filtered the method according to claim 1, wherein being filtered to said program code Program code, comprising:
It filters out at least one the following contents in program code: filtering the initial method of class, the filtering generation that filtering user specifies Code filters the method for generating JNI variable in recursive call, obtains filtered program code.
3. a kind of data processing method, which is characterized in that the described method includes:
Obtain target program packet, wherein the program code in target program packet is write by Java language;
Said program code is filtered according to default filtering rule, obtains filtered program code;
It is C language code by the filtered program code translation.
4. according to the method described in claim 3, it is characterized in that, by the filtered program code translation at C language After code, the method also includes:
Delete code corresponding with the C language code in the target program packet;
Increase identification information to translate into the function name of the function of C language code in the target program packet, wherein the mark Information is translated into C language code for identifying the function.
5. according to the method described in claim 3, it is characterized in that, the default filtering rule includes at least one of:
The initial method for filtering out class filters out the filtering code that user specifies, and filters out and generates JNI change in recursive call The method of amount.
6. according to the method described in claim 3, it is characterized in that, being C language generation by the filtered program code translation Code, comprising:
The function name in the filtered program code is translated according to JNI format;
The variable that the function in the filtered program code needs to use is translated, and states and defines at C function beginning The variable.
7. according to the method described in claim 3, it is characterized in that, being C language generation by the filtered program code translation Code, comprising:
By logic judgment instruction and operational order in the filtered program code, corresponding C sentence is translated into;
The code that will need to interact with JVM in the filtered program code is translated as corresponding JNI function call.
8. according to the method described in claim 3, it is characterized in that, being carried out according to default filtering rule to said program code Filter, obtaining filtered program code includes:
Program code in the target program packet is parsed, intermediate file is obtained;
The intermediate file is filtered, filtered program code is obtained.
9. the method according to any one of claim 3 to 8, which is characterized in that by the filtered program code It is translated as after C language code, the method also includes:
By having realized that the JVM of JNI interface runs the C language code.
10. a kind of data processing equipment, which is characterized in that including processor and depositing for storage processor executable instruction Reservoir, the processor are realized when executing described instruction:
Obtain target program packet, wherein the program code in target program packet is write by Java language;
Said program code is filtered according to default filtering rule, obtains filtered program code;
It is C language code by the filtered program code translation.
11. equipment according to claim 10, which is characterized in that the processor is by the filtered program code After translating into C language code, it is also used to:
Delete code corresponding with the C language code in the target program packet;
Increase identification information to translate into the function name of the function of C language code in the target program packet, wherein the mark Information is translated into C language code for identifying the function.
12. equipment according to claim 10, which is characterized in that the processor turns over the filtered program code It is translated into C language code, comprising:
The function name in the filtered program code is translated according to JNI format;
The variable that the function in the filtered program code needs to use is translated, and states and defines at C function beginning The variable.
13. equipment according to claim 10, which is characterized in that the processor turns over the filtered program code It is translated into C language code, comprising:
By logic judgment instruction and operational order in the filtered program code, corresponding C sentence is translated into;
The code that will need to interact with JVM in the filtered program code is translated as corresponding JNI function call.
14. a kind of program operating method characterized by comprising
Data processing method C language code generated described in any one of claim 3 to 9 is utilized by JVM operation.
15. a kind of computer readable storage medium is stored thereon with computer instruction, described instruction, which is performed, realizes that right is wanted The step of seeking any one of 3 to 9 the method.
16. a kind of data processing method, which is characterized in that the described method includes:
Obtain the first program, wherein at least part program code in first program is write using object oriented language;
The logic judgment instruction and operational order at least part program code are translated as using procedural language The logic judgment instruction write and operational order, obtain the second program;
The code that the needs of second program are interacted with virtual machine is translated as local interface function call or native interface letter Number calls, and obtains object routine.
17. a kind of data processing method, which is characterized in that the described method includes:
Obtain the first program, wherein at least part program code in first program is write using object oriented language;
The code that needs at least part program code are interacted with virtual machine, is translated as local interface function call Or native interface function call, obtain the second program;
By the logic judgment instruction and operational order in second program, it is translated as the logic write using procedural language Decision instruction and operational order, obtain object routine.
CN201810499423.0A 2018-05-23 2018-05-23 A kind of data processing method, program operating method and equipment Pending CN110531965A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810499423.0A CN110531965A (en) 2018-05-23 2018-05-23 A kind of data processing method, program operating method and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810499423.0A CN110531965A (en) 2018-05-23 2018-05-23 A kind of data processing method, program operating method and equipment

Publications (1)

Publication Number Publication Date
CN110531965A true CN110531965A (en) 2019-12-03

Family

ID=68657479

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810499423.0A Pending CN110531965A (en) 2018-05-23 2018-05-23 A kind of data processing method, program operating method and equipment

Country Status (1)

Country Link
CN (1) CN110531965A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111274551A (en) * 2019-12-30 2020-06-12 上海上讯信息技术股份有限公司 Compiler-based java code protection method and device and electronic equipment
CN111506314A (en) * 2020-04-08 2020-08-07 网易(杭州)网络有限公司 Project development method, device, server and medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110289490A1 (en) * 2010-05-20 2011-11-24 Mcatamney James A C-to-java programming language translator
CN103413073A (en) * 2013-07-09 2013-11-27 北京深思数盾科技有限公司 Method and equipment for protecting JAVA executable program
CN104463002A (en) * 2014-12-24 2015-03-25 北京奇虎科技有限公司 APK reinforcing method and device and APK reinforcing client and server
CN106055479A (en) * 2016-06-01 2016-10-26 中国科学院信息工程研究所 Android application software test method based on compulsory execution

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110289490A1 (en) * 2010-05-20 2011-11-24 Mcatamney James A C-to-java programming language translator
CN103413073A (en) * 2013-07-09 2013-11-27 北京深思数盾科技有限公司 Method and equipment for protecting JAVA executable program
CN104463002A (en) * 2014-12-24 2015-03-25 北京奇虎科技有限公司 APK reinforcing method and device and APK reinforcing client and server
CN106055479A (en) * 2016-06-01 2016-10-26 中国科学院信息工程研究所 Android application software test method based on compulsory execution

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
RUFFIAN-痞子: ""Android JNI/NDK开发(2)JNI实现C/C++与Android/JAVA相互调用"", 《HTTPS://BLOG.CSDN.NET/U014702653/ARTICLE/DETAILS/71141423》 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111274551A (en) * 2019-12-30 2020-06-12 上海上讯信息技术股份有限公司 Compiler-based java code protection method and device and electronic equipment
CN111506314A (en) * 2020-04-08 2020-08-07 网易(杭州)网络有限公司 Project development method, device, server and medium
CN111506314B (en) * 2020-04-08 2024-05-14 网易(杭州)网络有限公司 Project development method, device, server and medium

Similar Documents

Publication Publication Date Title
EP3971706B1 (en) Method, apparatus and electronic device for deploying operator in deep learning frame work
CN105022630B (en) A kind of assembly management system and assembly management method
US11797692B2 (en) Tool for generating security policies for containers
CN109189469B (en) Reflection-based android application micro-servitization method and system
CN112394942B (en) Distributed software development compiling method and software development platform based on cloud computing
CN111240684B (en) Cutting method and device of JS codes, medium and electronic equipment
CN104407863A (en) Abstract control model programming device and method
US10338901B2 (en) Translation of a visual representation into an executable information extraction program
CN104298534B (en) Programmed method and device based on Lua language
CN113296786B (en) Data processing method, device, electronic equipment and storage medium
CN106326099B (en) A kind of method, apparatus and electronic equipment for program tracking
CN111316232A (en) Providing optimization using annotations of programs
CN110321134A (en) A kind of method of application installation package, the storage medium of generating is with application server
US20190034195A1 (en) Systems and methods for providing patchable rom firmware
CN110531965A (en) A kind of data processing method, program operating method and equipment
CN109582305B (en) Encoding method and device for mobile application page elements and electronic equipment
CN106933642B (en) Application program processing method and processing device
CN103544298A (en) Log analysis method and analysis device for component
CN110354503B (en) Event triggering method and device and terminal
CN106020920A (en) Preprocessing method and system for JCVM interpreter
CN115113922A (en) Method, device, equipment and storage medium for realizing stack-free coroutine
CN110333872A (en) A kind of processing method of application, device, equipment and medium
CN112604273B (en) Data-driven game system function loading method, device and storage medium
CN105005497A (en) Method and apparatus for calling local function in Java card virtual machine
CN106681781A (en) Implementation method and system for real-time computing service

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
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 40017538

Country of ref document: HK

RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20191203