Code data processing method, device, electronic device and storage medium

By integrating code detection and protection during the code compilation process and utilizing dynamic and static analysis and binary hardening technologies, the problems of high cost and inflexibility of code detection and protection in existing technologies are solved, and efficient cross-platform code security protection is achieved.

CN114661297BActive Publication Date: 2025-09-05BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210335535.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-30
Publication Date
2025-09-05
Estimated Expiration
2042-03-30

AI Technical Summary

Technical Problem

Existing technologies are costly and inflexible in the code detection and protection process, and the reinforcement solutions between different platforms are not universal, resulting in a significant increase in the cost of code detection and protection.

Method used

Integrate code detection and protection into the front-end, optimization, and link compilation modules, identify security and quality defects through dynamic and static analysis techniques, perform binary reinforcement and obfuscation processing, and use virtual bytecode to achieve cross-platform compatibility.

Benefits of technology

It improves the flexibility of code detection and protection, reduces costs, and implements cross-platform code protection, improving code security and reliability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114661297B_ABST
    Figure CN114661297B_ABST
Patent Text Reader

Abstract

The present disclosure provides a code data processing method, which relates to the field of artificial intelligence technology, and in particular to the field of computer program compilation. The specific implementation scheme is: according to the code data, determine the target compilation task and code compilation parameters to be executed; according to the code compilation parameters, determine the target security task and security compilation parameters to be executed; and according to the code compilation parameters and security compilation parameters, execute the target compilation task and target security task to obtain the code processing result; wherein the target security task includes at least one of the front-end security task, the optimization security task and the link security task. Implementing code detection or code protection in the code compilation process improves flexibility and reduces related costs. The present disclosure also provides a code data processing device, an electronic device and a storage medium.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of artificial intelligence technology, and in particular to the field of computer program compilation technology. More specifically, the present disclosure provides a code data processing method, device, electronic device, and storage medium. Background Art

[0002] With the continuous development of computer and internet technologies, the application scenarios of artificial intelligence technology are becoming more and more extensive. In various scenarios (such as the Internet of Things or the Internet of Vehicles), the code that implements artificial intelligence technology can be processed to prevent the relevant technology from being reverse analyzed. Summary of the Invention

[0003] The present disclosure provides a code data processing method, apparatus, device, and storage medium.

[0004] According to one aspect of the present disclosure, a code data processing method is provided, the method comprising: determining a target compilation task and code compilation parameters to be executed based on code data; determining a target security task and security compilation parameters to be executed based on the code compilation parameters; and executing the target compilation task and target security task based on the code compilation parameters and the security compilation parameters to obtain a code processing result; wherein the target security task comprises at least one of a front-end security task, an optimization security task, and a link security task.

[0005] According to another aspect of the present disclosure, a code data processing device is provided, which includes: a first determination module for determining a target compilation task and code compilation parameters to be executed based on code data; a second determination module for determining a target security task and security compilation parameters to be executed based on the code compilation parameters; and an execution module for executing the target compilation task and the target security task based on the code compilation parameters and the security compilation parameters to obtain a code processing result; wherein the target security task includes at least one of a front-end security task, an optimization security task, and a link security task.

[0006] According to another aspect of the present disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the method provided according to the present disclosure.

[0007] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided. The computer instructions are used to cause a computer to execute the method provided according to the present disclosure.

[0008] According to another aspect of the present disclosure, a computer program product is provided, comprising a computer program, which implements the method provided according to the present disclosure when executed by a processor.

[0009] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present disclosure, nor are they intended to limit the scope of the present disclosure. Other features of the present disclosure will become readily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] The accompanying drawings are provided to facilitate a better understanding of the present invention and do not constitute a limitation of the present disclosure.

[0011] Figure 1 is a schematic diagram of an exemplary system architecture to which the code data processing method and apparatus according to an embodiment of the present disclosure can be applied;

[0012] Figure 2 is a flowchart of a code data processing method according to one embodiment of the present disclosure;

[0013] Figure 3 is a schematic diagram of a code data processing method according to an embodiment of the present disclosure;

