A blockchain-based code library construction method, device and equipment

CN115081029BActive Publication Date: 2026-10-09BANK OF CHINA
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202210688300.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-17
Publication Date
2026-10-09
Estimated Expiration
2042-06-17

AI Technical Summary

Technical Problem

[0004]本说明书实施例的目的是提供一种基于区块链的代码库构建方法、装置及设备,以解决如何保证公共代码库中的代码安全性的问题

Benefits of technology

[0010] As can be seen from the technical solutions provided in the embodiments of this specification above, after receiving the code segment to be reviewed, the embodiments of this specification send the code segment to be reviewed to each blockchain node so that each blockchain node can review the code segment to be reviewed. If the review result meets the code inclusion conditions, the code segment to be reviewed is then uploaded to the blockchain platform, so that the blockchain platform can save the code segment to be reviewed to the public code repository. The above method involves reviewing the code through different nodes before adding the code segment to the public code repository, which ensures the security of the code. The public code repository for storing the code is set on the blockchain platform. Based on the immutability of the blockchain, it also ensures that the code in the public code repository cannot be arbitrarily modified, thereby realizing the security of the code in the constructed public code repository, which is conducive to the effective production and development.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115081029B_ABST
    Figure CN115081029B_ABST
Patent Text Reader

Abstract

The embodiment of the present specification provides a code library construction method, device and equipment based on a block chain, which are applied to the technical field of information security. The method comprises the following steps: receiving a code segment to be audited; sending the code segment to be audited to each block chain node, so that each block chain node audits the code segment to be audited; in the case that the auditing result meets the code introduction condition, uploading the code segment to be audited to a block chain platform, so that the block chain platform saves the code segment to be audited to a public code library. The above method involves auditing the code through different nodes before adding the code segment to the public code library, which ensures the safety of the code. The public code library for saving the code is set on the block chain platform, and based on the non-tamperability of the block chain, the code in the public code library cannot be modified at will, so that the safety of the code in the constructed public code library is realized, which is beneficial to the effective production and development.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments in this specification relate to the field of information security technology, and in particular to a method, apparatus and device for building a blockchain-based codebase. Background Technology

[0002] During program and application development, different programs and applications often involve multiple technical architectures and implementation methods, requiring the introduction of a large amount of code. However, in actual development, developers generally do not write all the code themselves. For functions, encryption / decryption algorithms, and common mechanisms, they can directly import common code from code repositories, thus saving development time for programs and applications.

[0003] However, currently, it is difficult to audit the code within public code repositories. If malicious actors insert malware or backdoors into the code, and this code is used by developers, it will pose a code security risk, potentially leading to data leaks, system failures, and other serious threats to data security. Therefore, there is an urgent need for a technical solution that can guarantee the security of code in public code repositories. Summary of the Invention

[0004] The purpose of the embodiments in this specification is to provide a method, apparatus, and device for building a blockchain-based code repository, in order to solve the problem of how to ensure the security of code in a public code repository.

[0005] To address the aforementioned technical issues, this specification proposes a blockchain-based codebase construction method, comprising: receiving a code segment to be reviewed; sending the code segment to be reviewed to various blockchain nodes so that each blockchain node can review the code segment; and uploading the code segment to be reviewed to a blockchain platform if the review results meet the code inclusion conditions, so that the blockchain platform can save the code segment to be reviewed to a public codebase.

[0006] This specification also proposes a blockchain-based code repository construction device, comprising: a code segment receiving module for receiving code segments to be reviewed; a code segment sending module for sending the code segments to be reviewed to various blockchain nodes, so that each blockchain node can review the code segments to be reviewed; and a code segment uploading module for uploading the code segments to be reviewed to a blockchain platform if the review results meet the code inclusion conditions, so that the blockchain platform can save the code segments to be reviewed to a public code repository.

[0007] This specification also proposes a blockchain-based codebase building device, including a memory and a processor. The memory is used to store computer programs / instructions, and the processor is used to execute the computer programs / instructions to implement the steps of the blockchain-based codebase building method described above.

