WO2023200114A1 - 오픈 소스 라이선스를 검증하는 전자 장치 및 방법 - Google Patents

오픈 소스 라이선스를 검증하는 전자 장치 및 방법 Download PDF

Info

Publication number
WO2023200114A1
WO2023200114A1 PCT/KR2023/002942 KR2023002942W WO2023200114A1 WO 2023200114 A1 WO2023200114 A1 WO 2023200114A1 KR 2023002942 W KR2023002942 W KR 2023002942W WO 2023200114 A1 WO2023200114 A1 WO 2023200114A1
Authority
WO
WIPO (PCT)
Prior art keywords
embedding vector
artificial intelligence
open source
intelligence model
source code
Prior art date
Application number
PCT/KR2023/002942
Other languages
English (en)
French (fr)
Inventor
이정배
Original Assignee
삼성전자주식회사
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 삼성전자주식회사 filed Critical 삼성전자주식회사
Publication of WO2023200114A1 publication Critical patent/WO2023200114A1/ko

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/10Protecting distributed programs or content, e.g. vending or licensing of copyrighted material ; Digital rights management [DRM]
    • G06F21/105Arrangements for software license management or administration, e.g. for managing licenses at corporate level
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/10Protecting distributed programs or content, e.g. vending or licensing of copyrighted material ; Digital rights management [DRM]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/30Authentication, i.e. establishing the identity or authorisation of security principals
    • G06F21/44Program or device authentication
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/90Determination of colour characteristics
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2221/00Indexing scheme relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F2221/03Indexing scheme relating to G06F21/50, monitoring users, programs or devices to maintain the integrity of platforms
    • G06F2221/034Test or assess a computer or a system