[0014] Figure 4 is a flowchart of a code data processing method according to another embodiment of the present disclosure;

[0015] Figure 5 is a schematic diagram of a code data processing method according to another embodiment of the present disclosure;

[0016] Figure 6 is a block diagram of a code data processing apparatus according to an embodiment of the present disclosure; and

[0017] Figure 7 is a block diagram of an electronic device to which a code data processing method according to an embodiment of the present disclosure can be applied. DETAILED DESCRIPTION

[0018] The following description of exemplary embodiments of the present disclosure is made in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding. These details should be considered as merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.

[0019] A code data processing method based on code inspection utilizes dynamic and static analysis techniques to identify potential security and quality defects in code data. For example, static analysis techniques can be used to inspect source code, intermediate code, or binary data to determine whether the code complies with relevant specifications or security rules. When applying static analysis techniques, inspection plans can be set up in advance. For another example, dynamic analysis techniques can be used to execute programs generated from target code in real or simulated environments. Based on the program's running status, errors are detected to verify the program's reliability, stability, and other performance characteristics.

[0020] A code data processing method based on code protection can perform binary hardening or code obfuscation processing on code data to prevent the core logic or key data of the code from being cracked.

[0021] Code detection or code protection can be performed through various methods, such as the dynamic analysis techniques described above or the static analysis techniques. These methods are independent of each other and perform different functions. During code development, each method must be utilized separately to achieve the desired goal, resulting in high costs for code protection or code detection.

[0022] Furthermore, when performing binary hardening on code data, a specific hardening solution must be determined based on the code's application platform. Hardening solutions for different platforms are not universal.

[0023] In addition, code data processing methods based on code detection or code protection can be applied after code development is completed. However, after code development is completed, the amount of code data is large, and the cost required for code detection or code protection increases significantly.

[0024] Figure 1 FIG. 1 is a schematic diagram of an exemplary system architecture to which the code data processing method and apparatus can be applied according to an embodiment of the present disclosure.

[0025] It should be noted that Figure 1 The examples shown are merely examples of system architectures to which the embodiments of the present disclosure may be applied, to help those skilled in the art understand the technical content of the present disclosure, but do not mean that the embodiments of the present disclosure may not be used in other devices, systems, environments or scenarios.

[0026] like Figure 1As shown, the system architecture 100 according to this embodiment may include a driver module 110, a front-end compilation module 120, an optimization compilation module 130, a back-end compilation module 140, and a link compilation module 150. The driver module 110 may determine a target compilation task to be executed based on code data, and cause one or more of the front-end compilation module 120, the optimization compilation module 130, the back-end compilation module 140, and the link compilation module 150 to execute the target compilation task and generate a task execution result.

[0027] Figure 2 is a flowchart of a code data processing method according to an embodiment of the present disclosure.

[0028] like Figure 2 As shown, the method 200 may include operations S210 to S230.

[0029] In operation S210 , a target compiling task to be executed and code compiling parameters are determined according to the code data.

[0030] For example, the code data may include configured code compilation parameters.

[0031] For example, the code data may be all or part of the code data. In one example, the all code data may implement multiple functions, and the part of the code data may implement at least one of the multiple functions. That is, the method provided by the present disclosure may be performed on all code data that has already been developed, or on part of the code data during the code development process.

[0032] For example, the target compilation task may be performed by one or more of the front-end compilation module 120 , the optimization compilation module 130 , the back-end compilation module 140 , and the link compilation module 150 described above.

[0033] In operation S220 , a target security task to be executed and security compilation parameters are determined according to the code compilation parameters.

[0034] For example, the driver module 110 described above may determine the target security task to be executed and the security compilation parameters according to the code compilation parameters.

[0035] For example, the target security task includes at least one of a front-end security task, an optimization security task, and a link security task.

[0036] In operation S230 , a target compilation task and a target security task are executed according to the code compilation parameters and the security compilation parameters to obtain a code processing result.

[0037] For example, based on the security compilation parameters, the front-end compilation module 120 can perform the front-end security task. For another example, based on the security compilation parameters, the optimization compilation module 130 can perform the optimization security task. For another example, based on the security compilation parameters, the link compilation module 150 can perform the link security task.