[0008] This specification also proposes a computer-readable storage medium storing a computer program / instruction thereon, which, when executed by a processor, implements the above-described blockchain-based codebase construction method.

[0009] This specification also proposes a computer program product, including a computer program / instruction, which, when executed by a processor, implements the above-described blockchain-based codebase construction method.

[0010] As can be seen from the technical solutions provided in the embodiments of this specification above, after receiving the code segment to be reviewed, the embodiments of this specification send the code segment to be reviewed to each blockchain node so that each blockchain node can review the code segment to be reviewed. If the review result meets the code inclusion conditions, the code segment to be reviewed is then uploaded to the blockchain platform, so that the blockchain platform can save the code segment to be reviewed to the public code repository. The above method involves reviewing the code through different nodes before adding the code segment to the public code repository, which ensures the security of the code. The public code repository for storing the code is set on the blockchain platform. Based on the immutability of the blockchain, it also ensures that the code in the public code repository cannot be arbitrarily modified, thereby realizing the security of the code in the constructed public code repository, which is conducive to the effective production and development. Attached Figure Description

[0011] To more clearly illustrate the technical solutions in the embodiments or prior art of this specification, the drawings used in the description of the embodiments or prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this specification. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0012] Figure 1 This is a flowchart illustrating a blockchain-based codebase construction method as described in this specification.

[0013] Figure 2 This is a block diagram of a blockchain-based codebase building device according to an embodiment of this specification. Detailed Implementation

[0014] The technical solutions in the embodiments of this specification will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this specification, and not all embodiments. Based on the embodiments in this specification, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of this specification.

[0015] To address the aforementioned technical problems, this specification proposes a blockchain-based codebase construction method. The execution entity of this method is a blockchain-based codebase construction device. This device includes, but is not limited to, servers, industrial control computers, and PCs. Figure 1 As shown, the blockchain-based codebase construction method may include the following specific implementation steps.

[0016] S110: Receive code segment to be reviewed.

[0017] The code segment to be reviewed can be a collection of multiple lines of code. This code segment can be used to implement a specific function. Specifically, the code segment to be reviewed can be highly independent and reusable. For example, it can be code associated with specific functions, encryption / decryption algorithms, or common mechanisms. Because this type of code is often related to low-level computational processes and not strongly coupled with actual application scenarios, it can be reused and is suitable for building code libraries.

[0018] The code snippet to be reviewed can be code sent by the relevant developer. For example, after designing code, a programmer may send the code snippet to the code repository build equipment for review in order to facilitate use by other members of the team and reduce development workload.

[0019] The specific content and format of the code segment to be reviewed can be set according to the actual application requirements, and will not be elaborated here.

[0020] In some implementations, along with the code segment to be reviewed, a code identifier corresponding to the code segment to be reviewed can also be received. The code identifier can be identification information used to uniquely identify the code segment to be reviewed, such as a string used to uniquely identify the code segment, or a hash value obtained by hashing the code segment to be reviewed. The code identifier can be sent by the uploader of the code segment along with the code, or it can be generated by the code repository building device; there are no restrictions on this.

[0021] Preferably, the code identifier may also include a description of the code segment to be reviewed, such as the function and implementation method of the code segment, so that other users can better filter code segments in the public code library during subsequent use.

[0022] S120: The code segment to be reviewed is sent to each blockchain node so that each blockchain node can review the code segment to be reviewed.

[0023] After obtaining the code segment to be reviewed, it can be sent to various blockchain nodes for review. Blockchain nodes can be any nodes included in the blockchain platform.

[0024] A blockchain platform is a platform built upon the blockchain data structure. A blockchain is a chain of data composed of different blocks, each containing specific information. A blockchain platform includes multiple servers and other computing devices, each storing the blockchain data. This blockchain structure endows it with decentralized characteristics and the ability to prevent data tampering.

