Method and electronic device for filtering security data

The electronic device uses a processor to encode and hash input data using a learned encoder and LSH operations to filter out security data, addressing the risk of information leaks in generative AI systems by accurately identifying confidential information.

WO2026049408A1PCT designated stage Publication Date: 2026-03-05SAMSUNG ELECTRONICS CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
PCT/KR2025/012672
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-08-28
Filing Date
2025-08-21
Publication Date
2026-03-05

AI Technical Summary

Technical Problem

The proliferation of generative AI systems increases the risk of security breaches due to confidential information being inadvertently included in input data, leading to potential information leaks.

Method used

An electronic device employs a processor to encode input data using a learned encoder, generate feature vectors, and perform locality sensitive hash (LSH) operations to identify and filter out security data by comparing generated hash values with a stored database of secure data.

Benefits of technology

Effectively determines the presence of security data in input, reducing the risk of information leaks by accurately identifying and filtering confidential information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure KR2025012672_05032026_PF_FP_ABST
    Figure KR2025012672_05032026_PF_FP_ABST
Patent Text Reader

Abstract

An electronic device according to an embodiment may comprise a memory and a processor, wherein the processor may be configured to: identify input data arrangeable in a plurality of lines stored in the memory; generate a first feature vector by encoding, by using an encoder, first partial data corresponding to a first number of first lines among the input data; generate a second feature vector by encoding, by using the encoder, second partial data corresponding to the first number of second lines, which at least partially overlap the first lines, among the input data; and train the encoder so that a result of decoding the first feature vector and the second feature vector by using a decoder, which corresponds to the encoder, corresponds to the input data.
Need to check novelty before this filing date? Find Prior Art

Description

Methods and electronic devices for filtering security data

[0001] Various embodiments of the present invention relate to a method and an electronic device for filtering secure data.

[0002] Thanks to remarkable advancements in information and communication technology and semiconductor technology, the proliferation and use of various electronic devices is rapidly increasing. Electronic devices are being developed to enable users to carry and communicate with one another. An electronic device can refer to any device that performs a specific function based on its embedded software, such as a mobile communication terminal, tablet PC, audio / video device, desktop / laptop computer, or in-vehicle navigation system. However, this is not limited to these devices; an electronic device can also refer to a server that stores data.

[0003] With the recent increase in the use of generative AI (GAI), security issues may arise due to information leaks entering programs that provide generative AI. For example, when using generative AI to write or modify program code, the information entered as a prompt may contain confidential information (e.g., confidential code contained within the program), potentially leading to security breaches.

[0004] According to one embodiment, an electronic device includes a memory and a processor, wherein the processor is configured to identify input data that can be arranged into a plurality of lines stored in the memory, encode first partial data corresponding to a first number of first lines of the input data by an encoder to generate a first feature vector, encode second partial data corresponding to the first number of second lines of the input data that at least partially overlap with the first lines by the encoder to generate a second feature vector, and train the encoder such that a result of decoding the first feature vector and the second feature vector by a decoder corresponding to the encoder corresponds to the input data.

[0005] According to one embodiment, an electronic device includes a memory and a processor, wherein the processor is configured to identify security data that can be arranged into a plurality of lines, encode the security data by a learned encoder to generate a feature vector, perform a locality sensitive hash (LSH) operation on a first feature vector corresponding to a first portion of a first length among the feature vectors based on a plurality of first set values ​​to generate a plurality of first hash values, perform the LSH operation on a second feature vector corresponding to a second portion of the first length among the feature vectors, the second portion of the first length being at least partially overlapped with the first portion among the feature vectors, to generate a plurality of second hash values, and store the plurality of first hash values ​​and the plurality of second hash values ​​in the memory.

[0006] In one embodiment, an electronic device includes a memory and a processor, wherein the processor is configured to identify input data that can be arranged into a plurality of lines, encode the input data by a learned encoder to generate a feature vector, perform a locality sensitive hash (LSH) operation on a first feature vector corresponding to a first portion of a first length among the feature vectors based on a plurality of first set values ​​to generate a plurality of first hash values, and perform the LSH operation on a second feature vector corresponding to a second portion of the first length among the feature vectors, the second portion being at least partially overlapped with the first portion among the feature vectors, to generate a plurality of second hash values, and compare the plurality of first hash values ​​and the plurality of second hash values ​​with a plurality of hash values ​​corresponding to secure data stored in the memory to determine whether the input data includes secure data.

[0007] In one embodiment, a method for filtering secure data may include: identifying input data that can be arranged into a plurality of lines; encoding the input data by a learned encoder to generate a feature vector; generating a plurality of first hash values ​​by performing a locality sensitive hash (LSH) operation on a first feature vector corresponding to a first portion of a first length among the feature vectors based on a plurality of first set values; generating a plurality of second hash values ​​by performing the LSH operation on a second feature vector corresponding to a second portion of the first length among the feature vectors, the second portion of the feature vectors at least partially overlapping with the first portion, based on a plurality of second set values; and comparing the plurality of first hash values ​​and the plurality of second hash values ​​with a plurality of hash values ​​corresponding to secure data to determine whether the input data includes secure data.

[0008] According to various embodiments of the present document, a method and an electronic device for filtering security data can be provided, which can determine whether security information is included by performing a locality-sensitive hash operation on information input as a prompt and comparing the information with hash values ​​corresponding to the security data.

[0009] Figure 1 is a schematic diagram of a network environment according to one embodiment.

[0010] FIG. 2 is a block diagram of an electronic device according to one embodiment.

[0011] FIG. 3 is a block diagram illustrating an AI model structure for encoder learning according to one embodiment.

[0012] FIG. 4 is a block diagram illustrating an encoding procedure of security data by an AI model according to one embodiment.

[0013] FIG. 5 is a block diagram illustrating an example of a prompt input according to one embodiment.

[0014] FIG. 6 is a block diagram illustrating a security data detection procedure for input data according to one embodiment.

[0015] FIG. 7 is a block diagram illustrating a security data detection procedure for input data according to one embodiment.

[0016] Figure 8 is a flowchart illustrating a learning method of an encoder according to one embodiment.

[0017] Figure 9 is a flowchart illustrating a method for creating a database of security data according to one embodiment.

[0018] Fig. 10 is a flowchart illustrating a method for detecting security data for input data according to one embodiment.

[0019] FIG. 11 is a block diagram of an electronic device within a network environment according to one embodiment.

[0020] Hereinafter, embodiments of the present disclosure will be described in detail with reference to the drawings so that those skilled in the art can easily implement the present disclosure. However, the present disclosure may be implemented in various different forms and is not limited to the embodiments described herein. In connection with the description of the drawings, the same or similar reference numerals may be used for identical or similar components. Furthermore, in the drawings and related descriptions, descriptions of well-known functions and configurations may be omitted for clarity and conciseness.

[0021] Figure 1 is a schematic diagram of a network environment according to one embodiment.

[0022] Referring to FIG. 1, within a network environment (100), a plurality of electronic devices (101, 102, 103) and a server (108) may be included.

[0023] According to one embodiment, a plurality of electronic devices (101, 102, 103) may be included within an intranet (110) (e.g., an internal network). For example, the plurality of electronic devices (101, 102, 103) may include various types of electronic devices. Although FIG. 1 illustrates the plurality of electronic devices (101, 102, 103) as two smartphones and one PC, this is merely exemplary and the number or type of electronic devices may not be limited thereto.

[0024] According to one embodiment, the server (108) may provide a generative AI service. For example, a user may access the server (108) providing the generative AI service through an electronic device (101, 102, 103) and input data (e.g., program code) into a prompt to make a query, thereby obtaining a desired result from the server (108) by means of a large language model (LLM). As an example, a user may access the server (108) providing the generative AI service through an electronic device (101, 102, 103) and request the server (108) to find a bug by inputting input data including a program code into a prompt, as illustrated in FIG. 5. In this case, if the program code includes secure data (e.g., confidential code), the secure data may be leaked outside the intranet (110).

[0025] The various embodiments described below describe various embodiments that can verify whether the program code entered in the above prompt contains security data. The configurations and operations of the network environment (100) described in FIG. 1 will be described in more detail in the descriptions of the drawings below.

