System, verification system and method for generating software code certification authentication credentials

By combining AI semantic and structural fingerprinting technologies with developer signatures and trusted timestamps, a core code DNA package is generated, solving the problem of traditional methods struggling to identify advanced plagiarism and establish code ownership, thus achieving efficient code copyright protection.

CN120611364BActive Publication Date: 2025-11-07BEIJING UNITED TRUST TECH SERVICE CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202511079946.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-08-04
Publication Date
2025-11-07
Estimated Expiration
2045-08-04

AI Technical Summary

Technical Problem

Traditional code plagiarism detection methods struggle to identify sophisticated "reskinned" plagiarism, and the creation time and original ownership of the code are difficult to prove conclusively, impacting the protection of developers' rights.

Method used

AI semantic analysis is used to generate binary semantic fingerprints and structural fingerprints. Combined with developer signatures and trusted timestamps, a code DNA core package is constructed. The timestamp is anchored through a trusted timestamp service platform to form a certificate of ownership and authentication.

Benefits of technology

It improves the accuracy and reliability of identifying advanced plagiarism, provides tamper-proof timestamp evidence, ensures code originality, and protects developers' rights.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120611364B_ABST
    Figure CN120611364B_ABST
Patent Text Reader

Abstract

The application discloses a system, a verification system and a method for generating software code copyright authentication credentials. The system comprises an AI semantic analysis module for analyzing target code using an AI code large model to generate a high-dimensional semantic embedding vector; a semantic fingerprint generation module for hashing the vector to obtain a binary semantic fingerprint; an extraction module for extracting a plurality of structural features from an abstract syntax tree; a structural fingerprint generation module for hashing the plurality of structural features to obtain a structural fingerprint; a core package construction module for constructing a code DNA core package; a signature module for encrypting the core package hash value using a private key; a trusted timestamp acquisition module for obtaining a timestamp authentication hash value by overall hashing, and obtaining a trusted timestamp certificate therefrom; and the code DNA core package, the developer signature and the trusted timestamp certificate jointly serving as the copyright authentication credentials. The application can improve the accuracy of code plagiarism detection and provide reliable copyright protection.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of code copyright protection, and in particular to a system and method for generating software code copyright authentication credentials, a verification system and method for software code copyright authentication credentials. BACKGROUND

[0002] Traditional code plagiarism detection methods, such as those based on text matching or simple hashing, mainly focus on the surface form of the code. Advanced "skin-changing" plagiarism, on the other hand, involves replacing variable names and function names, fine-tuning code logic structures, and rewriting textual descriptions, among other methods. This makes the code significantly different from the original code on the surface, but the core content and essential structure remain unchanged. This makes it difficult for traditional methods to accurately identify such plagiarism, and it fails to meet the growing demand for code copyright protection.

[0003] In addition, during software development, the creation time and originality of the code are often difficult to prove conclusively. Developers may face the problem of code being plagiarized, and due to the lack of effective time markers and tamper-proof evidence, they are unable to effectively prove that their code is original and was created first. This puts developers at a disadvantage in copyright disputes, affecting the enthusiasm and rights protection of code creators. SUMMARY

[0004] In view of the above, the embodiments of the present application provide a system and method for generating software code copyright authentication credentials, and a verification system and method for software code copyright authentication credentials, to solve at least one of the above technical problems.

[0005] In a first aspect, the embodiments of the present application provide a system for generating software code copyright authentication credentials, comprising:

[0006] An AI semantic analysis module for performing semantic analysis on the content of the target code using a pre-trained AI code large model, and generating a high-dimensional semantic embedding vector based on the extracted features;

[0007] A semantic fingerprint generation module for performing hash calculation on the high-dimensional semantic embedding vector to obtain a binary semantic fingerprint of the target code;

[0008] A structural feature extraction module for constructing an abstract syntax tree of the target code using a static code analysis tool, and extracting a plurality of structural features of the target code from the abstract syntax tree;

[0009] A structural fingerprint generation module for arranging and combining the extracted plurality of structural features, and then performing hash calculation to obtain a structural fingerprint of the target code;

[0010] a core package construction module configured to receive a binary semantic fingerprint, a structural fingerprint, a unique identifier, a developer digital identity, and key commit metadata of the target code, and construct a code DNA core package based on the received data;

[0011] a private key signature module configured to encrypt a hash value of the code DNA core package using a private key of the developer, and take the encrypted hash value as a developer signature;

[0012] a trusted timestamp acquisition module configured to hash the code DNA core package and the developer signature as a whole to obtain a timestamp authentication hash value, and send the timestamp authentication hash value to a trusted timestamp service platform and receive a trusted timestamp certificate returned by the trusted timestamp service platform;

[0013] an authentication module configured to take the code DNA core package, the developer signature, and the trusted timestamp certificate as an authentication credential of the target code.

[0014] According to some embodiments of the present application, the AI semantic analysis module is specifically configured to identify variable names, function names, and operator elements in the target code using an AI code large model, and perform feature extraction on the elements; and output a high-dimensional semantic embedding vector by performing weighted summation or nonlinear transformation on the features of the elements, wherein the high-dimensional semantic embedding vector is a multi-dimensional array.

[0015] According to some embodiments of the present application, the plurality of structural features of the target code include cyclomatic complexity, a topological digest of a function call graph, a feature vector of a module dependency graph, and a structural pattern occurrence frequency of a specific design pattern.

[0016] According to some embodiments of the present application, the structural fingerprint generation module is specifically configured to arrange the plurality of structural features in a preset arrangement order; then perform normalization processing on the arranged plurality of structural features to map feature values of the plurality of structural features in different ranges to a unified range; perform weighted splicing combination processing or small hash network combination processing on the normalized plurality of structural features to obtain a new feature vector through combination; and perform hash calculation on the new feature vector to obtain the structural fingerprint of the target code.

[0017] In a second aspect, the embodiments of the present application provide a verification system for a software code authentication credential, the software code authentication credential including a forged software code authentication credential or a software code authentication credential generated by the system for generating a software code authentication credential provided in the first aspect, and the verification system for the software code authentication credential includes:

[0018] The right authentication credential obtaining module is configured to obtain a first right authentication credential of the software code to be verified, the first right authentication credential including a first code DNA core package, a first developer signature, and a first trusted timestamp certificate;

[0019] The query module is configured to query, from the database, whether there is a second right authentication credential corresponding to the first right authentication credential, the second right authentication credential being a right-verified second right authentication credential; if there is, the subsequent module is called to further verify the first right authentication credential; if there is not, a verification failure is output; the second right authentication credential includes a second code DNA core package, a second developer signature, and a second trusted timestamp certificate;

[0020] The code DNA core package verification module is configured to perform consistency verification on a signature chain, a time, and a hash value in the first code DNA core package based on the second code DNA core package and a public key associated with the second code DNA core package.