[0025] Based on the characteristics of blockchain, when data in a blockchain block needs to be modified, the consent of more than half of the nodes in the blockchain platform is required to complete the modification. This ensures the authority of the data on the blockchain platform and prevents arbitrary tampering of blockchain ledgers. In the embodiments of this specification, the security of the code in the public code repository maintained by the blockchain platform can be guaranteed.

[0026] A blockchain node can correspond to any of the nodes associated with the blockchain. Blockchain nodes can be different devices. After receiving a code segment to be reviewed, the blockchain platform can send it to the various blockchain nodes.

[0027] Specifically, the blockchain platform can broadcast the code segment to be reviewed to various blockchain nodes. In practical applications, other methods can also be used to send the code segment to be reviewed, and this example is not limited to them, so they will not be elaborated here.

[0028] In some implementations, the blockchain nodes are nodes corresponding to various code review experts. After receiving a code segment to be reviewed, the blockchain node can display the code segment on the code review expert's terminal so that the expert can determine whether the code segment has any security issues.

[0029] In some implementations, the devices corresponding to the blockchain nodes are each configured with different code review logics, which can then be used to review the code segments to be reviewed in order to determine whether the code segments to be reviewed have security risks and whether they can be added to the public code library.

[0030] After reviewing the code segment to be reviewed, each blockchain node can generate a corresponding review result. The review result can include "agree to introduce" and "disagree to introduce," indicating whether or not the code segment is approved for inclusion in the public code repository on the blockchain platform.

[0031] S130: If the review results meet the code introduction conditions, the code segment to be reviewed is uploaded to the blockchain platform so that the blockchain platform saves the code segment to be reviewed to the public code repository.

[0032] After obtaining the review results from each blockchain node, these review results can be combined to determine whether the code meets the requirements for inclusion.

[0033] In some implementations, the code introduction condition can be that at least half of the blockchain nodes approve the introduction, thereby satisfying the condition for modifying a block in the blockchain. In practical applications, this ratio can also be adjusted, and it can be increased if more than half are involved; there is no limitation on this.

[0034] If the review results meet the code inclusion criteria, the code segment to be reviewed can be uploaded to the blockchain platform, allowing the platform to save it to the public code repository. The specific saving process can be configured based on the blockchain's data structure characteristics and the rules governing the public code repository, and will not be elaborated upon here.

[0035] In some implementations, the code segment to be reviewed corresponds to a code segment identifier. The code identifier can be identification information used to uniquely identify the code segment to be reviewed, such as a string used to uniquely identify the code segment, or a hash value obtained by hashing the code segment to be reviewed. The code identifier can be sent by the uploader of the code segment along with the code, or it can be generated by the code repository building device; there are no restrictions on this.

[0036] After obtaining the code segment to be reviewed and its identifier, these two elements can be uploaded to the blockchain platform. The blockchain platform can then store the code segment and its identifier in the public code repository. Since the code segment identifier uniquely identifies the code segment to be reviewed and is shorter than the code segment itself, it is easier to use as a basis for searching. Correspondingly, because the code segment to be reviewed and its identifier are stored in a corresponding relationship, the code segment identifier can be directly searched in the public code repository during a search, and the specific code segment to be reviewed can be indexed based on the identifier, thus facilitating subsequent code segment searches.

[0037] Based on the above implementation, before uploading the code segment to be reviewed to the blockchain platform, it is possible to first query whether the public code repository contains an original code segment corresponding to the code segment identifier. When a code segment's identifier is generated based on factors such as the uploader and the implemented function, there may be instances where the uploader uploads the same code segment repeatedly. In such cases, the uploader may need to update the original code segment, or there may be duplicate uploads. Therefore, if the public code repository contains an original code segment corresponding to the code segment identifier, the saved original code segment can be replaced with the code segment to be reviewed, ensuring the validity of the code segments stored in the public code repository.

[0038] If no identical code segment identifier exists, then the corresponding code segment has not been saved in advance, and the code segment to be reviewed can be saved to the public code repository according to the normal process.