[0026] FIG. 2 is a block diagram of an electronic device according to one embodiment.

[0027] Referring to FIG. 2, in one embodiment, an electronic device (200) (e.g., electronic devices (101, 102, 103) of FIG. 1) may include a communication module (210), a memory (220), a processor (230), an input module (240), and / or a display module (250).

[0028] In one embodiment, the communication module (210) may communicate with an external device (e.g., the electronic device (102), the electronic device (103), or the server (108) of FIG. 1). In one embodiment, the electronic device (200) may be implemented as a user terminal or a server, but is not limited thereto.

[0029] In one embodiment, the communication module (210) may obtain input data from an external device. In another embodiment, the input module (240) may obtain input data input from a user. In one embodiment, the input data may include data for training the encoder (e.g., program code including multiple lines of code). In one embodiment, the input data may be information or prompts regarding code that a user inputs or is to input into a designated application (e.g., an application for utilizing generative artificial intelligence). In one embodiment, the input data may include program code including multiple lines of code.

[0030] In one embodiment, the communication module (210) may acquire security data from an external device. In one embodiment, the security data may include data (e.g., program code including security data) for constructing a database of security data through an encoder trained by the input data.

[0031] In one embodiment, when the electronic device (200) is implemented as a server, the electronic device (200) can obtain the aforementioned input data or security data from an external device through the communication module (210). Alternatively, in one embodiment, when the electronic device (200) is implemented as an electronic device (e.g., a user terminal) rather than a server, the electronic device (200) can obtain the input data or security data through the communication module (210), or obtain the input data or security data based on data input by a user to a prompt through the input module (240).

[0032] In one embodiment, the memory (220) may store various data used by at least one component of the electronic device (200). The data may include, for example, input data or output data for software and commands related thereto. The memory (220) may include volatile memory or non-volatile memory. A program may be stored as software in the memory (220) and may include, for example, an operating system, middleware, or an application. In one embodiment, the memory (220) may store setting values ​​for performing a locality sensitive hash (LSH) operation on a feature vector in the embodiments described below.

[0033] In one embodiment, the processor (230) may include one or more processors. In one embodiment, the processor (230) may perform various operations by executing instructions stored in the memory (220).

[0034] According to one embodiment, the processor (230) may train the encoder based on input data input via the input module (240) or stored in the memory (220) or input data received via the communication module (210). A detailed description thereof will be provided later in the description of FIG. 3.

[0035] According to one embodiment, the processor (230) may create or build a database of security data by encoding the security data stored in the memory (220) or the security data received via the communication module (210) using the encoder learned above. A detailed description thereof will be provided later in the description of FIG. 4.

[0036] According to one embodiment, the processor (230) may encode input data input through the input module (240) or stored in the memory (220) or input data received through the communication module (210) through the encoder learned above, and compare it with the secure data stored in the database to check whether the input data includes secure data. For example, a user may input a code for checking a program bug as the input data through a prompt input screen displayed through the display module (250) as illustrated in FIG. 5. The processor (250) may be configured to display the input data input through the input module (240) on the prompt input screen. A detailed description thereof will be provided later in the description of FIG. 6.

[0037] FIG. 3 is a block diagram illustrating an AI model structure for encoder learning according to one embodiment.

[0038] Referring to FIG. 3, according to one embodiment, an AI model for encoder learning may include an encoder (320) and a decoder (340). At least a portion of the encoder (320) and the decoder (340) may be implemented by the processor (230) of FIG. 2. According to one embodiment, the encoder (320) may include, but is not limited to, an auto encoder in which a decoder (340) exists. For example, the encoder (320) and the decoder (340) may be trained together and configured, and the encoder (320) may be trained such that data input to the encoder (320) is identical or similar to data output from the decoder (340). For example, the auto encoder may utilize input original data as a label without requiring a label using an unsupervised learning method. For example, the autoencoder can learn to ensure that the data input to the encoder (320) and the data output from the decoder (340) have the same values ​​as much as possible. The encoder (320) can learn the network by itself by encoding the input data to generate a low-dimensional representation.

[0039] According to one embodiment, the input data (310) input to the encoder (320) may include any type of data that can be arranged into multiple lines. For example, the input data (310) may include text data such as program code. Additionally, the input data may include image data that can be configured as a bit string in a specific format. In the embodiments described below, for convenience of explanation, text data will be described as an example of input data.

[0040] According to one embodiment, the encoder (320) may divide the entire input data (310) into a plurality of partial data (311, 312) and encode them. For example, the encoder (320) may encode first partial data (311) corresponding to a first number of first lines among the entire input data (310) to generate a first feature vector (331). The feature vector may be referred to as a feature or a latent vector, but is not limited to the above terms. For example, the encoder (320) may encode second partial data (312) corresponding to a first number of second lines among the entire input data (310) to generate a second feature vector (332). According to one embodiment, the first partial data (311) and the second partial data (312) may overlap at least some lines. For example, encoding can be performed using a sliding window method by setting at least some lines of the second partial data (312) to overlap with at least some lines of the first partial data (311). In FIG. 3, two partial data (311, 312) are illustrated for convenience of explanation, but encoding can also be performed by dividing the entire input data (310) into three or more partial data and setting the three or more partial data to overlap with each other at least partially. In FIG. 3, the first partial data (311) and the second partial data (312) are set to have the same number (e.g., the first number), but they may be set to have different numbers.

[0041] According to one embodiment, the AI ​​model for learning of the encoder (320) may refer to a model that generates new data that follows the distribution of the corresponding data. The AI ​​model may include a generative AI model, but the AI ​​model described below is not limited to a generative AI model. The AI ​​model may learn the distribution of data, and the data may have a latent space. Learning by the AI ​​model may correspond to learning the latency space, and the latency vector output from the encoder (320) may include a latent variable that the data has. For example, the latency vector is a variable in the form of a latent vector that the entire data has, and the latency space may be formed by gathering latency vectors. In the latency space, input data to be learned exist in the form of a distribution of latency vectors, and the distribution of the latency that the data has can be learned through the AI ​​model.

[0042] According to one embodiment, referring to FIG. 3, when the first feature vector (331) encoding the first partial data (311) is decoded, first restored data (351) may be generated. In addition, when the second feature vector (332) encoding the second partial data (312) is decoded, second restored data (352) may be generated. According to one embodiment, as described above, the encoder may be trained so that the first partial data (311) and the first restored data (351) become identical or similar, and so that the second partial data (312) and the second restored data (352) become identical or similar.

[0043] According to one embodiment, the encoder (320) may be configured to encode specific data (e.g., specific code) in the input data (310) at the same or similar positions in the feature vectors (331, 332). For example, an objective function for reducing the L2 distance may be added to the encoder (320) so that values ​​corresponding to positions where corresponding partial data (311, 312) in the first feature vector (331) and the second feature vector (332) overlap with each other are the same or similar. For example, overlapping portions of the first partial data (311) and the second partial data (312) may be arranged at different positions on the first feature vector (331) and the second feature vector (332). For example, a portion of the first partial data (311) that overlaps with the second partial data (312) may be placed at the lower portion (331a) of the first feature vector (331), and a portion of the second partial data (312) that overlaps with the first partial data (311) may be placed at the upper portion (332a) of the second feature vector (332). For example, when the encoder (320) is trained so that the lower portion (331a) of the first feature vector (331) and the upper portion (332a) of the second feature vector (332) have the same or similar values, any code snippet containing a specific code among the entire input data (310) may have a feature vector placed at a position corresponding to the specific code on the feature vector. For example, when learning by adding an objective function to train the encoder (320) so that the lower part (331a) of the first characteristic vector (331) and the upper part (332a) of the second characteristic vector (332) have the same or similar values, the encoder (320) can be trained to have meaning with only a part of the characteristic vector.

[0044] According to various embodiments, when training the encoder (320) as described above, the objective function for reducing the L2 distance and the function for encoding the autoencoder can be trained simultaneously, and by adjusting the weight between the two, it can be possible to control whether to focus on the entire input code or on the code corresponding to the position of the feature vector. According to various embodiments, encoding that adds the objective function to train the encoder (320) as described above can be referred to as spatial locality preserving encoding, but is not limited to the above term.