[0038] Through the disclosed embodiments, the front-end compilation module, the optimization compilation module, or the link compilation module can all perform security tasks, which is equivalent to integrating a code detection solution or a code protection solution into the front-end compilation module, the optimization compilation module, or the link compilation module. Implementing code detection or code protection during the code compilation process increases the flexibility of code detection or code protection and reduces the cost of code detection or code protection.

[0039] In some embodiments, the target compilation task includes a front-end compilation task, an optimization compilation task, and a link compilation task, and the security compilation parameter includes at least one of a front-end security compilation parameter, an optimization security compilation parameter, and a link compilation parameter.

[0040] For example, based on the front-end security compilation parameters, the front-end compilation module 120 can execute the front-end security task. For another example, based on the optimization security compilation parameters, the optimization compilation module 130 can execute the optimization security task. For another example, based on the link security compilation parameters, the link compilation module 150 can execute the link security task.

[0041] For example, the front-end compilation module 120 can also perform front-end compilation tasks. For another example, the optimization compilation module 130 can perform optimization compilation tasks. For another example, the link compilation module 150 can perform link compilation tasks.

[0042] In some embodiments, the code processing result includes at least one of a front-end task execution result, an optimization task execution result, and a link task execution result.

[0043] For example, the front-end compilation module 120 may execute at least one of a front-end compilation task and a front-end security task, and obtain a front-end task execution result. For another example, the optimization compilation module 130 may execute at least one of an optimization compilation task and an optimization security task, and obtain an optimization task execution result. For another example, the link compilation module 140 may execute at least one of a link compilation task and a link security task, and obtain a link task execution result.

[0044] Figure 3 is a schematic diagram of a code data processing method according to an embodiment of the present disclosure.

[0045] like Figure 3As shown, the driver module 310 may include a parameter parsing submodule 311 and a task determination submodule 312. The parameter parsing submodule 311 may parse the code data to obtain code compilation parameters and target compilation tasks. The task determination submodule 312 may determine the target security task and security compilation parameters based on the code compilation parameters.

[0046] For example, the driver module can parse code compilation parameters to perform blocking compilation or non-blocking compilation.

[0047] In one example, if the first preset functional module cannot be successfully compiled due to a high-level compilation error during the execution of the front-end compilation task, it can be determined that the compilation has failed, blocking the compilation, and not executing subsequent processes.

[0048] In one example, if a low-level compilation error during the execution of a front-end compilation task prevents the successful compilation of a second preset functional module, a non-blocking compilation can be performed, skipping the compilation of the second preset functional module and continuing with the subsequent process. The compilation error level can be pre-set to enable the driver module to perform blocking or non-blocking compilation.

[0049] As described above, the target compilation task may include a front-end compilation task, an optimization compilation task, and a link compilation task; the security compilation parameters may include a front-end security compilation parameter, an optimization security compilation parameter, and a link compilation parameter; and the target security task may include a front-end security task, an optimization security task, and a link security task.

[0050] Front-end compilation module 320 may include a front-end compilation submodule 321 and a front-end security hardening submodule 322. Front-end compilation submodule 321 may execute the front-end compilation task described above to obtain a front-end task execution result. Front-end security hardening submodule 322 may execute a front-end security task on the front-end task execution result based on front-end security compilation parameters to obtain a security-hardened front-end task execution result.

[0051] The front-end security reinforcement submodule 321 may include a symbol randomization unit 3221, a static detection unit 3222, a source code replacement unit 3223, and an automatic burying unit 3224. These units can perform corresponding front-end security tasks. For example, the symbol randomization unit 3221 can randomly replace some preset symbols in the front-end task execution result to perform symbol obfuscation. The static detection unit 3222 can perform detection on the front-end task execution result based on the static analysis technology described above. The source code replacement unit 3223 can replace some source codes in the front-end task execution result. The automatic burying unit 3224 can bury points in the front-end task execution result.

