Code text information storage method and device, equipment and computer medium

By reconstructing and detecting model input of application package text information, identifying and processing exception codes, the security reduction problem caused by the failure to record exception codes in the prior art is solved, and higher application package security is achieved.

CN118981772AInactive Publication Date: 2024-11-19ADDX (BEIJING) TECH CO LTD

Patent Information

Application Number
CN202411047640.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-01
Publication Date
2024-11-19
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In the prior art, when identifying exception codes in application packages, some exception codes are not recorded in the feature library and rule library, making it difficult to identify and reducing the security of application packages.

Method used

By obtaining the text information of the application package to be detected, the reconstruction process is performed to generate the text information of the reconstruction application package, and input it into the pre-trained application package text detection model to generate the detection result. If the exception conditions are met, it will be sent to the program code maintenance terminal for repair; if the exception conditions are not met, it will be stored in the application package cloud.

Benefits of technology

Improves the security of application packages, can identify and handle unrecorded exception codes, and improves the security of application packages.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118981772A_ABST
    Figure CN118981772A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a code text information storage method and device, equipment and a computer medium. A specific embodiment of the method comprises the following steps: acquiring text information of a to-be-detected application package; performing reconstruction processing on the to-be-detected application package text information to generate reconstructed application package text information; inputting the reconstructed application package text information into a pre-trained application package text detection model to obtain an application package text detection result; in response to determining that the application package text detection result meets the abnormal condition, sending the to-be-detected application package text information to a program code maintenance terminal for repair processing; and in response to determining that the application package text detection result does not meet the abnormal condition, storing the reconstructed application package text information to an associated application package cloud. According to the embodiment, the security of the application package is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present disclosure relate to the computer field, and in particular to a code text information storage method, device, equipment and computer medium. Background Art

[0002] By identifying abnormal codes in application packages and issuing an alarm, the security of downloading application packages can be improved. At present, when identifying abnormal codes in application packages, a common method is to use a pre-set feature library and rule library to identify the abnormal codes.

[0003] However, when the above method is used to identify abnormal codes, the following technical problems often occur: when some abnormal codes are not recorded in the feature library and the rule library, it is difficult to identify the abnormal codes, which reduces the security of the application package.

[0004] The above information disclosed in this Background section is only for enhancement of understanding of the background of the inventive concept and therefore it may contain information that does not form the prior art that is already known in this country to a person of ordinary skill in the art. Summary of the invention

[0005] The content of this disclosure is used to introduce concepts in a brief form, which will be described in detail in the detailed implementation section below. The content of this disclosure is not intended to identify the key features or essential features of the technical solution claimed for protection, nor is it intended to limit the scope of the technical solution claimed for protection.

[0006] Some embodiments of the present disclosure propose code text information storage methods, devices, electronic devices and computer-readable media to solve one or more of the technical problems mentioned in the above background technology section.

[0007] In a first aspect, some embodiments of the present disclosure provide a code text information storage method, the method comprising: obtaining text information of an application package to be detected; reconstructing the text information of the application package to be detected to generate reconstructed application package text information; inputting the reconstructed application package text information into a pre-trained application package text detection model to obtain an application package text detection result; in response to determining that the application package text detection result meets an abnormal condition, sending the application package text information to be detected to a program code maintenance terminal for repair processing; in response to determining that the application package text detection result does not meet the abnormal condition, storing the reconstructed application package text information in an associated application package cloud.

[0008] In a second aspect, some embodiments of the present disclosure provide a code text information storage device, which includes: an acquisition unit, configured to acquire text information of an application package to be detected; a reconstruction unit, configured to reconstruct the text information of the application package to be detected to generate reconstructed application package text information; an input unit, configured to input the reconstructed application package text information into a pre-trained application package text detection model to obtain an application package text detection result; a sending unit, configured to, in response to determining that the application package text detection result meets an abnormal condition, send the application package text information to be detected to a program code maintenance terminal for repair processing; a storage unit, configured to, in response to determining that the application package text detection result does not meet the abnormal condition, store the reconstructed application package text information in an associated application package cloud.