[0039] By querying the original code segments, the orderliness of the code segments maintained in the public code repository is ensured, which is beneficial for the use of the code in the public code repository during later development.

[0040] In some implementations, if the review results do not meet the code inclusion criteria, for example, if more than half of the review results are "disapproved," then the uploaded code segment poses a security risk. In this case, an alert can be issued for the code segment to be reviewed. Specifically, this could involve sending a warning message to the uploader, informing them that the uploaded code has a security risk, or sending an alert message to a specific device to verify the code upload process and prevent corresponding attack events.

[0041] Based on the above description, when a blockchain platform maintains the aforementioned public code repository, developers can send a code segment query request to the blockchain platform when they need to obtain a code segment. The code segment query request may include a code segment identifier. This identifier can be determined by the developer based on the correspondence between the functional description of the code segment provided by the public code repository and the code segment identifier. Upon receiving the code segment query request, the blockchain platform can locate the corresponding target code segment based on the code segment identifier and return the found target code segment to the requester, enabling the relevant developer to better proceed with subsequent development.

[0042] In some implementations, the request submitted by the developer may not include a code segment identifier, but only the functional requirements of the needed code. Based on the developer's requirements and descriptions of different code segments, the blockchain platform identifies at least one code segment needed by the developer and then provides that code segment to the user, enabling the user to develop using the appropriate code segment based on their needs.

[0043] In practical applications, there are no restrictions on the way to send code segment query requests or query the target code segment, and it is not limited to the above example, so it will not be elaborated here.

[0044] Based on the above embodiments and scenario examples of the blockchain-based code repository construction method, it can be seen that after receiving the code segment to be reviewed, the method sends the code segment to each blockchain node so that each blockchain node can review the code segment. If the review result meets the code inclusion conditions, the code segment to be reviewed is then uploaded to the blockchain platform, allowing the blockchain platform to save the code segment to be reviewed in the public code repository. Before adding the code segment to the public code repository, the above method involves reviewing the code through different nodes, ensuring code security. Furthermore, the public code repository, which stores the code, is located on the blockchain platform. Based on the immutability of the blockchain, it also ensures that the code in the public code repository cannot be arbitrarily modified, thus achieving the security of the code in the constructed public code repository and facilitating effective production development.

[0045] based on Figure 1 This specification describes a blockchain-based codebase construction method and an embodiment of a blockchain-based codebase construction device. The blockchain-based codebase construction device can be installed on a blockchain-based codebase construction equipment. Figure 2 As shown, the blockchain-based codebase building device includes the following modules.

[0046] The code segment receiving module 210 is used to receive code segments to be reviewed.

[0047] The code segment to be reviewed sending module 220 is used to send the code segment to be reviewed to each blockchain node so that each blockchain node can review the code segment to be reviewed.

[0048] The code segment upload module 230 is used to upload the code segment to be reviewed to the blockchain platform when the review result meets the code introduction conditions, so that the blockchain platform can save the code segment to be reviewed to the public code library.

[0049] In some implementations, the code segment to be reviewed corresponds to a code segment identifier; the code segment to be reviewed upload module includes: a code and identifier upload unit, used to upload the code segment to be reviewed and the code segment identifier to the blockchain platform, so that the blockchain platform stores the code segment to be reviewed and the code segment identifier in the public code repository.

[0050] Based on the above implementation, the code and identifier uploading unit includes: an original code segment query subunit, used to query whether the public code library stores an original code segment corresponding to the code segment identifier; and a code segment replacement subunit, used to replace the original code segment with the code segment to be reviewed if an original code segment corresponding to the code segment identifier is stored.

[0051] Based on the foregoing embodiments, the apparatus further includes: a code segment query request sending module, used to send a code segment query request to the blockchain platform, so that the blockchain platform can find the target code segment according to the code segment identifier in the code segment query request; and a target code segment receiving module, used to receive the target code segment fed back by the blockchain platform.