[0052] The optimized compilation module 330 may include an optimized compilation submodule 331 and an optimized security hardening submodule 332. The optimized compilation submodule 331 may execute the optimized compilation task described above to obtain an optimized task execution result. The optimized security hardening submodule 332 may execute an optimized security task on the optimized task execution result based on the optimized security compilation parameters to obtain a security-hardened optimized task execution result.

[0053] The optimization security reinforcement submodule 332 may include an intermediate code virtualization unit 3321, a security vulnerability analysis unit 3322, an automatic instrumentation unit 3323, a code obfuscation unit 3324, and a custom optimization unit 3325. For example, the intermediate code virtualization unit 3321 may virtualize a portion of the code in the optimization task execution result. The security vulnerability analysis unit 3322 may perform vulnerability analysis processing on the optimization task execution result. The automatic instrumentation unit 3323 may perform instrumentation processing on the optimization task execution result. The code obfuscation unit 3324 may perform code obfuscation processing on the optimization task execution result. One or more of the symbol randomization unit, static detection unit, source code replacement unit, and automatic tracking unit described above may be deployed as a custom optimization unit 3325 to process the optimization task execution result.

[0054] The backend compilation module 340 may obtain a target file based on the optimization task execution result.

[0055] The link compilation module 350 includes a link compilation submodule 351 and a link security hardening submodule 352. The link compilation submodule 351 can execute the link compilation task described above on the target file to obtain a link task execution result. The link security hardening submodule 352 can execute a link security task on the link task execution result based on the link security compilation parameters to obtain a link task execution result with security hardening.

[0056] The link security hardening submodule 352 may include a virtual execution unit 3521, a secure input unit 3522, a white-box encryption unit 3523, an environment clearing unit 3524, and an anti-debugging unit 3525. For example, the virtual execution unit 3521 may link a virtual engine with the link task execution result, outputting a security-hardened link task execution result. In one example, the virtual engine is used to execute the virtual bytecode output by the intermediate code virtualization unit 3321. For another example, the secure input unit 3522 may link a secure keyboard with the link task execution result, outputting a security-hardened link task execution result. The white-box encryption unit 3523 may link a functional module with white-box encryption functionality with the link task execution result, outputting a security-hardened link task execution result. The environment clearing unit 3524 may link a functional module with environment clearing functionality with the link task execution result, outputting a security-hardened link task execution result. The anti-debugging unit 3525 may link a functional module with anti-debugging functionality with the link task execution result, outputting a security-hardened link task execution result.

[0057] like Figure 3 As shown, according to the code compilation parameters, at least one of the front-end task execution result, the optimization task execution result, the target file and the link task execution result can be input into the detection and analysis module 360 ​​for detection and analysis.

[0058] For example, after the driver module 310 detects that each compilation module has completed the relevant task, it can detect and analyze the task execution results.

[0059] For example, based on code compilation parameters, detection and analysis parameters can be obtained, and based on the detection and analysis parameters, detection and analysis tasks can be determined.

[0060] In one example, when the detection and analysis task includes a type detection task, the detection and analysis module 360 ​​may perform the type detection task on the front-end task execution result.

[0061] In one example, when the detection and analysis task includes a vulnerability detection task or a sensitive interface detection task, the detection and analysis module 360 ​​may execute the vulnerability detection task or the sensitive interface detection task on the optimization task execution result.

[0062] In one example, when the detection and analysis task includes a fuzz testing task, the detection and analysis module 360 ​​may perform the fuzz testing task on the link task execution result.

[0063] Figure 4 is a flowchart of a code processing method according to another embodiment of the present disclosure.

[0064] like Figure 4As shown, method 430 can execute target compilation tasks and target security tasks according to code compilation parameters and security compilation parameters to obtain code processing results, which will be described in detail below in conjunction with operations S4301 to S4311.

[0065] In operation S4301, a front-end compilation task is executed according to code compilation parameters to obtain a front-end task execution result.

[0066] For example, the front-end compilation submodule 311 described above may execute the front-end compilation task according to the code compilation parameters to obtain the front-end task execution result.

[0067] In operation S4302, it is determined whether the target security task includes a front-end security task.

[0068] In the embodiment of the present disclosure, when the target security task includes a front-end security task, operation S4303 is performed.