[0009] In a third aspect, some embodiments of the present disclosure provide an electronic device comprising: one or more processors; a storage device on which one or more programs are stored, and when the one or more programs are executed by the one or more processors, the one or more processors implement the method described in any implementation manner of the above-mentioned first aspect.

[0010] In a fourth aspect, some embodiments of the present disclosure provide a computer-readable medium having a computer program stored thereon, wherein when the program is executed by a processor, the method described in any implementation manner of the above-mentioned first aspect is implemented.

[0011] The above-mentioned embodiments of the present disclosure have the following beneficial effects: through the code text information storage method of some embodiments of the present disclosure, the security of the application package is improved. Specifically, the reason for reducing the security of the application package is that when part of the abnormal code is not recorded in the feature library and the rule library, it is difficult to identify the abnormal code, which reduces the security of the application package. Based on this, the code text information storage method of some embodiments of the present disclosure, first, obtains the text information of the application package to be detected. Secondly, the text information of the application package to be detected is reconstructed to generate the reconstructed application package text information. Thus, the reconstructed application package text information can be obtained. Then, the reconstructed application package text information is input into the pre-trained application package text detection model to obtain the application package text detection result. Thus, the application package text detection result can be generated by the application package text detection model. Then, in response to determining that the application package text detection result meets the abnormal condition, the application package text information to be detected is sent to the program code maintenance terminal for repair processing. Thus, the application package code can be repaired. Finally, in response to determining that the application package text detection result does not meet the abnormal condition, the reconstructed application package text information is stored in the associated application package cloud. Therefore, when it is detected that there is no abnormality in the application package text information, the application package text information can be stored in the cloud for download. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar figure labels represent the same or similar elements. It should be understood that the drawings are schematic and that the components and elements are not necessarily drawn to scale.

[0013] Figure 1 is a flow chart of some embodiments of the code text information storage method according to the present disclosure;

[0014] Figure 2 is a flow chart of some embodiments of the code text information storage device according to the present disclosure;

[0015] Figure 3 It is a schematic diagram of the structure of an electronic device suitable for implementing some embodiments of the present disclosure. DETAILED DESCRIPTION

[0016] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments set forth herein. On the contrary, these embodiments are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.

[0017] It should also be noted that, for ease of description, only the parts related to the invention are shown in the drawings. In the absence of conflict, the embodiments and features in the embodiments of the present disclosure can be combined with each other.

[0018] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.

[0019] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".

[0020] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.

[0021] The present disclosure will be described in detail below with reference to the accompanying drawings and in conjunction with embodiments.

[0022] Figure 11 is a flowchart of some embodiments of the code text information storage method according to the present disclosure. It shows a process 100 of some embodiments of the code text information storage method according to the present disclosure. The code text information storage method comprises the following steps:

[0023] Step 101: Obtain text information of the application package to be detected.

[0024] In some embodiments, the execution subject (e.g., computing device) of the code text information storage method may obtain the text information of the application package to be detected. The text information of the application package to be detected may refer to the text information of the application package to be detected, which may include: domain name information, program code text, and version text information. The domain name information may refer to the domain name information carried in the program code text.

[0025] Step 102: reconstruct the text information of the application package to be detected to generate reconstructed application package text information.

[0026] In some embodiments, the execution entity may reconstruct the text information of the application package to be detected to generate reconstructed application package text information.

[0027] In practice, the execution subject may reconstruct the text information of the application package to be detected by:

[0028] In the first step, the text information of the application package to be detected is processed by data partitioning to generate application package partition text information groups. The text information of the application package to be detected can be processed by data partitioning through a preset data partitioning algorithm to generate application package partition text information groups. For example, the preset data partitioning algorithm can be: ULM (Unigram Language Model, natural language model) subword partitioning technology algorithm.

[0029] In the second step, the application package is divided into text information groups and tree construction is performed to generate application package program syntax tree information. The application package is divided into text information groups and tree construction is performed to generate application package program syntax tree information by using a preset tree construction algorithm. For example, the preset tree construction algorithm may be an AST (abstract syntax code) construction algorithm.