[0045] FIG. 4 is a block diagram illustrating an encoding procedure of security data by an AI model according to one embodiment.

[0046] Referring to FIG. 4, according to one embodiment, the processor (230) may create or build a database of secure data (e.g., confidential code) by encoding the secure data using the encoder learned in FIG. 3.

[0047] According to one embodiment, the secure data (410) may be encoded by the encoder (320) learned in FIG. 3. According to one embodiment, the secure data (410) input to the encoder (320) may include any type of data that can be arranged into a plurality of lines. For example, the secure data (410) may include text data such as program code. Additionally, the secure data may include image data that can be configured as a bit string in a specific format. At least a portion of the secure data may include confidential code.

[0048] In one embodiment, the encoder (320) may encode the input security data (410) to generate a feature vector (430). The feature vector may be referred to as a feature or a latent vector, but is not limited to the above terms.

[0049] According to one embodiment, the processor (230) may perform a locality sensitive hash (LSH) operation on the feature vector (430) to generate a hash value (440). For convenience of explanation, the locality sensitive hash-operated hash value will be denoted as 'LSH'. According to one embodiment, the feature vector (430) may be divided into a plurality of parts and subjected to an LSH operation. For example, the feature vector (430) may be divided into a first feature vector (430-1) corresponding to a first part, a second feature vector (430-2) corresponding to a second part, a third feature vector (430-3) corresponding to a third part, a fourth feature vector (430-4) corresponding to a fourth part, ..., an n-th feature vector (430-n) corresponding to an n-th part. Each of the parts may overlap with at least a portion of an adjacent part.

[0050] According to one embodiment, the LSH operation may be set as in <Mathematical Formula 1> below, but is not limited thereto.

[0051]

[0052] In the above <Mathematical Formula 1>, q is a feature vector, and x, b, and w can correspond to settings for the LSH operation. The above x indicates in which direction the feature vector is projected, and b and w can indicate values ​​that set the sensitivity to locality.

[0053] In one embodiment, the LSH is not limited to a specific hash function, and the LSH may be defined as a function encompassing a broad concept that may be defined by the following parameters.

[0054] Distance metric: d

[0055] Approximation factor: c > 1

[0056] Threshold r > 0

[0057] Probability p1> p2

[0058] Using the above parameters, if, for all pairs of elements, the probability that the hash values ​​of the two elements are the same when the distance between them is less than or equal to r is at least greater than p1, and the probability that the hash values ​​of the two elements are the same when the distance between them is greater than or equal to c*r is at most less than p2, then the hash function h can be referred to as a locality sensitive hash. In addition, such a hash function can be defined as (r, cr, p1, p2) sensitive. For example, a function that has a greater probability of having the same hash value when the distance between two elements is close than the probability of having the same hash value when the distance between the two elements is far can be defined as an LSH function according to the present disclosure.

[0059] According to one embodiment, the processor (230) may generate a plurality of hash values ​​by performing a plurality of LSH operations by setting different setting values ​​for each of a plurality (e.g., n) of feature vectors (430-1, 430-2, 430-3, 430-4, ..., 430-n) corresponding to each part. According to one embodiment, the processor (230) may generate k LSH (440-1) by performing an LSH operation on the first feature vector (430-1) by k setting values. For example, the processor (230) may perform an LSH operation on the first feature vector (430-1) by using the first setting value (e.g., x1, b1, w1). 1,1 can be generated, and LSH is performed by LSH operation with the second setting value (e.g., x2, b2, w2). 1,2 can be generated, and the k setting value (e.g., x k , b k , w k ) by LSH operation 1,k can be created.

[0060] According to one embodiment, the processor (230) may generate k LSHs (440-2) by performing LSH operations on the second feature vector (430-2) by k set values. For example, the processor (230) may perform LSH operations on the second feature vector (430-2) by performing LSH operations on the first set values ​​(e.g., x1, b1, w1). 2,1 can be generated, and LSH is performed by LSH operation with the second setting value (e.g., x2, b2, w2). 2,2 can be generated, and the k setting value (e.g., x k , b k , w k ) by LSH operation 2,k can be created.

[0061] According to one embodiment, the processor (230) can generate k LSHs (440-n) by performing LSH operations on the n-th feature vector (430-n) by k set values. For example, the processor (230) can perform LSH operations on the n-th feature vector (430-n) by performing LSH operations on the first set value (e.g., x1, b1, w1). n,1 can be generated, and LSH is performed by LSH operation with the second setting value (e.g., x2, b2, w2). n,2 can be generated, and the k setting value (e.g., x k , b k , w k ) by LSH operation n,k can be created.

[0062] According to one embodiment, the processor (230) may perform a plurality of LSH operations by setting different settings for each of a plurality of (e.g., n) characteristic vectors (430-1, 430-2, 430-3, 430-4, ..., 430-n) corresponding to each portion of the characteristic vector (430), thereby generating a plurality of hash values ​​(440) and storing them in a database (450) as hash values ​​for a confidential code.

[0063] According to one embodiment, the setting values ​​for the feature vectors corresponding to each part may be set identically or differently. For example, as illustrated in FIG. 4, the first LSHs (441) (LSH) to which the first setting values ​​(e.g., x1, b1, w1) of each feature vector (430-1, 430-2, 430-3, 430-4, ..., 430-n) are applied 1,1 , LSH 2,1 ,..., LSH n,1 ) may all be set to the same value, or at least some of the settings may be set to different values.

[0064] FIG. 5 is a block diagram illustrating an example of a prompt input according to one embodiment.

[0065] Referring to FIG. 5, as described above, a user may access a server (108) providing a generative AI service through an electronic device (200) (e.g., electronic devices (101, 102, 103) of FIG. 1) and input data (e.g., program code) into a prompt (500) to make a query, thereby obtaining a desired result from the server (108) by means of a large language model (LLM). As an example, a user may access a server (108) providing a generative AI service through an electronic device (101, 102, 103) and request the server (108) to find a bug by inputting input data including a program code into the prompt as illustrated in FIG. 5 (e.g., requesting by inputting "please find any bug in following code:"). According to one embodiment, as described later in the description of FIG. 6, the input data is encoded and LSH-operated by the learned encoder (320), and then compared with a hash value corresponding to the secure data (e.g., a confidential code) stored in the database, thereby determining whether the input data includes secure data.

[0066] FIG. 6 is a block diagram illustrating a security data detection procedure for input data according to one embodiment.

[0067] Referring to FIG. 6, according to one embodiment, the processor (230) may encode input data entered in the prompt or code data (610) corresponding to at least a portion of the input data (hereinafter, referred to as input data for convenience of explanation) by the encoder (320) learned in FIG. 3, as illustrated in FIG. 5.

[0068] In one embodiment, the encoder (320) may encode the input data (610) to generate a feature vector (630). The feature vector may be referred to as a feature or a latent vector, but is not limited to the above terms.

[0069] According to one embodiment, the processor (230) may perform a locality sensitive hash (LSH) operation on the feature vector (630) to generate a hash value (640). For convenience of explanation, the locality sensitive hash-operated hash value will be denoted as 'LSH'. According to one embodiment, the feature vector (630) may be divided into a plurality of parts and subjected to an LSH operation. For example, the feature vector (630) may be divided into a first feature vector (630-1) corresponding to a first part, a second feature vector (630-2) corresponding to a second part, a third feature vector (630-3) corresponding to a third part, a fourth feature vector (630-4) corresponding to a fourth part, ..., an n-th feature vector (630-n) corresponding to an n-th part. Each of the parts may overlap with at least a portion of an adjacent part.