[0069] In the embodiment of the present disclosure, when the target security task does not include a front-end security task, operation S4304 is performed.

[0070] In operation S4303, a front-end security task is executed on the front-end task execution result according to the front-end security compilation parameter as the front-end task execution result.

[0071] For example, when the target security task includes a front-end security task, one or more units in the front-end security reinforcement submodule 322 described above may execute the front-end security task on the front-end task execution result according to the front-end security compilation parameters.

[0072] In operation S4304, an optimization compilation task is performed on the front-end task execution result according to the code compilation parameters to obtain an optimization task execution result.

[0073] For example, the front-end compilation submodule 321 described above may execute the optimization compilation task according to the code compilation parameters. In operation S4304, the front-end task execution result may be obtained after executing operation S4301 or after executing operation S4303.

[0074] In operation S4305 , it is determined whether the target security task includes an optimization security task.

[0075] In the embodiment of the present disclosure, when the target security task includes the optimization security task, operation S4306 is performed.

[0076] In the embodiment of the present disclosure, when the target security task does not include the optimization security task, operation S4307 is performed.

[0077] In operation S4306 , the optimized security task is executed on the optimized task execution result according to the optimized security compilation parameter, as the optimized task execution result.

[0078] For example, when the target security task includes an optimization security task, one or more units in the optimization security hardening submodule 332 described above may execute the optimization security task on the optimization task execution result according to the optimization security compilation parameters.

[0079] In operation S4307 , a target file is obtained based on the optimization task execution result according to the code compilation parameters.

[0080] For example, according to the code compilation parameters, the backend compilation module 340 described above can process the optimization task execution result to obtain the target file. In operation S4307, the optimization task execution result can be obtained after executing operation S4304 or after executing operation S4306.

[0081] In operation S4308, the link compilation task is executed on the target file to obtain a link task execution result.

[0082] For example, the link compilation submodule 351 described above may execute the link compilation task to obtain a link task execution result.

[0083] In operation S4309 , it is determined whether the target safety task includes a link safety task.

[0084] In an embodiment of the present disclosure, in a case where the target security task includes a linked security task, operation S4310 is performed.

[0085] In the embodiment of the present disclosure, when the target security task does not include a linked security task, operation S4311 is performed.

[0086] In operation S4310, a link safety task is executed on the link task execution result according to the link safety compilation parameter as the link task execution result.

[0087] For example, the link security task may be performed by one or more units in the link security hardening submodule 352 described above.

[0088] In operation S4311, the process ends.

[0089] For example, the linked task execution result obtained by executing operation S4308 may be used as the final execution result.

[0090] In some embodiments, the link task execution result includes at least one of a static library file, a dynamic library file, and an executable file.

[0091] For example, a static library file may be a static link library file in a Linux system, with a file extension of ".a". Another example is a dynamic library file may be a dynamic link library file in a Linux system, with a file extension of ".so". Another example is an executable file may be an exe file.

[0092] In some embodiments, an optimized security task is performed on the optimized task execution result according to the optimized security compilation parameters, and the optimized task execution result includes: extracting instructions in the optimized task execution result in units of functional modules according to the optimized security compilation parameters; translating the instructions into virtual bytecode; and adding the virtual bytecode to the target file.

[0093] In some embodiments, the link security task is executed on the optimization task execution result according to the link security compilation parameter, and the link task execution result includes: extracting virtual bytecode from the target file; and executing the virtual bytecode. Figure 5 Provide detailed explanation.

[0094] Figure 5 is a schematic diagram of a code data processing method according to an embodiment of the present disclosure.

[0095] like Figure 5 As shown, as described above, the intermediate code virtualization unit 3321 can virtualize a portion of the code in the optimization task execution result. For example, the intermediate code virtualization unit 3321 can translate the instructions in a functional module 5021 in the optimization task execution result 502 into virtual bytecodes to obtain a virtualized functional module 5021'. The virtualized functional module 5021' is located in the virtualized optimization task execution result 502'. The virtualized optimization task execution result 502' can be the optimization task execution result after security reinforcement as described above.