[0030] The third step is to perform graph construction processing on the application package division text information group to generate application package program syntax graph information. The application package division text information group can be subjected to graph construction processing by a preset graph construction algorithm to generate application package program syntax graph information. For example, the preset graph construction algorithm can be: DFG (Data Flow Graph) construction algorithm.

[0031] In the fourth step, the application package program syntax tree information is input into the first application package program encoding model to obtain the first application package program encoding information. The first application package program encoding model includes: an application package program encoding self-attention network and an application package program encoding neural network. For example, the application package program encoding self-attention network can be: a multi-head attention model. The application package program encoding neural network can be: a fully connected feedforward neural network model.

[0032] In the fifth step, the application package program syntax diagram information is input into the second application package program coding model to obtain the second application package program coding information. The second application package program coding model may be a neural network model that takes the application package program syntax diagram information as input and the second application package program coding model as output. For example, the second application package program coding model may be a GNN (Graph Neural Networks) model.

[0033] In step 6, the first application package program coding information and the second application package program coding information are fused to generate application package program coding fusion information. The first application package program coding information and the second application package program coding information can be input into a program coding fusion model to obtain application package program coding fusion information. For example, the program coding fusion model can be a Crossmodal attention model.

[0034] In the seventh step, the application package program encoding fusion information is input into the application package program decoding model to obtain the application package program code information as the reconstructed application package text information. Among them, the user program decoding model includes: an application package decoding attention network, an encoding and decoding attention network, and a program decoding neural network. For example, the application package decoding attention network can be: a multi-head attention model. The encoding and decoding attention network can be: an Encoder-Decoder Attention model. The program decoding neural network can be: a fully connected feedforward neural network model.

[0035] Thus, the text information after removing the code redundancy included in the text information of the application package can be obtained, thereby reducing the computing resources for traversing the code redundancy included in the text information of the application package and reducing the waste of computing resources.

[0036] Step 103: input the reconstructed application package text information into a pre-trained application package text detection model to obtain an application package text detection result.

[0037] In some embodiments, the above-mentioned execution entity can input the reconstructed application package text information into a pre-trained application package text detection model to obtain an application package text detection result. The application package text detection model can be a pre-trained neural network model that takes application package text information as input and takes application package text detection results as output. For example, the application package text detection model can be a DB (Deep Binarization) model, a deep packet inspection (DPI) model, an application detection model combining CNN and Catboost algorithms, a CRNN (Convolutional Recurrent Neural Networks) model, or a Mask R-CNN model. Mask R-CNN is a model for instance segmentation. By treating text detection as an instance segmentation problem, Mask R-CNN can process text in any direction.

[0038] The application package text detection model can be trained through the following steps:

[0039] The first step is to obtain an application package program sample set, wherein the application package program samples in the application package program sample set include: sample application package program text information and sample labels.

[0040] The second step is to determine the initial application package text detection model. The initial application package text detection model includes: an initial feature extraction network and an initial recognition network. The initial feature extraction network includes: an initial text preprocessing network, an initial text composition network, and an initial text feature extraction network. The above-mentioned initial feature extraction model can be a neural network model that takes the sample application package program text information as input and the initial feature information as output. The initial text preprocessing network can be a neural network model that takes the application package program text information as input and the initial text preprocessing information as output. For example, the initial text preprocessing network can be used to: remove the information representing the space included in the application package program text information to obtain the initial text preprocessing information. For example, the initial text preprocessing information can include but is not limited to: words, and grammatical relations between words. The initial text composition network can be a model that takes the initial text preprocessing information as input and takes the initial text composition information as output. For example, the initial text composition network is used to: take the words included in the initial text preprocessing information as nodes, and take the grammatical relations between words included in the initial text preprocessing information as edges to construct the initial text composition information.

[0041] The third step is to select a target application package program sample from the application package program sample set. An application package program sample can be randomly selected from the application package program sample set as the target application package program sample.