[0070] According to one embodiment, the processor (230) may generate a plurality of hash values ​​by performing a plurality of LSH operations by setting different setting values ​​for each of a plurality (e.g., n) of feature vectors (630-1, 630-2, 630-3, 630-4, ..., 630-n) corresponding to each part. According to one embodiment, the processor (230) may generate k LSH (640-1) by performing an LSH operation on the first feature vector (630-1) by k setting values. For example, the processor (230) may perform an LSH operation on the first feature vector (630-1) by using the first setting value (e.g., x1, b1, w1). 1,1can be generated, and LSH is performed by LSH operation with the second setting value (e.g., x2, b2, w2). 1,2 can be generated, and the k setting value (e.g., x k , b k , w k ) by LSH operation 1,k can be created.

[0071] According to one embodiment, the processor (230) may generate k LSHs (640-2) by performing LSH operations on the second feature vector (630-2) by k set values. For example, the processor (230) may perform LSH operations on the second feature vector (630-2) by performing LSH operations on the first set value (e.g., x1, b1, w1). 2,1 can be generated, and LSH is performed by LSH operation with the second setting value (e.g., x2, b2, w2). 2,2 can be generated, and the k setting value (e.g., x k , b k , w k ) by LSH operation 2,k can be created.

[0072] According to one embodiment, the processor (230) can generate k LSHs (640-n) by performing LSH operations on the n-th feature vector (630-n) by k set values. For example, the processor (230) can generate LSHs by performing LSH operations on the n-th feature vector (630-n) by a first set value (e.g., x1, b1, w1). n,1 can be generated, and LSH is performed by LSH operation with the second setting value (e.g., x2, b2, w2). n,2 can be generated, and the k setting value (e.g., x k , b k , w k ) by LSH operation n,k can be created.

[0073] According to one embodiment, the processor (230) may perform a plurality of LSH operations on a plurality of (e.g., n) feature vectors (630-1, 630-2, 630-3, ..., 630-n) corresponding to each portion of the feature vector (630) to generate a plurality of hash values ​​(640) and compare the generated LSH operations with hash values ​​stored in the database (450). According to one embodiment, the processor (230) may perform a plurality of LSH operations by setting different or identical setting values ​​for a plurality of (e.g., n) feature vectors (630-1, 630-2, 630-3, ..., 630-n) corresponding to each portion of the feature vector (630) to generate a plurality of hash values ​​(640).

[0074] According to one embodiment, the processor (230) may determine or confirm whether the input data (610) includes security data based on the comparison result. For example, when k LSHs (640-1) generated by performing LSH operation on the first feature vector (630-1) with k set values ​​are compared with k LSHs stored in the database (450), if all k are identical or are identical by a number greater than or equal to a set ratio, it may be determined or confirmed that the input data (610) includes security data. In addition, when k LSHs (640-2) generated by performing LSH operation on the second feature vector (630-2) with k set values ​​are compared with k LSHs stored in the database (450), if all k are identical or are identical by a number greater than or equal to a set ratio, it may be determined or confirmed that the input data (610) includes security data. For example, when k LSHs (640-n) generated by performing LSH operations on the n-th feature vector (630-n) with k set values ​​are compared with k LSHs stored in the database (450), if all k are the same or are the same by a number greater than or equal to a set ratio, it can be determined or confirmed that the input data (610) contains security data.

[0075] FIG. 7 is a block diagram illustrating a security data detection procedure for input data according to one embodiment.

[0076] Referring to FIG. 7, according to one embodiment, the processor (230) may encode input data entered in the prompt or code data (710) corresponding to at least a portion of the input data (hereinafter, referred to as input data for convenience of explanation) by the encoder (320) learned in FIG. 3, as illustrated in FIG. 5.

[0077] According to one embodiment, the processor (230) may compare the size of the code data (710) corresponding to the input data inputted in the prompt or at least a portion of the input data with the input size set in the encoder (320). If the size of the code data (710) is smaller than the input size set in the encoder (320) as a result of the comparison, the size of the code data (710) may be expanded or increased by the input size set in the encoder (320) through a code expansion unit (711). According to one embodiment, the code expander (711) may increase the size of the input code data (710) through expansion using zero padding or learning through a generative model.

[0078] In one embodiment, the encoder (320) may encode the input data (710) to generate a feature vector (730). The feature vector may be referred to as a feature or a latent vector, but is not limited to the above terms.

[0079] According to one embodiment, the processor (230) may perform a locality sensitive hash (LSH) operation on the feature vector (730) to generate a hash value (740). For convenience of explanation, the locality sensitive hash-operated hash value will be denoted as 'LSH'. According to one embodiment, the LSH may use a Euclidean LSH, but is not limited thereto. According to one embodiment, the feature vector (730) may be divided into a plurality of parts and subjected to an LSH operation. For example, the feature vector (730) may be divided into a first feature vector (730-1) corresponding to a first part, a second feature vector (730-2) corresponding to a second part, a third feature vector (730-3) corresponding to a third part, ..., an n-th feature vector (730-n) corresponding to an n-th part. Each of the parts may overlap with at least a portion of an adjacent part. According to one embodiment, the processor (230) may perform an LSH operation without including the values ​​of the feature vector (731) corresponding to the portion increased through the code expander (711) in the sliding window. By not including the values ​​of the feature vector (731) corresponding to the portion increased through the code expander (711) in the sliding window, false positives may be reduced.

[0080] According to one embodiment, the processor (230) may generate a plurality of hash values ​​by performing a plurality of LSH operations by setting different setting values ​​for each of a plurality (e.g., n) of feature vectors (730-1, 730-2, 730-3, ..., 730-n) corresponding to each part. According to one embodiment, the processor (230) may generate k LSHs (740-1) by performing an LSH operation on the first feature vector (730-1) by k setting values. For example, the processor (230) may perform an LSH operation on the first feature vector (730-1) by using the first setting value (e.g., x1, b1, w1).1,1 can be generated, and LSH is performed by LSH operation with the second setting value (e.g., x2, b2, w2). 1,2 can be generated, and the k setting value (e.g., x k , b k , w k ) by LSH operation 1,k can be created.

[0081] According to one embodiment, the processor (230) may generate k LSHs (740-2) by performing LSH operations on the second feature vector (730-2) by k set values. For example, the processor (230) may perform LSH operations on the second feature vector (730-2) by performing LSH operations on the first set value (e.g., x1, b1, w1). 2,1 can be generated, and LSH is performed by LSH operation with the second setting value (e.g., x2, b2, w2). 2,2 can be generated, and the k setting value (e.g., x k , b k , w k ) by LSH operation 2,k can be created.

[0082] According to one embodiment, the processor (230) may perform a plurality of LSH operations by setting different settings for each of a plurality of (e.g., n) characteristic vectors (730-1, 730-2, 730-3, ..., 730-n) corresponding to each portion of the characteristic vector (730), thereby generating a plurality of hash values ​​(740) and comparing them with hash values ​​stored in the database (450).

[0083] According to one embodiment, the processor (230) may determine or confirm whether the input data (710) includes security data based on the comparison result. For example, when k LSHs (740-1) generated by performing LSH operation on the first feature vector (730-1) with k set values ​​are compared with k LSHs stored in the database (450), if all k are identical or are identical by a number greater than or equal to a set ratio, it may be determined or confirmed that the input data (710) includes security data. In addition, when k LSHs (740-2) generated by performing LSH operation on the second feature vector (730-2) with k set values ​​are compared with k LSHs stored in the database (450), if all k are identical or are identical by a number greater than or equal to a set ratio, it may be determined or confirmed that the input data (710) includes security data. For example, when k LSHs (740-n) generated by performing LSH operations on the n-th feature vector (730-n) with k set values ​​are compared with k LSHs stored in the database (450), if all k are the same or are the same by a number greater than or equal to a set ratio, it can be determined or confirmed that the input data (710) contains security data.

[0084] According to one embodiment, various methods may be applied to check whether all k hash values ​​included in each LSH (740-1, 740-2, ..., 740-n) corresponding to each feature vector exist in the database (450), and the present invention is not limited to a specific method. For example, the processor (230) may concatenate the k hash values ​​included in each LSH (740-1, 740-2, ..., 740-n) corresponding to each feature vector, and then perform a hash operation using a secure hash algorithm (SHA). According to another embodiment, the processor (230) may use a bloom filter to check whether all k hash values ​​included in each LSH (740-1, 740-2, ..., 740-n) corresponding to each feature vector exist in the database (450). Hereinafter, an example of checking whether security data is included in input data (710) using the above SHA will be described, and is not limited to the method described below.