[0096] Next, the backend compilation module 340 mentioned above can obtain the target file according to the virtualized optimization task execution result 502 ′.

[0097] The link compilation module 350 described above can execute a link compilation task on the target file to obtain a link task execution result. A link security task can then be executed on the link task execution result. For example, a virtual engine capable of executing virtual bytecodes can be linked to the link task execution module to produce the link task execution result 503. The virtual engine is configured with a bridge instruction for converting virtual bytecodes. The bridge instruction is used to process the virtual bytecode extracted from the target file and execute the virtual bytecode.

[0098] According to the embodiments of the present disclosure, since the virtual bytecode is independent of the target architecture, it is applicable to various platforms built based on various architectures.

[0099] Virtualization can be implemented at the functional module level. Functional modules requiring high-level protection can be virtualized, achieving a balance between security and performance. When processing these functional modules, bridge instructions carry corresponding virtual execution information, allowing the execution logic of, for example, functional module 502 to be transferred to the virtual engine interface, allowing the virtual engine to execute the functional module's actual logic. In one example, the various functions of a functional module can be implemented by one or more functions.

[0100] Figure 6 is a block diagram of a code data processing apparatus according to another embodiment of the present disclosure.

[0101] like Figure 6 As shown, the apparatus 600 may include a first determining module 610 , a second determining module 620 and an executing module 630 .

[0102] The first determination module 610 is configured to determine a target compilation task to be executed and code compilation parameters according to the code data.

[0103] The second determining module 620 is configured to determine a target security task to be executed and security compilation parameters according to the code compilation parameters.

[0104] The execution module 630 is used to execute the target compilation task and the target security task according to the code compilation parameters and the security compilation parameters to obtain a code processing result.

[0105] For example, the target security task includes at least one of a front-end security task, an optimization security task, and a link security task.

[0106] In some embodiments, the target compilation task includes a front-end compilation task, an optimization compilation task, and a link compilation task, and the security compilation parameter includes at least one of a front-end security compilation parameter, an optimization security compilation parameter, and a link security compilation parameter.

[0107] In some embodiments, the execution module includes: a first execution sub-module, used to execute the front-end compilation task according to the code compilation parameters to obtain the front-end task execution result; and a second execution sub-module, used to execute the front-end security task on the front-end task execution result according to the front-end security compilation parameters when the target security task includes the front-end security task, as the front-end task execution result.

[0108] In some embodiments, the execution module also includes: a third execution sub-module, which is used to execute the optimization compilation task on the front-end task execution result according to the code compilation parameters to obtain the optimization task execution result; and a fourth execution sub-module, which is used to execute the optimization security task on the optimization task execution result according to the optimization security compilation parameters when the target security task includes the optimization security task, as the optimization task execution result.

[0109] In some embodiments, the execution module also includes: an acquisition submodule, used to obtain a target file based on the optimization task execution result according to the code compilation parameters; a fifth execution submodule, used to execute the link compilation task on the target file to obtain a link task execution result; and a sixth execution submodule, used to execute the link security task on the link task execution result according to the link security compilation parameters when the target security task includes the link security task, as the link task execution result.

[0110] In some embodiments, the fourth execution sub-module includes: an extraction unit for extracting instructions from the optimization task execution results in units of functional modules based on the optimization security compilation parameters; a translation unit for translating the instructions into virtual bytecodes; and an adding unit for adding the virtual bytecodes to the target file.

[0111] In some embodiments, the sixth execution submodule includes: an extraction unit for extracting the virtual bytecode from the target file; and an execution unit for executing the virtual bytecode.

[0112] In some embodiments, the code processing result includes at least one of a front-end task execution result, an optimization task execution result, and a link task execution result.

[0113] In some embodiments, the link task execution result includes at least one of a static library file, a dynamic library file, and an executable file.

[0114] In the technical solutions disclosed herein, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved comply with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0115] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium, and a computer program product.

[0116] Figure 7A schematic block diagram of an example electronic device 700 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or claimed herein.