[0042] The fourth step is to input the sample application package program text information included in the target application package program sample into the initial feature extraction network to obtain initial feature information.

[0043] The fourth step may include the following sub-steps:

[0044] In the first step, the sample application package program text information is input into the initial text preprocessing network to obtain initial text preprocessing information.

[0045] In the second step, the initial text preprocessing information is input into the initial text composition network to obtain the initial text composition information.

[0046] The third step is to input the initial text composition information into the initial text feature extraction network to obtain the initial feature information. The initial text feature extraction network is a custom network that takes the initial text composition information as input and the initial feature information as output.

[0047] Wherein, the custom network is divided into four layers: a first processing layer, including: a first graph convolution model and a first activation model, wherein the first graph convolution model is a convolution model with initial text composition information as input and the first initial text convolution information as output, and the first activation model is used to: activate the first initial text convolution information to generate the first initial text activation information; a second processing layer, including: a second graph convolution model and a second activation model, wherein the second graph convolution model is a convolution model with the first initial text activation information as input and the second initial text convolution information as output, and the second activation model is used to: activate the second initial text convolution information to generate the second initial text activation information; a fully connected layer, used to: convert the second initial text activation information to generate initial text conversion information; a normalization layer, used to: normalize the initial text conversion information to generate the second initial feature information.

[0048] In the fifth step, the initial feature information is input into the initial recognition network to obtain the initial application package text detection result. The initial recognition network may be a neural network model that takes the initial feature information as input and takes the initial application package text detection result as output. For example, the initial recognition network may be a support vector machine (SVM) model.

[0049] Step 6: Determine the loss value between the initial application package text detection result and the corresponding sample label. For example, the loss value between the initial application package text detection result and the corresponding sample label can be determined by a preset loss function. The preset loss function can be a cross entropy loss function or a hinge loss function.

[0050] In the seventh step, in response to determining that the loss value is less than the preset difference value, the initial application package text detection model is determined as the trained application package text detection model.

[0051] Optionally, in response to determining that the loss value is greater than or equal to the preset difference value, the network parameters of the initial application package text detection model are adjusted, the adjusted initial application package text detection model is determined as the initial application package text detection model, and the target application package program sample is selected from each application package program sample that has not been selected, and the initial application package text detection model is trained again. For example, the difference between the above-mentioned loss value and the preset difference value can be calculated. On this basis, the network parameters of the above-mentioned initial application package text detection model are adjusted using methods such as back propagation and gradient descent. It should be noted that the back propagation algorithm and the gradient descent method are well-known technologies that are currently widely studied and applied, and will not be repeated here. Among them, there is no limitation on the setting of the preset difference value. For example, the preset difference value can be 0.1.

[0052] Therefore, the initial text preprocessing information can be subjected to text composition by training the text composition network, so as to perform feature extraction processing on the text composition information later. After that, relatively accurate initial feature information can be extracted by training the initial text feature extraction network including the first processing layer, the second processing layer, the fully connected layer, and the normalization layer. Thus, relatively accurate abnormal codes can be identified through the extracted relatively accurate initial feature information.

[0053] Step 104, in response to determining that the application package text detection result meets the abnormal condition, the application package text information to be detected is sent to the program code maintenance terminal for repair processing.

[0054] In some embodiments, the execution subject may, in response to determining that the application package text detection result meets the abnormal condition, send the application package text information to be detected to the program code maintenance terminal for repair processing. Among them, the preset condition may be: the application package text detection result is that the application package text information represents the program code abnormality. The program code maintenance terminal may refer to a terminal for maintaining and repairing the code.

[0055] Step 105 , in response to determining that the application package text detection result does not meet the abnormal condition, storing the reconstructed application package text information in the associated application package cloud.

[0056] In some embodiments, the execution subject may store the reconstructed application package text information in an associated application package cloud in response to determining that the application package text detection result does not meet the abnormal condition. The application package cloud may refer to a pre-set cloud for storing application package text information.