[0085] According to one embodiment, the feature vector q to be currently examined i may correspond to a part of the feature vector (e.g., latency vector) obtained through the sliding window. The feature vector q i can be expressed as in <Mathematical Formula 2> below.

[0086]

[0087] In the above <Mathematical Formula 2>, i can correspond to the ith feature vector. I2 is the size of the sliding window, and assuming that I1 is the size of the feature vector, 1<=I2<=I1 can be satisfied. s is the unit value by which the sliding window moves and can be set to a value greater than or equal to 1.

[0088] According to one embodiment, the processor (230) may each of the q iLSH is the value calculated for k LSHs i,1 (q), LSH i,2 (q), ..., LSH i,k (q) can be obtained. By inputting the obtained value into a hash function such as SHA1, SHA2, or SHA256, a hash value (or hash key value) can be obtained as in <Mathematical Formula 3> below.

[0089]

[0090] According to one embodiment, the addition operation (+) in the above <Mathematical Formula 3> may be replaced with a concatenation operation. For example, the processor (230) checks whether the hash value (or hash key value) exists in the hash table (T) corresponding to the security data stored in the database (450), thereby obtaining q i It can be checked whether the code exists in the database (450). According to one embodiment, the hash table (T) can indicate in an on / off form whether the corresponding key value exists in the database (450), but is not limited thereto. According to one embodiment, the database (450) can store a piece of a feature vector (e.g., a latency vector) used during generation. When a piece of the feature vector is stored in the database (450), false positives due to hash collisions can be reduced. According to one embodiment, the hash table (T) can be generated for each file or project, and multiple projects can be managed with one hash table for space utilization.

[0091] According to one embodiment, as described above, the feature vector (730) may be divided into n parts, each of which may be calculated using k LSHs. The processor (230) may confirm or determine that a confidential code exists if at least one of the n cases in which all of the k LSH values ​​are the same exists in the database (450). According to one embodiment, a sliding window may be used, as described above, to divide the feature vector (730) into n parts. At this time, multiple windows with different window sizes may be used, and the overall processing speed may be improved by checking for the presence of confidential data starting from a window with a relatively large size. In this way, by using a sliding window, as described above, to divide the feature vector (730) into n parts, even if only a part of the code of the input data (710) entered into the prompt is included in the confidential data (e.g., confidential code), it is possible to detect this.

[0092] Figure 8 is a flowchart illustrating a learning method of an encoder according to one embodiment.

[0093] Referring to FIG. 8, the electronic device (200) may include a memory (220) and a processor (230). According to one embodiment, the processor (230) may, in operation 802, check input data that can be arranged into a plurality of lines stored in the memory (220).

[0094] According to one embodiment, the processor (230) may, at operation 804, encode first partial data corresponding to a first number of first lines of the input data by the encoder (320) to generate a first feature vector.

[0095] According to one embodiment, the processor (230) may, at operation 806, generate a second feature vector by encoding, by the encoder (320), second partial data corresponding to the first number of second lines of the input data, at least some of which overlap with the first lines.

[0096] According to one embodiment, the processor (230) may be configured to train the encoder (320) such that the result of decoding the first feature vector and the second feature vector by the decoder (340) corresponding to the encoder (320) corresponds to the input data, at operation 808.

[0097] Figure 9 is a flowchart illustrating a method for creating a database of security data according to one embodiment.

[0098] Referring to FIG. 9, the electronic device (200) may include a memory (220) and a processor (230). According to one embodiment, the processor (230) may, in operation 902, verify security data that can be arranged into a plurality of lines.

[0099] According to one embodiment, the processor (230) may, at operation 904, encode the security data by a learned encoder to generate a feature vector.

[0100] According to one embodiment, the processor (230) may, in operation 906, generate a plurality of first hash values ​​by performing a locality sensitive hash (LSH) operation on a first feature vector corresponding to a first portion of a first length among the feature vectors based on a plurality of first set values.

[0101] According to one embodiment, the processor (230) may, at operation 908, generate a plurality of second hash values ​​by performing the LSH operation on a second feature vector corresponding to a second portion of the first length that at least partially overlaps the first portion of the feature vector, based on a plurality of second set values.

[0102] According to one embodiment, the processor (230) may be configured to store the plurality of first hash values ​​and the plurality of second hash values ​​in the memory (220), at operation 910.

[0103] Fig. 10 is a flowchart illustrating a method for detecting security data for input data according to one embodiment.

[0104] Referring to FIG. 10, the electronic device (200) may include a memory (220) and a processor (230). According to one embodiment, the processor (230) may, in operation 1002, identify input data that can be arranged into a plurality of lines.

[0105] According to one embodiment, the processor (230) may, at operation 1004, encode the input data by a learned encoder to generate a feature vector.

[0106] According to one embodiment, the processor (230) may, in operation 1006, generate a plurality of first hash values ​​by performing a locality sensitive hash (LSH) operation on a first feature vector corresponding to a first portion of a first length among the feature vectors based on a plurality of first set values.

[0107] According to one embodiment, the processor (230) may, in operation 1008, generate a plurality of second hash values ​​by performing the LSH operation on a second feature vector corresponding to a second portion of the first length that at least partially overlaps the first portion of the feature vector, based on a plurality of second set values.

[0108] According to one embodiment, the processor (230) may be configured to, in operation 1010, compare the plurality of first hash values ​​and the plurality of second hash values ​​with a plurality of hash values ​​corresponding to secure data stored in the memory to determine whether the input data includes secure data.

[0109] FIG. 11 is a block diagram of an electronic device (1101) within a network environment (1100), according to one embodiment. Referring to FIG. 11 , in the network environment (1100), the electronic device (1101) may communicate with the electronic device (1102) via a first network (1198) (e.g., a short-range wireless communication network), or may communicate with at least one of the electronic device (1104) or the server (1108) via a second network (1199) (e.g., a long-range wireless communication network). In one embodiment, the electronic device (1101) may communicate with the electronic device (1104) via the server (1108). According to one embodiment, the electronic device (1101) may include a processor (1120), a memory (1130), an input module (1150), an audio output module (1155), a display module (1160), an audio module (1170), a sensor module (1176), an interface (1177), a connection terminal (1178), a haptic module (1179), a camera module (1180), a power management module (1188), a battery (1189), a communication module (1190), a subscriber identification module (1196), or an antenna module (1197). In some embodiments, the electronic device (1101) may omit at least one of these components (e.g., the connection terminal (1178)), or may have one or more other components added. In some embodiments, some of these components (e.g., sensor module (1176), camera module (1180), or antenna module (1197)) may be integrated into a single component (e.g., display module (1160)).

[0110] The processor (1120) may, for example, execute software (e.g., a program (1140)) to control at least one other component (e.g., a hardware or software component) of the electronic device (1101) connected to the processor (1120) and perform various data processing or operations. According to one embodiment, as at least a part of the data processing or operations, the processor (1120) may store commands or data received from other components (e.g., a sensor module (1176) or a communication module (1190)) in a volatile memory (1132), process the commands or data stored in the volatile memory (1132), and store result data in a non-volatile memory (1134). According to one embodiment, the processor (1120) may include a main processor (1121) (e.g., a central processing unit or an application processor) or an auxiliary processor (1123) (e.g., a graphics processing unit, a neural processing unit (NPU), an image signal processor, a sensor hub processor, or a communication processor) that can operate independently or together with the main processor (1121). For example, when the electronic device (1101) includes the main processor (1121) and the auxiliary processor (1123), the auxiliary processor (1123) may be configured to use less power than the main processor (1121) or to be specialized for a given function. The auxiliary processor (1123) may be implemented separately from the main processor (1121) or as a part thereof.