Definitions

  • This disclosure relates to an electronic device and method for verifying an open source license, and more specifically, to an electronic device and method for verifying an open source license using a deep learning-based artificial intelligence model.
  • license verification verifies the license for each file based on the software source code.
  • the program developer verifies the license by matching each source code file with the Knowledge Base, which is an existing component pool.
  • This conventional method searches for similar open source codes through text matches centered on keywords of the code to be verified, and provides the search results in the form of a list.
  • the verifier qualitatively reviews the search results in the form of a list and ultimately decides whether the code subject to verification matches the open source code.
  • the conventional method requires manual verification by a verifier due to the low accuracy of search results for open source code that matches the code to be verified. Additionally, when a verifier performs a qualitative review, there is a possibility of verification failure due to human error.
  • This disclosure is intended to solve the above-mentioned problems, and the purpose of this disclosure is to increase the reliability of open source license verification and reduce verification time and cost by using a deep learning artificial intelligence model.
  • An open source license verification method includes the steps of dividing the source code of the software to be verified according to a preset standard, converting each part of the divided source code into an embedding vector in the form of a sequence, Loading each of the converted sequence-type embedding vectors to generate a 2D-shaped embedding vector and inputting it into a learned artificial intelligence model, and using the learned artificial intelligence model to It includes the step of outputting information.
  • An electronic device includes an input interface, a memory, and a processor, wherein the processor receives the source code of the software to be verified through the input interface, and matches the source code of the software to be verified according to a preset standard. Divide according to, convert each part of the divided source code into an embedding vector in the form of a sequence, load each embedding vector in the converted sequence form to generate a 2D embedding vector, and apply it to the learned artificial intelligence model. input, and output information related to open source corresponding to the source code using the learned artificial intelligence model.
  • FIG. 1 is a block diagram of an electronic device according to an embodiment of the present disclosure.
  • FIG. 2 is a detailed block diagram of an electronic device according to an embodiment of the present disclosure.
  • Figure 3 is a block diagram of a processor according to an embodiment of the present disclosure.
  • 4A to 4D are diagrams illustrating a process of converting an embedding vector according to an embodiment of the present disclosure.
  • 5A to 5B are diagrams illustrating a process of converting an image into a 2D image according to an embodiment of the present disclosure.
  • FIG. 6 is a diagram illustrating operations related to an open source license verification process according to an embodiment of the present disclosure.
  • Figure 7 is a flowchart illustrating an open source license verification method according to an embodiment of the present disclosure.
  • a “module” or “unit” for a component used in this specification performs at least one function or operation. And, the “module” or “unit” may perform a function or operation by hardware, software, or a combination of hardware and software. Additionally, a plurality of “modules” or a plurality of “units” excluding a “module” or “unit” that must be performed on specific hardware or performed on at least one processor may be integrated into at least one module. Singular expressions include plural expressions unless the context clearly dictates otherwise.
  • each step should be understood as non-limiting unless the preceding step must be performed logically and temporally prior to the subsequent step. In other words, except for the above exceptional cases, even if the process described as a subsequent step is performed before the process described as a preceding step, the nature of disclosure is not affected, and the scope of rights must also be defined regardless of the order of the steps.
  • the term “A or B” is defined not only to selectively indicate either A or B, but also to include both A and B.
  • the term "included” in this specification has the meaning of including additional components in addition to the elements listed as included.
  • each embodiment may be implemented or operated independently, but each embodiment may be implemented or operated in combination.
  • FIG. 1 is a block diagram of an electronic device according to an embodiment of the present disclosure.
  • the electronic device 100 includes an input interface 110, a memory 120, and a processor 130.
  • the input interface 110 can receive control commands from the user or various data including source code.
  • the input interface 110 may receive input source code of software to be verified.
  • the input interface 110 can receive open source source code.
  • Open source refers to software whose code is open and available for anyone to use. However, there are open sources that can be used freely according to regulations, and there are also open sources that must fulfill certain restrictions or requirements.
  • a license refers to regulations such as certain restrictions or requirements that must be fulfilled.
  • this disclosure describes embodiments related to verification of open source licenses, it can also be applied to various types of program sources that can collect various data and conditions.
  • the electronic device 100 may learn an artificial intelligence model for verifying an open source license. Additionally, the electronic device 100 may perform open source license verification on software to be verified using the learned artificial intelligence model. A detailed description of the artificial intelligence model for open source license verification is described later.
  • the input interface 110 may receive open source source code as learning data.
  • the input interface 110 may receive the source code of the software to be verified.
  • the input interface 110 may be implemented as a keypad, keyboard, touchpad, touch screen, etc.
  • the input interface 110 may be implemented as an input/output port.
  • the input/output port may be USB (Universal Serial Bus), PS/2 (Personal System/2), HDMI (High-Definition Multimedia Interface), DP (DisplayPort), RGB, DVI. It may include ports such as (Digital Visual Interface), Thunderbolt, LAN, and AUX.
  • the input interface 110 may also be called an input device, input unit, input module, etc. When the input interface 110 performs an input/output function, it may be called an input/output device, input/output unit, input/output module, etc.
  • the memory 120 stores data and algorithms that perform the functions of the electronic device 100, and can store programs and commands that run in the electronic device 100.
  • the memory 120 includes the source code of the input open source, the source code of the input verification target software, the artificial intelligence model for license verification, the data generated during the learning process of the artificial intelligence model, and the license verification process. You can save data, etc.
  • the algorithm or artificial intelligence model stored in the memory 120 may be loaded into the processor 130 under the control of the processor 130 to perform a learning process or a license verification process of the artificial intelligence model.
  • the memory 190 may be implemented in the form of ROM, RAM, HDD, SSD, memory card, etc.
  • the processor 130 can control each component of the electronic device 100.
  • the processor 130 controls the input interface 110 to receive data, controls the memory 120 to store the input data, and stores the algorithm, artificial intelligence model, or data stored in the memory 120.
  • the memory 120 can be controlled to load into the processor 130.
  • the processor 130 may perform the following operations to learn an artificial intelligence model.
  • the processor 130 may load the artificial intelligence model stored in the memory 120 into the processor 130 .
  • the processor 130 may divide the input open source source code according to preset standards.
  • the preset standard may be set as a function, a preset character, or a preset word. That is, the processor 130 may divide the open source source code based on a function included in the open source source code, a preset character included in the function, or a preset word included in the function.
  • the processor 130 may convert each portion of the divided source code into an embedding vector in the form of a sequence.
  • the embedding vector may be set to a preset length. Additionally, if the length of the converted embedding vector is shorter than the preset length, the processor 130 may add a dummy value and convert it into an embedding vector of the preset length.
  • the processor 130 may load each of the converted sequence-type embedding vectors to generate a 2D-type embedding vector.
  • a 2D embedding vector may include a preset number of rows. Additionally, if the number of converted embedding vectors is less than the preset number of rows, the processor 130 may load the remaining rows as dummy rows to generate a 2D embedding vector.
  • the processor 130 may input a 2D embedding vector into an artificial intelligence model to learn an artificial intelligence model for license verification. For example, the processor 130 may train an artificial intelligence model to output license information corresponding to open source.
  • the embedding vector input to the artificial intelligence model may be data related to open source source code.
  • the artificial intelligence model can be trained to output license information corresponding to open source. Accordingly, the artificial intelligence model can be trained to output license information corresponding to the open source source code related to the input embedding vector.
  • input data for an artificial intelligence model may be image data.
  • the processor 130 can convert the generated 2D embedding vector into a 2D image. For example, the processor 130 may identify a color code corresponding to each value included in the 2D embedding vector. Additionally, the processor 130 may assign a color corresponding to the identified color code to an area corresponding to each value included in the 2D embedding vector. The processor 130 can convert an embedding vector in 2D form into a 2D image through the above-described process. Additionally, the processor 130 may input the converted 2D image into an artificial intelligence model to learn the artificial intelligence model for license verification.
  • the electronic device 100 may verify an open source license for software created using a learned artificial intelligence model.
  • the input interface 110 may receive input source code of software to be verified.
  • the processor 130 may input the source code of the input verification target software into the learned artificial intelligence model.
  • the processor 130 may divide the source code of the software to be verified according to preset standards, similar to the learning process.
  • the processor 130 may convert each portion of the segmented source code to be verified into a sequence-type embedding vector and load each embedding vector to generate a 2D-type embedding vector.
  • the learned artificial intelligence model can provide information related to open source corresponding to the input source code to be verified.
  • the electronic device may include an output interface. And, the electronic device can output information related to open source through an output interface.
  • the output interface may be implemented in the form of a display, communication interface, input/output port, etc.
  • information related to open source may include information related to open source license information and source code of the software to be verified that corresponds to the open source source code.
  • the electronic device 100 uses the learned artificial intelligence model to determine which open source license information the software to be verified corresponds to and which part of the source code of the software to be verified corresponds to the source code of the open source. Information about can be output.
  • the processor 130 can convert the embedding vector of the software to be verified into an image. That is, the processor 130 can identify the color code corresponding to each value included in the 2D embedding vector. Additionally, the processor 130 can convert the 2D embedding vector into a 2D image by allocating the color corresponding to the identified color code to an area corresponding to each value included in the 2D embedding vector. The processor 130 inputs the converted 2D image into a learned artificial intelligence model, and the learned artificial intelligence model may output information related to open source for the software to be verified.
  • the processor 130 may be comprised of one or multiple processors.
  • one or more processors 130 may be a general-purpose processor such as a CPU, AP, or DSP (Digital Signal Processor), a graphics-specific processor such as a GPU or a VPU (Vision Processing Unit), or an artificial intelligence-specific processor such as an NPU.
  • One or more processors 130 control input data to be processed according to predefined operation rules or artificial intelligence models stored in the memory 120.
  • the artificial intelligence dedicated processors may be designed with a hardware structure specialized for processing a specific artificial intelligence model.
  • Predefined operation rules or artificial intelligence models are characterized by being created through learning.
  • created through learning means that a basic artificial intelligence model is learned using a large number of learning data by a learning algorithm, thereby creating a predefined operation rule or artificial intelligence model set to perform the desired characteristics (or purpose). It means burden.
  • This learning may be accomplished in the device itself that performs artificial intelligence according to the present disclosure, or may be accomplished through a separate server and/or system. Examples of learning algorithms include supervised learning, unsupervised learning, semi-supervised learning, or reinforcement learning, but are not limited to the examples described above.
  • An artificial intelligence model may be composed of multiple neural network layers.
  • Each of the plurality of neural network layers has a plurality of weight values, and neural network calculation is performed through calculation between the calculation result of the previous layer and the plurality of weights.
  • Multiple weights of multiple neural network layers can be optimized by the learning results of the artificial intelligence model. For example, a plurality of weights may be updated so that loss or cost values obtained from the artificial intelligence model are reduced or minimized during the learning process.
  • Artificial neural networks may include deep neural networks (DNN), for example, Convolutional Neural Network (CNN), Deep Neural Network (DNN), Graph Neural Network (GNN), Recurrent Neural Network (RNN), U-net, Long Short-Term Memory (LSTM), Multi-Layer Perceptron (MLP), Restricted Boltzmann Machine (RBM), Deep Belief Network (DBN), Bidirectional Recurrent Deep Neural Network (BRDNN), or Deep Q-Network.
  • DNN deep neural networks
  • CNN Convolutional Neural Network
  • DNN Deep Neural Network
  • NNN Graph Neural Network
  • RNN Recurrent Neural Network
  • U-net Long Short-Term Memory
  • MLP Multi-Layer Perceptron
  • RBM Restricted Boltzmann Machine
  • DBN Deep Belief Network
  • BDN Bidirectional Recurrent Deep Neural Network
  • Deep Q-Network Deep Q-Network.
  • Q-Networks Deep Q-Networks
  • FIG. 2 is a detailed block diagram of an electronic device according to an embodiment of the present disclosure.
  • the electronic device 100 includes an input interface 110, a memory 120, a processor 130, a communication interface 140, a camera 150, a microphone 160, a display 170, and a speaker. (180) and may include a sensor (190). Since the input interface 110 and memory 120 are the same as those described in FIG. 1, detailed descriptions are omitted.
  • the communication interface 140 can communicate with an external device.
  • the communication interface 140 may use at least one of the following communication methods: Wi-Fi, Wi-Fi Direct, Bluetooth, Zigbee, 3G (3rd Generation), 3GPP (3rd Generation Partnership Project), and LTE (Long Term Evolution).
  • Wi-Fi Wireless Fidelity
  • Wi-Fi Direct Wireless Fidelity
  • Bluetooth Wireless Fidelity
  • Zigbee 3G (3rd Generation)
  • 3GPP 3rd Generation Partnership Project
  • LTE Long Term Evolution
  • You can communicate with external devices using this communication method.
  • 1 illustrates an embodiment in which the electronic device 100 receives various data including source code through the input interface 110, but the electronic device 100 receives the source code from an external device through the communication interface 140. You may also receive various data including codes. Additionally, the electronic device 100 may verify software to be verified using a learned artificial intelligence model and transmit the verification result to an external device through the communication interface 140.
  • the above-described communication interface 140 may be referred to as a communication device
  • the camera 150 may capture the surrounding environment of the electronic device 100 and create an image.
  • an image may contain an object.
  • images may include still images and videos.
  • the camera 150 may include a CCD sensor or a CMOS sensor.
  • the camera 150 may include an RGB camera, a depth camera, a wide-angle camera, a telephoto camera, etc.
  • the microphone 160 receives external sound.
  • one microphone may be placed in the electronic device 100, or a plurality of microphones may be placed in the electronic device 100.
  • the microphone 160 may include a general microphone, a surround microphone, a directional microphone, etc.
  • the display 170 may output data processed by the processor 130 as an image. During the artificial intelligence model learning process, the display 170 may output license information corresponding to the input open source source code. In addition, during the open source license verification process, the display 170 may output information related to the open source corresponding to the source code of the input verification target software. For example, information related to open source may include open source license information, information related to the source code of the software to be verified that corresponds to the open source source code, etc.
  • the display 170 may be implemented as a liquid crystal display (LCD), organic light emitting diode (OLED), flexible display, touch screen, etc. When the display 170 is implemented as a touch screen, the electronic device 100 can receive control commands through the touch screen.
  • LCD liquid crystal display
  • OLED organic light emitting diode
  • the speaker 180 outputs a voice signal on which voice processing has been performed.
  • a plurality of speakers 180 may be placed in the electronic device 100, and the processor 130 may output three-dimensional sound by allocating the sound of each channel based on the position of the placed speakers 180. You can. Additionally, the speaker 180 may output information about the user's input command, information about the status of the electronic device 100, or information about the operation, etc. as a voice or notification sound.
  • the sensor 190 can detect objects around the electronic device 100.
  • the processor 130 may recognize a control command based on the sensed signal and perform a control operation corresponding to the recognized control command. Additionally, the sensor 190 can detect information about the surrounding environment of the electronic device 100.
  • the processor 130 may perform a corresponding control operation based on the surrounding environment information detected by the sensor 190.
  • the sensor 190 may include an acceleration sensor, a gravity sensor, a gyro sensor, a geomagnetic sensor, a direction sensor, a motion recognition sensor, a proximity sensor, a voltmeter, an ammeter, a barometer, a hygrometer, a thermometer, an illumination sensor, a heat sensor, and a touch sensor. , infrared sensors, ultrasonic sensors, etc.
  • the electronic device 100 may include all of the above-described configurations, or may include some of the configurations. Additionally, the electronic device 100 may further include other components that perform various functions in addition to the components described above.
  • one electronic device 100 performs both learning and verification of an artificial intelligence model.
  • learning of the artificial intelligence model can be performed in an external electronic device
  • open source license verification using the learned artificial intelligence model can be performed in the terminal device.
  • external electronic devices may include servers, clouds, host devices, etc.
  • terminal devices may include smartphones, tablet PCs, navigation systems, slate PCs, wearable devices, digital TVs, desktop computers, laptop computers, kiosks, etc. That is, the external electronic device stores the artificial intelligence model to be learned and can receive data including open source source code, etc. through an input interface or communication interface.
  • An external electronic device can learn an artificial intelligence model for open source license verification through the above-described process.
  • An external electronic device can provide a learned artificial intelligence model to the terminal device.
  • a terminal device may be provided with a learned artificial intelligence model through an input interface or communication interface.
  • the terminal device stores the learned artificial intelligence model and can receive the source code of the software to be verified through an input interface or communication interface.
  • the terminal device may provide information related to open source corresponding to the source code of the software to be verified using the learned artificial intelligence model.
  • the terminal device may output information related to open source corresponding to the source code of the software to be verified through an output interface.
  • the output interface may include a display, communication interface, input/output port, etc. Accordingly, the block diagram and description of the electronic device 100 shown in FIG. 2 may correspond to an external electronic device that performs learning of an artificial intelligence model or a terminal device that performs open source license verification.
  • FIG. 3 is a block diagram of a processor according to an embodiment of the present disclosure
  • FIGS. 4A to 4D are diagrams illustrating a process of converting into an embedding vector according to an embodiment of the present disclosure
  • FIGS. 5A to 5B are This is a diagram explaining the process of converting to a 2D image according to an embodiment of the disclosure. The description will be made with reference to FIGS. 3 to 5B.
  • the processor 130 may include a token generation unit 131, an embedding vector conversion unit 132, an image conversion unit 133, and a model learning unit 134.
  • Each configuration shown in FIG. 3 may be implemented in software and stored in the memory 120. Additionally, each configuration may be loaded into the processor 130 under the control of the processor 130 when learning an artificial intelligence model.
  • the electronic device 100 may collect data about open source code and license information. For example, the electronic device 100 may collect data about open source code and license information through the input interface 110 or the communication interface 140. The electronic device 100 may store data on collected open source code and license information in the memory 120.
  • the token generator 131 may convert open source source code into tokens according to preset standards.
  • processor 130 may identify the language type of open source source code. Additionally, the processor 130 may convert the token into a preset unit based on the identified language type.
  • the preset standard (or unit) may be a function included in the open source source code, a preset character included in the function, or a preset word included in the function.
  • a token may refer to each part of the open source source code divided according to preset standards.
  • the processor 130 may perform a normalization process to remove preset noise according to the identified language type. For example, meaningless words, repeated words, etc. may be set as noise, and the processor 130 may remove the noise according to set standards.
  • the token generator 131 can convert the open source source code 11 into a token 21 according to preset standards.
  • the token generator 131 may identify the start point and end point in the source code 11 and identify the order in which the program is performed.
  • the token generator 131 identifies that the open source source code 11 is performed in the order of prepare_handle_locker(), dynamic_load(), debug(), return function, or command. You can.
  • the token generator 131 may divide the source code 11 into ‘_’ (underbar) units. Accordingly, the token generator 131 may convert prepare(31), handle(32), and locker(33) into one token 21 (or divide them into respective parts) in prepare_handle_locker().
  • the embedding vector converter 132 can convert each divided source code portion (token) into an embedding vector in the form of a sequence.
  • An embedding vector refers to a form of natural language listed in numbers that a device can understand.
  • the embedding vector converter 132 can convert each segmented source code into an embedding vector using algorithms such as Neural Network Language Model (NNLM), Word2Vec, GloVe, FastText, Doc2Vec, and Bert.
  • the embedding vector can be set to a preset length. As an example, the embedding vector may be set to a length of 128 bytes. If the converted embedding vector is 120 bytes, the embedding vector converter 132 may add a dummy value to the remaining 8 bytes.
  • the embedding vector converter 132 can generate a 2D embedding vector by loading the converted sequence embedding vector.
  • a 2D embedding vector may include a preset number of rows. As an example, a 2D embedding vector may include 16 rows. If there are 14 embedding vectors in the loaded sequence form, the embedding vector converter 132 can load the remaining two rows as dummy rows.
  • the embedding vector conversion unit 132 converts each part of the source code 11 divided by the token generation unit 131 into an embedding vector 21 in the form of a sequence. It can be converted to . Additionally, the embedding vector converter 132 can load the embedding vector and generate a 2D embedding vector. Meanwhile, as shown in FIG. 4D, the embedding vector 21 can be set to a length of n bytes, and the 2D embedding vector can include m rows.
  • the embedding vector converter 132 may add dummy values 41-1, 41-2, and 41-3 to convert it into an embedding vector with a length of n bytes. . Additionally, if the number of converted embedding vectors is less than m, the embedding vector converter 132 may load the remaining rows as dummy rows to generate a 2D embedding vector including m rows.
  • FIGS. 4A to 4D The example shown in FIGS. 4A to 4D is an example, and the present disclosure is not limited to the example shown.
  • the model learning unit 134 can train an artificial intelligence model for license verification.
  • the model learning unit 134 can receive a 2D embedding vector and input it as input data to the artificial intelligence model.
  • the artificial intelligence model can be trained to output license information corresponding to the open source associated with the input embedding vector.
  • artificial intelligence models may include models based on CNN, GNN, RNN, U-net, LSTM, and MLP.
  • the input data of the artificial intelligence model may be an image.
  • the image conversion unit 133 may generate image data to be input into an artificial intelligence model. That is, the image conversion unit 133 can convert the 2D embedding vector generated by the embedding vector conversion unit 132 into a 2D image. For example, the image converter 133 may identify a color code corresponding to each value included in the 2D embedding vector. Additionally, the image conversion unit 133 may assign a color corresponding to the identified color code to an area corresponding to each value included in the 2D embedding vector. The image conversion unit 133 can convert a 2D embedding vector into a 2D image through the above-described process.
  • the model learning unit 134 can input a 2D image into an artificial intelligence model to learn the artificial intelligence model.
  • embedding vector 21 may contain a series of specific values. And, as shown in FIG. 5A, a color code is assigned to each color. As an example, the value of (1, 1) of the 2D embedding vector in FIG. 4D is 0xFF0000, and may correspond to red as a color code. Accordingly, the image conversion unit 133 can convert the area of the 2D image corresponding to (1, 1) of the 2D embedding vector into red. That is, the image conversion unit 133 can convert the 2D embedding vector into a 2D image by allocating the color corresponding to the color code to the area corresponding to each value included in the 2D embedding vector.
  • Figure 5b shows an example of a 2D image 51 converted through the above-described process.
  • FIG. 6 is a diagram illustrating operations related to an open source license verification process according to an embodiment of the present disclosure.
  • the process of inputting a 2D image 51 converted from the source code of the software to be verified into the learned artificial intelligence model 52 and outputting the result is shown.
  • the artificial intelligence model 52 may be a model based on CNN, U-net, etc.
  • the electronic device 100 can verify the open source license through a process similar to the above-described process. That is, during the artificial intelligence model learning process and license verification process, the electronic device 100 may preprocess the source code in the same manner and input the preprocessed data into the artificial intelligence model.
  • data preprocessed from open source source code with sufficient information may be input data to the artificial intelligence model.
  • the artificial intelligence model can be learned through a process of correcting errors (or errors) based on data corresponding to the input open source source code.
  • data preprocessed from the source code of the software being verified may be input data for a learned artificial intelligence model.
  • the electronic device 100 inputs input data corresponding to the source code of the software to be verified into the learned artificial intelligence model, and uses the learned artificial intelligence model to provide information related to the open source of the source code of the software to be verified. can be output.
  • the electronic device 100 may receive source code of software to be verified through the input interface 110 or the communication interface 140.
  • the electronic device 100 may store data about the source code of the provided software to be verified in the memory 120 .
  • the electronic device 100 may load each configuration described in FIG. 3 into the processor 130 under the control of the processor 130.
  • the token generator 131 may convert the source code of the software to be verified into a token according to preset standards.
  • the token generator 131 can convert tokens into preset units according to the language type and perform a normalization process to remove noise.
  • the embedding vector converter 132 can convert each divided source code portion (token) into an embedding vector in the form of a sequence. Additionally, the embedding vector converter 132 can generate a 2D embedding vector by loading the converted sequence embedding vector.
  • the image conversion unit 133 uses the 2D embedding vector generated in the embedding vector conversion unit 132. It can be converted to a 2D image.
  • the processor 130 may input a 2D embedding vector or 2D image into the artificial intelligence model 52.
  • the artificial intelligence model can output information 53 related to open source corresponding to the source code of the software to be verified.
  • the information 53 related to open source may include license information of the identified open source, information related to the source code of the software to be verified corresponding to the source code of the open source, etc. That is, the processor 130 can output open source license information, information on the code portion corresponding to the open source source code in the source code of the software to be verified, etc. through the output interface.
  • Figure 7 is a flowchart illustrating an open source license verification method according to an embodiment of the present disclosure.
  • the electronic device may divide the source code of the software to be verified according to a preset standard (S710).
  • the preset standard may be set based on a function, a preset character, or a preset word.
  • the electronic device may divide the source code of the software to be verified based on a function included in the source code of the software to be verified, a preset character included in the function, or a preset word included in the function.
  • the electronic device can convert each part of the divided source code into an embedding vector in the form of a sequence (S720).
  • the embedding vector may be set to a preset length. If the length of the converted embedding vector is shorter than the preset length, the electronic device may add a dummy value and convert it into an embedding vector of the preset length.
  • the electronic device can load each embedded vector in the converted sequence form to generate a 2D embedding vector and input it to the learned artificial intelligence model (S730).
  • a 2D embedding vector may include a preset number of rows. If the number of converted embedding vectors is less than the preset number of rows, the electronic device may load the remaining rows as dummy rows to generate a 2D embedding vector.
  • the electronic device may output information related to open source corresponding to the source code of the software to be verified using the learned artificial intelligence model (S740).
  • the artificial intelligence model may be a model based on CNN, GNN, RNN, U-net, LSTM, or MLP.
  • the electronic device can convert the generated 2D embedding vector into a 2D image. For example, an electronic device can identify a color code corresponding to each value included in a 2D embedding vector. Additionally, the electronic device may assign a color corresponding to the identified color code to an area corresponding to each value included in the 2D embedding vector. The electronic device can convert a 2D embedding vector into a 2D image through the above-described process. The electronic device can input a 2D image into an artificial intelligence model and output information related to open source corresponding to the source code of the software to be verified. For example, information related to open source may include open source license information, information related to the source code of the software to be verified that corresponds to the open source source code, etc.
  • the open source license verification method according to the various embodiments described above may be provided as a computer program product.
  • a computer program product may include the S/W program itself or a non-transitory computer readable medium in which the S/W program is stored.
  • a non-transitory readable medium refers to a medium that stores data semi-permanently and can be read by a device, rather than a medium that stores data for a short period of time, such as registers, caches, and memories.
  • the various applications or programs described above may be stored and provided on non-transitory readable media such as CD, DVD, hard disk, Blu-ray disk, USB, memory card, ROM, etc.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Computer Security & Cryptography (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Artificial Intelligence (AREA)
  • Computational Linguistics (AREA)
  • Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Multimedia (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Technology Law (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • General Health & Medical Sciences (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Image Analysis (AREA)

Abstract

오픈 소스 라이선스를 검증하는 전자 장치 및 방법이 개시된다. 오픈 소스의 라이선스 검증 방법은 검증 대상 소프트웨어의 소스 코드를 기 설정된 기준에 따라 분할하는 단계, 분할된 소스 코드의 부분 각각을 시퀀스 형태의 임베딩 벡터로 변환하는 단계, 변환된 시퀀스 형태의 임베딩 벡터 각각을 적재하여 2D 형태의 임베딩 벡터를 생성하고, 학습된 인공 지능 모델에 입력하는 단계 및 학습된 인공 지능 모델을 이용하여 소스 코드에 대응되는 오픈 소스와 관련된 정보를 출력하는 단계를 포함한다.

Description

오픈 소스 라이선스를 검증하는 전자 장치 및 방법
본 개시는 오픈 소스 라이선스를 검증하는 전자 장치 및 방법에 관한 것으로, 더욱 상세하게는, 딥 러닝 기반의 인공 지능 모델을 이용한 오픈 소스 라이선스를 검증하는 전자 장치 및 방법에 관한 것이다.
제조사 및 프로그램 개발자는 품질이 검증된 FOSS(Free and Open Source Software)를 사용함으로써 개발 주기를 단축시키고, 개발 비용을 감소시키며 적시 출시(Time To Market)를 통한 시장 선점을 할 수 있는 이점을 얻고 있다.
그러나, 제조사 및 프로그램 개발자가 FOSS를 제품 개발에 사용하는 경우, 오픈 소스 라이선스 감시 단체에 의한 소송을 피하고, 기업과 제품의 브랜딩 이미지의 실추에 대한 위험 부담을 줄이기 위해 제조사 및 프로그램 개발자는 사용하는 FOSS가 라이선스 규약을 준수하는지 필수적으로 검증해야 한다.
일반적으로, 라이선스 검증은 소프트웨어 소스 코드를 기반으로 하여 파일별로 라이선스를 검증한다. 즉, 프로그램 개발자는 소스 코드의 파일 별로 기존에 확보된 컴포넌트 풀(component pool)인 지식 베이스(Knowledge Base)와 매칭하여 라이선스를 검증한다. 이러한 종래의 방식은 검증 대상 코드의 키워드를 중심으로 텍스트 매치를 통해 유사한 오픈 소스 코드를 검색하고, 검색 결과를 리스트 형태로 제공한다. 검증자는 리스트 형태의 검색 결과를 정성적으로 리뷰하여 검증 대상 코드와 오픈 소스 코드의 매칭 여부를 최종적으로 결정한다.
그러나, 종래의 방식은 검증 대상 코드와 매칭되는 오픈 소스 코드의 검색 결과의 정확도가 낮아 검증자에 의한 수동 검증이 반드시 필요하다. 또한, 검증자가 정성적으로 리뷰를 할 때, 휴먼 에러로 인한 검증 실패의 가능성이 존재하는 문제점이 있다.
따라서, 오픈 소스의 라이선스 검증의 정확도를 높이고, 검증 시간 및 비용을 줄일 수 있는 기술에 대한 필요성이 존재한다.
본 개시는 상술한 문제점을 해결하기 위한 것으로, 본 개시의 목적은 딥 러닝 인공 지능 모델을 이용하여 오픈 소스의 라이선스 검증의 신뢰도를 높이고 검증 시간 및 비용을 줄이기 위한 것이다.
본 개시의 일 실시 예에 따른 오픈 소스의 라이선스 검증 방법은 검증 대상 소프트웨어의 소스 코드를 기 설정된 기준에 따라 분할하는 단계, 상기 분할된 소스 코드의 부분 각각을 시퀀스 형태의 임베딩 벡터로 변환하는 단계, 상기 변환된 시퀀스 형태의 임베딩 벡터 각각을 적재하여 2D 형태의 임베딩 벡터를 생성하고, 학습된 인공 지능 모델에 입력하는 단계 및 상기 학습된 인공 지능 모델을 이용하여 상기 소스 코드에 대응되는 오픈 소스와 관련된 정보를 출력하는 단계를 포함한다.
본 개시의 일 실시 예에 따른 전자 장치는 입력 인터페이스, 메모리 및 프로세서를 포함하고, 상기 프로세서는 상기 입력 인터페이스를 통해 검증 대상 소프트웨어의 소스 코드를 입력받고, 상기 검증 대상 소프트웨어의 소스 코드를 기 설정된 기준에 따라 분할하며, 상기 분할된 소스 코드의 부분 각각을 시퀀스 형태의 임베딩 벡터로 변환하고, 상기 변환된 시퀀스 형태의 임베딩 벡터 각각을 적재하여 2D 형태의 임베딩 벡터를 생성하고, 학습된 인공 지능 모델에 입력하며, 상기 학습된 인공 지능 모델을 이용하여 상기 소스 코드에 대응되는 오픈 소스와 관련된 정보를 출력한다.
도 1은 본 개시의 일 실시 예에 따른 전자 장치의 블록도이다.
도 2는 본 개시의 일 실시 예에 따른 전자 장치의 구체적인 블록도이다.
도 3은 본 개시의 일 실시 예에 따른 프로세서의 블록도이다.
도 4a 내지 도 4d는 본 개시의 일 실시 예에 따른 임베딩 벡터로 변환하는 과정을 설명하는 도면이다.
도 5a 내지 도 5b는 본 개시의 일 실시 예에 따른 2D 이미지로 변환하는 과정을 설명하는 도면이다.
도 6은 본 개시의 일 실시 예에 따른 오픈 소스의 라이선스 검증 과정과 관련된 동작을 설명하는 도면이다.
도 7은 본 개시의 일 실시 예에 따른 오픈 소스의 라이선스 검증 방법을 설명하는 흐름도이다.
이하에서는 첨부된 도면을 참조하여 다양한 실시 예를 보다 상세하게 설명한다. 본 명세서에 기재된 실시 예는 다양하게 변형될 수 있다. 특정한 실시 예가 도면에서 묘사되고 상세한 설명에서 자세하게 설명될 수 있다. 그러나, 첨부된 도면에 개시된 특정한 실시 예는 다양한 실시 예를 쉽게 이해하도록 하기 위한 것일 뿐이다. 따라서, 첨부된 도면에 개시된 특정 실시 예에 의해 기술적 사상이 제한되는 것은 아니며, 개시의 사상 및 기술 범위에 포함되는 모든 균등물 또는 대체물을 포함하는 것으로 이해되어야 한다.
제1, 제2 등과 같이 서수를 포함하는 용어는 다양한 구성요소들을 설명하는데 사용될 수 있지만, 이러한 구성요소들은 상술한 용어에 의해 한정되지는 않는다. 상술한 용어는 하나의 구성요소를 다른 구성요소로부터 구별하는 목적으로만 사용된다.
본 명세서에서, "포함한다" 또는 "가지다" 등의 용어는 명세서상에 기재된 특징, 숫자, 단계, 동작, 구성요소, 부품 또는 이들을 조합한 것이 존재함을 지정하려는 것이지, 하나 또는 그 이상의 다른 특징들이나 숫자, 단계, 동작, 구성요소, 부품 또는 이들을 조합한 것들의 존재 또는 부가 가능성을 미리 배제하지 않는 것으로 이해되어야 한다. 어떤 구성요소가 다른 구성요소에 "연결되어" 있다거나 "접속되어" 있다고 언급된 때에는, 그 다른 구성요소에 직접적으로 연결되어 있거나 또는 접속되어 있을 수도 있지만, 중간에 다른 구성요소가 존재할 수도 있다고 이해되어야 할 것이다. 반면에, 어떤 구성요소가 다른 구성요소에 "직접 연결되어" 있다거나 "직접 접속되어" 있다고 언급된 때에는, 중간에 다른 구성요소가 존재하지 않는 것으로 이해되어야 할 것이다.
한편, 본 명세서에서 사용되는 구성요소에 대한 "모듈" 또는 "부"는 적어도 하나의 기능 또는 동작을 수행한다. 그리고, "모듈" 또는 "부"는 하드웨어, 소프트웨어 또는 하드웨어와 소프트웨어의 조합에 의해 기능 또는 동작을 수행할 수 있다. 또한, 특정 하드웨어에서 수행되어야 하거나 적어도 하나의 프로세서에서 수행되는 "모듈" 또는 "부"를 제외한 복수의 "모듈들" 또는 복수의 "부들"은 적어도 하나의 모듈로 통합될 수도 있다. 단수의 표현은 문맥상 명백하게 다르게 뜻하지 않는 한, 복수의 표현을 포함한다.
본 개시의 설명에 있어서 각 단계의 순서는 선행 단계가 논리적 및 시간적으로 반드시 후행 단계에 앞서서 수행되어야 하는 경우가 아니라면 각 단계의 순서는 비제한적으로 이해되어야 한다. 즉, 위와 같은 예외적인 경우를 제외하고는 후행 단계로 설명된 과정이 선행단계로 설명된 과정보다 앞서서 수행되더라도 개시의 본질에는 영향이 없으며 권리범위 역시 단계의 순서에 관계없이 정의되어야 한다. 그리고 본 명세서에서 "A 또는 B"라고 기재한 것은 A와 B 중 어느 하나를 선택적으로 가리키는 것뿐만 아니라 A와 B 모두를 포함하는 것도 의미하는 것으로 정의된다. 또한, 본 명세서에서 "포함"이라는 용어는 포함하는 것으로 나열된 요소 이외에 추가로 다른 구성요소를 더 포함하는 것도 포괄하는 의미를 가진다.
본 명세서에서는 본 개시의 설명에 필요한 필수적인 구성요소만을 설명하며, 본 개시의 본질과 관계가 없는 구성요소는 언급하지 아니한다. 그리고 언급되는 구성요소만을 포함하는 배타적인 의미로 해석되어서는 아니되며 다른 구성요소도 포함할 수 있는 비배타적인 의미로 해석되어야 한다.
그 밖에도, 본 개시를 설명함에 있어서, 관련된 공지 기능 혹은 구성에 대한 구체적인 설명이 본 개시의 요지를 불필요하게 흐릴 수 있다고 판단되는 경우, 그에 대한 상세한 설명은 축약하거나 생략한다. 한편, 각 실시 예는 독립적으로 구현되거나 동작될 수도 있지만, 각 실시 예는 조합되어 구현되거나 동작될 수도 있다.
도 1은 본 개시의 일 실시 예에 따른 전자 장치의 블록도이다.
도 1을 참조하면, 전자 장치(100)는 입력 인터페이스(110), 메모리(120) 및 프로세서(130)를 포함한다.
입력 인터페이스(110)는 사용자로부터 제어 명령을 입력받거나 소스 코드 등을 포함하는 다양한 데이터를 입력받을 수 있다. 예를 들어, 입력 인터페이스(110)는 검증 대상 소프트웨어의 소스 코드를 입력받을 수 있다. 또한, 입력 인터페이스(110)는 오픈 소스의 소스 코드를 입력받을 수 있다. 오픈 소스는 코드가 공개되고 누구나 사용할 수 있는 소프트웨어를 의미한다. 그러나, 규약에 따라 자유롭게 사용할 수 오픈 소스도 있고, 일정한 제약이나 요구 조건을 이행해야 하는 오픈 소스도 있다. 라이선스는 일정한 제약이나 이행해야 할 요구 조건 등의 규약을 의미한다. 본 개시는 오픈 소스 라이선스의 검증과 관련된 실시 예를 설명하지만, 다양한 데이터 및 조건을 수집할 수 있는 다양한 종류의 프로그램 소스에도 적용될 수 있다. 일 실시 예로서, 전자 장치(100)는 오픈 소스의 라이선스 검증을 위한 인공 지능 모델을 학습시킬 수 있다. 그리고, 전자 장치(100)는 학습된 인공 지능 모델을 이용하여 검증 대상 소프트웨어를 대상으로 오픈 소스의 라이선스 검증을 수행할 수 있다. 오픈 소스의 라이선스 검증을 위한 인공 지능 모델의 구체적인 설명은 후술한다.
전자 장치(100)가 인공 지능 모델을 학습시킬 때, 입력 인터페이스(110)는 학습 데이터로서 오픈 소스의 소스 코드를 입력받을 수 있다. 또는, 전자 장치(100)가 학습된 인공 지능 모델을 이용하여 소프트웨어의 소스 코드를 검증할 때, 입력 인터페이스(110)는 검증 대상 소프트웨어의 소스 코드를 입력받을 수 있다.
예를 들어, 입력 인터페이스(110)는 키 패드, 키보드, 터치 패드, 터치 스크린 등으로 구현될 수 있다. 또는, 입력 인터페이스(110)는 입출력 포트로 구현될 수 있다. 입력 인터페이스(110)가 입출력 포트를 포함하는 경우, 입출력 포트는 USB(Universal Serial Bus), PS/2(Personal System/2), HDMI(High-Definition Multimedia Interface), DP(DisplayPort), RGB, DVI(Digital Visual Interface), 썬더볼트, LAN, AUX 등의 포트를 포함할 수 있다. 입력 인터페이스(110)는 입력 장치, 입력부, 입력 모듈 등으로 불릴 수도 있다. 입력 인터페이스(110)가 입출력 기능을 수행하는 경우, 입출력 장치, 입출력부, 입출력 모듈 등으로 불릴 수도 있다.
메모리(120)는 전자 장치(100)의 기능을 수행하는 데이터, 알고리즘 등을 저장하고, 전자 장치(100)에서 구동되는 프로그램, 명령어 등을 저장할 수 있다. 예를 들어, 메모리(120)는 입력된 오픈 소스의 소스 코드, 입력된 검증 대상 소프트웨어의 소스 코드, 라이선스 검증을 위한 인공 지능 모델, 인공 지능 모델의 학습 과정에서 생성된 데이터, 라이선스 검증 과정에서 생성된 데이터 등을 저장할 수 있다. 메모리(120)에 저장된 알고리즘 또는 인공 지능 모델은 프로세서(130)의 제어에 의해 프로세서(130)로 로딩되어 인공 지능 모델의 학습 과정 또는 라이선스 검증 과정을 수행할 수 있다. 예를 들어, 메모리(190)는 롬, 램, HDD, SSD, 메모리 카드 등의 타입으로 구현될 수 있다.
프로세서(130)는 전자 장치(100)의 각 구성을 제어할 수 있다. 예를 들어, 프로세서(130)는 데이터를 입력받도록 입력 인터페이스(110)를 제어하고, 입력된 데이터를 저장하도록 메모리(120)를 제어하며, 메모리(120)에 저장된 알고리즘, 인공 지능 모델 또는 데이터를 프로세서(130)로 로딩하도록 메모리(120)를 제어할 수 있다.
예를 들어, 프로세서(130)는 인공 지능 모델을 학습시키기 위해 아래와 같은 동작을 수행할 수 있다. 프로세서(130)는 메모리(120)에 저장된 인공 지능 모델을 프로세서(130)로 로딩할 수 있다. 그리고, 프로세서(130)는 입력된 오픈 소스의 소스 코드를 기 설정된 기준에 따라 분할할 수 있다. 예를 들어, 기 설정된 기준은 함수, 기 설정된 문자 또는 기 설정된 단어로 설정될 수 있다. 즉, 프로세서(130)는 오픈 소스의 소스 코드에 포함된 함수, 함수에 포함된 기 설정된 문자 또는 함수에 포함된 기 설정된 단어를 기준으로 오픈 소스의 소스 코드를 분할할 수 있다.
프로세서(130)는 분할된 소스 코드의 부분 각각을 시퀀스 형태의 임베딩 벡터로 변환할 수 있다. 예를 들어, 임베딩 벡터는 기 설정된 길이로 설정될 수 있다. 그리고, 프로세서(130)는 변환된 임베딩 벡터의 길이가 기 설정된 길이보다 짧으면, 더미 값을 추가하여 기 설정된 길이의 임베딩 벡터로 변환할 수 있다.
프로세서(130)는 변환된 시퀀스 형태의 임베딩 벡터 각각을 적재하여 2D 형태의 임베딩 벡터를 생성할 수 있다. 예를 들어, 2D 형태의 임베딩 벡터는 기 설정된 개수의 행을 포함할 수 있다. 그리고, 프로세서(130)는 변환된 임베딩 벡터의 개수가 기 설정된 개수의 행보다 적으면, 나머지 행을 더미 행으로 적재하여 2D 형태의 임베딩 벡터를 생성할 수 있다.
프로세서(130)는 2D 형태의 임베딩 벡터를 인공 지능 모델에 입력하여 라이선스 검증을 위한 인공 지능 모델을 학습시킬 수 있다. 예를 들어, 프로세서(130)는 오픈 소스에 대응되는 라이선스 정보를 출력하도록 인공 지능 모델을 학습시킬 수 있다. 즉, 인공 지능 모델에 입력된 임베딩 벡터는 오픈 소스의 소스 코드와 관련된 데이터일 수 있다. 그리고, 인공 지능 모델은 오픈 소스에 대응되는 라이선스 정보를 출력하도록 학습될 수 있다. 따라서, 인공 지능 모델은 입력된 임베딩 벡터와 관련된 오픈 소스의 소스 코드에 대응되는 라이선스 정보를 출력하도록 학습될 수 있다.
일 실시 예로서, 인공 지능 모델의 입력 데이터는 이미지 데이터일 수 있다. 따라서, 프로세서(130)는 생성된 2D 형태의 임베딩 벡터를 2D 이미지로 변환할 수 있다. 예를 들어, 프로세서(130)는 2D 형태의 임베딩 벡터에 포함된 각 값에 대응되는 색상 코드를 식별할 수 있다. 그리고, 프로세서(130)는 식별된 색상 코드에 대응되는 색상을 2D 형태의 임베딩 벡터에 포함된 각 값에 대응되는 영역에 할당할 수 있다. 프로세서(130)는 상술한 과정을 통해 2D 형태의 임베딩 벡터를 2D 이미지로 변환할 수 있다. 그리고, 프로세서(130)는 변환된 2D 이미지를 인공 지능 모델에 입력하여 라이선스 검증을 위한 인공 지능 모델을 학습시킬 수 있다.
전자 장치(100)는 학습된 인공 지능 모델을 이용하여 생성된 소프트웨어에 대한 오픈 소스의 라이선스를 검증할 수 있다. 예를 들어, 입력 인터페이스(110)는 검증 대상 소프트웨어의 소스 코드를 입력받을 수 있다. 프로세서(130)는 입력된 검증 대상 소프트웨어의 소스 코드를 학습된 인공 지능 모델에 입력할 수 있다. 이때, 프로세서(130)는 학습 과정과 유사하게 검증 대상 소프트웨어의 소스 코드를 기 설정된 기준에 따라 분할할 수 있다. 그리고, 프로세서(130)는 분할된 검증 대상 소스 코드의 부분 각각을 시퀀스 형태의 임베딩 벡터로 변환하고, 각각의 임베딩 벡터를 적재하여 2D 형태의 임베딩 벡터를 생성할 수 있다. 프로세서(130)가 2D 형태의 임베딩 벡터를 학습된 인공 지능 모델에 입력하면, 학습된 인공 지능 모델은 입력된 검증 대상 소스 코드에 대응되는 오픈 소스와 관련된 정보를 제공할 수 있다. 전자 장치는 출력 인터페이스를 포함할 수 있다. 그리고, 전자 장치는 출력 인터페이스를 통해 오픈 소스와 관련된 정보를 출력할 수 있다. 예를 들어, 출력 인터페이스는 디스플레이, 통신 인터페이스, 입출력 포트 등의 형태로 구현될 수 있다. 그리고, 오픈 소스와 관련된 정보는 오픈 소스의 라이선스 정보, 오픈 소스의 소스 코드에 대응되는 검증 대상 소프트웨어의 소스 코드와 관련된 정보를 포함할 수 있다. 즉, 전자 장치(100)는 학습된 인공 지능 모델을 이용하여 검증 대상 소프트웨어가 어떤 오픈 소스의 라이선스 정보에 해당되는지 여부, 검증 대상 소프트웨어의 소스 코드 중 어느 부분이 오픈 소스의 소스 코드에 대응되는지 여부에 대한 정보를 출력할 수 있다.
한편, 인공 지능 모델에 이미지 데이터를 입력해야 하는 경우, 프로세서(130)는 검증 대상 소프트웨어의 임베딩 벡터를 이미지로 변환할 수 있다. 즉, 프로세서(130)는 2D 형태의 임베딩 벡터에 포함된 각 값에 대응되는 색상 코드를 식별할 수 있다. 그리고, 프로세서(130)는 식별된 색상 코드에 대응되는 색상을 2D 형태의 임베딩 벡터에 포함된 각 값에 대응되는 영역에 할당하여 2D 형태의 임베딩 벡터를 2D 이미지로 변환할 수 있다. 프로세서(130)는 변환된 2D 이미지를 학습된 인공 지능 모델에 입력하고, 학습된 인공 지능 모델은 검증 대상 소프트웨어에 대한 오픈 소스와 관련된 정보를 출력할 수 있다.
본 개시에 따른 인공 지능과 관련된 기능은 프로세서(130)와 메모리(120)를 통해 동작될 수 있다. 프로세서(130)는 하나 또는 복수의 프로세서로 구성될 수 있다. 이때, 하나 또는 복수의 프로세서(130)는 CPU, AP, DSP(Digital Signal Processor) 등과 같은 범용 프로세서, GPU, VPU(Vision Processing Unit)와 같은 그래픽 전용 프로세서 또는 NPU와 같은 인공 지능 전용 프로세서일 수 있다. 하나 또는 복수의 프로세서(130)는, 메모리(120)에 저장된 기 정의된 동작 규칙 또는 인공 지능 모델에 따라, 입력 데이터를 처리하도록 제어한다. 또는, 하나 또는 복수의 프로세서(130)가 인공 지능 전용 프로세서인 경우, 인공 지능 전용 프로세서는, 특정 인공 지능 모델의 처리에 특화된 하드웨어 구조로 설계될 수 있다.
기 정의된 동작 규칙 또는 인공 지능 모델은 학습을 통해 만들어진 것을 특징으로 한다. 여기서, 학습을 통해 만들어진다는 것은, 기본 인공 지능 모델이 학습 알고리즘에 의하여 다수의 학습 데이터들을 이용하여 학습됨으로써, 원하는 특성(또는, 목적)을 수행하도록 설정된 기 정의된 동작 규칙 또는 인공 지능 모델이 만들어짐을 의미한다. 이러한 학습은 본 개시에 따른 인공 지능이 수행되는 기기 자체에서 이루어질 수도 있고, 별도의 서버 및/또는 시스템을 통해 이루어 질 수도 있다. 학습 알고리즘의 예로는, 지도형 학습(supervised learning), 비지도형 학습(unsupervised learning), 준지도형 학습(semi-supervised learning) 또는 강화 학습(reinforcement learning)이 있으나, 전술한 예에 한정되지 않는다.
인공 지능 모델은, 복수의 신경망 레이어들로 구성될 수 있다. 복수의 신경망 레이어들 각각은 복수의 가중치들(weight values)을 갖고 있으며, 이전(previous) 레이어의 연산 결과와 복수의 가중치들 간의 연산을 통해 신경망 연산을 수행한다. 복수의 신경망 레이어들이 갖고 있는 복수의 가중치들은 인공 지능 모델의 학습 결과에 의해 최적화될 수 있다. 예를 들어, 학습 과정 동안 인공 지능 모델에서 획득한 로스(loss) 값 또는 코스트(cost) 값이 감소 또는 최소화되도록 복수의 가중치들이 갱신될 수 있다. 인공 신경망은 심층 신경망(DNN:Deep Neural Network)를 포함할 수 있으며, 예를 들어, CNN (Convolutional Neural Network), DNN (Deep Neural Network), GNN(Graph Neural Network), RNN (Recurrent Neural Network), U-net, LSTM(Long Short-Term Memory), MLP(Multi-Layer Perceptron), RBM (Restricted Boltzmann Machine), DBN (Deep Belief Network), BRDNN(Bidirectional Recurrent Deep Neural Network) 또는 심층 Q-네트워크 (Deep Q-Networks) 등이 있으나, 전술한 예에 한정되지 않는다.
도 2는 본 개시의 일 실시 예에 따른 전자 장치의 구체적인 블록도이다.
도 2를 참조하면, 전자 장치(100)는 입력 인터페이스(110), 메모리(120), 프로세서(130), 통신 인터페이스(140), 카메라(150), 마이크(160), 디스플레이(170), 스피커(180), 센서(190)를 포함할 수 있다. 입력 인터페이스(110) 및 메모리(120)는 도 1에서 설명한 바와 동일하므로 구체적인 설명을 생략한다.
통신 인터페이스(140)는 외부 장치와 통신을 수행할 수 있다. 예를 들어, 통신 인터페이스(140)는 Wi-Fi, Wi-Fi 다이렉트, 블루투스, 지그비, 3G(3rd Generation), 3GPP(3rd Generation Partnership Project) 및 LTE(Long Term Evolution)의 통신 방식 중 적어도 하나 이상의 통신 방식으로 외부 장치와 통신을 수행할 수 있다. 도 1에서는 전자 장치(100)가 입력 인터페이스(110)를 통해 소스 코드 등을 포함하는 다양한 데이터를 입력받는 실시 예를 설명하였으나, 전자 장치(100)는 외부 장치로부터 통신 인터페이스(140)를 통해 소스 코드 등을 포함하는 다양한 데이터를 수신할 수도 있다. 또한, 전자 장치(100)는 학습된 인공 지능 모델을 이용하여 검증 대상 소프트웨어를 검증하고, 통신 인터페이스(140)를 통해 검증 결과를 외부 장치로 전송할 수 있다. 상술한 통신 인터페이스(140)는 통신 장치, 통신부, 통신 모듈, 송수신부 등으로 지칭될 수 있다.
카메라(150)는 전자 장치(100)의 주변 환경을 촬영하여 이미지를 생성할 수 있다. 예를 들어, 이미지는 오브젝트를 포함할 수 있다. 또한, 이미지는 스틸 이미지 및 동영상 등을 포함할 수 있다. 예를 들어, 카메라(150)는 CCD 센서, CMOS 센서를 포함할 수 있다. 또한, 카메라(150)는 RGB 카메라, 뎁스 카메라, 광각 카메라, 망원 카메라 등을 포함할 수 있다.
마이크(160)는 외부의 사운드를 입력받는다. 예를 들어, 전자 장치(100)에 한 개의 마이크가 배치될 수 있고, 복수의 마이크가 배치될 수 있다. 예를 들어, 마이크(160)는 일반 마이크, 서라운드 마이크, 지향성 마이크 등을 포함할 수 있다.
디스플레이(170)는 프로세서(130)에서 처리된 데이터를 영상으로 출력할 수 있다. 인공 지능 모델 학습 과정에서 디스플레이(170)는 입력된 오픈 소스의 소스 코드에 대응되는 라이선스 정보를 출력할 수 있다. 그리고, 오픈 소스의 라이선스 검증 과정에서 디스플레이(170)는 입력된 검증 대상 소프트웨어의 소스 코드에 대응되는 오픈 소스와 관련된 정보를 출력할 수 있다. 예를 들어, 오픈 소스와 관련된 정보는 오픈 소스의 라이선스 정보, 오픈 소스의 소스 코드에 대응되는 검증 대상 소프트웨어의 소스 코드와 관련된 정보 등을 포함할 수 있다. 예를 들어, 디스플레이(170)는 LCD(Liquid Crystal Display), OLED(Organic Light Emitting Diode), 플렉서블 디스플레이, 터치 스크린 등으로 구현될 수 있다. 디스플레이(170)가 터치 스크린으로 구현되는 경우, 전자 장치(100)는 터치 스크린을 통해 제어 명령을 입력받을 수 있다.
스피커(180)는 음성 처리가 수행된 음성 신호를 출력한다. 예를 들어, 스피커(180)는 전자 장치(100)에 복수 개가 배치될 수 있고, 프로세서(130)는 배치된 스피커(180)의 위치에 기초하여 각 채널의 사운드를 할당하여 입체 사운드를 출력할 수 있다. 또한, 스피커(180)는 사용자의 입력 명령에 대한 정보, 전자 장치(100)의 상태 관련 정보 또는 동작 관련 정보 등을 음성이나 알림음으로 출력할 수 있다.
센서(190)는 전자 장치(100) 주변의 물체를 감지할 수 있다. 프로세서(130)는 감지된 신호에 기초하여 제어 명령을 인식하고, 인식된 제어 명령에 대응되는 제어 동작을 수행할 수 있다. 또한, 센서(190)는 전자 장치(100)의 주변 환경 정보를 감지할 수 있다. 프로세서(130)는 센서(190)에서 감지된 주변 환경 정보에 기초하여 대응되는 제어 동작을 수행할 수 있다. 예를 들어, 센서(190)는 가속도 센서, 중력 센서, 자이로 센서, 지자기 센서, 방향 센서, 모션 인식 센서, 근접 센서, 전압계, 전류계, 기압계, 습도계, 온도계, 조도 센서, 열 감지 센서, 터치 센서, 적외선 센서, 초음파 센서 등을 포함할 수 있다.
전자 장치(100)는 상술한 구성을 모두 포함할 수 있고, 일부 구성을 포함할 수도 있다. 또한, 전자 장치(100)는 상술한 구성 이외에도 다양한 기능을 수행하는 다른 구성을 더 포함할 수도 있다.
지금까지 일 실시 예로서 하나의 전자 장치(100)가 인공 지능 모델의 학습과 검증을 모두 수행하는 것으로 설명하였다. 그러나, 인공 지능 모델의 학습은 외부 전자 장치에서 수행되고, 학습된 인공 지능 모델을 이용한 오픈 소스의 라이선스 검증은 단말 장치에서 수행될 수 있다. 예를 들어, 외부 전자 장치는 서버, 클라우드, 호스트 장치 등을 포함할 수 있다. 그리고, 단말 장치는 스마트폰, 태블릿 PC, 네비게이션, 슬레이트 PC, 웨어러블 디바이스, 디지털 TV, 데스크탑 컴퓨터, 랩탑 컴퓨터, 키오스크 등을 포함할 수 있다. 즉, 외부 전자 장치는 학습할 인공 지능 모델을 저장하고, 입력 인터페이스 또는 통신 인터페이스를 통해 오픈 소스의 소스 코드 등을 포함하는 데이터를 제공받을 수 있다. 외부 전자 장치는 상술한 과정을 통해 오픈 소스의 라이선스 검증을 위한 인공 지능 모델을 학습시킬 수 있다. 외부 전자 장치는 학습된 인공 지능 모델을 단말 장치로 제공할 수 있다. 예를 들어, 단말 장치는 입력 인터페이스 또는 통신 인터페이스를 통해 학습된 인공 지능 모델을 제공받을 수 있다. 단말 장치는 학습된 인공 지능 모델을 저장하고, 입력 인터페이스 또는 통신 인터페이스를 통해 검증 대상 소프트웨어의 소스 코드를 제공받을 수 있다. 단말 장치는 학습된 인공 지능 모델을 이용하여 검증 대상 소프트웨어의 소스 코드에 대응되는 오픈 소스와 관련된 정보를 제공할 수 있다. 예를 들어, 단말 장치는 출력 인터페이스를 통해 검증 대상 소프트웨어의 소스 코드에 대응되는 오픈 소스와 관련된 정보를 출력할 수 있다. 출력 인터페이스는 디스플레이, 통신 인터페이스, 입출력 포트 등을 포함할 수 있다. 따라서, 도 2에 도시된 전자 장치(100)의 블록도 및 설명은 인공 지능 모델의 학습을 수행하는 외부 전자 장치 또는 오픈 소스의 라이선스 검증을 수행하는 단말 장치에 대응될 수 있다.
도 3은 본 개시의 일 실시 예에 따른 프로세서의 블록도이고, 도 4a 내지 도 4d는 본 개시의 일 실시 예에 따른 임베딩 벡터로 변환하는 과정을 설명하는 도면이며, 도 5a 내지 도 5b는 본 개시의 일 실시 예에 따른 2D 이미지로 변환하는 과정을 설명하는 도면이다. 도 3 내지 도 5b를 함께 참조하여 설명한다.
도 3을 참조하면, 프로세서(130)는 토큰 생성부(131), 임베딩 벡터 변환부(132), 이미지 변환부(133), 모델 학습부(134)를 포함할 수 있다. 도 3에 도시된 각 구성은 소프트웨어로 구현되고 메모리(120)에 저장될 수 있다. 그리고, 각 구성은 인공 지능 모델을 학습할 때 프로세서(130)의 제어에 의해 프로세서(130)로 로딩될 수 있다.
전자 장치(100)가 인공 지능 모델을 학습시킬 때, 전자 장치(100)는 오픈 소스 코드 및 라이선스 정보에 대한 데이터를 수집할 수 있다. 예를 들어, 전자 장치(100)는 입력 인터페이스(110) 또는 통신 인터페이스(140)를 통해 오픈 소스 코드 및 라이선스 정보에 대한 데이터를 수집할 수 있다. 전자 장치(100)는 수집된 오픈 소스 코드 및 라이선스 정보에 대한 데이터를 메모리(120)에 저장할 수 있다.
토큰 생성부(131)는 오픈 소스의 소스 코드를 기 설정된 기준에 따라 토큰으로 변환할 수 있다. 예를 들어, 프로세서(130)는 오픈 소스의 소스 코드의 언어 타입을 식별할 수 있다. 그리고, 프로세서(130)는 식별된 언어 타입에 기초하여 기 설정된 단위의 토큰으로 변환할 수 있다. 예를 들어, 기 설정된 기준(또는, 단위)는 오픈 소스의 소스 코드에 포함된 함수, 함수에 포함된 기 설정된 문자, 함수에 포함된 기 설정된 단어일 수 있다. 토큰은 기 설정된 기준에 따라 오픈 소스의 소스 코드를 분할한 각 부분을 의미할 수 있다. 또한, 프로세서(130)는 식별된 언어 타입에 따라 기 설정된 노이즈를 제거하는 정규화 과정을 수행할 수 있다. 예를 들어, 의미가 없는 단어, 반복되는 단어 등이 노이즈로 설정될 수 있고, 프로세서(130)는 설정된 기준에 따라 노이즈를 제거할 수 있다.
도 4a에 도시된 바와 같이, 토큰 생성부(131)는 오픈 소스의 소스 코드(11)를 기 설정된 기준에 따라 토큰(21)으로 변환할 수 있다. 일 실시 예로서, 도 4b에 도시된 바와 같이, 토큰 생성부(131)는 소스 코드(11)에서 시작 지점과 종료 지점을 식별하고, 프로그램이 수행되는 순서를 식별할 수 있다. 일 실시 예로서, 도 4b를 참조하면, 토큰 생성부(131)는 prepare_handle_locker(), dynamic_load(), debug(), return 함수 또는 명령어의 순서로 오픈 소스의 소스 코드(11)가 수행된다고 식별할 수 있다. 토큰 생성부(131)는 ‘_’(언더 바) 단위로 소스 코드(11)를 분할할 수 있다. 따라서, 토큰 생성부(131)는 prepare_handle_locker()에서 prepare(31), handle(32), locker(33)를 각각 하나의 토큰(21)으로 변환(또는, 각 부분으로 분할)할 수 있다.
임베딩 벡터 변환부(132)는 분할된 소스 코드 부분(토큰) 각각을 시퀀스 형태의 임베딩 벡터로 변환할 수 있다. 임베딩 벡터는 자연어를 장치가 이해할 수 있는 숫자로 나열한 형태를 의미한다. 예를 들어, 임베딩 벡터 변환부(132)는 NNLM(Neural Network Language Model), Word2Vec, GloVe, FastText, Doc2Vec, Bert 등의 알고리즘을 이용하여 분할된 소스 코드 각각을 임베딩 벡터로 변환할 수 있다. 임베딩 벡터는 기 설정된 길이로 설정될 수 있다. 일 실시 예로서, 임베딩 벡터는 128 byte의 길이로 설정될 수 있다. 만일, 변환된 임베딩 벡터가 120 byte인 경우, 임베딩 벡터 변환부(132)는 나머지 8 byte 부분에 더미 값을 추가할 수 있다.
임베딩 벡터 변환부(132)는 변환된 시퀀스 형태의 임베딩 벡터를 적재하여 2D 형태의 임베딩 벡터를 생성할 수 있다. 2D 형태의 임베딩 벡터는 기 설정된 개수의 행을 포함할 수 있다. 일 실시 예로서, 2D 형태의 임베딩 벡터는 16개의 행을 포함할 수 있다. 만일, 적재된 시퀀스 형태의 임베딩 벡터가 14개인 경우, 임베딩 벡터 변환부(132)는 나머지 2개의 행을 더미 행으로 적재할 수 있다.
일 실시 예로서, 도 4c 및 도 4d에 도시된 바와 같이, 임베딩 벡터 변환부(132)는 토큰 생성부(131)에서 분할된 소스 코드(11)의 각 부분을 시퀀스 형태의 임베딩 벡터(21)로 변환할 수 있다. 그리고, 임베딩 벡터 변환부(132)는 임베딩 벡터를 적재하여 2D 형태의 임베딩 벡터를 생성할 수 있다. 한편, 도 4d에 도시된 바와 같이, 임베딩 벡터(21)는 n byte의 길이로 설정될 수 있고, 2D 형태의 임베딩 벡터는 m 개의 행을 포함할 수 있다. 임베딩 벡터 변환부(132)는 변환된 임베딩 벡터가 n byte의 길이보다 짧으면, 더미 값(41-1, 41-2, 41-3)을 추가하여 n byte의 길이의 임베딩 벡터로 변환할 수 있다. 또한, 임베딩 벡터 변환부(132)는 변환됨 임베딩 벡터의 개수가 m개 보다 적으면, 나머지 행을 더미 행으로 적재하여 m개 행을 포함하는 2D 형태의 임베딩 벡터를 생성할 수 있다. 도 4a 내지 도 4d에 도시된 예는 일 실시 예이며, 본 개시는 도시된 예에 한정되는 것은 아니다.
모델 학습부(134)는 라이선스 검증을 위한 인공 지능 모델을 학습시킬 수 있다. 모델 학습부(134)는 2D 형태의 임베딩 벡터를 전달받고, 인공 지능 모델에 입력 데이터로 입력시킬 수 있다. 인공 지능 모델은 입력된 임베딩 벡터와 관련된 오픈 소스에 대응되는 라이선스 정보를 출력하도록 학습될 수 있다. 예를 들어, 인공 지능 모델은 CNN, GNN, RNN, U-net, LSTM, MLP 기반의 모델을 포함할 수 있다.
만일, 인공 지능 모델이 이미지를 입력받는 CNN, U-net 등을 기반으로 하는 모델인 경우, 인공 지능 모델의 입력 데이터는 이미지일 수 있다. 이미지 변환부(133)는 인공 지능 모델에 입력하기 위한 이미지 데이터를 생성할 수 있다. 즉, 이미지 변환부(133)는 임베딩 벡터 변환부(132)에서 생성된 2D 형태의 임베딩 벡터를 2D 이미지로 변환할 수 있다. 예를 들어, 이미지 변환부(133)는 2D 형태의 임베딩 벡터에 포함된 각 값에 대응되는 색상 코드를 식별할 수 있다. 그리고, 이미지 변환부(133)는 식별된 색상 코드에 대응되는 색상을 2D 형태의 임베딩 벡터에 포함된 각 값에 대응되는 영역에 할당할 수 있다. 이미지 변환부(133)는 상술한 과정을 통해 2D 형태의 임베딩 벡터를 2D 이미지로 변환할 수 있다. 모델 학습부(134)는 2D 이미지를 인공 지능 모델에 입력하여 인공 지능 모델을 학습시킬 수 있다.
도 4d에 도시된 바와 같이, 임베딩 벡터(21)는 일련의 특정 값을 포함할 수 있다. 그리고, 도 5a에 도시된 바와 같이, 각 색상에는 색상 코드가 할당되어 있다. 일 실시 예로서, 도 4d의 2D 형태의 임베딩 벡터의 (1, 1)의 값은 0xFF0000이고, 색상 코드로 레드에 대응될 수 있다. 따라서, 이미지 변환부(133)는 2D 형태의 임베딩 벡터의 (1, 1)에 대응되는 2D 이미지의 영역을 레드로 변환할 수 있다. 즉, 이미지 변환부(133)는 색상 코드에 대응되는 색상을 2D 형태의 임베딩 벡터에 포함된 각 값에 대응되는 영역에 할당하여 2D 형태의 임베딩 벡터를 2D 이미지로 변환할 수 있다. 도 5b에는 상술한 과정을 통해 변환된 2D 이미지(51)의 일 실시 예가 도시되어 있다.
도 6은 본 개시의 일 실시 예에 따른 오픈 소스의 라이선스 검증 과정과 관련된 동작을 설명하는 도면이다.
도 6을 참조하면, 검증 대상 소프트웨어의 소스 코드로부터 변환된 2D 이미지(51)를 학습된 인공 지능 모델(52)에 입력하여 결과를 출력하는 과정이 도시되어 있다. 일 실시 예로서, 인공 지능 모델(52)은 CNN, U-net 등을 기반으로 하는 모델일 수 있다.
전자 장치(100)는 상술한 과정과 유사한 과정으로 오픈 소스의 라이선스를 검증할 수 있다. 즉, 인공 지능 모델 학습 과정 및 라이선스 검증 과정에서 전자 장치(100)는 동일한 방식으로 소스 코드를 전처리하고, 전처리가 수행된 데이터를 인공 지능 모델에 입력할 수 있다.
다만, 인공 지능 모델의 학습 과정에서는 정보를 충분히 알고 있는 오픈 소스의 소스 코드를 전처리한 데이터가 인공 지능 모델의 입력 데이터일 수 있다. 그리고, 인공 지능 모델은 입력된 오픈 소스의 소스 코드에 대응되는 데이터에 기초하여 오류(또는, 오차, 에러)를 수정하는 과정을 통해 학습될 수 있다. 라이선스 검증 과정에서는 검증 대상 소프트웨어의 소스 코드를 전처리한 데이터가 학습된 인공 지능 모델의 입력 데이터일 수 있다. 그리고, 전자 장치(100)는 검증 대상 소프트웨어의 소스 코드에 대응되는 입력 데이터를 학습된 인공 지능 모델에 입력하고, 학습된 인공 지능 모델을 이용하여 검증 대상 소프트웨어의 소스 코드에 대한 오픈 소스와 관련된 정보를 출력할 수 있다.
예를 들어, 전자 장치(100)는 입력 인터페이스(110) 또는 통신 인터페이스(140)를 통해 검증 대상 소프트웨어의 소스 코드를 제공받을 수 있다. 전자 장치(100)는 제공된 검증 대상 소프트웨어의 소스 코드에 대한 데이터를 메모리(120)에 저장할 수 있다. 그리고, 전자 장치(100)는 도 3에서 설명한 각 구성을 프로세서(130)의 제어에 의해 프로세서(130)로 로딩할 수 있다.
토큰 생성부(131)는 검증 대상 소프트웨어의 소스 코드를 기 설정된 기준에 따라 토큰으로 변환할 수 있다. 토큰 생성부(131)는 언어 타입에 따라 기 설정된 단위의 토큰으로 변환할 수 있고, 노이즈를 제거하는 정규화 과정을 수행할 수 있다.
임베딩 벡터 변환부(132)는 분할된 소스 코드 부분(토큰) 각각을 시퀀스 형태의 임베딩 벡터로 변환할 수 있다. 그리고, 임베딩 벡터 변환부(132)는 변환된 시퀀스 형태의 임베딩 벡터를 적재하여 2D 형태의 임베딩 벡터를 생성할 수 있다.
만일, 인공 지능 모델(52)이 이미지를 입력받는 CNN, U-net 등을 기반으로 하는 모델인 경우, 이미지 변환부(133)는 임베딩 벡터 변환부(132)에서 생성된 2D 형태의 임베딩 벡터를 2D 이미지로 변환할 수 있다.
프로세서(130)는 2D 형태의 임베딩 벡터 또는 2D 이미지를 인공 지능 모델(52)에 입력할 수 있다. 인공 지능 모델은 검증 대상 소프트웨어의 소스 코드에 대응되는 오픈 소스와 관련된 정보(53)를 출력할 수 있다. 예를 들어, 오픈 소스와 관련된 정보(53)는 식별된 상기 오픈 소스의 라이선스 정보, 오픈 소스의 소스 코드에 대응되는 검증 대상 소프트웨어의 소스 코드와 관련된 정보 등을 포함할 수 있다. 즉, 프로세서(130)는 출력 인터페이스를 통해 오픈 소스의 라이선스 정보, 검증 대상 소프트웨어의 소스 코드에서 오픈 소스의 소스 코드에 대응되는 코드 부분의 정보 등을 출력할 수 있다.
지금까지 오픈 소스의 라이선스 검증을 위한 인공 지능 모델을 학습시키고, 학습된 인공 지능 모델을 이용하여 오픈 소스의 라이선스를 검증하는 실시 예를 설명하였다. 아래에서는 오픈 소스 라이선스 검증 방법에 대해 설명한다.
도 7은 본 개시의 일 실시 예에 따른 오픈 소스의 라이선스 검증 방법을 설명하는 흐름도이다.
도 7을 참조하면, 전자 장치는 검증 대상 소프트웨어의 소스 코드를 기 설정된 기준에 따라 분할할 수 있다(S710). 예를 들어, 기 설정된 기준은 함수, 기 설정된 문자 또는 기 설정된 단어 등에 기초하여 설정될 수 있다. 전자 장치는 검증 대상 소프트웨어의 소스 코드에 포함된 함수, 함수에 포함된 기 설정된 문자 또는 함수에 포함된 기 설정된 단어를 기준으로 검증 대상 소프트웨어의 소스 코드를 분할할 수 있다.
전자 장치는 분할된 소스 코드의 부분 각각을 시퀀스 형태의 임베딩 벡터로 변환할 수 있다(S720). 예를 들어, 임베딩 벡터는 기 설정된 길이로 설정될 수 있다. 전자 장치는 변환된 임베딩 벡터의 길이가 기 설정된 길이보다 짧으면, 더미 값을 추가하여 기 설정된 길이의 임베딩 벡터로 변환할 수 있다.
전자 장치는 변환된 시퀀스 형태의 임베딩 벡터 각각을 적재하여 2D 형태의 임베딩 벡터를 생성하고, 학습된 인공 지능 모델에 입력할 수 있다(S730). 예를 들어, 2D 형태의 임베딩 벡터는 기 설정된 개수의 행을 포함할 수 있다. 전자 장치는 변환된 임베딩 벡터의 개수가 기 설정된 개수의 행보다 적으면, 나머지 행을 더미 행으로 적재하여 2D 형태의 임베딩 벡터를 생성할 수 있다.
전자 장치는 학습된 인공 지능 모델을 이용하여 검증 대상 소프트웨어의 소스 코드에 대응되는 오픈 소스와 관련된 정보를 출력할 수 있다(S740). 예를 들어, 인공 지능 모델은 CNN, GNN, RNN, U-net, LSTM 또는 MLP 기반의 모델일 수 있다.
일 실시 예로서, 인공 지능 모델이 이미지를 입력받는 CNN, U-net 등을 기반의 모델이면, 전자 장치는 생성된 2D 형태의 임베딩 벡터를 2D 이미지로 변환할 수 있다. 예를 들어, 전자 장치는 2D 형태의 임베딩 벡터에 포함된 각 값에 대응되는 색상 코드를 식별할 수 있다. 그리고, 전자 장치는 식별된 색상 코드에 대응되는 색상을 2D 형태의 임베딩 벡터에 포함된 각 값에 대응되는 영역에 할당할 수 있다. 전자 장치는 상술한 과정을 통해 2D 형태의 임베딩 벡터를 2D 이미지로 변환할 수 있다. 전자 장치는 2D 이미지를 인공 지능 모델에 입력하고, 검증 대상 소프트웨어의 소스 코드에 대응되는 오픈 소스와 관련된 정보를 출력할 수 있다. 예를 들어, 오픈 소스와 관련된 정보는 오픈 소스의 라이선스 정보, 오픈 소스의 소스 코드에 대응되는 검증 대상 소프트웨어의 소스 코드와 관련된 정보 등을 포함할 수 있다.
상술한 다양한 실시 예에 따른 오픈 소스의 라이선스 검증 방법은 컴퓨터 프로그램 제품으로 제공될 수도 있다. 컴퓨터 프로그램 제품은 S/W 프로그램 자체 또는 S/W 프로그램이 저장된 비일시적 판독 가능 매체(non-transitory computer readable medium)를 포함할 수 있다.
비일시적 판독 가능 매체란 레지스터, 캐쉬, 메모리 등과 같이 짧은 순간 동안 데이터를 저장하는 매체가 아니라 반영구적으로 데이터를 저장하며, 기기에 의해 판독(reading)이 가능한 매체를 의미한다. 구체적으로는, 상술한 다양한 어플리케이션 또는 프로그램들은 CD, DVD, 하드 디스크, 블루레이 디스크, USB, 메모리카드, ROM 등과 같은 비일시적 판독 가능 매체에 저장되어 제공될 수 있다.
또한, 이상에서는 본 개시의 바람직한 실시 예에 대하여 도시하고 설명하였지만, 본 개시는 상술한 특정의 실시 예에 한정되지 아니하며, 청구범위에서 청구하는 본 개시의 요지를 벗어남이 없이 당해 개시가 속하는 기술분야에서 통상의 지식을 가진 자에 의해 다양한 변형실시가 가능한 것은 물론이고, 이러한 변형실시들은 본 개시의 기술적 사상이나 전망으로부터 개별적으로 이해되어서는 안될 것이다.

Claims (15)

  1. 오픈 소스의 라이선스 검증 방법에 있어서,
    검증 대상 소프트웨어의 소스 코드를 기 설정된 기준에 따라 분할하는 단계;
    상기 분할된 소스 코드의 부분 각각을 시퀀스 형태의 임베딩 벡터로 변환하는 단계;
    상기 변환된 시퀀스 형태의 임베딩 벡터 각각을 적재하여 2D 형태의 임베딩 벡터를 생성하고, 학습된 인공 지능 모델에 입력하는 단계; 및
    상기 학습된 인공 지능 모델을 이용하여 상기 소스 코드에 대응되는 오픈 소스와 관련된 정보를 출력하는 단계;를 포함하는 오픈 소스의 라이선스 검증 방법.
  2. 제1항에 있어서,
    상기 오픈 소스와 관련된 정보를 출력하는 단계는,
    상기 학습된 인공 지능 모델을 이용하여 식별된 상기 오픈 소스의 라이선스 정보 및 상기 오픈 소스의 소스 코드에 대응되는 상기 검증 대상 소프트웨어의 소스 코드와 관련된 정보 중 적어도 하나의 정보를 출력하는, 오픈 소스의 라이선스 검증 방법.
  3. 제1항에 있어서,
    상기 학습된 인공 지능 모델에 입력하는 단계는,
    상기 생성된 2D 형태의 임베딩 벡터를 2D 이미지로 변환하는 단계; 및
    상기 2D 이미지를 상기 학습된 인공 지능 모델에 입력하는 단계;를 포함하는 오픈 소스의 라이선스 검증 방법.
  4. 제3항에 있어서,
    상기 2D 이미지로 변환하는 단계는,
    상기 2D 형태의 임베딩 벡터에 포함된 각 값에 대응되는 색상 코드를 식별하고, 상기 식별된 색상 코드에 대응되는 색상을 상기 2D 형태의 임베딩 벡터에 포함된 각 값에 대응되는 영역에 할당하여 상기 2D 형태의 임베딩 벡터를 상기 2D 이미지로 변환하는, 오픈 소스의 라이선스 검증 방법.
  5. 제1항에 있어서,
    상기 기 설정된 기준은,
    함수, 기 설정된 문자 또는 기 설정된 단어를 기초로 설정되고,
    상기 기 설정된 기준에 따라 분할하는 단계는,
    상기 검증 대상 소프트웨어의 소스 코드에 포함된 함수, 상기 함수에 포함된 기 설정된 문자 또는 상기 함수에 포함된 기 설정된 단어를 기준으로 상기 검증 대상 소프트웨어의 소스 코드를 분할하는, 오픈 소스의 라이선스 검증 방법.
  6. 제1항에 있어서,
    상기 임베딩 벡터는 기 설정된 길이로 설정되고,
    상기 임베딩 벡터로 변환하는 단계는,
    상기 변환된 임베딩 벡터의 길이가 상기 기 설정된 길이보다 짧으면, 더미 값을 추가하여 상기 기 설정된 길이의 임베딩 벡터로 변환하는, 오픈 소스의 라이선스 검증 방법.
  7. 제1항에 있어서,
    상기 2D 형태의 임베딩 벡터는 기 설정된 개수의 행을 포함하고,
    상기 2D 형태의 임베딩 벡터를 생성하는 단계는,
    상기 변환된 임베딩 벡터의 개수가 상기 기 설정된 개수의 행보다 적으면, 나머지 행을 더미 행으로 적재하여 상기 2D 형태의 임베딩 벡터를 생성하는, 오픈 소스의 라이선스 검증 방법.
  8. 제1항에 있어서,
    상기 인공 지능 모델은,
    CNN, GNN, RNN, U-net, LSTM 또는 MLP 기반의 모델인, 오픈 소스의 라이선스 검증 방법.
  9. 제1항에 있어서,
    라이선스 검증을 위한 인공 지능 모델을 학습하는 단계;를 더 포함하는 오픈 소스의 라이선스 검증 방법.
  10. 제9항에 있어서,
    상기 라이선스 검증을 위한 인공 지능 모델을 학습하는 단계는,
    상기 오픈 소스의 소스 코드를 기 설정된 기준에 따라 분할하는 단계;
    상기 분할된 오픈 소스의 소스 코드의 부분 각각을 시퀀스 형태의 학습용 임베딩 벡터로 변환하는 단계;
    상기 변환된 시퀀스 형태의 학습용 임베딩 벡터 각각을 적재하여 2D 형태의 학습용 임베딩 벡터를 생성하고, 상기 라이선스 검증을 위한 인공 지능 모델에 입력하는 단계; 및
    상기 2D 형태의 학습용 임베딩 벡터에 기초하여 상기 오픈 소스의 소스 코드에 대응되는 정보를 출력하도록 상기 라이선스 검증을 위한 인공 지능 모델을 학습하는 단계;를 포함하는 오픈 소스의 라이선스 검증 방법.
  11. 입력 인터페이스;
    메모리; 및
    프로세서;를 포함하고,
    상기 프로세서는,
    상기 입력 인터페이스를 통해 검증 대상 소프트웨어의 소스 코드를 입력받고,
    상기 검증 대상 소프트웨어의 소스 코드를 기 설정된 기준에 따라 분할하며,
    상기 분할된 소스 코드의 부분 각각을 시퀀스 형태의 임베딩 벡터로 변환하고,
    상기 변환된 시퀀스 형태의 임베딩 벡터 각각을 적재하여 2D 형태의 임베딩 벡터를 생성하고, 학습된 인공 지능 모델에 입력하며,
    상기 학습된 인공 지능 모델을 이용하여 상기 소스 코드에 대응되는 오픈 소스와 관련된 정보를 출력하는, 전자 장치.
  12. 제11항에 있어서,
    상기 프로세서는,
    상기 학습된 인공 지능 모델을 이용하여 식별된 상기 오픈 소스의 라이선스 정보 및 상기 오픈 소스의 소스 코드에 대응되는 상기 검증 대상 소프트웨어의 소스 코드와 관련된 정보 중 적어도 하나의 정보를 출력하는, 전자 장치.
  13. 제11항에 있어서,
    상기 프로세서는,
    상기 생성된 2D 형태의 임베딩 벡터를 2D 이미지로 변환하고, 상기 2D 이미지를 인공 지능 모델에 입력하여 라이선스 검증을 위한 인공 지능 모델을 학습하는, 전자 장치.
  14. 제13항에 있어서,
    상기 프로세서는,
    상기 2D 형태의 임베딩 벡터에 포함된 각 값에 대응되는 색상 코드를 식별하고, 상기 식별된 색상 코드에 대응되는 색상을 상기 2D 형태의 임베딩 벡터에 포함된 각 값에 대응되는 영역에 할당하여 상기 2D 형태의 임베딩 벡터를 상기 2D 이미지로 변환하는, 전자 장치.
  15. 제11항에 있어서,
    상기 기 설정된 기준은,
    함수, 기 설정된 문자 또는 기 설정된 단어를 기초로 설정되고,
    상기 프로세서는,
    상기 검증 대상 소프트웨어의 소스 코드에 포함된 함수, 상기 함수에 포함된 기 설정된 문자 또는 상기 함수에 포함된 기 설정된 단어를 기준으로 상기 검증 대상 소프트웨어의 소스 코드를 분할하는, 전자 장치.
PCT/KR2023/002942 2022-04-15 2023-03-03 오픈 소스 라이선스를 검증하는 전자 장치 및 방법 WO2023200114A1 (ko)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
KR10-2022-0046844 2022-04-15
KR1020220046844A KR20230147908A (ko) 2022-04-15 2022-04-15 오픈 소스 라이선스를 검증하는 전자 장치 및 방법

Publications (1)

Publication Number Publication Date
WO2023200114A1 true WO2023200114A1 (ko) 2023-10-19

Family

ID=88329810

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/KR2023/002942 WO2023200114A1 (ko) 2022-04-15 2023-03-03 오픈 소스 라이선스를 검증하는 전자 장치 및 방법

Country Status (2)

Country Link
KR (1) KR20230147908A (ko)
WO (1) WO2023200114A1 (ko)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200249918A1 (en) * 2019-02-02 2020-08-06 Microsoft Technology Licensing, Llc. Deep learning enhanced code completion system
KR20200096766A (ko) * 2018-01-04 2020-08-13 라인플러스 주식회사 오픈소스 소프트웨어의 라이선스를 검증하는 방법 및 시스템
US20200349052A1 (en) * 2019-05-03 2020-11-05 International Business Machines Corporation Representing source code in vector space to detect errors
US20210232376A1 (en) * 2018-06-05 2021-07-29 Beihang University Vectorized representation method of software source code
WO2022023385A1 (en) * 2020-07-28 2022-02-03 Deepmind Technologies Limited Training action selection neural networks using auxiliary tasks of controlling observation embeddings

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20200096766A (ko) * 2018-01-04 2020-08-13 라인플러스 주식회사 오픈소스 소프트웨어의 라이선스를 검증하는 방법 및 시스템
US20210232376A1 (en) * 2018-06-05 2021-07-29 Beihang University Vectorized representation method of software source code
US20200249918A1 (en) * 2019-02-02 2020-08-06 Microsoft Technology Licensing, Llc. Deep learning enhanced code completion system
US20200349052A1 (en) * 2019-05-03 2020-11-05 International Business Machines Corporation Representing source code in vector space to detect errors
WO2022023385A1 (en) * 2020-07-28 2022-02-03 Deepmind Technologies Limited Training action selection neural networks using auxiliary tasks of controlling observation embeddings

Also Published As

Publication number Publication date
KR20230147908A (ko) 2023-10-24

Similar Documents

Publication Publication Date Title
WO2018217019A1 (ko) 신경망 학습 기반의 변종 악성 코드를 탐지하기 위한 장치, 이를 위한 방법 및 이 방법을 수행하기 위한 프로그램이 기록된 컴퓨터 판독 가능한 기록매체
WO2021261696A1 (en) Visual object instance segmentation using foreground-specialized model imitation
WO2021029523A1 (en) Techniques for learning effective musical features for generative and retrieval-based applications
WO2020262800A1 (en) System and method for automating natural language understanding (nlu) in skill development
WO2022131497A1 (ko) 이미지 생성을 위한 학습 장치 및 방법과 이미지 생성 장치 및 방법
EP3984022A1 (en) System and method for natural language understanding
WO2020017890A1 (en) System and method for 3d association of detected objects
WO2022059969A1 (ko) 심전도 데이터 분류를 위한 심층 신경망 사전 학습 방법
WO2022097927A1 (en) Method of live video event detection based on natural language queries, and an apparatus for the same
WO2020231005A1 (ko) 영상 처리 장치 및 그 동작방법
WO2022197136A1 (en) System and method for enhancing machine learning model for audio/video understanding using gated multi-level attention and temporal adversarial training
WO2023229305A1 (en) System and method for context insertion for contrastive siamese network training
WO2023200114A1 (ko) 오픈 소스 라이선스를 검증하는 전자 장치 및 방법
WO2022191366A1 (ko) 전자 장치 및 그 제어 방법
WO2022191424A1 (ko) 전자 장치 및 그 제어 방법
WO2024014706A1 (ko) 화질 개선을 수행하는 신경망 모델을 학습시키는 전자 장치 및 그 제어 방법
WO2022139327A1 (en) Method and apparatus for detecting unsupported utterances in natural language understanding
WO2019225875A1 (ko) 재고 추적 방법 및 장치
WO2023058969A1 (en) Machine learning model compression using weighted low-rank factorization
EP3997625A1 (en) Electronic apparatus and method for controlling thereof
WO2016021829A1 (ko) 동작 인식 방법 및 동작 인식 장치
WO2021045434A1 (ko) 전자 장치 및 이의 제어 방법
WO2024071995A1 (en) System and method for efficient language model editing using contextual prompt generator
WO2023128660A1 (ko) 검색을 수행하기 위한 전자 장치 및 그 제어 방법
WO2023219267A1 (en) System and method for accent-agnostic frame-level wake word detection

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 23788468

Country of ref document: EP

Kind code of ref document: A1