[0057] Further references Figure 2 As an implementation of the methods shown in the above figures, the present disclosure provides some embodiments of a code text information storage device, and these code text information storage device embodiments are Figure 1 Corresponding to the method embodiments shown, the code text information storage device can be specifically applied to various electronic devices.

[0058] like Figure 2 As shown, the code text information storage device 200 of some embodiments includes: an acquisition unit 201, a reconstruction unit 202, an input unit 203, a sending unit 204 and a storage unit 205. Among them, the acquisition unit 201 is configured to acquire the text information of the application package to be detected; the reconstruction unit 202 is configured to reconstruct the text information of the application package to be detected to generate the reconstructed application package text information; the input unit 203 is configured to input the reconstructed application package text information into the pre-trained application package text detection model to obtain the application package text detection result; the sending unit 204 is configured to send the application package text information to the program code maintenance terminal for repair processing in response to determining that the application package text detection result meets the abnormal condition; the storage unit 205 is configured to store the reconstructed application package text information in the associated application package cloud in response to determining that the application package text detection result does not meet the abnormal condition.

[0059] It is understandable that the units recorded in the code text information storage device 200 and the reference Figure 1 Therefore, the operations, features and beneficial effects described above for the method are also applicable to the code text information storage device 200 and the units contained therein, and will not be repeated here.

[0060] Reference below Figure 3 , which shows a schematic diagram of the structure of an electronic device (e.g., a computing device) 300 suitable for implementing some embodiments of the present disclosure. The electronic devices in some embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (e.g., vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 3 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0061] like Figure 3As shown, the electronic device 300 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 301, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 302 or a program loaded from a storage device 308 into a random access memory (RAM) 303. In the RAM 303, various programs and data required for the operation of the electronic device 300 are also stored. The processing device 301, the ROM 302, and the RAM 303 are connected to each other via a bus 304. An input / output (I / O) interface 305 is also connected to the bus 304.

[0062] Typically, the following devices may be connected to the I / O interface 305: input devices 306 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; output devices 307 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 308 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 309. The communication devices 309 may allow the electronic device 300 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 3 The electronic device 300 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead. Figure 3 Each block shown in the figure may represent one device, or may represent multiple devices as required.

[0063] In particular, according to some embodiments of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, some embodiments of the present disclosure include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In some such embodiments, the computer program can be downloaded and installed from the network through the communication device 309, or installed from the storage device 308, or installed from the ROM 302. When the computer program is executed by the processing device 301, the above-mentioned functions defined in the method of some embodiments of the present disclosure are executed.

[0064] It should be noted that the computer-readable medium recorded in some embodiments of the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, 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 above. In some embodiments of the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In some embodiments of the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

[0065] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with 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"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.

[0066] The computer-readable medium may be included in the electronic device; or it may exist independently without being installed in the electronic device. The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device: obtains the text information of the application package to be detected; reconstructs the text information of the application package to be detected to generate reconstructed application package text information; inputs the reconstructed application package text information into a pre-trained application package text detection model to obtain an application package text detection result; in response to determining that the application package text detection result meets the abnormal condition, sends the application package text information to the program code maintenance terminal for repair processing; in response to determining that the application package text detection result does not meet the abnormal condition, stores the reconstructed application package text information in the associated application package cloud.

[0067] Computer program code for performing the operations of some embodiments of the present disclosure may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0068] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0069] The units described in some embodiments of the present disclosure may be implemented by software or hardware. The described units may also be set in a processor, for example, it may be described as: a processor includes: an acquisition unit, a reconstruction unit, an input unit, a sending unit and a storage unit. The names of these units do not constitute a limitation on the units themselves in some cases. For example, the acquisition unit may also be described as a "unit for acquiring text information of the application package to be detected."

[0070] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.

[0071] The above descriptions are only some preferred embodiments of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the embodiments of the present disclosure is not limited to the technical solutions formed by a specific combination of the above-mentioned technical features, but should also cover other technical solutions formed by any combination of the above-mentioned technical features or their equivalent features without departing from the above-mentioned inventive concept. For example, the above-mentioned features are replaced with the technical features with similar functions disclosed in the embodiments of the present disclosure (but not limited to) and the technical solutions formed.