[0052] In some implementations, the blockchain nodes include nodes corresponding to various code review experts.

[0053] In some implementations, the code introduction conditions include: at least half of the blockchain nodes agreeing to the introduction.

[0054] In some implementations, the code segment to be audited sending module includes: a code segment to be audited broadcasting unit, used to broadcast the code segment to be audited based on the blockchain platform to send it to various blockchain nodes.

[0055] based on Figure 1 The corresponding blockchain-based codebase construction method, as described in this specification, includes a blockchain-based codebase construction device. The blockchain-based codebase construction device may include a memory and a processor.

[0056] In this embodiment, the memory can be implemented in any suitable manner. For example, the memory can be a read-only memory, a hard disk drive, a solid-state drive, or a USB flash drive, etc. The memory can be used to store computer programs / instructions.

[0057] In this embodiment, the processor can be implemented in any suitable manner. For example, the processor can take the form of a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro)processor, logic gates, switches, application-specific integrated circuits (ASICs), programmable logic controllers, and embedded microcontrollers, etc. The processor can execute the computer program instructions to implement, for example, Figure 1 The corresponding blockchain-based codebase construction method.

[0058] based on Figure 1The corresponding blockchain-based codebase construction method, in this specification, provides a computer-readable storage medium storing computer programs / instructions. The computer-readable storage medium can be read by a processor via the device's internal bus, and the processor can then implement the program instructions in the computer-readable storage medium.

[0059] In this embodiment, the computer-readable storage medium can be implemented in any suitable manner. The computer-readable storage medium includes, but is not limited to, random access memory (RAM), read-only memory (ROM), cache, hard disk drive (HDD), memory card, etc. The computer storage medium stores computer program instructions. When the computer program instructions are executed, this specification is implemented. Figure 1 The program instructions or modules corresponding to the embodiments.

[0060] In this embodiment, the processor can be implemented in any suitable manner. For example, the processor can take the form of a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro)processor, logic gates, switches, application-specific integrated circuits (ASICs), programmable logic controllers, and embedded microcontrollers, etc. Specifically, the processor can execute when set up on a blockchain-based codebase building device. Figure 1 The method steps in the corresponding embodiments.

[0061] based on Figure 1 The corresponding blockchain-based codebase construction method, in this specification embodiment, also provides a computer program product, including a computer program / instruction. The computer program product may be a program written in a corresponding computer programming language, stored in a corresponding storage device in a program manner, and transmitted via a computer network. The computer program product can be executed by a processor. In this specification embodiment, when the computer program product is executed, it implements the following... Figure 1 The program instructions or modules of the blockchain-based codebase construction method in the corresponding embodiment.

[0062] It should be noted that the above-mentioned blockchain-based codebase construction methods, devices, and equipment can be applied to the field of information security technology, as well as to other technical fields other than information security technology, without any restrictions.

[0063] Furthermore, it should be noted that the use, storage, processing, and retrieval of user-related data involved in the aforementioned blockchain-based codebase construction methods, devices, and equipment all comply with the relevant provisions of national laws and regulations.

[0064] Although the process described above includes multiple operations that occur in a specific order, it should be clearly understood that these processes may include more or fewer operations, which may be executed sequentially or in parallel (e.g., using parallel processors or a multithreaded environment).

[0065] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this specification. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create a machine for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0066] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0067] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0068] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0069] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.

[0070] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape storage, disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0071] Those skilled in the art will understand that the embodiments of this specification can be provided as methods, systems, or computer program products. Therefore, the embodiments of this specification can take the form of entirely hardware embodiments, entirely software embodiments, or embodiments combining software and hardware aspects. Furthermore, the embodiments of this specification can take the form of computer program products implemented on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0072] The embodiments described in this specification can be described in the general context of computer-executable instructions, such as program modules, that are executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform a specific task or implement a specific abstract data type. The embodiments of this specification can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.

[0073] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, system embodiments are basically similar to method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments. In the description of this specification, the terms "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of the embodiments in this specification. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described can be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification and the features of different embodiments or examples.