[0117] like Figure 7 As shown, the device 700 includes a computing unit 701, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 702 or a computer program loaded from a storage unit 708 into a random access memory (RAM) 703. Various programs and data required for the operation of the device 700 can also be stored in the RAM 703. The computing unit 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.

[0118] Various components in device 700 are connected to I / O interface 705, including an input unit 706, such as a keyboard, mouse, etc.; an output unit 707, such as various types of displays, speakers, etc.; a storage unit 708, such as a magnetic disk, optical disk, etc.; and a communication unit 709, such as a network card, modem, wireless communication transceiver, etc. The communication unit 709 allows device 700 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.

[0119] The computing unit 701 can be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 701 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units that run machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 701 performs the various methods and processes described above, such as the code data processing method. For example, in some embodiments, the code data processing method can be implemented as a computer software program that is tangibly contained in a machine-readable medium, such as the storage unit 708. In some embodiments, part or all of the computer program can be loaded and / or installed on the device 700 via the ROM 702 and / or the communication unit 709. When the computer program is loaded into the RAM 703 and executed by the computing unit 701, one or more steps of the code data processing method described above can be performed. Alternatively, in other embodiments, the computing unit 701 can be configured to perform the code data processing method by any other appropriate means (e.g., by means of firmware).

[0120] Various embodiments of the systems and techniques described above can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), system-on-chip systems (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system that includes at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0121] The program code for implementing the method of the present disclosure can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device so that when the program code is executed by the processor or controller, the functions / operations specified in the flow chart and / or block diagram are implemented. The program code can be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.

[0122] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in conjunction with an instruction execution system, device or equipment. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium can include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0123] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0124] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network (LAN), a wide area network (WAN), and the Internet.

[0125] Computer systems may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The client and server relationship arises through computer programs running on the respective computers and having a client-server relationship to each other.

[0126] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in this disclosure can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved. This is not a limitation herein.

[0127] The above specific embodiments do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may be made based on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure shall be included within the scope of protection of this disclosure.

Claims

1. A code data processing method, comprising: Determine the target compilation tasks and code compilation parameters to be executed based on some code data during the code development process; Determining, based on the code compilation parameters, target security tasks and security compilation parameters to be executed, wherein the target compilation tasks include front-end compilation tasks, optimization compilation tasks, and link compilation tasks; the security compilation parameters include front-end security compilation parameters, optimization security compilation parameters, and link security compilation parameters; and the target security tasks include front-end security tasks, optimization security tasks, and link security tasks; as well as Executing the target compilation task and the target security task according to the code compilation parameter and the security compilation parameter to obtain a code processing result includes: Executing the front-end compilation task and the front-end security task according to the code compilation parameters and the front-end security compilation parameters to obtain a front-end task execution result; Executing the optimization compilation task and the optimization security task on the front-end task execution result according to the code compilation parameter and the optimization security compilation parameter to obtain an optimization task execution result; Obtaining a target file based on the optimization task execution result according to the code compilation parameters; The link compilation task and the link security task are executed on the target file according to the code compilation parameter and the link security compilation parameter to obtain a link task execution result.

2. The method according to claim 1, wherein The executing the target compilation task and the target security task according to the code compilation parameter and the security compilation parameter to obtain a code processing result further comprises: Execute the front-end compilation task according to the code compilation parameters to obtain a front-end task execution result; and In a case where the target security task includes the front-end security task, the front-end security task is executed on the front-end task execution result according to the front-end security compilation parameter as the front-end task execution result.

3. The method according to claim 2, wherein: The executing the target compilation task and the target security task according to the code compilation parameter and the security compilation parameter to obtain a code processing result further comprises: Executing the optimization compilation task on the front-end task execution result according to the code compilation parameter to obtain an optimization task execution result; and In a case where the target security task includes the optimized security task, the optimized security task is executed on the optimized task execution result according to the optimized security compilation parameter as the optimized task execution result.

4. The method according to claim 3, wherein: The executing the target compilation task and the target security task according to the code compilation parameter and the security compilation parameter to obtain a code processing result further comprises: Executing the link compilation task on the target file to obtain a link task execution result; and In a case where the target safety task includes the linked safety task, the linked safety task is executed on the linked task execution result according to the linked safety compilation parameter as the linked task execution result.