[0021] The developer signature verification module is configured to decrypt the first developer signature by using a public key of the developer, and compare a result after the decryption with a hash value of the second code DNA core package.

[0022] The trusted timestamp certificate verification module is configured to send the first trusted timestamp certificate to a trusted timestamp service platform, and receive a verification result of the first trusted timestamp certificate returned by the trusted timestamp service platform.

[0023] According to some embodiments of the present application, the code DNA core package verification module is specifically configured to start from a starting point of the signature chain, verify each signature in sequence by using a corresponding public key until the entire signature chain is verified; compare time points of different operations recorded in the first code DNA core package with time points of different operations recorded in the second code DNA core package one by one; and compare a plurality of hash values in the first code DNA core package with a plurality of hash values in the second code DNA core package one by one, wherein the plurality of hash values at least include a binary semantic fingerprint and a structural fingerprint.

[0024] According to some embodiments of the present application, the verification system for the software code right authentication credential further includes a fingerprint similarity analysis module configured to calculate a first similarity score of a binary semantic fingerprint in the first code DNA core package and a binary semantic fingerprint in the second code DNA core package, calculate a second similarity score of a structural fingerprint in the first code DNA core package and a structural fingerprint in the second code DNA core package, and perform weighted summation on the first similarity score and the second similarity score according to a preset weight to obtain a target similarity score, the target similarity score being used for version evolution tracing or copyright ownership determination.

[0025] According to some embodiments of the present application, optionally, the verification system for the software code copyright authentication credential further comprises an evolution tracing module configured to, in the case that the first code DNA core package and the second code DNA core package are different and the target similarity score is greater than a preset score, construct an evolution relationship of the software codes of the first code DNA core package and the second code DNA core package based on the code version information of the first code DNA core package and the second code DNA core package, the timestamp information of the first trusted timestamp certificate and the second trusted timestamp certificate, and input the evolution relationship into a visualization tool.

[0026] In a third aspect, the embodiments of the present application provide a method for generating a software code copyright authentication credential, characterized in that the method is implemented based on the system for generating a software code copyright authentication credential provided in the first aspect, and comprises:

[0027] performing semantic analysis on the content of the target code by using the pre-trained AI code large model, and generating a high-dimensional semantic embedding vector based on the extracted features;

[0028] performing hash calculation on the high-dimensional semantic embedding vector to obtain a binary semantic fingerprint of the target code;

[0029] constructing an abstract syntax tree of the target code by using a static code analysis tool, and extracting a plurality of structural features of the target code from the abstract syntax tree;

[0030] performing permutation and combination on the extracted plurality of structural features, and then performing hash calculation thereon to obtain a structural fingerprint of the target code;

[0031] receiving the binary semantic fingerprint, the structural fingerprint, the unique identifier, the developer digital identity and the key commit metadata of the target code, and constructing a code DNA core package based on the received data;

[0032] encrypting the hash value of the code DNA core package by using the private key of the developer, and taking the encrypted hash value as a developer signature;

[0033] performing hash calculation on the code DNA core package and the developer signature as a whole to obtain a timestamp authentication hash value, and sending the timestamp authentication hash value to a trusted timestamp service platform and receiving a trusted timestamp certificate returned by the trusted timestamp service platform;

[0034] taking the code DNA core package, the developer signature and the trusted timestamp certificate together as the copyright authentication credential of the target code.

[0035] In a fourth aspect, the embodiments of the present application provide a verification method for a software code copyright authentication credential, which is implemented based on the verification system for a software code copyright authentication credential provided in the second aspect, and comprises:

[0036] obtain a first right authentication credential of the software code to be verified, the first right authentication credential comprising a first code DNA core package, a first developer signature and a first trusted timestamp certificate;

[0037] query, from a database, whether there is a second right authentication credential corresponding to the first right authentication credential; if there is, call a subsequent module to further verify the first right authentication credential; if there is not, output a verification failure; the second right authentication credential comprises a second code DNA core package, a second developer signature and a second trusted timestamp certificate;

[0038] based on the second code DNA core package and the public key associated therewith, perform consistency verification on the signature chain, time and hash value in the first code DNA core package;

[0039] decrypt the first developer signature by using the public key of the developer, and compare the decrypted result with the hash value of the second code DNA core package;

[0040] send the first trusted timestamp certificate to a trusted timestamp service platform, and receive a verification result of the first trusted timestamp certificate returned by the trusted timestamp service platform.

[0041] The system and method for generating software code right authentication credentials, and the verification system and method for software code right authentication credentials provided by the embodiments of the present application can analyze the code from multiple dimensions through the “semantic + structural” dual-fingerprint technology. The semantic fingerprint deeply understands the functional semantics of the code, and the structural fingerprint grasps the structural characteristics of the code. This multi-dimensional analysis method can comprehensively and meticulously depict the essential characteristics of the code. Compared with traditional methods, it can more accurately identify various forms of plagiarism, especially advanced “skin-changing” plagiarism. For example, in actual applications, for some plagiarized codes that have been complexly disguised, traditional hash methods may misjudge them as original, but the dual-fingerprint technology can accurately determine their plagiarism nature through deep analysis of semantics and structure, greatly improving the accuracy and reliability of plagiarism detection. In addition, the “code DNA core package” containing the code dual-fingerprint, the developer signature and the key metadata is anchored by the trusted timestamp service platform (TSA). The timestamp provided by the TSA has the characteristics of authority and non-tamperability, and can accurately record the existence state of the code at a certain time point. Once a copyright dispute occurs, this timestamp can serve as strong evidence to ensure the non-repudiation of the originality of the code and provide reliable copyright protection for the developer. BRIEF DESCRIPTION OF DRAWINGS

[0042] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following briefly introduces the drawings in the embodiments of the present application.

[0043] Figure 1 A structural diagram of a system for generating software code copyright authentication credentials provided by an embodiment of the present application.

[0044] Figure 2 A structural diagram of a verification system for software code copyright authentication credentials provided by an embodiment of the present application.

[0045] Figure 3 Another structural diagram of a verification system for software code copyright authentication credentials provided by an embodiment of the present application.

[0046] Figure 4 A flowchart of a method for generating software code copyright authentication credentials provided by an embodiment of the present application.

[0047] Figure 5 A flowchart of a verification method for software code copyright authentication credentials provided by an embodiment of the present application.

[0048] Figure 6 A hardware structural diagram of an electronic device of an embodiment of the present application. DETAILED DESCRIPTION

[0049] The features and exemplary embodiments of various aspects of the present application will be described in detail below with reference to the drawings. To make the purpose, technical solutions and advantages of the present application more clear, the present application will be further described in detail below with reference to the drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain the present application, but not to limit the present application. The present application can be implemented without some of the specific details by those skilled in the art. The following description of the embodiments is only to provide a better understanding of the present application by showing examples of the present application.