[0111] The auxiliary processor (1123) may control at least a portion of functions or states associated with at least one component (e.g., a display module (1160), a sensor module (1176), or a communication module (1190)) of the electronic device (1101), for example, on behalf of the main processor (1121) while the main processor (1121) is in an inactive (e.g., sleep) state, or together with the main processor (1121) while the main processor (1121) is in an active (e.g., application execution) state. In one embodiment, the auxiliary processor (1123) (e.g., an image signal processor or a communication processor) may be implemented as a part of another functionally related component (e.g., a camera module (1180) or a communication module (1190)). In one embodiment, the auxiliary processor (1123) (e.g., a neural network processing unit) may include a hardware structure specialized for processing artificial intelligence models. The artificial intelligence models may be generated through machine learning. This learning can be performed, for example, on the electronic device (1101) itself where the artificial intelligence model is executed, or can be performed through a separate server (e.g., server (1108)). The learning algorithm can include, for example, supervised learning, unsupervised learning, semi-supervised learning, or reinforcement learning, but is not limited to the examples described above. The artificial intelligence model can include multiple artificial neural network layers.The artificial neural network may be one of a deep neural network (DNN), a convolutional neural network (CNN), a recurrent neural network (RNN), a restricted Boltzmann machine (RBM), a deep belief network (DBN), a bidirectional recurrent deep neural network (BRDNN), a deep Q-network, or a combination of two or more of the above, but is not limited to the examples described above. In addition to, or alternatively to, a hardware structure, an artificial intelligence model may include a software structure.

[0112] The memory (1130) can store various data used by at least one component (e.g., the processor (1120) or the sensor module (1176)) of the electronic device (1101). The data can include, for example, software (e.g., the program (1140)) and input data or output data for commands related thereto. The memory (1130) can include a volatile memory (1132) or a non-volatile memory (1134).

[0113] The program (1140) may be stored as software in memory (1130) and may include, for example, an operating system (1142), middleware (1144), or an application (1146).

[0114] The input module (1150) can receive commands or data to be used in a component of the electronic device (1101) (e.g., a processor (1120)) from an external source (e.g., a user) of the electronic device (1101). The input module (1150) can include, for example, a microphone, a mouse, a keyboard, a key (e.g., a button), or a digital pen (e.g., a stylus pen).

[0115] The audio output module (1155) can output audio signals to the outside of the electronic device (1101). The audio output module (1155) can include, for example, a speaker or a receiver. The speaker can be used for general purposes, such as multimedia playback or recording playback. The receiver can be used to receive incoming calls. In one embodiment, the receiver can be implemented separately from the speaker or as part of the speaker.

[0116] The display module (1160) can visually provide information to an external party (e.g., a user) of the electronic device (1101). The display module (1160) may include, for example, a display, a holographic device, or a projector and a control circuit for controlling the device. In one embodiment, the display module (1160) may include a touch sensor configured to detect a touch, or a pressure sensor configured to measure the intensity of a force generated by the touch.

[0117] The audio module (1170) can convert sound into an electrical signal, or vice versa, convert an electrical signal into sound. According to one embodiment, the audio module (1170) can acquire sound through the input module (1150), output sound through the sound output module (1155), or an external electronic device (e.g., electronic device (1102)) (e.g., speaker or headphone) directly or wirelessly connected to the electronic device (1101).

[0118] The sensor module (1176) can detect the operating status (e.g., power or temperature) of the electronic device (1101) or the external environmental status (e.g., user status) and generate an electrical signal or data value corresponding to the detected status. According to one embodiment, the sensor module (1176) can include, for example, a gesture sensor, a gyro sensor, a barometric pressure sensor, a magnetic sensor, an acceleration sensor, a grip sensor, a proximity sensor, a color sensor, an IR (infrared) sensor, a biometric sensor, a temperature sensor, a humidity sensor, or an illuminance sensor.

[0119] The interface (1177) may support one or more designated protocols that may be used to directly or wirelessly connect the electronic device (1101) with an external electronic device (e.g., the electronic device (1102)). In one embodiment, the interface (1177) may include, for example, a high definition multimedia interface (HDMI), a universal serial bus (USB) interface, an SD card interface, or an audio interface.

[0120] The connection terminal (1178) may include a connector through which the electronic device (1101) may be physically connected to an external electronic device (e.g., the electronic device (1102)). In one embodiment, the connection terminal (1178) may include, for example, an HDMI connector, a USB connector, an SD card connector, or an audio connector (e.g., a headphone connector).

[0121] The haptic module (1179) can convert electrical signals into mechanical stimuli (e.g., vibration or movement) or electrical stimuli that a user can perceive through tactile or kinesthetic sensations. In one embodiment, the haptic module (1179) may include, for example, a motor, a piezoelectric element, or an electrical stimulation device.

[0122] The camera module (1180) can capture still images and videos. In one embodiment, the camera module (1180) may include one or more lenses, image sensors, image signal processors, or flashes.

[0123] The power management module (1188) can manage the power supplied to the electronic device (1101). According to one embodiment, the power management module (1188) can be implemented as, for example, at least a part of a power management integrated circuit (PMIC).

[0124] A battery (1189) may power at least one component of the electronic device (1101). In one embodiment, the battery (1189) may include, for example, a non-rechargeable primary battery, a rechargeable secondary battery, or a fuel cell.

[0125] The communication module (1190) may support the establishment of a direct (e.g., wired) communication channel or a wireless communication channel between the electronic device (1101) and an external electronic device (e.g., electronic device (1102), electronic device (1104), or server (1108)), and the performance of communication through the established communication channel. The communication module (1190) may operate independently from the processor (1120) (e.g., application processor) and may include one or more communication processors that support direct (e.g., wired) communication or wireless communication. According to one embodiment, the communication module (1190) may include a wireless communication module (1192) (e.g., a cellular communication module, a short-range wireless communication module, or a global navigation satellite system (GNSS) communication module) or a wired communication module (1194) (e.g., a local area network (LAN) communication module, or a power line communication module). Among these communication modules, a corresponding communication module can communicate with an external electronic device (1104) via a first network (1198) (e.g., a short-range communication network such as Bluetooth, wireless fidelity (WiFi) direct, or infrared data association (IrDA)) or a second network (1199) (e.g., a long-range communication network such as a legacy cellular network, a 5G network, a next-generation communication network, the Internet, or a computer network (e.g., a LAN or WAN)). These various types of communication modules can be integrated into a single component (e.g., a single chip) or implemented as multiple separate components (e.g., multiple chips). The wireless communication module (1192) can verify or authenticate the electronic device (1101) within a communication network such as the first network (1198) or the second network (1199) by using subscriber information (e.g., an international mobile subscriber identity (IMSI)) stored in the subscriber identification module (1196).

[0126] The wireless communication module (1192) can support 5G networks and next-generation communication technologies following the 4G network, such as NR access technology (new radio access technology). The NR access technology can support high-speed transmission of high-capacity data (eMBB (enhanced mobile broadband)), minimization of terminal power and connection of multiple terminals (mMTC (massive machine type communications)), or high reliability and low latency (URLLC (ultra-reliable and low-latency communications)). The wireless communication module (1192) can support, for example, a high-frequency band (e.g., mmWave band) to achieve a high data transmission rate. The wireless communication module (1192) may support various technologies for securing performance in a high-frequency band, such as beamforming, massive multiple-input and multiple-output (MIMO), full dimensional MIMO (FD-MIMO), array antenna, analog beam-forming, or large scale antenna. The wireless communication module (1192) may support various requirements specified in the electronic device (1101), an external electronic device (e.g., the electronic device (1104)), or a network system (e.g., the second network (1199)). According to one embodiment, the wireless communication module (1192) may support a peak data rate (e.g., 20 Gbps or more) for eMBB implementation, a loss coverage (e.g., 164 dB or less) for mMTC implementation, or a U-plane latency (e.g., 0.5 ms or less for downlink (DL) and uplink (UL), or 1 ms or less for round trip) for URLLC implementation.