Claims

1. A code text information storage method, comprising: Get the text information of the application package to be detected; Reconstructing the text information of the application package to be detected to generate reconstructed text information of the application package; Inputting the reconstructed application package text information into a pre-trained application package text detection model to obtain an application package text detection result; In response to determining that the application package text detection result meets the abnormal condition, sending the application package text information to be detected to the program code maintenance terminal for repair processing; In response to determining that the application package text detection result does not meet the abnormal condition, the reconstructed application package text information is stored in the associated application package cloud.

2. The method according to claim 1, wherein: The reconstructing the text information of the application package to be detected to generate reconstructed text information of the application package includes: Performing data division processing on the text information of the application package to be detected to generate an application package division text information group; Performing tree construction processing on the application package divided text information groups to generate application package program syntax tree information; Performing graph construction processing on the application package divided text information groups to generate application package program syntax graph information; Inputting the application package program syntax tree information into a first application package program encoding model to obtain first application package program encoding information, wherein the first application package program encoding model includes: an application package program encoding self-attention network and an application package program encoding neural network; Inputting the application package program syntax diagram information into a second application package program coding model to obtain second application package program coding information; fusing the first application package program coding information and the second application package program coding information to generate application package program coding fusion information; The application package program encoding fusion information is input into the application package program decoding model to obtain the application package program code information as the reconstructed application package text information, wherein the user program decoding model includes: an application package decoding attention network, an encoding and decoding attention network, and a program decoding neural network.

3. The method according to claim 1, wherein: Before inputting the reconstructed application package text information into a pre-trained application package text detection model to obtain an application package text detection result, the method further includes: Acquire an application package program sample set, wherein the application package program samples in the application package program sample set include: sample application package program text information and sample labels; Determine an initial application package text detection model, wherein the initial application package text detection model includes: an initial feature extraction network and an initial recognition network; Selecting a target application package program sample from the application package program sample set; Inputting the sample application package program text information included in the target application package program sample into the initial feature extraction network to obtain initial feature information; Input the initial feature information into the initial recognition network to obtain the initial application package text detection result; Determine the loss value between the initial application package text detection result and the corresponding sample label; In response to determining that the loss value is less than the preset difference value, the initial application package text detection model is determined as the trained application package text detection model.

4. The method according to claim 3, wherein: The method further comprises: In response to determining that the loss value is greater than or equal to a preset difference value, the network parameters of the initial application package text detection model are adjusted, the adjusted initial application package text detection model is determined as the initial application package text detection model, and a target application package program sample is selected from each application package program sample that has not been selected, and the initial application package text detection model is trained again.

5. A code text information storage device, comprising: An acquisition unit, configured to acquire text information of an application package to be detected; a reconstruction unit, configured to reconstruct the application package text information to be detected to generate reconstructed application package text information; An input unit, configured to input the reconstructed application package text information into a pre-trained application package text detection model to obtain an application package text detection result; a sending unit configured to send the application package text information to be detected to a program code maintenance terminal for repair processing in response to determining that the application package text detection result meets the abnormal condition; The storage unit is configured to store the reconstructed application package text information in the associated application package cloud in response to determining that the application package text detection result does not meet the abnormal condition.

6. An electronic device comprising: one or more processors; a storage device having one or more programs stored thereon; When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 4.

7. A computer readable medium having a computer program stored thereon, wherein: When the program is executed by a processor, the method according to any one of claims 1 to 4 is implemented.

Citation Information

Patent Citations

  • Code detection method and device, computer equipment and storage medium

    CN114817913A

  • Multi-mode program automatic repair method, system and equipment and storage medium

    CN116302998A

  • Vulnerability code detection method based on multi-dimensional feature extraction

    CN117454387A

  • XSS attack detection method and device, computer equipment and storage medium

    CN117728995A

Cited By

  • Automatic defense method and equipment based on malicious code attack chain recognition model

    CN118761061A