[0050] It should be noted that, in this document, relational terms such as first and second and the like can be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises", "comprising", or any other variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without more limitations, an element defined by the phrase "comprising a" does not exclude the existence of additional identical elements in the process, method, article, or apparatus that includes the element.

[0051] It should be understood that the term "and / or" used herein is only to describe an association relationship of associated objects, which means that there can be three relationships, for example, A and / or B, which can represent three cases of A existing alone, A and B existing together, and B existing alone. In addition, the character " / " herein generally represents an "or" relationship between the front and rear associated objects.

[0052] Various modifications and changes can be made to the application in matters of form and details without departing from the spirit and scope of the application, which will be apparent to one skilled in the art. Therefore, the application is intended to cover modifications and variations of the application falling within the scope of the corresponding claims (claimed technical solutions) and their equivalents. It should be noted that the embodiments provided by the application can be combined with each other without contradiction.

[0053] Before describing the technical solutions provided by the embodiments of the application, in order to facilitate the understanding of the embodiments of the application, the application first specifically describes the problems existing in the related art:

[0054] Traditional code plagiarism detection methods, such as text matching or simple hash-based methods, mainly focus on the surface form of the code. Advanced "skin-changing" plagiarism makes the code have great differences with the original code on the surface through replacing variable names, function names, fine-tuning of code logic structure, and rewriting of text expression, but the core content and essential structure do not change. This makes it difficult for traditional methods to accurately identify such plagiarism behavior, and cannot meet the growing demand for code copyright protection.

[0055] In addition, in the software development process, the creation time and originality of the code are often difficult to prove conclusively. Developers may face the problem that after the code is plagiarized, due to the lack of effective time markers and tamper-proof evidence, they cannot effectively prove that their code is original and was created first. This puts developers at a disadvantage in copyright disputes, affecting the enthusiasm and rights protection of code creators.

[0056] In view of the above research findings of the inventors, the embodiments of the application provide a system and method for generating software code copyright authentication credentials, a verification system and method for software code copyright authentication credentials, which can solve the technical problems of difficult identification of advanced "skin-changing" plagiarism of software code and easy tampering of code copyright credentials in the related art.

[0057] Figure 1 A structural block diagram of a system for generating software code copyright authentication credentials provided by the embodiments of the application. As shown in Figure 1As shown, the system 10 for generating software code copyright authentication credentials can include an AI semantic analysis module 101, a semantic fingerprint generation module 102, a structural feature extraction module 103, a structural fingerprint generation module 104, a core package construction module 105, a private key signature module 106, a trusted timestamp acquisition module 107, and a copyright authentication module 108.

[0058] The AI semantic analysis module 101 can be configured to perform semantic analysis on the content of the target code using a pre-trained AI code large model, and generate a high-dimensional semantic embedding vector based on the extracted features.

[0059] The target code is the code that needs to be copyrighted, which can be any code or any code snippet, and the present application does not limit it. The AI code large model can be a code language model (Code Language Models), such as a BERT type code language model or a code language model optimized for language. The AI code large model learns the syntax, semantics and structure of the code during pre-training using a large amount of code data, and generates a high-dimensional semantic embedding vector based on the extracted features.

[0060] For example, in some embodiments, the AI semantic analysis module 101 can be configured to identify variable names, function names, operators and other elements in the target code using the AI code large model, and extract features of the elements; and output a high-dimensional semantic embedding vector by performing weighted summation or nonlinear transformation on the features of the elements. The high-dimensional semantic embedding vector can be a multi-dimensional array. The high-dimensional semantic embedding vector is usually an array composed of real numbers, and its dimension can be tens or even thousands. For example, in a common code semantic analysis scenario, the generated high-dimensional semantic embedding vector can be an array of length 512, and each element is a floating-point number, such as [0.123, -0.456, 0.789, …, 0.234]. The above is only an example and does not limit the present application.

[0061] In generating the high-dimensional semantic embedding vector, the AI semantic analysis module 101 can input the target code into the pre-trained AI code large model. The AI code large model can perform in-depth analysis on the syntax, semantics and other information of the target code, identify variable names, function names, operators and other elements in the target code, and extract features of the elements. For variable names, function names, operators and other elements in the target code, the AI code large model will map these elements to a high-dimensional space according to the patterns learned from a large amount of code data. Then, by performing comprehensive calculations on the features of these elements in the target code, such as weighted summation, nonlinear transformation and other operations, a high-dimensional semantic embedding vector representing the semantics of the target code is finally output.

[0062] The semantic fingerprint generation module 102 can be configured to perform a hash computation on the high-dimensional semantic embedding vector to obtain a binary semantic fingerprint of the target code. For example, in some embodiments, the semantic fingerprint generation module 102 can convert the high-dimensional semantic embedding vector into a fixed-length binary semantic fingerprint SF by a locality-sensitive hashing algorithm, such as the SimHash algorithm. The core value of the binary semantic fingerprint SF lies in its ability to identify code snippets that are similar in functional or logical intent but can differ in specific implementation (e.g., variable names, comments, code structure).

[0063] The structural feature extraction module 103 can be configured to utilize a static code analysis tool to construct an abstract syntax tree of the target code and extract a plurality of structural features of the target code from the abstract syntax tree.

[0064] The abstract syntax tree (AST) is a tree structure that graphically demonstrates the syntactic structure of the target code. The nodes of the tree represent various syntactic elements in the code, such as function definitions, variable declarations, expressions, etc., and the edges represent the hierarchical relationships between these elements. For example, for a simple C language code "int main () { int a = 5; return a;}", the root node of its abstract syntax tree can be a "function definition" node. It has two child nodes, one is a "variable declaration" node (corresponding to "int a = 5;"), and the other is a "return statement" node (corresponding to "return a;"). The "variable declaration" node has child nodes representing the variable type "int" and the variable name "a" as well as the assignment expression, etc.

[0065] Specifically, the structural feature extraction module 103 can be configured to utilize a static code analysis tool to construct an abstract syntax tree of the target code. First, a lexical analyzer will decompose the target code into individual lexical units. Then, a syntax analyzer will combine these lexical units into syntactic structures according to the syntax rules of the programming language and construct an abstract syntax tree. During the construction process, each syntactic element will be gradually added to the tree as a node according to the syntactic hierarchy of the code, and the parent-child relationships between them will be established. Next, a plurality of structural features of the target code can be extracted from the abstract syntax tree. Exemplarily, the plurality of structural features include but are not limited to cyclomatic complexity, topological summary of function call graph, feature vector of module dependency graph, structural pattern occurrence frequency of specific design pattern, etc.

[0066] Cyclomatic complexity can represent the number of independent paths in the code, reflecting the complexity of the code's logical structure. The higher the cyclomatic complexity, the more complex the code, and the more difficult it is to understand, test, and maintain.

[0067] The topological summary of the function call graph can be used to represent the calling relationship between functions in the program. Through the topological summary of the function call graph, the calling mode and overall architecture between functions in the code can be quickly understood.