5. The method according to claim 4, wherein The performing of the optimization security task on the optimization task execution result according to the optimization security compilation parameter, as the optimization task execution result, includes: Extracting instructions from the optimization task execution result in units of functional modules according to the optimization security compilation parameters; translating the instructions into virtual bytecode; and The virtual bytecode is added to the object file.

6. The method according to claim 5, wherein: The link security task is executed on the link task execution result according to the link security compilation parameter, and the link task execution result includes: Extracting the virtual bytecode from the target file; and The virtual bytecode is executed.

7. The method according to claim 1, wherein The code processing result includes at least one of a front-end task execution result, an optimization task execution result, and a link task execution result.

8. The method according to claim 7, wherein: The link task execution result includes at least one of a static library file, a dynamic library file and an executable file.

9. A code data processing device comprising: The first determination module is used to determine the target compilation task and code compilation parameters to be executed based on part of the code data in the code development process; a second determination module, configured to determine, based on the code compilation parameters, a target security task to be executed and security compilation parameters, wherein the target compilation task includes a front-end compilation task, an optimization compilation task, and a link compilation task; the security compilation parameters include a front-end security compilation parameter, an optimization security compilation parameter, and a link security compilation parameter; and the target security task includes a front-end security task, an optimization security task, and a link security task; as well as An execution module, configured to execute the target compilation task and the target security task according to the code compilation parameters and the security compilation parameters, and obtain a code processing result; The execution module is further configured to: Executing the front-end compilation task and the front-end security task according to the code compilation parameters and the front-end security compilation parameters to obtain a front-end task execution result; Executing the optimization compilation task and the optimization security task on the front-end task execution result according to the code compilation parameter and the optimization security compilation parameter to obtain an optimization task execution result; Obtaining a target file based on the optimization task execution result according to the code compilation parameters; The link compilation task and the link security task are executed on the target file according to the code compilation parameter and the link security compilation parameter to obtain a link task execution result.

10. The device according to claim 9, wherein The execution module includes: A first execution submodule is configured to execute the front-end compilation task according to the code compilation parameters to obtain a front-end task execution result; and The second execution submodule is used to execute the front-end security task on the front-end task execution result as the front-end task execution result according to the front-end security compilation parameters when the target security task includes the front-end security task.

11. The device according to claim 10, wherein The execution module also includes: A third execution submodule is configured to execute the optimization compilation task on the front-end task execution result according to the code compilation parameter to obtain an optimization task execution result; and A fourth execution submodule is used to execute the optimized security task on the optimized task execution result according to the optimized security compilation parameter when the target security task includes the optimized security task, as the optimized task execution result.

12. The device according to claim 11, wherein The execution module also includes: An acquisition submodule is used to obtain a target file based on the code compilation parameters and the execution result of the optimization task; a fifth execution submodule, configured to execute the link compilation task on the target file to obtain a link task execution result; and A sixth execution submodule is configured to, when the target safety task includes the linked safety task, execute the linked safety task on the linked task execution result according to the linked safety compilation parameter as the linked task execution result.

13. The device according to claim 12, wherein The fourth execution submodule includes: An extraction unit, configured to extract instructions from the optimization task execution result in units of functional modules according to the optimization security compilation parameters; a translation unit, configured to translate the instructions into virtual bytecodes; and An adding unit is used to add the virtual bytecode to the target file.

14. The device according to claim 13, wherein The sixth execution submodule includes: an extraction unit, configured to extract the virtual bytecode from the target file; and An execution unit is configured to execute the virtual bytecode.

15. The device according to claim 9, wherein The code processing result includes at least one of a front-end task execution result, an optimization task execution result, and a link task execution result.

16. The device according to claim 15, wherein The link task execution result includes at least one of a static library file, a dynamic library file and an executable file.

17. An electronic device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 8.

18. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 8.

19. A computer program product comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Reinforcing method for Android application dynamic link library and related equipment

    CN109960510A

  • Dynamic link library file virtualization method, storage medium and terminal equipment

    CN111782334A