[0074] The above description is merely an embodiment of this application and is not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.

Claims

1. A method for building a blockchain-based codebase, characterized in that, include: Receive code segments awaiting review; The code segment to be reviewed has a corresponding code segment identifier; Public code repositories provide a mapping between functional descriptions of code segments and code segment identifiers; The code segment to be reviewed is sent to each blockchain node so that each blockchain node can review the code segment to be reviewed; the blockchain node includes a node corresponding to each code review expert, and the device corresponding to each blockchain node is set with different code review logic, which can review the code segment to be reviewed according to the code review logic to determine whether the code segment to be reviewed has security risks and whether it can be added to the public code library; If the review results meet the code inclusion conditions, the code segment to be reviewed will be uploaded to the blockchain platform so that the blockchain platform can save the code segment to be reviewed to the public code repository; Uploading the code segment to be reviewed to the blockchain platform includes: querying whether the public code repository contains an original code segment with a code segment identifier corresponding to the code segment to be reviewed; If so, replace the original code segment with the code segment to be reviewed.

2. The method as described in claim 1, characterized in that, The code segment to be reviewed corresponds to a code segment identifier; uploading the code segment to be reviewed to the blockchain platform, so that the blockchain platform saves the code segment to be reviewed to the public code repository, includes: The code segment to be reviewed and its identifier are uploaded to the blockchain platform so that the blockchain platform stores the code segment to be reviewed and its identifier in the public code repository.

3. The method as described in claim 2, characterized in that, After uploading the code segment to be reviewed to the blockchain platform, the process also includes: A code segment query request is sent to the blockchain platform so that the blockchain platform can find the target code segment based on the code segment identifier in the code segment query request. The target code segment that receives feedback from the blockchain platform.

4. The method as described in claim 1, characterized in that, The conditions for introducing the code include: at least half of the blockchain nodes agreeing to its introduction.

5. The method as described in claim 1, characterized in that, Sending the code segment to be reviewed to each blockchain node includes: The code segment to be reviewed is broadcast on the blockchain platform to be sent to various blockchain nodes.

6. A blockchain-based codebase building device, characterized in that, include: The code segment receiving module is used to receive code segments that are pending review. The code segment to be reviewed has a corresponding code segment identifier; Public code repositories provide a mapping between functional descriptions of code segments and code segment identifiers; The code segment to be reviewed module is used to send the code segment to be reviewed to each blockchain node so that each blockchain node can review the code segment to be reviewed; the blockchain node includes a node corresponding to each code review expert, and the device corresponding to each blockchain node is set with different code review logic, which can review the code segment to be reviewed according to the code review logic to determine whether the code segment to be reviewed has security risks and whether it can be added to the public code library; The code segment upload module is used to upload the code segment to be reviewed to the blockchain platform when the review result meets the code introduction conditions, so that the blockchain platform can save the code segment to be reviewed to the public code library; Uploading the code segment to be reviewed to the blockchain platform includes: querying whether the public code repository contains an original code segment corresponding to the code segment identifier; If so, replace the original code segment with the code segment to be reviewed.

7. A blockchain-based codebase building device, comprising a memory and a processor, characterized in that, The memory is used to store computer programs / instructions, and the processor is used to execute the computer programs / instructions to implement the steps of the method as described in any one of claims 1-5.

8. A computer-readable storage medium having a computer program / instructions stored thereon, characterized in that, When the computer program / instructions are executed, they implement the steps of the method as described in any one of claims 1-5.

9. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed, they implement the steps of the method as described in any one of claims 1-5.

Citation Information

Patent Citations

  • Implementation method and device of code hosting warehouse based on block chain and medium

    CN112764804A

  • Work original auditing method, device and equipment based on block chain

    CN114065145A

  • Program code management method and device based on block chain, equipment and medium

    CN114491659A

  • Blockchain-based program review system, method, computing device and storage medium

    US20200279224A1