[0068] The module dependency graph describes the dependency relationship between modules in the target code, and the node represents the module and the edge represents the dependency direction between modules. The feature vector of the module dependency graph is a data structure for quantifying and representing the characteristics of the module dependency graph. It maps various structural information and attributes in the graph into a vector, and each element in the vector corresponds to a certain feature of the graph. By analyzing the feature vector of the module dependency graph, key modules that have a greater impact on other modules can be found.

[0069] The structural pattern of a specific design pattern occurrence frequency represents the number of times the structural pattern of a specific design pattern is applied in the target code. By counting the structural pattern occurrence frequency, the use of design patterns in the target code can be understood, and the dependence of the target code on a specific design pattern can be evaluated.

[0070] The structural fingerprint generation module 104 can be used to arrange and combine the extracted multiple structural features, and then perform a hash calculation to obtain the structural fingerprint STF of the target code. The structural fingerprint STF mainly represents the organization architecture and morphological complexity of the target code. In order to ensure the reproducibility of the structural fingerprint, the arrangement and combination follows a pre-set rule, such as arranging the extracted multiple structural features in the lexicographic order of their feature names, and then normalizing and weighting splicing to ensure that the output result for the same code is unique.

[0071] The core package construction module 105 can be used to receive the binary semantic fingerprint SF of the target code, the structural fingerprint STF of the target code, the unique identifier of the target code, the developer digital identity identifier of the target code, and the key submission metadata, and construct the code DNA core package based on the received data.

[0072] Among them, the unique identifier of the target code is the unique identifier of the target code in the code repository, such as Git Commit ID (H1). Git Commit ID (H1) represents the unique identifier corresponding to the latest submission of the target code in the code repository, which is a string generated by a hash algorithm, used to uniquely identify the content and state of a code submission. The developer digital identity identifier includes but is not limited to the certificate DN (Distinguished Name, identifiable name) and / or DID (Decentralized Identifier) based on PKI (Public Key Infrastructure). The key submission metadata includes but is not limited to the summary of the submission information and the project identifier, etc.

[0073] The core package construction module 105 can be configured to construct the binary semantic fingerprint SF, the structural fingerprint STF, the unique identifier, the developer digital identity, and the key commit metadata of the target code into a standardized data structure (such as a JSON format or an XML format), which is referred to as a code DNA core package.

[0074] The private key signature module 106 can be configured to encrypt the hash value of the code DNA core package using the private key of the developer (such as a private key based on the SM2 algorithm, a private key based on the RSA algorithm, or a private key based on the ECDSA algorithm), and the encrypted hash value is taken as the developer signature Developer_Signature. The developer signature Developer_Signature ensures the integrity of the core package and the non-repudiation of the developer identity.

[0075] The trusted timestamp acquisition module 107 can be configured to hash the code DNA core package and the developer signature Developer_Signature as a whole to obtain a timestamp authentication hash value Hash_For_TSA.

[0076] For example, in some embodiments, when calculating Hash_For_TSA, the code DNA core package and the developer signature can be input as a whole into a hash algorithm (such as a SHA-256 hash algorithm), which performs a series of bit operations and transformations on it, and finally outputs a fixed-length timestamp authentication hash value Hash_For_TSA. The timestamp authentication hash value Hash_For_TSA can be used for subsequent trusted timestamp authentication and other operations to ensure the integrity and non-tamperability of the data.

[0077] The trusted timestamp acquisition module 107 can also be configured to send the timestamp authentication hash value Hash_For_TSA to a trusted timestamp service platform (TSA), and receive the trusted timestamp certificate of the target code returned by the trusted timestamp service platform.

[0078] The right authentication module 108 can be used to combine the code DNA core package, the developer signature and the trusted timestamp certificate as the right authentication credentials of the target code. That is, the right authentication module 108 can combine the complete "code DNA core package + Developer_Signature + trusted timestamp certificate" as a "code DNA right authentication credential" of the target code. Among them, the trusted timestamp certificate can be a PDF format authentication certificate, which is embedded as a PDF attachment, or it can be displayed in the form of a string. In this application, the right authentication credential is a "trinity" complete evidence chain credential, that is, the right authentication credential is a logically indivisible whole composed of three elements of code DNA core package (content), developer signature (identity) and trusted timestamp (time). Without any part, it is impossible to form a complete and reliable right evidence chain.

[0079] The embodiments of the present application provide a system for generating software code right authentication credentials, which analyzes the code from multiple dimensions through "semantic + structural" double fingerprint technology. The semantic fingerprint deeply understands the functional semantics of the code, and the structural fingerprint grasps the structural characteristics of the code. This multi-dimensional analysis method can comprehensively and meticulously depict the essential characteristics of the code. Compared with traditional methods, it can more accurately identify various forms of plagiarism, especially advanced "skin-changing" plagiarism. For example, in actual application, for some plagiarized codes that have been complexly disguised, traditional hash methods may misjudge them as original, but the double fingerprint technology can accurately judge their plagiarism nature through deep analysis of semantics and structure, greatly improving the accuracy and reliability of plagiarism detection.

[0080] In addition, the "code DNA core package" containing the code double fingerprint, the developer signature and the key metadata is anchored by the trusted timestamp service platform (TSA). The timestamp provided by the TSA has the characteristics of authority and non-tamperability, and can accurately record the existence state of the code at a certain time point. Once a copyright dispute occurs, this timestamp can serve as strong evidence to ensure the non-repudiation of the originality of the code and provide reliable copyright protection for the developer.

[0081] In order to make the structural fingerprint STF of the target code better reflect the organization architecture and form complexity of the target code, according to some embodiments of the present application, the structural fingerprint generation module 104 can be used to arrange the plurality of structural characteristics in a preset arrangement order; then normalize the plurality of structural characteristics after arrangement to map the feature values of the plurality of structural characteristics in different ranges to a unified range; perform weighted splicing combination processing or small hash network combination processing on the normalized plurality of structural characteristics, and obtain a new feature vector through combination; and perform hash calculation on the new feature vector to obtain the structural fingerprint STF of the target code.

[0082] Specifically, different structural features can be disordered in the original state, and the disordered features are not conducive to subsequent unified processing and analysis. First, the structural fingerprint generation module 104 can be used to arrange the plurality of structural features extracted from the abstract syntax tree according to a preset arrangement order. The arrangement order can be flexibly adjusted according to actual conditions, which is not limited in the present application. Then, the structural fingerprint generation module 104 can be used to normalize the plurality of structural features arranged to map the feature values of the plurality of structural features in different ranges to a unified range. In this way, each feature can have the same weight basis in the subsequent combination process, avoiding the influence of some features on the result due to the large value range, so that the finally generated structural fingerprint can more accurately reflect the structural features of the target code without deviation due to the value range of a certain feature.