[0127] The antenna module (1197) can transmit or receive signals or power to or from an external device (e.g., an external electronic device). In one embodiment, the antenna module (1197) may include an antenna including a radiator formed of a conductor or a conductive pattern formed on a substrate (e.g., a PCB). In one embodiment, the antenna module (1197) may include a plurality of antennas (e.g., an array antenna). In this case, at least one antenna suitable for a communication method used in a communication network, such as the first network (1198) or the second network (1199), may be selected from the plurality of antennas by, for example, the communication module (1190). A signal or power may be transmitted or received between the communication module (1190) and an external electronic device via the selected at least one antenna. In some embodiments, in addition to the radiator, another component (e.g., a radio frequency integrated circuit (RFIC)) may be additionally formed as a part of the antenna module (1197).

[0128] According to various embodiments, the antenna module (1197) may form a mmWave antenna module. In one embodiment, the mmWave antenna module may include a printed circuit board, an RFIC disposed on or adjacent a first side (e.g., a bottom side) of the printed circuit board and capable of supporting a designated high frequency band (e.g., a mmWave band), and a plurality of antennas (e.g., an array antenna) disposed on or adjacent a second side (e.g., a top side or a side side) of the printed circuit board and capable of transmitting or receiving signals in the designated high frequency band.

[0129] At least some of the above components can be interconnected and exchange signals (e.g., commands or data) with each other via a communication method between peripheral devices (e.g., a bus, GPIO (general purpose input and output), SPI (serial peripheral interface), or MIPI (mobile industry processor interface)).

[0130] According to one embodiment, commands or data may be transmitted or received between the electronic device (1101) and an external electronic device (1104) via a server (1108) connected to a second network (1199). Each of the external electronic devices (1102 or 1104) may be the same or a different type of device as the electronic device (1101). According to one embodiment, all or part of the operations executed in the electronic device (1101) may be executed in one or more of the external electronic devices (1102, 1104, or 1108). For example, when the electronic device (1101) is to perform a certain function or service automatically or in response to a request from a user or another device, the electronic device (1101) may, instead of or in addition to executing the function or service itself, request one or more external electronic devices to perform the function or at least a part of the service. One or more external electronic devices that receive the request may execute at least a portion of the requested function or service, or an additional function or service related to the request, and transmit the result of the execution to the electronic device (1101). The electronic device (1101) may process the result as is or additionally and provide it as at least a portion of a response to the request. For this purpose, cloud computing, distributed computing, mobile edge computing (MEC), or client-server computing technology may be used, for example. The electronic device (1101) may provide an ultra-low latency service by using distributed computing or mobile edge computing, for example. In another embodiment, the external electronic device (1104) may include an Internet of Things (IoT) device. The server (1108) may be an intelligent server utilizing machine learning and / or a neural network.According to one embodiment, an external electronic device (1104) or server (1108) may be included within the second network (1199). The electronic device (1101) may be applied to intelligent services (e.g., smart homes, smart cities, smart cars, or healthcare) based on 5G communication technology and IoT-related technology.

[0131] According to one embodiment, an electronic device includes a memory and a processor, wherein the processor is configured to identify input data that can be arranged into a plurality of lines stored in the memory, encode first partial data corresponding to a first number of first lines of the input data by an encoder to generate a first feature vector, encode second partial data corresponding to the first number of second lines of the input data that at least partially overlap with the first lines by the encoder to generate a second feature vector, and train the encoder such that a result of decoding the first feature vector and the second feature vector by a decoder corresponding to the encoder corresponds to the input data.

[0132] According to one embodiment, the input data may include text data corresponding to program code.

[0133] In one embodiment, the encoder may include an auto encoder.

[0134] In one embodiment, the processor may train the encoder by adding an objective function to train the encoder so that the first portion of the first feature vector and the second portion of the second feature vector have the same or similar values.

[0135] According to one embodiment, the processor can learn a function for encoding and the objective function simultaneously, and can learn by adjusting the weight of the function for encoding and the weight of the objective function.

[0136] According to one embodiment, an electronic device includes a memory and a processor, wherein the processor is configured to identify security data that can be arranged into a plurality of lines, encode the security data by a learned encoder to generate a feature vector, perform a locality sensitive hash (LSH) operation on a first feature vector corresponding to a first portion of a first length among the feature vectors based on a plurality of first set values ​​to generate a plurality of first hash values, perform the LSH operation on a second feature vector corresponding to a second portion of the first length among the feature vectors, the second portion of the first length being at least partially overlapped with the first portion among the feature vectors, to generate a plurality of second hash values, and store the plurality of first hash values ​​and the plurality of second hash values ​​in the memory.

[0137] According to one embodiment, the security data may include text data corresponding to program code.

[0138] According to one embodiment, the LSH operation may be set by the following <mathematical formula>.

[0139]

[0140] In the above <mathematical formula>, q is a feature vector, x indicates in which direction the feature vector is projected, and b and w can indicate values ​​that set the sensitivity to locality.

[0141] According to one embodiment, the plurality of first setting values ​​may be set as a first set including a plurality of different setting values, and the plurality of second setting values ​​may be set as a second set including a plurality of different setting values.

[0142] According to one embodiment, the plurality of setting values ​​included in the first set may correspond to the plurality of setting values ​​included in the second set.

[0143] In one embodiment, an electronic device includes a memory and a processor, wherein the processor is configured to identify input data that can be arranged into a plurality of lines, encode the input data by a learned encoder to generate a feature vector, perform a locality sensitive hash (LSH) operation on a first feature vector corresponding to a first portion of a first length among the feature vectors based on a plurality of first set values ​​to generate a plurality of first hash values, and perform the LSH operation on a second feature vector corresponding to a second portion of the first length among the feature vectors, the second portion being at least partially overlapped with the first portion among the feature vectors, to generate a plurality of second hash values, and compare the plurality of first hash values ​​and the plurality of second hash values ​​with a plurality of hash values ​​corresponding to secure data stored in the memory to determine whether the input data includes secure data.

[0144] According to one embodiment, the input data may include text data corresponding to program code.

[0145] According to one embodiment, the LSH operation may be set by the following <mathematical formula>.

[0146]

[0147] In the above <mathematical formula>, q is a feature vector, x indicates in which direction the feature vector is projected, and b and w can indicate values ​​that set the sensitivity to locality.

[0148] According to one embodiment, the plurality of first setting values ​​may be set as a first set including a plurality of different setting values, and the plurality of second setting values ​​may be set as a second set including a plurality of different setting values.

[0149] According to one embodiment, the plurality of setting values ​​included in the first set may correspond to the plurality of setting values ​​included in the second set.

[0150] According to one embodiment, the processor may be configured to compare the size of the input data with an input size set for the encoder, and, if the size of the input data is smaller than the input size set for the encoder as a result of the comparison, expand the size of the input data to a size corresponding to the input size.

[0151] In one embodiment, a method for filtering secure data may include: identifying input data that can be arranged into a plurality of lines; encoding the input data by a learned encoder to generate a feature vector; generating a plurality of first hash values ​​by performing a locality sensitive hash (LSH) operation on a first feature vector corresponding to a first portion of a first length among the feature vectors based on a plurality of first set values; generating a plurality of second hash values ​​by performing the LSH operation on a second feature vector corresponding to a second portion of the first length among the feature vectors, the second portion of the feature vectors at least partially overlapping with the first portion, based on a plurality of second set values; and comparing the plurality of first hash values ​​and the plurality of second hash values ​​with a plurality of hash values ​​corresponding to secure data to determine whether the input data includes secure data.

[0152] According to one embodiment, the input data may include text data corresponding to program code.

[0153] According to one embodiment, the LSH operation may be set by the following <mathematical formula>.

[0154]

[0155] In the above <mathematical formula>, q is a feature vector, x indicates in which direction the feature vector is projected, and b and w can indicate values ​​that set the sensitivity to locality.

[0156] According to one embodiment, the plurality of first setting values ​​may be set as a first set including a plurality of different setting values, and the plurality of second setting values ​​may be set as a second set including a plurality of different setting values.

[0157] Electronic devices according to the various embodiments disclosed in this document may take various forms. Electronic devices may include, for example, portable communication devices (e.g., smartphones), computer devices, portable multimedia devices, portable medical devices, cameras, wearable devices, or home appliances. Electronic devices according to the embodiments of this document are not limited to the aforementioned devices.

