Method and device for identifying tampering of software license, storage medium and product
By segmenting the sequences in the software license text, extracting feature characters, and using recurrent neural network models to identify tampering, and adjusting the model weights in combination with the permutation feature importance method, the problem of insufficient recognition efficiency and accuracy of software license tampering in the prior art is solved, and efficient and accurate automatic recognition effect is achieved.
Patent Information
- Application Number
- CN202411618489.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-13
- Publication Date
- 2025-03-14
AI Technical Summary
The prior art is difficult to efficiently and accurately identify whether software licenses have been tampered with, resulting in high false alarm rates and missed alarm rates, which may in turn cause legal issues.
By splitting multiple sequences from the license text corresponding to the software license to be identified, text features are extracted, license feature characters are obtained, and the trained recurrent neural network model is used to identify whether these feature characters have been tampered with, and the model weight is adjusted in combination with the permutation feature importance method until the model converges.
It realizes the rapid and accurate automatic identification of whether the software license has been tampered with, reduces the false alarm rate and missed alarm rate, and improves the efficiency and accuracy of identification.
Smart Images

Figure CN119622669A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of network technology and security, and in particular to a method, device, storage medium and product for identifying that a software license has been tampered with. Background Art
[0002] In order to cope with increasingly fierce market competition, such as shortening new product cycles and pursuing perfect technological innovation requirements, more and more companies often introduce a large number of open source components during the development process.
[0003] In order to avoid legal risks caused by license violations, the security and compliance of the open source component licenses used must be ensured during product development. However, the problem of software license tampering has always been a major challenge in the field of software security.
[0004] Traditional license tampering detection methods often rely on manual review, simple file comparison or detection methods based on specific rules. These methods are insufficient in efficiency and accuracy, resulting in high false positive and false negative rates, which can easily lead to legal issues in the future.
[0005] In view of this, how to efficiently and accurately identify whether a software license has been tampered with has become a technical problem that needs to be solved urgently. Summary of the invention
[0006] The present invention provides a method, device, storage medium and product for identifying whether a software license has been tampered with, so as to solve the technical problem in the prior art that it is impossible to efficiently and accurately identify whether a software license has been tampered with.
[0007] In the first aspect, in order to solve the above technical problems, an embodiment of the present invention provides a method for identifying that a software license has been tampered with. The technical solution of the identification method is as follows:
[0008] Slicing a plurality of sequences from the license text corresponding to the software license to be identified; wherein the sequences are used to represent information related to the license scope of the software license;
[0009] Extracting text features from each sequence to obtain corresponding license feature characters; wherein the license feature characters are used to represent key characters related to the license scope;
[0010] Use a trained recurrent neural network model to identify whether the license characteristic characters corresponding to the multiple sequences have been tampered with, and obtain an identification result of whether the software license has been tampered with; wherein, during the iterative training process, the trained neural network model predicts the weight adjustment gradients of the parameters corresponding to the license characteristic characters in the recurrent neural network model based on the permutation feature importance method, and adjusts the weights of the corresponding parameters based on the weight adjustment gradients of the parameters until the latest adjusted recurrent neural network model converges.
[0011] In a possible implementation manner, before using the trained recurrent neural network model to identify whether the license characteristic characters corresponding to the plurality of sequences have been tampered with, the method further includes:
[0012] Build an initial recurrent neural network model;
[0013] Iteratively training the initial recurrent neural network model until the accuracy of the trained initial neural network model reaches a preset value, thereby obtaining the trained recurrent neural network model;
[0014] Among them, for any training sample, if the recognition result output by the initial recurrent neural network model after any iterative training is different from the actual result, the permutation feature importance method is used to predict the weight adjustment gradient of each parameter in the current initial recurrent neural network model, and the weight of each parameter in the initial recurrent neural network model is adjusted according to the weight adjustment gradient of each parameter.
[0015] A possible implementation method for constructing an initial recurrent neural network model includes:
[0016] A many-to-one structure is adopted to construct an input layer including multiple input terminals, multiple hidden layers connected in series, and an output layer; the multiple hidden layers correspond one-to-one to the license characteristic characters corresponding to each of the multiple sequences;
[0017] Each hidden layer is connected to an input terminal, and the output terminal of the last hidden layer is connected to the output layer; the hidden layer is used to predict the license characteristic characters received by the subsequent hidden layer according to the license characteristic characters received from the connected input terminal and the information output by the previous hidden layer;
[0018] Each hidden layer is provided with a loss function and an adjustment gradient of the loss function, wherein the loss function is used to characterize the difference between the prediction result of the hidden layer and the characteristic characters of the license received by the subsequent hidden layer.
[0019] A possible implementation method uses the permutation feature importance method to predict the weight adjustment gradient of each parameter in the current recurrent neural network model, including:
[0020] Calculate the error and loss function between the recognition result output by the current recurrent neural network model and the true result;
[0021] The error is back-propagated from the output layer to the hidden layer until it reaches the input layer; wherein, in the process of back-propagation, the error gradient of each hidden layer is calculated by the derivative chain rule, and the weights of the parameters in the corresponding hidden layer and the gradient of the partial derivative with respect to the loss function are calculated according to the error gradient;
[0022] According to the obtained gradients of all parameters, the weight and partial derivative of each parameter are updated using the permutation feature importance method until the loss function converges to obtain the weight adjustment gradient of each parameter.
[0023] A possible implementation method is to extract text features from each sequence to obtain corresponding license feature characters, including:
[0024] Natural language processing technology is used to extract text features from each sequence to obtain the license feature characters.
[0025] In a possible implementation manner, the information related to the scope of permission of the software license includes:
[0026] The name, copyright ownership, and legal terms in the software license.
[0027] In a second aspect, an embodiment of the present invention provides a device for identifying that a software license has been tampered with, comprising:
[0028] A segmentation unit, used to segment a plurality of sequences from the license text corresponding to the software license to be identified; wherein the sequences are used to represent information related to the license scope of the software license;
[0029] An extraction unit, used to extract text features from each sequence to obtain corresponding license feature characters; wherein the license feature characters are used to represent key characters related to the license scope;
[0030] The identification unit is used to use a trained recurrent neural network model to identify whether the license characteristic characters corresponding to the multiple sequences have been tampered with, and obtain an identification result of whether the software license has been tampered with; wherein, during the iterative training process, the trained neural network model predicts the weight adjustment gradient of the parameters corresponding to the license characteristic characters in the recurrent neural network model based on the permutation feature importance method, and adjusts the weights of the corresponding parameters based on the weight adjustment gradients of the parameters until the latest adjusted recurrent neural network model converges.
[0031] In a possible implementation manner, the identification device further includes a construction unit, and the construction unit is used to:
[0032] Before using the trained recurrent neural network model to identify whether the license characteristic characters corresponding to the plurality of sequences have been tampered with, an initial recurrent neural network model is constructed;
[0033] Iteratively training the initial recurrent neural network model until the accuracy of the trained initial neural network model reaches a preset value, thereby obtaining the trained recurrent neural network model;
[0034] Among them, for any training sample, if the recognition result output by the initial recurrent neural network model after any iterative training is different from the actual result, the permutation feature importance method is used to predict the weight adjustment gradient of each parameter in the current initial recurrent neural network model, and the weight of each parameter in the initial recurrent neural network model is adjusted according to the weight adjustment gradient of each parameter.
[0035] In a possible implementation manner, the construction unit is further used for:
[0036] A many-to-one structure is adopted to construct an input layer including multiple input terminals, multiple hidden layers connected in series, and an output layer; the multiple hidden layers correspond one-to-one to the license characteristic characters corresponding to each of the multiple sequences;
[0037] Each hidden layer is connected to an input terminal, and the output terminal of the last hidden layer is connected to the output layer; the hidden layer is used to predict the license characteristic characters received by the subsequent hidden layer according to the license characteristic characters received from the connected input terminal and the information output by the previous hidden layer;
[0038] Each hidden layer is provided with a loss function and an adjustment gradient of the loss function, wherein the loss function is used to characterize the difference between the prediction result of the hidden layer and the characteristic characters of the license received by the subsequent hidden layer.
[0039] In a possible implementation manner, the construction unit is further used for:
[0040] Calculate the error and loss function between the recognition result output by the current recurrent neural network model and the true result;
[0041] The error is back-propagated from the output layer to the hidden layer until it reaches the input layer; wherein, in the process of back-propagation, the error gradient of each hidden layer is calculated by the derivative chain rule, and the weights of the parameters in the corresponding hidden layer and the gradient of the partial derivative with respect to the loss function are calculated according to the error gradient;
[0042] According to the obtained gradients of all parameters, the weight and partial derivative of each parameter are updated using the permutation feature importance method until the loss function converges to obtain the weight adjustment gradient of each parameter.
[0043] In a possible implementation manner, the extraction unit is further used for:
[0044] Natural language processing technology is used to extract text features from each sequence to obtain the license feature characters.
[0045] In a possible implementation manner, the information related to the scope of permission of the software license includes:
[0046] The name, copyright ownership, and legal terms in the software license.
[0047] In a third aspect, an embodiment of the present invention further provides a device for identifying that a software license has been tampered with, comprising:
[0048] at least one processor, and
[0049] a memory coupled to the at least one processor;
[0050] The memory stores instructions that can be executed by the at least one processor, and the at least one processor executes the method as described in the first aspect above by executing the instructions stored in the memory.
[0051] In a fourth aspect, an embodiment of the present invention further provides a readable storage medium, including:
[0052] Memory,
[0053] The memory is used to store instructions. When the instructions are executed by the processor, the device including the readable storage medium performs the method described in the first aspect above.
[0054] In a fifth aspect, an embodiment of the present invention further provides a computer program product, comprising a program code. When a computer runs the computer program, the program code executes the identification method as described in the first aspect.
[0055] Through the technical solutions in one or more of the above embodiments of the embodiments of the present invention, the embodiments of the present invention have at least the following technical effects:
[0056] In the embodiment provided by the present invention, multiple sequences are segmented from the license text corresponding to the software license to be identified; wherein the sequence is used to represent information related to the license scope of the software license; text features are extracted from each sequence to obtain corresponding license feature characters; wherein the license feature characters are used to represent key characters related to the license scope; a trained recurrent neural network model is used to identify whether the license feature characters corresponding to the multiple sequences have been tampered with, and an identification result of whether the software license has been tampered with is obtained; wherein, during the iterative training process, the trained neural network model predicts the weight adjustment gradient of the parameters corresponding to the license feature characters in the recurrent neural network model based on the permutation feature importance method, and adjusts the weights of the corresponding parameters based on the weight adjustment gradient of each parameter until the latest adjusted recurrent neural network model converges, so as to quickly and accurately automatically identify whether the software license has been tampered with. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] Figure 1 A flowchart of a method for identifying a tampered software license provided by an embodiment of the present invention;
[0058] Figure 2 A schematic diagram of the structure of an initial recurrent neural network model provided by an embodiment of the present invention;
[0059] Figure 3 A schematic diagram of the structure of a device for identifying a tampered software license provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0060] The embodiments of the present invention provide a method, device, storage medium and product for identifying whether a software license has been tampered with, so as to solve the technical problem in the prior art that it is impossible to efficiently and accurately identify whether a software license has been tampered with.
[0061] In order to better understand the above technical scheme, the technical scheme of the present invention is described in detail below through the accompanying drawings and specific embodiments. It should be understood that the embodiments of the present invention and the specific features in the embodiments are detailed descriptions of the technical scheme of the present invention, rather than limitations on the technical scheme of the present invention. In the absence of conflict, the embodiments of the present invention and the technical features in the embodiments can be combined with each other.
[0062] Please refer to Figure 1 , an embodiment of the present invention provides a method for identifying that a software license has been tampered with, and the processing process of the method is as follows.
[0063] Step 101: Segment a plurality of sequences from the license text corresponding to the software license to be identified; wherein the sequence is used to represent information related to the permission scope of the software license;
[0064] A software license is a text file that is designed to protect the intellectual property rights of software developers and to limit any claims that may be made against them as a result of the use of the license. In the present invention, the permission text of a software license is the entire text content of the software license. In addition, the software license in the present invention can be a software license for a component or a software license for software, without specific limitation.
[0065] Software licenses include proprietary licenses and open source licenses.
[0066] Proprietary licenses do not provide permission for code modification or reuse and usually provide only operating code, not source code. Proprietary software licenses often include provisions prohibiting the licensee from "reverse engineering" the object code in order to obtain the source code.
[0067] Open source licenses give users the right to modify and reuse software code, provide the actual source code to the software product. This type of open source license gives users the right to modify the software's functionality and the freedom to inspect the software code.
[0068] The contents of a software license usually include:
[0069] User rights and responsibilities: defines the rights and responsibilities of users when using the software, including the operations that users can perform (such as installation, operation, copying, etc.) and the regulations and restrictions that users need to comply with.
[0070] Scope of use and restrictions: The license specifies the scope of use of the software, including the functions, devices, operating systems, etc. Some licenses may limit use to specific hardware or operating systems, or restrict specific scenarios of use.
[0071] Copyright and intellectual property protection: Licenses usually contain copyright information to protect the intellectual property of the software. Developers can use the terms of the license to ensure that their software is not illegally copied, distributed, or modified.
[0072] Compatibility and Updates: Licenses may contain terms regarding software updates, upgrades, and compatibility. Some licenses may require users to continue to comply with the original terms when using the new version, or provide specific compatibility support.
[0073] Legal constraints: The license also includes legal constraints to ensure that users do not infringe on the intellectual property rights of third parties or violate relevant laws and regulations when using the software.
[0074] In this embodiment, the information related to the scope of permission of the software license includes the name of the software or component, copyright ownership, legal terms, etc., and such information is usually located in different locations in the software license.
[0075] The above information is segmented from the license text corresponding to the software license, and each information constitutes a sequence, that is, it constitutes multiple sequences segmented from the license text corresponding to the software license in the present invention. In this way, the long text corresponding to the software license can be segmented into multiple shorter sequences related to the permission scope of the software license, which is convenient for subsequent recognition by the model.
[0076] After the multiple sequences are divided, step 102 may be performed.
[0077] Step 102: extracting text features from each sequence to obtain corresponding license feature characters; wherein the license feature characters are used to represent key characters related to the license scope;
[0078] For example, the copyright ownership sequence usually contains key characters related to the scope of the license. Natural Language Processing (NLP) technology can be used to extract the corresponding key characters from the sequence as the license feature characters corresponding to the sequence. Of course, a data dictionary can also be pre-built to store various commonly used key characters related to the scope of the license. The key characters in the data dictionary are matched with the characters in the sequence to determine the license feature characters corresponding to the sequence.
[0079] After obtaining the license characteristic characters corresponding to each sequence, step 103 may be executed.
[0080] Step 103: Use the trained recurrent neural network model to identify whether the license characteristic characters corresponding to multiple sequences have been tampered with, and obtain an identification result of whether the software license has been tampered with; wherein, during the iterative training process, the trained neural network model predicts the weight adjustment gradient of the parameters corresponding to the license characteristic characters in the recurrent neural network model based on the permutation feature importance method, and adjusts the weights of the corresponding parameters based on the weight adjustment gradients of each parameter until the latest adjusted recurrent neural network model converges.
[0081] In the embodiment provided by the present invention, multiple sequences are segmented from the license text corresponding to the software license to be identified; wherein the sequence is used to represent information related to the license scope of the software license; text features are extracted from each sequence to obtain corresponding license feature characters; wherein the license feature characters are used to represent key characters related to the license scope; a trained recurrent neural network model is used to identify whether the license feature characters corresponding to the multiple sequences have been tampered with, and an identification result of whether the software license has been tampered with is obtained; wherein, during the iterative training process, the trained neural network model predicts the weight adjustment gradient of the parameters corresponding to the license feature characters in the recurrent neural network model based on the permutation feature importance method, and adjusts the weights of the corresponding parameters based on the weight adjustment gradient of each parameter until the latest adjusted recurrent neural network model converges, so as to quickly and accurately automatically identify whether the software license has been tampered with.
[0082] Before using the trained recurrent neural network model to identify whether the license characteristic characters corresponding to multiple sequences have been tampered with, it is necessary to first form a trained recurrent neural network model, which can be implemented in the following ways:
[0083] Build an initial recurrent neural network model;
[0084] Iteratively training the initial recurrent neural network model until the accuracy of the trained initial neural network model reaches a preset value, thereby obtaining a trained recurrent neural network model;
[0085] Among them, for any training sample, if the recognition result output by the initial recurrent neural network model after any iterative training is different from the actual result, the permutation feature importance method is used to predict the weight adjustment gradient of each parameter in the current initial recurrent neural network model, and the weights of each parameter in the initial recurrent neural network model are adjusted according to the weight adjustment gradient of the current parameters.
[0086] The sample set for training the initial recurrent neural network model can be various sample software licenses collected in advance, and each sample software license is processed using the above steps 101-102 to obtain multiple license feature characters of each sample license, where the multiple license characters corresponding to a sample license are a sample data in the sample set.
[0087] When training the initial recurrent neural network model, the sample data in the sample set is used to iteratively train the initial recurrent neural network model. In each iteration, the currently used sample data is input into the initial recurrent neural network model after the previous iteration to identify whether the corresponding sample license has been tampered with, and the recognition result is compared with the corresponding true result. If the recognition result is inconsistent with the true result, the permuted feature importance method is used to predict the weight adjustment gradient of each parameter in the initial recurrent neural network model after the current iteration, and the weight of each parameter in the initial recurrent neural network model after the current iteration is adjusted according to the weight adjustment gradient of each parameter, and then enter the next iterative cycle process; if the recognition result is the same as the true result, directly enter the next iterative cycle process.
[0088] When the accuracy of the trained initial recurrent neural network model in identifying the sample software license reaches a preset value, the training is stopped, and a trained recurrent neural network model is obtained.
[0089] In some embodiments, constructing an initial recurrent neural network model may be achieved by:
[0090] A many-to-one structure is adopted to construct an input layer including multiple input terminals, multiple hidden layers connected in series, and an output layer; the multiple hidden layers correspond one-to-one to the license feature characters corresponding to the multiple sequences;
[0091] Each hidden layer is connected to an input terminal, and the output terminal of the last hidden layer is connected to the output layer; the hidden layer is used to predict the license characteristic characters received by the subsequent hidden layer according to the license characteristic characters received from the connected input terminal and the information output by the previous hidden layer;
[0092] Each hidden layer is provided with a loss function and an adjustment gradient of the loss function, and the loss function is used to characterize the difference between the prediction result of the hidden layer and the characteristic characters of the license received by the subsequent hidden layer.
[0093] In some embodiments, sublicense features include:
[0094] Features corresponding to the name in the software license, features corresponding to copyright ownership, and features corresponding to legal terms.
[0095] See also Figure 2 A schematic diagram of the structure of an initial recurrent neural network model provided in an embodiment of the present invention.
[0096] exist Figure 2 In, x 1 ~x n represents the n input terminals in the input layer, where n is greater than 1; h 1 ~hn represents n hidden layers, and n hidden layers correspond to n input terminals one by one, and Y represents the output layer. The license characteristic characters corresponding to each sequence obtained in step 102 are input from one of the input terminals, and the multiple license characteristic characters corresponding to multiple sequences corresponding to the same software license are input in sequence from multiple input terminals of the input layer; Figure 2 The hidden layer h in 2 For example, the hidden layer h 2 According to the previous hidden layer h 1 The output information (i.e. the previous hidden layer h 1 The predicted result) and the input terminal x connected 2 The license character received is predicted in the following hidden layer h 3 From the input terminal x connected 3 The received license feature characters can determine the working process of other hidden layers by analogy. After the last hidden layer outputs the prediction result, the output layer can determine whether the software license has been changed based on the prediction results of each hidden layer, and then output the recognition result.
[0097] In some embodiments, using the permutation feature importance method to predict the weight adjustment gradient of each parameter in the current recurrent neural network model can be achieved by:
[0098] Calculate the error and loss function between the recognition result output by the current recurrent neural network model and the actual result;
[0099] The error is back-propagated from the output layer to the hidden layer until it reaches the input layer. In the process of back-propagation, the error gradient of each hidden layer is calculated by the derivative chain rule, and the weights of the parameters in the corresponding hidden layer and the gradient of the partial derivative with respect to the loss function are calculated based on the error gradient.
[0100] According to the obtained gradients of all parameters, the permutation feature importance method is used to update the weight and partial derivative of each parameter until the loss function converges, and the weight adjustment gradient of each parameter is obtained.
[0101] In the embodiment provided by the present invention, in the process of training a recurrent neural network model, when the reverse recognition result is inconsistent with the true result, the error and loss function between the recognition result output by the current recurrent neural network model and the true result are calculated; the error is back-propagated from the output layer to the hidden layer until it is propagated to the input layer; wherein, in the process of back-propagation, the error gradient of each hidden layer is calculated by the derivative chain rule, and the weights of each parameter in the corresponding hidden layer and the gradient of the partial derivative with respect to the loss function are calculated according to the error gradient; according to the obtained gradients of all parameters, the weights and partial derivatives of each parameter are updated using the permutation feature importance method until the loss function converges, and the weight adjustment gradient of each parameter is obtained, so that the loss function of the recurrent neural network model can be explained by the permutation feature importance method, the model transparency is increased, and the weights of the parameters in the recurrent neural network model are adjusted quickly and accurately according to the obtained weight adjustment gradient, thereby improving the training efficiency and recognition accuracy of the recurrent neural network model.
[0102] Based on the same inventive concept, an embodiment of the present invention provides a device for identifying that a software license has been tampered with. The specific implementation of the method for identifying that a software license has been tampered with by the identification device can be found in the description of the method embodiment part, and the repeated parts will not be repeated. Figure 3 , the identification device comprises:
[0103] The segmentation unit 301 is used to segment a plurality of sequences from the license text corresponding to the software license to be identified; wherein the sequences are used to represent information related to the license scope of the software license;
[0104] The extraction unit 302 is used to extract text features from each sequence to obtain corresponding license feature characters; wherein the license feature characters are used to represent key characters related to the license scope;
[0105] The identification unit 303 is used to use a trained recurrent neural network model to identify whether the license characteristic characters corresponding to the multiple sequences have been tampered with, and obtain an identification result of whether the software license has been tampered with; wherein, during the iterative training process, the trained neural network model predicts the weight adjustment gradient of the parameters corresponding to the license characteristic characters in the recurrent neural network model based on the permutation feature importance method, and adjusts the weights of the corresponding parameters based on the weight adjustment gradients of the parameters until the latest adjusted recurrent neural network model converges.
[0106] In a possible implementation manner, the identification device further includes a construction unit 304, and the construction unit 304 is used to:
[0107] Before using the trained recurrent neural network model to identify whether the license characteristic characters corresponding to the plurality of sequences have been tampered with, an initial recurrent neural network model is constructed;
[0108] Iteratively training the initial recurrent neural network model until the accuracy of the trained initial neural network model reaches a preset value, thereby obtaining the trained recurrent neural network model;
[0109] Among them, for any training sample, if the recognition result output by the initial recurrent neural network model after any iterative training is different from the actual result, the permutation feature importance method is used to predict the weight adjustment gradient of each parameter in the current initial recurrent neural network model, and the weight of each parameter in the initial recurrent neural network model is adjusted according to the weight adjustment gradient of each parameter.
[0110] In a possible implementation manner, the construction unit 304 is further configured to:
[0111] A many-to-one structure is adopted to construct an input layer including multiple input terminals, multiple hidden layers connected in series, and an output layer; the multiple hidden layers correspond one-to-one to the license characteristic characters corresponding to each of the multiple sequences;
[0112] Each hidden layer is connected to an input terminal, and the output terminal of the last hidden layer is connected to the output layer; the hidden layer is used to predict the license characteristic characters received by the subsequent hidden layer according to the license characteristic characters received from the connected input terminal and the information output by the previous hidden layer;
[0113] Each hidden layer is provided with a loss function and an adjustment gradient of the loss function, wherein the loss function is used to characterize the difference between the prediction result of the hidden layer and the characteristic characters of the license received by the subsequent hidden layer.
[0114] In a possible implementation manner, the construction unit 304 is further configured to:
[0115] Calculate the error and loss function between the recognition result output by the current recurrent neural network model and the true result;
[0116] The error is back-propagated from the output layer to the hidden layer until it reaches the input layer; wherein, in the process of back-propagation, the error gradient of each hidden layer is calculated by the derivative chain rule, and the weights of the parameters in the corresponding hidden layer and the gradient of the partial derivative with respect to the loss function are calculated according to the error gradient;
[0117] According to the obtained gradients of all parameters, the weight and partial derivative of each parameter are updated using the permutation feature importance method until the loss function converges to obtain the weight adjustment gradient of each parameter.
[0118] In a possible implementation manner, the extraction unit 302 is further configured to:
[0119] Natural language processing technology is used to extract text features from each sequence to obtain the license feature characters.
[0120] In a possible implementation manner, the information related to the scope of permission of the software license includes:
[0121] The name, copyright ownership, and legal terms in the software license.
[0122] It should be noted that the division of units in the embodiments of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation. In addition, each functional unit in each embodiment of the present application may be integrated into a processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0123] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a processor-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) or a processor (processor) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), disk or optical disk and other media that can store program codes.
[0124] It should be noted here that the above-mentioned device provided in the embodiment of the present invention can implement all the method steps implemented in the above-mentioned method embodiment, and can achieve the same technical effect. The parts and beneficial effects that are the same as the method embodiment in this embodiment will not be described in detail here.
[0125] Based on the same inventive concept, an embodiment of the present invention provides a device for identifying that a software license has been tampered with, comprising: at least one processor, and
[0126] a memory coupled to the at least one processor;
[0127] The memory stores instructions that can be executed by the at least one processor, and the at least one processor executes the above-mentioned identification method by executing the instructions stored in the memory.
[0128] Based on the same inventive concept, an embodiment of the present invention further provides a readable storage medium, including:
[0129] Memory,
[0130] The memory is used to store instructions, and when the instructions are executed by the processor, the device including the readable storage medium performs the identification method as described above.
[0131] The readable storage medium may be any available medium or data storage device that the processor can access, including volatile memory or non-volatile memory, or may include both volatile memory and non-volatile memory. As an example and not limitation, non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory, solid state disk (SSD), magnetic storage (e.g., floppy disk, hard disk, magnetic tape, magneto-optical disc (MO), etc.), optical storage (e.g., CD, DVD, BD, HVD, etc.). Volatile memory may include random access memory (RAM), which may act as an external cache memory. By way of example and not limitation, RAM is available in a variety of forms, such as dynamic random access memory (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced synchronous DRAM (ESDRAM), and synchronous link DRAM (SLDRAM). The memory devices of the disclosed aspects are intended to include, but are not limited to, these and other suitable types of memory.
[0132] Based on the same inventive concept, an embodiment of the present invention further provides a computer program product, including program code. When a computer runs the computer program, the program code executes the identification method as described above.
[0133] Those skilled in the art will appreciate that the embodiments of the present invention may be provided as methods, systems, or program products. Therefore, the embodiments of the present invention may be in the form of complete hardware embodiments, complete software embodiments, or embodiments combining software and hardware. Moreover, the embodiments of the present invention may be in the form of machine program products implemented on one or more readable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer / processor available program codes.
[0134] The embodiments of the present invention are described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0135] These program instructions may also be stored in a readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0136] These program instructions may also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer / processor-implemented process, thereby providing instructions executed on the computer / processor or other programmable device for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0137] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
Claims
1. A method for identifying a tampered software license, characterized in that: include: Slicing a plurality of sequences from the license text corresponding to the software license to be identified; wherein the sequences are used to represent information related to the license scope of the software license; Extracting text features from each sequence to obtain corresponding license feature characters; wherein the license feature characters are used to represent key characters related to the license scope; Use a trained recurrent neural network model to identify whether the license characteristic characters corresponding to the multiple sequences have been tampered with, and obtain an identification result of whether the software license has been tampered with; wherein, during the iterative training process, the trained neural network model predicts the weight adjustment gradients of the parameters corresponding to the license characteristic characters in the recurrent neural network model based on the permutation feature importance method, and adjusts the weights of the corresponding parameters based on the weight adjustment gradients of the parameters until the latest adjusted recurrent neural network model converges.
2. The identification method according to claim 1, characterized in that: Before using the trained recurrent neural network model to identify whether the license characteristic characters corresponding to the plurality of sequences have been tampered with, the method further includes: Build an initial recurrent neural network model; Iteratively training the initial recurrent neural network model until the accuracy of the trained initial neural network model reaches a preset value, thereby obtaining the trained recurrent neural network model; Among them, for any training sample, if the recognition result output by the initial recurrent neural network model after any iterative training is different from the actual result, the permutation feature importance method is used to predict the weight adjustment gradient of each parameter in the current initial recurrent neural network model, and the weight of each parameter in the initial recurrent neural network model is adjusted according to the weight adjustment gradient of each parameter.
3. The identification method according to claim 2, characterized in that: Build an initial recurrent neural network model, including: A many-to-one structure is adopted to construct an input layer including multiple input terminals, multiple hidden layers connected in series, and an output layer; the multiple hidden layers correspond one-to-one to the license characteristic characters corresponding to each of the multiple sequences; Each hidden layer is connected to an input terminal, and the output terminal of the last hidden layer is connected to the output layer; the hidden layer is used to predict the license characteristic characters received by the subsequent hidden layer according to the license characteristic characters received from the connected input terminal and the information output by the previous hidden layer; Each hidden layer is provided with a loss function and an adjustment gradient of the loss function, wherein the loss function is used to characterize the difference between the prediction result of the hidden layer and the characteristic characters of the license received by the subsequent hidden layer.
4. The identification method according to claim 3, characterized in that: Using the permutation feature importance method to predict the weight adjustment gradient of each parameter in the current recurrent neural network model includes: Calculate the error and loss function between the recognition result output by the current recurrent neural network model and the true result; The error is back-propagated from the output layer to the hidden layer until it reaches the input layer; wherein, in the process of back-propagation, the error gradient of each hidden layer is calculated by the derivative chain rule, and the weights of the parameters in the corresponding hidden layer and the gradient of the partial derivative with respect to the loss function are calculated according to the error gradient; According to the obtained gradients of all parameters, the weight and partial derivative of each parameter are updated using the permutation feature importance method until the loss function converges to obtain the weight adjustment gradient of each parameter.
5. The identification method according to any one of claims 1 to 4, characterized in that: Extract text features from each sequence to obtain the corresponding license feature characters, including: Natural language processing technology is used to extract text features from each sequence to obtain the license feature characters.
6. The identification method according to any one of claims 1 to 4, characterized in that: Information related to the scope of the software license, including: The name, copyright ownership, and legal terms in the software license.
7. A device for identifying a tampered software license, characterized in that: include: A segmentation unit, used to segment a plurality of sequences from the license text corresponding to the software license to be identified; wherein the sequences are used to represent information related to the license scope of the software license; An extraction unit, used to extract text features from each sequence to obtain corresponding license feature characters; wherein the license feature characters are used to represent key characters related to the license scope; The identification unit is used to use a trained recurrent neural network model to identify whether the license characteristic characters corresponding to the multiple sequences have been tampered with, and obtain an identification result of whether the software license has been tampered with; wherein, during the iterative training process, the trained neural network model predicts the weight adjustment gradient of the parameters corresponding to the license characteristic characters in the recurrent neural network model based on the permutation feature importance method, and adjusts the weights of the corresponding parameters based on the weight adjustment gradients of the parameters until the latest adjusted recurrent neural network model converges.
8. A device for identifying a tampered software license, characterized in that: include: at least one processor, and a memory coupled to the at least one processor; The memory stores instructions that can be executed by the at least one processor, and the at least one processor executes the identification method according to any one of claims 1 to 6 by executing the instructions stored in the memory.
9. A readable storage medium, characterized in that: Including memory, The memory is used to store instructions. When the instructions are executed by the processor, the device including the readable storage medium performs the identification method according to any one of claims 1 to 6.
10. A computer program product, characterized in that The computer program comprises program codes, and when a computer runs the computer program, the program codes execute the identification method according to any one of claims 1 to 6.