[0083] Then, the structural fingerprint generation module 104 can be used to perform weighted splicing combination processing or small hash network combination processing on the normalized plurality of structural features to obtain a new feature vector through combination.

[0084] Specifically, for the normalized plurality of structural feature vectors, each structural feature vector can be assigned a corresponding weight. For example, assuming that there are three structural feature vectors, structural feature vector A, structural feature vector B and structural feature vector C. For example, the weight assigned to structural feature vector A is 0.6, the weight assigned to structural feature vector B is 0.3, and the weight assigned to structural feature vector C is 0.1. The process of weighted splicing is to multiply each element in structural feature vector A by its weight, multiply each element in structural feature vector B by its weight, and multiply each element in structural feature vector C by its weight, and then sequentially splice the results to obtain a new feature vector.

[0085] Different structural features can have different importance in describing the structure of the code, and by weighting, different weights can be assigned to the features according to their importance, so that important features can be more prominent in the combination result, so that the generated new feature vector can more accurately reflect the essential features of the code structure, improving the quality and representativeness of the structural fingerprint.

[0086] The small hash network can map a plurality of features to a new feature space, and in this way, the features can be compressed and converted to extract more representative feature combinations to obtain a new feature vector. The small hash network is relatively simple and has a small amount of calculation, which can reduce the feature dimension while retaining the key information of the features, improving the calculation efficiency.

[0087] Based on the same technical concept of the system 10 for generating software code certification authentication credentials provided in the above embodiments, the present application also provides a verification system for software code certification authentication credentials. The verification system can be used to verify the authenticity of software code certification authentication credentials, such as to verify counterfeit software code certification authentication credentials, and to verify software code certification authentication credentials generated by the system 10 for generating software code certification authentication credentials.

[0088] Figure 2 A structural block diagram of the verification system for software code certification authentication credentials provided in the embodiments of the present application is shown in FIG. 2. As shown in FIG. 2, the verification system 20 for software code certification authentication credentials can include a certification authentication credential acquisition module 201, a query module 202, a code DNA core package verification module 203, a developer signature verification module 204, and a trusted timestamp certificate verification module 205. Figure 2

[0089] The certification authentication credential acquisition module 201 can be used to acquire the first certification authentication credential of the software code to be verified. Specifically, in order to facilitate the distinction, the certification authentication credential of the software code to be verified is referred to as the first certification authentication credential. The first certification authentication credential can be submitted by a user, or uploaded or called through other means, which is not limited in the present application. The first certification authentication credential can include a first code DNA core package, a first developer signature, and a first trusted timestamp certificate.

[0090] The query module 202 can be used to query from a database whether there is an already certified second certification authentication credential corresponding to the first certification authentication credential. If there is, the code DNA core package verification module 203, the developer signature verification module 204, and the trusted timestamp certificate verification module 205 are called to further verify the first certification authentication credential; if there is not, a verification failure result is output.

[0091] Similarly, the second certification authentication credential can include a second code DNA core package, a second developer signature, and a second trusted timestamp certificate.

[0092] The code DNA core package verification module 203 can be used to verify the consistency of the signature chain, the time, and the hash value in the first code DNA core package based on the second code DNA core package and its associated public key.

[0093] For example, in some embodiments, the code DNA core package verification module 203 can be specifically used to start from the starting point of the signature chain in the first code DNA core package, and use the corresponding public key to verify each signature in sequence until the entire signature chain is verified.

[0094] ​In particular, the signature chain can include multiple signatures, which can be added in a certain order one after another. Starting from the beginning of the signature chain, each signature is verified using the corresponding public key. For example, if the first signature is signed by the developer using his private key, then the developer's public key is used to verify this signature. If the verification is passed, it means that this signature is valid, i.e. the part of data has not been tampered with when signing.

[0095] Then, in the order of the signature chain, the next signature is verified using the next public key one after another until the entire signature chain is verified. If any signature fails to be verified, the signature chain verification of the first code DNA core package fails, and a verification failure result is output.

[0096] For example, in some embodiments, the code DNA core package verification module 203 can also be configured to compare the time points of different operations recorded by the first code DNA core package with the time points of different operations recorded by the second code DNA core package one by one.

[0097] In particular, the first code DNA core package can record the time points of multiple different operations. For example, the signature time should be after the data generation, and the subsequent operation time should be after the signature time. If the time points of different operations recorded by the first code DNA core package are in disorder or differ from the time points of different operations recorded by the second code DNA core package, the verification fails, and a verification failure result is output.

[0098] For example, in some embodiments, the code DNA core package verification module 203 can also be configured to compare the multiple hash values in the first code DNA core package with the multiple hash values in the second code DNA core package one by one. The multiple hash values at least include the binary semantic fingerprint SF and the structure fingerprint STF.

[0099] In particular, the hash values carried by the first code DNA core package or recalculated can be compared with the multiple hash values in the second code DNA core package one by one, such as comparing the binary semantic fingerprint SF of the first code DNA core package with the binary semantic fingerprint SF of the second code DNA core package, and comparing the structure fingerprint STF of the first code DNA core package with the structure fingerprint STF of the second code DNA core package. For example, if any one or more hash values are inconsistent, the verification fails, and a verification failure result is output.

[0100] The developer signature verification module 204 can be configured to decrypt the first developer signature using the public key of the developer, and compare the decrypted result with the hash value of the second code DNA core package. If they are consistent, it means that the first developer signature is valid, otherwise the verification fails.

[0101] The trusted timestamp certificate verification module 205 can be configured to send the first trusted timestamp certificate to a trusted timestamp service platform (TSA) and receive a verification result of the first trusted timestamp certificate returned by the TSA. The verification result of the first trusted timestamp certificate can include a verification success or a verification failure.

[0102] The verification system for software code right authentication credentials provided by the embodiments of the present application includes a code DNA core package verification module, a developer signature verification module, and a trusted timestamp certificate verification module. The code DNA core package verification module performs consistency verification on the signature chain, time, and hash value. The signature chain verification ensures the authenticity and integrity of the code in the circulation process. The time comparison ensures the reasonableness of the code operation sequence and time. The hash value comparison quickly determines whether the code core content is consistent, thereby improving the accuracy of the verification. The developer signature verification module further confirms the reliability of the code source by decrypting the signature and comparing it with the code hash value, thereby preventing the code from being published by imitating the developer. The trusted timestamp certificate verification module verifies with the help of an authoritative trusted timestamp service platform, thereby ensuring the authenticity and validity of the timestamp and enhancing the reliability of the entire verification system.

[0103] Figure 3 Another structural block diagram of the verification system for software code right authentication credentials provided by the embodiments of the present application is provided. As shown in FIG. 6, according to some embodiments of the present application, the verification system 20 for software code right authentication credentials can further include a fingerprint similarity analysis module 301. Figure 3