[0158] The various embodiments of this document and the terminology used therein are not intended to limit the technical features described in this document to specific embodiments, but should be understood to include various modifications, equivalents, or substitutes of the embodiments. In connection with the description of the drawings, similar reference numerals may be used for similar or related components. The singular form of a noun corresponding to an item may include one or more of the items, unless the context clearly indicates otherwise. In this document, each of the phrases "A or B", "at least one of A and B", "at least one of A or B", "A, B, or C", "at least one of A, B, and C", and "at least one of A, B, or C" can include any one of the items listed together in the corresponding phrase among those phrases, or all possible combinations thereof. Terms such as "first," "second," or "first" or "second" may be used merely to distinguish one component from another, and do not limit the components in any other respect (e.g., importance or order). When a component (e.g., a first component) is referred to as "coupled" or "connected" to another (e.g., a second component), with or without the terms "functionally" or "communicatively," it means that the component can be connected to the other component directly (e.g., wired), wirelessly, or through a third component.

[0159] The term "module" used in various embodiments of this document may include a unit implemented in hardware, software, or firmware, and may be used interchangeably with terms such as logic, logic block, component, or circuit. A module may be an integral component, or a minimum unit or part of such a component that performs one or more functions. For example, according to one embodiment, a module may be implemented in the form of an application-specific integrated circuit (ASIC).

[0160] Various embodiments of the present document may be implemented as software (e.g., a program (1140)) including one or more instructions stored in a storage medium (e.g., an internal memory (1136) or an external memory (1138)) readable by a machine (e.g., an electronic device (1101)). For example, a processor (e.g., a processor (1120)) of the machine (e.g., an electronic device (1101)) may call at least one instruction among the one or more instructions stored from the storage medium and execute it. This enables the machine to operate to perform at least one function according to the at least one called instruction. The one or more instructions may include code generated by a compiler or code executable by an interpreter. The machine-readable storage medium may be provided in the form of a non-transitory storage medium. Here, 'non-transitory' simply means that the storage medium is a tangible device and does not contain signals (e.g., electromagnetic waves), and the term does not distinguish between cases where data is stored semi-permanently or temporarily on the storage medium.

[0161] According to one embodiment, the method according to various embodiments disclosed in this document may be provided as included in a computer program product. The computer program product may be traded as a product between a seller and a buyer. The computer program product may be distributed in the form of a machine-readable storage medium (e.g., compact disc read-only memory (CD-ROM)), or may be distributed online (e.g., downloaded or uploaded) through an application store (e.g., Play Store™) or directly between two user devices (e.g., smart phones). In the case of online distribution, at least a portion of the computer program product may be temporarily stored or temporarily generated in a machine-readable storage medium, such as the memory of a manufacturer's server, an application store's server, or an intermediary server.

[0162] According to various embodiments, each component (e.g., a module or a program) of the above-described components may include one or more entities, and some of the entities may be separated and placed in other components. According to various embodiments, one or more components or operations of the aforementioned components may be omitted, or one or more other components or operations may be added. Alternatively or additionally, a plurality of components (e.g., a module or a program) may be integrated into a single component. In such a case, the integrated component may perform one or more functions of each of the plurality of components identically or similarly to those performed by the corresponding component among the plurality of components prior to the integration. According to various embodiments, the operations performed by a module, program, or other component may be executed sequentially, in parallel, iteratively, or heuristically, or one or more of the operations may be executed in a different order, omitted, or one or more other operations may be added.

Claims

1. In electronic devices, memory; and comprising a processor, said processor comprising: Check the input data that can be arranged into multiple lines stored in the above memory, Encode first partial data corresponding to the first number of first lines among the above input data by an encoder to generate a first feature vector, Encode second partial data corresponding to the first number of second lines that at least partially overlap with the first lines among the input data by the encoder to generate a second feature vector, An electronic device configured to train the encoder so that the result of decoding the first characteristic vector and the second characteristic vector by a decoder corresponding to the encoder corresponds to the input data.

2. In paragraph 1, The above processor, An electronic device that trains the encoder by adding an objective function to train the encoder so that the first part of the first feature vector and the second part of the second feature vector have the same or similar values.

3. In paragraph 2, The above processor, An electronic device that simultaneously learns a function for encoding and the objective function, and learns by adjusting the weight of the function for encoding and the weight of the objective function.

4. In electronic devices, memory; and comprising a processor, said processor comprising: Check the security data that can be arranged in multiple lines, Encode the above security data by a learned encoder to generate a feature vector, Based on a plurality of first setting values, a first feature vector corresponding to a first portion of a first length among the feature vectors is subjected to a locality sensitive hash (LSH) operation to generate a plurality of first hash values, Based on a plurality of second setting values, a second feature vector corresponding to a second portion of the first length that overlaps at least a portion of the first portion of the feature vector is subjected to the LSH operation to generate a plurality of second hash values, An electronic device configured to store the plurality of first hash values ​​and the plurality of second hash values ​​in the memory.

5. In paragraph 4, An electronic device, wherein the above security data includes text data corresponding to program code.

6. In paragraph 4, The above LSH operation is an electronic device set by the following <mathematical formula>. In the above <mathematical formula>, q is a feature vector, x indicates in which direction the feature vector is projected, and b and w indicate values ​​that set the sensitivity to locality.

7. In paragraph 4, An electronic device wherein the plurality of first setting values ​​are set as a first set including a plurality of different setting values, and the plurality of second setting values ​​are set as a second set including a plurality of different setting values.

8. In paragraph 7, An electronic device wherein a plurality of setting values ​​included in the first set correspond to a plurality of setting values ​​included in the second set.

9. In electronic devices, memory; and comprising a processor, said processor comprising: Check the input data that can be arranged into multiple lines, Encode the input data using a learned encoder to generate a feature vector, Based on a plurality of first setting values, a first feature vector corresponding to a first portion of a first length among the feature vectors is subjected to a locality sensitive hash (LSH) operation to generate a plurality of first hash values, Based on a plurality of second setting values, a second feature vector corresponding to a second portion of the first length that overlaps at least a portion of the first portion of the feature vector is subjected to the LSH operation to generate a plurality of second hash values, An electronic device configured to compare the plurality of first hash values ​​and the plurality of second hash values ​​with the plurality of hash values ​​corresponding to the secure data stored in the memory to determine whether the input data includes secure data.

10. In paragraph 9, An electronic device, wherein the above input data includes text data corresponding to program code.

11. In paragraph 9, The above LSH operation is an electronic device set by the following <mathematical formula>. In the above <mathematical formula>, q is a feature vector, x indicates in which direction the feature vector is projected, and b and w indicate values ​​that set the sensitivity to locality.

12. In paragraph 11, An electronic device wherein the plurality of first setting values ​​are set as a first set including a plurality of different setting values, and the plurality of second setting values ​​are set as a second set including a plurality of different setting values.

13. In paragraph 12, An electronic device wherein a plurality of setting values ​​included in the first set correspond to a plurality of setting values ​​included in the second set.

14. In paragraph 9, The above processor, Compare the size of the above input data with the input size set in the encoder, An electronic device configured to expand the size of the input data to a size corresponding to the input size when the size of the input data is smaller than the input size set in the encoder as a result of the above comparison.

15. In the method of filtering security data, An action to check input data that can be arranged into multiple lines; An operation of encoding the input data by a learned encoder to generate a feature vector; An operation of generating a plurality of first hash values ​​by performing a locality sensitive hash (LSH) operation on a first feature vector corresponding to a first portion of a first length among the feature vectors based on a plurality of first setting values; An operation of generating a plurality of second hash values ​​by performing an LSH operation on a second feature vector corresponding to a second portion of the first length that overlaps at least a portion of the first portion of the feature vector based on a plurality of second setting values; and A method for filtering secure data, comprising an operation of comparing the plurality of first hash values ​​and the plurality of second hash values ​​with a plurality of hash values ​​corresponding to secure data to determine whether the input data includes secure data.

Citation Information

Patent Citations

  • Code generation methods, devices, electronic devices, and readable storage media

    CN113504906B

  • A code generation method and terminal

    CN116700684B

  • Security of code between code generator and compiler

    US11431727B2