[0104] The fingerprint similarity analysis module 301 can be configured to calculate a first similarity score between the binary semantic fingerprint in the first code DNA core package and the binary semantic fingerprint in the second code DNA core package, calculate a second similarity score between the structural fingerprint in the first code DNA core package and the structural fingerprint in the second code DNA core package, and perform weighted summation on the first similarity score and the second similarity score according to a preset weight to obtain a target similarity score. The target similarity score is used for version evolution tracing or copyright ownership determination.

[0105] Specifically, the similarity score can be calculated from multiple dimensions, and the semantic and structural similarity of the code is comprehensively considered. For example, for semantic similarity, the fingerprint similarity analysis module 301 can be configured to calculate a first similarity between the binary semantic fingerprint SF in the first code DNA core package and the binary semantic fingerprint SF in the second code DNA core package, such as the Hamming distance or vector cosine similarity of the two binary semantic fingerprints SF. Then, according to the first similarity, a score corresponding thereto is given, which is called the first similarity score or the semantic similarity score.

[0106] ​For example, for structural similarity, a second similarity can be calculated between the structural fingerprint STFs in the first code DNA core package and the structural fingerprint STFs in the second code DNA core package, such as the graph edit distance or feature vector distance between the two structural fingerprint STFs. Then, based on the second similarity, a corresponding score is assigned, which is called the second similarity score or structural similarity score.

[0107] Then, the first similarity score (i.e., semantic similarity score) and the second similarity score (i.e., structural similarity score) are weighted and summed according to their respective preset weights to obtain the final target similarity score. For example, if the weight of the first similarity score is 0.6 and the weight of the second similarity score is 0.4, then the target similarity score = the first similarity score. 0.6 + Second similarity score 0.4.

[0108] This target similarity score is used for version evolution tracing or copyright ownership determination. For example, a high target similarity score, excluding reasonable coincidence, strongly suggests code plagiarism. This helps determine code copyright ownership and protect the rights of the original developer. On the other hand, by comparing the similarity of binary semantic fingerprints (SF) and structural fingerprints (STF), we can understand the code's evolution path and trends. This helps development teams understand the code's development history, analyze which parts have changed significantly and which have remained relatively stable, thereby improving code maintenance and subsequent development.

[0109] Accordingly, such as Figure 3 As shown, in some embodiments, the verification system 20 for software code ownership authentication credentials may further include an evolution tracing module 302. The evolution tracing module 302 can be used to construct the evolutionary relationship between the software code of the first and second code DNA core packages when there are differences between them and the target similarity score is greater than a preset score. This is based on the code version information of the first and second code DNA core packages, and the timestamp information of the first and second trusted timestamp certificates. The module also inputs this evolutionary relationship into a visualization tool. The visualized evolutionary relationship and target similarity score can serve as an objective, credible quantitative basis or indicator for determining the degree of code plagiarism or borrowing, providing technical support for litigation, judicial appraisal, and arbitration processes.

[0110] Specifically, when there is a difference between the first code DNA core package and the second code DNA core package, it indicates that the software code corresponding to the first code DNA core package and the software code corresponding to the second code DNA core package are not completely the same. However, in the case where the target similarity score is greater than the preset score, it indicates that the similarity between the software code corresponding to the first code DNA core package and the software code corresponding to the second code DNA core package is relatively high. At this time, the code version information of the first code DNA core package and the second code DNA core package can be extracted, and based on the timestamp information of the first trusted timestamp certificate and the second trusted timestamp certificate, the software code corresponding to the different versions of the first code DNA core package and the software code corresponding to the different versions of the second code DNA core package are arranged in chronological order. For example, according to the timestamp, it is determined which version is the earliest and which version is the subsequent updated version.

[0111] Next, the binary semantic fingerprint SF and the structural fingerprint STF can be used to establish the association between the two versions of the software code. For example, if the two different versions of the software code have similar structural fingerprints, it indicates that there may be an evolutionary relationship between them, and the closeness of this relationship can be determined through the second similarity between the structural fingerprints, and the evolutionary relationship of the software code of the first code DNA core package and the second code DNA core package is constructed. As seen from time, the software code corresponding to the second code DNA core package is earlier, and the software code corresponding to the first code DNA core package is later. From the code structure, the first code DNA core package of version A modifies and replaces the related algorithm code in the second code DNA core package of version B, for example, some module structures related to data processing and storage are adjusted at the same time. These changes are reflected in the hash value and the structural fingerprint of the code, so that the first code DNA core package of version A and the second code DNA core package of version B have differences in these aspects.

[0112] Next, the constructed evolutionary relationship of the software code can be input into a visualization tool. For example, the version information, the identification of the software code, and the association relationship between them are provided to the visualization tool in a preset data format (such as JSON format). Through the interactive function of the visualization tool, the user can more intuitively understand the trusted evolution process of the software code between different versions.

[0113] Based on the same technical concept as the system 10 for generating software code ownership authentication credentials provided in the above embodiments, the present application also provides a method for generating software code ownership authentication credentials. The method can be implemented based on the system 10 for generating software code ownership authentication credentials provided in the above embodiments.

[0114] Figure 4A flowchart of a method for generating software code copyright authentication credentials provided by the embodiments of the present application is shown in FIG. 1. As shown in FIG. 1, the method for generating software code copyright authentication credentials can include the following steps: Figure 4

[0115] S401: performing semantic analysis on the content of the target code using a pre-trained AI code large model, and generating a high-dimensional semantic embedding vector based on the extracted features;

[0116] S402: performing hash calculation on the high-dimensional semantic embedding vector to obtain a binary semantic fingerprint of the target code;

[0117] S403: constructing an abstract syntax tree of the target code using a static code analysis tool, and extracting a plurality of structural features of the target code from the abstract syntax tree;

[0118] S404: performing permutation and combination on the extracted plurality of structural features, and then performing hash calculation thereon to obtain a structural fingerprint of the target code;

[0119] S405: receiving the binary semantic fingerprint, the structural fingerprint, the unique identifier, the developer digital identity, and the key submission metadata of the target code, and constructing a code DNA core package based on the received data;

[0120] S406: encrypting the hash value of the code DNA core package using the private key of the developer, and taking the encrypted hash value as the developer signature;

[0121] S407: performing hash calculation on the code DNA core package and the developer signature as a whole to obtain a timestamp authentication hash value, and sending the timestamp authentication hash value to a trusted timestamp service platform and receiving a trusted timestamp certificate returned thereby;

[0122] S408: taking the code DNA core package, the developer signature, and the trusted timestamp certificate together as the copyright authentication credentials of the target code.

[0123] The specific processes of the above steps have been described in detail above, and will not be described here again.

[0124] Figure 4 Each step in the method has the function of implementing each module / unit of the system 10 for generating software code copyright authentication credentials provided by the above embodiments, and can achieve the corresponding technical effects thereof. For the sake of brevity, they will not be described here again.

[0125] ​Based on the same technical concept of the verification system 20 for software code right authentication credential provided in the above embodiments, the application further provides a verification method for software code right authentication credential. The method can be implemented based on the verification system 20 for software code right authentication credential provided in the above embodiments.

[0126] Figure 5 A flowchart of a verification method for software code right authentication credential provided in the embodiments of the application is shown in FIG. 6. As shown in FIG. 6, the verification method for software code right authentication credential can include the following steps: Figure 5

[0127] S501: obtaining a first right authentication credential of a software code to be verified, the first right authentication credential including a first code DNA core package, a first developer signature and a first trusted timestamp certificate;

[0128] S502: querying from a database whether there is a second right authentication credential of a righted software code corresponding to the first right authentication credential; if there is, calling a subsequent module to further verify the first right authentication credential; if there is not, outputting a verification failure; the second right authentication credential including a second code DNA core package, a second developer signature and a second trusted timestamp certificate;

[0129] S503: based on the second code DNA core package and the public key associated therewith, performing consistency verification on a signature chain, a time and a hash value in the first code DNA core package;

[0130] S504: decrypting the first developer signature by using a public key of the developer, and comparing the decrypted result with a hash value of the second code DNA core package;

[0131] S505: sending the first trusted timestamp certificate to a trusted timestamp service platform, and receiving a verification result of the first trusted timestamp certificate returned by the trusted timestamp service platform.

[0132] The specific process of the above steps has been described in detail above, and will not be repeated here.

[0133] Figure 5 Each step in the method has the function of implementing each module / unit of the verification system 20 for software code right authentication credential provided in the above embodiments, and can achieve the corresponding technical effects. For brevity, the description will not be repeated here.

[0134] Based on the method for generating software code right authentication credential or the verification method for software code right authentication credential provided in the above embodiments, the application further provides an electronic device.

[0135] ​The electronic device in the embodiments of the present application can be a user terminal device, can be a server, can also be other computing devices, and can also be a cloud server. Figure 6 A hardware structure schematic diagram of the electronic device in the embodiments of the present application can include a processor 601 and a memory 602 storing computer program instructions, and the processor 601 implements the flow or function of the method of any of the above embodiments when executing the computer program instructions.

[0136] Specifically, the processor 601 can include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or can be configured to implement one or more integrated circuits of the embodiments of the present application. The memory 602 can include a mass storage device for data or instructions. For example, the memory 602 can be at least one of a hard disk drive (HDD), a read-only memory (ROM), a random access memory (RAM), a floppy disk drive, a flash memory, an optical disc, a magneto-optical disc, a magnetic tape, a universal serial bus (USB) drive, or other physical / tangible memory storage devices. For another example, the memory 602 can include removable or non-removable (or fixed) media. For another example, the memory 602 can be internal or external to the integrated gateway disaster recovery device. The memory 602 can be a non-volatile solid-state memory. In other words, the memory 602 generally includes a tangible (non-transitory) computer-readable storage medium (such as a memory device) encoded with computer-executable instructions and, when the software is executed (such as by one or more processors), can perform the operations described in the method of the embodiments of the present application. The processor 601 implements the flow or function of any of the above embodiments by reading and executing the computer program instructions stored in the memory 602.

[0137] In one example, Figure 6The electronic device shown can also include a communication interface 603 and a bus 610. Among them, the processor 601, the memory 602, the communication interface 603 are connected through the bus 610 and complete the communication between each other. The communication interface 603 is mainly used to realize the communication between the modules, devices, units and / or equipment in the embodiments of the application. The bus 610 includes hardware, software or both, which can couple the components of the online data traffic billing device to each other. For example, the bus can include at least one of the following: an accelerated graphics port (AGP) or other graphics bus, an enhanced industry standard architecture (EISA) bus, a front side bus (FSB), a hyper transport (HT) interconnect, an industry standard architecture (ISA) bus, an infiniband interconnect, a low pin count (LPC) bus, a memory bus, a micro channel architecture (MCA) bus, a peripheral component interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a serial advanced technology attachment (SATA) bus, a video electronics standards association local (VLB) bus or other suitable bus. The bus 610 can include one or more buses. Although the embodiments of the application describe or show a specific bus, any suitable bus or interconnection method can be considered by the embodiments of the application.

[0138] In combination with the method in the above embodiments, the embodiments of the application further provide a computer readable storage medium, which has stored thereon computer program instructions, and the computer program instructions are executed by a processor to implement the flow or function of any of the methods in the above embodiments.

[0139] In addition, the embodiments of the application also provide a computer program product, which has stored thereon computer program instructions, and the computer program instructions are executed by a processor to implement the flow or function of any of the methods in the above embodiments.

[0140] The flowcharts and / or block diagrams of the methods, devices, systems and computer program products of the embodiments of the application are described above as examples, and the related aspects are described. It should be understood that each block in the flowchart and / or block diagram can be implemented by computer program instructions, or by special hardware that performs specified functions or actions, or by a combination of special hardware and computer instructions. For example, these computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus, to form a machine, so that the instructions executed by the processor enable the implementation of the functions / actions specified in each block or combination of blocks in the flowchart and / or block diagram. Such a processor can be a general-purpose processor, a special-purpose processor, a special application processor, or a field programmable logic circuit.

[0141] The functional blocks shown in the structural block diagram of the embodiments of the present application can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc.; when implemented in software, it is a program or code segment used to perform the required tasks. The program or code segment can be stored in a memory or transmitted through a data signal carried in a carrier wave over a transmission medium or communication link. The code segment can be downloaded via a computer network such as the Internet, an intranet, etc.

[0142] It should be noted that the present application is not limited to the specific configurations and processes described above or shown in the drawings. The above description is merely a specific implementation of the present application, and those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the described systems, devices, modules or units can refer to the corresponding processes in the method embodiments, which need not be described again. It should be understood that the scope of protection of the present application is not limited thereto, and any skilled in the art can think of various equivalent modifications or replacements within the technical scope disclosed by the present application, and these modifications or replacements should be covered within the scope of protection of the present application.

Claims

1. A system for generating a software code provenance authentication credential, the system comprising: Comprise: An AI semantic analysis module for performing semantic analysis on the content of the target code using a pre-trained AI code large model, and generating a high-dimensional semantic embedding vector based on the extracted features; A semantic fingerprint generation module for performing hash calculation on the high-dimensional semantic embedding vector to obtain a binary semantic fingerprint of the target code; A structural feature extraction module for constructing an abstract syntax tree of the target code using a static code analysis tool, and extracting a plurality of structural features of the target code from the abstract syntax tree, the plurality of structural features including cyclomatic complexity, topological summary of function call graph, feature vector of module dependency graph, and structural pattern occurrence frequency of target design pattern; A structural fingerprint generation module for arranging and combining the extracted plurality of structural features, and then performing hash calculation thereon to obtain a structural fingerprint of the target code; A core package construction module for receiving the binary semantic fingerprint, the structural fingerprint, the unique identifier, the developer digital identity, and the key commit metadata of the target code, and constructing a code DNA core package based on the received data; A private key signing module for encrypting the hash value of the code DNA core package using the private key of the developer, and taking the encrypted hash value as the developer signature; A trusted timestamp acquisition module for performing hash calculation on the code DNA core package and the developer signature as a whole to obtain a timestamp authentication hash value; And sending the timestamp authentication hash value to a trusted timestamp service platform and receiving a trusted timestamp certificate returned thereby; An authentication module for taking the code DNA core package, the developer signature, and the trusted timestamp certificate as the authentication credentials of the target code; The AI semantic analysis module is specifically configured to identify variable names, function names, and operators in the target code using an AI code large model, extract features of the elements, and output a high-dimensional semantic embedding vector by performing weighted summation or nonlinear transformation on the features, wherein the high-dimensional semantic embedding vector is a multidimensional array.

2. The system of claim 1, wherein, The structural fingerprint generation module is specifically configured to arrange the plurality of structural features in a predetermined arrangement order, normalize the arranged plurality of structural features to map feature values of the plurality of structural features in different ranges to a unified range, perform weighted splicing combination processing or small hash network combination processing on the normalized plurality of structural features to obtain a new feature vector, and perform hash calculation on the new feature vector to obtain the structural fingerprint of the target code.

3. A verification system for software code ownership authentication credentials, characterized in that, The software code authentication credential includes a counterfeit software code authentication credential or a software code authentication credential generated by the system for generating a software code authentication credential according to any one of claims 1-2, and the verification system comprises: An authentication credential acquisition module for acquiring a first authentication credential of a software code to be verified, the first authentication credential comprising a first code DNA core package, a first developer signature, and a first trusted timestamp certificate; The query module is configured to query from the database whether there is an authorized second authorized authentication credential corresponding to the first authorized authentication credential, and if so, call a subsequent module to further verify the first authorized authentication credential, and if not, output a verification failure. The second authorized authentication credential includes a second code DNA core package, a second developer signature, and a second trusted timestamp certificate. The code DNA core package verification module is configured to verify the signature chain, time, and hash value in the first code DNA core package based on the second code DNA core package and its associated public key. The developer signature verification module is configured to decrypt the first developer signature using the public key of the developer and compare the decrypted result with the hash value of the second code DNA core package. The trusted timestamp certificate verification module is configured to send the first trusted timestamp certificate to a trusted timestamp service platform and receive a verification result of the first trusted timestamp certificate returned by the trusted timestamp service platform.

4. The verification system of claim 3, wherein, The code DNA core package verification module is specifically configured to start from the starting point of the signature chain, use the corresponding public key to verify each signature in turn until the entire signature chain is verified, and compare the time points of different operations recorded in the first code DNA core package with the time points of different operations recorded in the second code DNA core package one by one. The plurality of hash values in the first code DNA core package and the plurality of hash values in the second code DNA core package are compared one by one, wherein the plurality of hash values at least include binary semantic fingerprints and structural fingerprints.

5. The verification system of claim 3, wherein, The verification system further comprises: The fingerprint similarity analysis module is configured to calculate a first similarity score of the binary semantic fingerprint in the first code DNA core package and the binary semantic fingerprint in the second code DNA core package, calculate a second similarity score of the structural fingerprint in the first code DNA core package and the structural fingerprint in the second code DNA core package, and weight-sum the first similarity score and the second similarity score according to a preset weight to obtain a target similarity score, which is used for version evolution tracing or copyright ownership determination.

6. The verification system of claim 5, wherein, The verification system further comprises: The evolution tracing module is configured to, in the case that the first code DNA core package and the second code DNA core package have differences and the target similarity score is greater than a preset score, construct an evolution relationship of the software code of the first code DNA core package and the second code DNA core package based on the code version information of the first code DNA core package and the second code DNA core package, the timestamp information of the first trusted timestamp certificate and the second trusted timestamp certificate, and input the evolution relationship into a visualization tool.

7. A method for generating a software code attestation authentication credential, the method comprising: The method is implemented based on the system for generating software code authorized authentication credentials according to any one of claims 1-2, comprising: performing semantic analysis on the content of the target code using a pre-trained AI code large model, and generating a high-dimensional semantic embedding vector based on the extracted features; performing hash calculation on the high-dimensional semantic embedding vector to obtain a binary semantic fingerprint of the target code; An abstract syntax tree of the target code is constructed using a static code analysis tool, and a plurality of structural features of the target code are extracted from the abstract syntax tree, the plurality of structural features including a cyclomatic complexity, a topological summary of a function call graph, a feature vector of a module dependency graph, and a structural pattern occurrence frequency of a target design pattern; The plurality of structural features are arranged and combined, and then hashed to obtain a structural fingerprint of the target code; A binary semantic fingerprint, a structural fingerprint, a unique identifier, a developer digital identity, and key commit metadata of the target code are received, and a code DNA core package is constructed based on the received data; A hash value of the code DNA core package is encrypted using a private key of the developer, and the encrypted hash value is used as a developer signature; The code DNA core package and the developer signature are hashed as a whole to obtain a timestamp authentication hash value, and the timestamp authentication hash value is sent to a trusted timestamp service platform, and a trusted timestamp certificate returned by the trusted timestamp service platform is received; The code DNA core package, the developer signature, and the trusted timestamp certificate are used as a right authentication credential of the target code; The content of the target code is semantically analyzed using a pre-trained AI code large model, and a high-dimensional semantic embedding vector is generated based on the extracted features, including: The AI code large model identifies a plurality of elements including variable names, function names, and operators in the target code, and extracts features of the plurality of elements; and a high-dimensional semantic embedding vector is output by performing weighted summation or nonlinear transformation on the features of the plurality of elements, wherein the high-dimensional semantic embedding vector is a multi-dimensional array.

8. A verification method for software code ownership authentication credentials, characterized in that, The method is implemented based on the verification system for software code right authentication credentials according to any one of claims 3-6, comprising: Obtaining a first right authentication credential of the software code to be verified, the first right authentication credential including a first code DNA core package, a first developer signature, and a first trusted timestamp certificate; Querying whether there is a second right authentication credential corresponding to the first right authentication credential in the database; if there is, further verifying the first right authentication credential by calling the subsequent module; if there is not, outputting a verification failure; the second right authentication credential includes a second code DNA core package, a second developer signature, and a second trusted timestamp certificate; Based on the second code DNA core package and the associated public key, the signature chain, the time, and the hash value in the first code DNA core package are verified for consistency; Decrypting the first developer signature using the public key of the developer, and comparing the decrypted result with the hash value of the second code DNA core package; Sending the first trusted timestamp certificate to the trusted timestamp service platform, and receiving a verification result of the first trusted timestamp certificate returned by the trusted timestamp service platform.

Citation Information

Patent Citations

  • Data right confirmation method and system based on block chain technology

    CN112651052A