CN111399841B - Code processing method and device based on blockchain, storage medium and electronic equipment - Google Patents

Code processing method and device based on blockchain, storage medium and electronic equipment Download PDF

Info

Publication number
CN111399841B
CN111399841B CN202010162068.5A CN202010162068A CN111399841B CN 111399841 B CN111399841 B CN 111399841B CN 202010162068 A CN202010162068 A CN 202010162068A CN 111399841 B CN111399841 B CN 111399841B
Authority
CN
China
Prior art keywords
code
blockchain
combined
information
storing
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010162068.5A
Other languages
Chinese (zh)
Other versions
CN111399841A (en
Inventor
彭冬炜
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN202010162068.5A priority Critical patent/CN111399841B/en
Publication of CN111399841A publication Critical patent/CN111399841A/en
Application granted granted Critical
Publication of CN111399841B publication Critical patent/CN111399841B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/44Encoding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The disclosure provides a code processing method based on a block chain, a code processing device based on the block chain, a storage medium and electronic equipment, and relates to the technical field of the block chain, wherein the code processing method based on the block chain comprises the following steps: if the submitting operation of the target code is received, code submitting information of the target code is obtained; combining the target code and the reference code stored in the blockchain to obtain a combined code; and storing the combined code and code submission information of the target code to the blockchain. The method and the device can improve the safety and reliability of code storage.

Description

Code processing method and device based on blockchain, storage medium and electronic equipment
Technical Field
The present disclosure relates to the field of blockchain technologies, and in particular, to a blockchain-based code processing method, a blockchain-based code processing device, a computer-readable storage medium, and an electronic apparatus.
Background
Data preservation in existing code warehouses mostly uses a distributed version control system Git. Git is to take a snapshot of the changed file and record it in a miniature file system. Each time an update is committed, the Git looks through all the file information and takes a snapshot of the file, and then saves an index pointing to this snapshot. In order to improve the performance, if the file is unchanged, the distributed version control system does not save again, but only connects the last saved snapshot.
In the above manner, the distributed version control system needs to master a lot of operation instructions and branch switching knowledge, and the operation difficulty is high. The branch merging code of the distributed version control system is easy to cause conflict and has a certain limitation. When the distributed version control system performs multi-node cooperation through the warehouse hosting platform, the manager of the platform project grasps the authority of merging codes, namely, the manager is completed by a central node, the risk of damage exists, and the safety is poor.
It should be noted that the information disclosed in the above background section is only for enhancing understanding of the background of the present disclosure and thus may include information that does not constitute prior art known to those of ordinary skill in the art.
Disclosure of Invention
The disclosure provides a code processing method based on a blockchain, a code processing device based on the blockchain, a computer readable storage medium and electronic equipment, so that the problem of poor code processing safety is overcome at least to a certain extent.
Other features and advantages of the present disclosure will be apparent from the following detailed description, or may be learned in part by the practice of the disclosure.
According to a first aspect of the present disclosure, there is provided a blockchain-based code processing method, including: if the submitting operation of the target code is received, code submitting information of the target code is obtained; combining the target code and the reference code stored in the blockchain to obtain a combined code; and storing the combined code and code submission information of the target code to the blockchain.
According to one aspect of the present disclosure, there is provided a blockchain-based code processing apparatus including: the information determining module is used for acquiring code submitting information of the target code if receiving submitting operation of the target code; the code combination module is used for carrying out combination processing on the target code and the reference code stored in the blockchain so as to obtain a combined code; and the code storage module is used for storing the code submission information of the combined code and the target code to the blockchain.
According to one aspect of the present disclosure, there is provided a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the blockchain-based code processing method of any of the above.
According to one aspect of the present disclosure, there is provided an electronic device including: a processor; a memory for storing executable instructions of the processor; and wherein the processor is configured to perform any of the above blockchain-based code processing methods via execution of the executable instructions.
According to the code processing method based on the blockchain, the code processing device based on the blockchain, the computer readable storage medium and the electronic equipment, if the submitting operation of the target code is received, code submitting information of the target code can be obtained, further, the target code can be combined with reference codes stored in the blockchain to process the codes to obtain combined codes, and the combined codes and the code submitting information of the target code are stored in the blockchain. On the one hand, the code updating and processing can be carried out by combining the newly submitted target code and the reference code stored in the blockchain to obtain the combined code, and then the combined code and the code submitting information during the submitting operation are stored in the blockchain. On the other hand, compared with the related art, the method has the advantages that the process of combining the target code and the reference code stored in the blockchain is realized, so that the operation steps are simplified, the limitation caused by collision easily caused by code combination is avoided, and the accuracy and the practicability are improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the disclosure and together with the description, serve to explain the principles of the disclosure. It will be apparent to those of ordinary skill in the art that the drawings in the following description are merely some embodiments of the present disclosure and that other drawings may be derived from these drawings without undue effort.
FIG. 1 shows a schematic diagram of a system architecture for implementing a blockchain-based code processing method in the present exemplary embodiment;
FIG. 2 illustrates a flow chart of a blockchain-based code processing method in the present exemplary embodiment;
fig. 3 shows a flow chart of code storage in the present exemplary embodiment;
FIG. 4 illustrates a block diagram of a blockchain-based code processing device in the present exemplary embodiment;
fig. 5 shows a schematic diagram of an electronic device for implementing the above method in the present exemplary embodiment.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. However, the exemplary embodiments may be embodied in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of the example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of embodiments of the present disclosure. One skilled in the relevant art will recognize, however, that the aspects of the disclosure may be practiced without one or more of the specific details, or with other methods, components, devices, steps, etc. In other instances, well-known technical solutions have not been shown or described in detail to avoid obscuring aspects of the present disclosure.
Furthermore, the drawings are merely schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and thus a repetitive description thereof will be omitted. Some of the block diagrams shown in the figures are functional entities and do not necessarily correspond to physically or logically separate entities. These functional entities may be implemented in software or in one or more hardware modules or integrated circuits or in different networks and/or processor devices and/or microcontroller devices.
A system architecture diagram of a method of an embodiment of the present disclosure is schematically illustrated in fig. 1, as illustrated in fig. 1, the system architecture 100 may include a plurality of nodes 101, which may be the same or different in form, to form a blockchain network 102. The blockchain may be a federation chain or a private chain for storing code for nodes, each of which may be a computer or server in an enterprise, uploading, storing, and updating data in the blockchain based on a certain consensus mechanism. The data in the blockchain may be code-related data, such as source code, code test results, and the like.
It should be noted that the number of nodes shown in fig. 1 is merely exemplary, and any number of nodes 101 may be provided according to actual needs, and is not limited herein.
Based on the system architecture shown in fig. 1, a blockchain-based code processing method is provided in an embodiment of the present disclosure. A flowchart of a blockchain-based code processing method in an embodiment of the present disclosure is schematically shown in fig. 2, and referring to fig. 2, the flowchart mainly includes steps S210 to S230, and is described in detail as follows:
in step S210, if a commit operation for an object code is received, code commit information of the object code is acquired.
In the embodiment of the disclosure, the object code may be modified code, newly added code, newly upgraded code, and the like, and the type of the object code may be the same as the type of the code already stored in the blockchain, and both may belong to the same object, where the object may be an item or a target. The language in which the object code is written may be various languages, and is not limited herein.
In embodiments of the present disclosure, object code may be committed by a node in the blockchain. The nodes that submit the object code each time may be different, so each node in the blockchain may submit the object code. Code commit information associated with the object code may be recorded and obtained upon detection of a commit operation of each node to the object code. Code commit information is used to describe the specifics of the commit operation, and includes, but is not limited to, the commit maker, reviewer, block number, time of uplink, code information, etc., where code information may include, but is not limited to, the modified content of the code, the filename of the code, and the number of lines of the code. A presenter to trace back who submitted codes; the auditor is used for tracing the code audited by the auditor; a block number for recording in which block the data is stored; the uplink time is used for determining the specific time of code submission so as to be convenient for accurate tracing; code information for determining the new object code submitted. By recording the code submitting information, the specific condition of the target code can be accurately determined according to the code submitting information, so that the operations such as accurate positioning, modification and adjustment and the like can be conveniently performed according to the code submitting information, and the convenience and the referenceof code processing are improved.
It should be noted that, each time the target code is submitted, code submission information of the target code submitted at the time may be recorded. The code submission information corresponding thereto may be different for each target code. The storage content of each block of the blockchain, as well as the format, may be modified and customized as desired to facilitate blockchain information queries and concerns.
In step S220, the object code and the reference code stored in the blockchain are combined to obtain a combined code.
In embodiments of the present disclosure, after a commit operation is received for the object code, the object code and reference code stored in the blockchain may be processed to achieve code merging. The reference code refers to a code existing in the blockchain, and the number of lines, the specific format, etc. of the code are not limited, so long as the uplink time of the code is earlier than the target code, and the code can be used as the reference code.
In an embodiment of the present disclosure, the specific process of performing a combination process on the object code and the reference code stored in the blockchain to obtain the combined code may include: downloading the reference code of the last block stored in the block chain; the object code is incorporated into the reference code to form the combined code. The block chain is a distributed account book which combines data blocks into a chain data structure according to time sequence and guarantees non-falsifiability and non-falsifiability in a cryptography mode. The last block refers to the last block in the blockchain, i.e., the block that is the tail of the blockchain, and the reference code stored in the last block may be the latest version of the existing code.
The combining process may be a merging process or other type of code process. Specifically, the reference code of the last block may be downloaded locally, and the object code may be incorporated into the reference code to form a combined code. That is, the newly added object code may be merged into the old code of the blockchain, forming a new code as a combined code. For example, if the reference code stored in the last block of the blockchain is the code a corresponding to the version 1 and the target code is the code B, the code B may be incorporated into the code a (e.g., added to the end of the code a) to obtain a new code, which may be used as the code C.
In code merging, a collective consensus mechanism may be employed for merging. Specifically, if the target code is determined to be correct according to the collective consensus mechanism, the target code may be added to the back of the reference code, thereby forming a combined code. If the object code is determined to be incorrect, then the object code and the reference code cannot be merged. The collective consensus mechanism is referred to as POW/POS. Among them, POW is a work load demonstration, which is a well-known mine excavation. The method is specifically used for calculating a random number meeting the rule through mathematical operation, namely obtaining the current accounting right, sending out the data required to be recorded in the round, and storing the data after the verification of other nodes in the whole network. The POS equity proves that an upgrading consensus mechanism of the workload proves that the mining difficulty is reduced in equal proportion according to the proportion and time of the tokens occupied by each node, so that the speed of finding random numbers is increased.
By merging the object code into the reference code stored in the blockchain when the plurality of nodes in the blockchain determine that the object code is correct according to a collective formula mechanism, the accuracy and reliability of code merging can be improved. Compared with the related art, the method has the advantages that true distribution is achieved, a central node does not exist, the risk of damaging the central node is eliminated, and the safety of codes is protected. Some features of blockchain technology, i.e., non-tamperable, traceable features, are utilized to combine based on collective consensus (POW/POS) to form the longest chain.
In step S230, the combined code and code submission information of the target code are stored to a blockchain.
In the embodiment of the disclosure, after the combined code is obtained, the combined code may be stored. To ensure the security and reliability of code storage, it may be stored based on a blockchain. The blockchain can comprise a plurality of blocks, each block can be used for storing all information, and encryption is carried out through a cryptography technology, so that the stored information cannot be tampered, and the information security is realized.
Specifically, the code submission information of the combined code and the target code may be added as a block to the tail of the blockchain to update the blockchain to obtain a new blockchain.
When the code submission information of the combined code and the target code is added to the blockchain as one block, the combined code may be stored to the blockchain according to the attribute information of the combined code, and at the same time the code submission information corresponding to the target code may be stored to the blockchain in order to ensure efficiency and processing speed. Wherein the attribute information of the combination code may be used to represent detailed information of the combination code, such as size information or other types of information. When the attribute information is size information, the combined code may be stored into the blockchain according to whether the size information of the combined code satisfies a storage condition. Whether the size information of the combination code satisfies the storage condition may make the manner in which the combination code is stored different. The storage condition may be specifically represented by a preset threshold, for example, if the size information of the combined code is smaller than the preset threshold, it may be considered that the combined code satisfies the storage condition; if the size information of the combined code is greater than the preset threshold, it can be considered that the combined code does not satisfy the storage condition. The preset threshold may be determined according to actual requirements, and is not limited herein. The storage condition may be determined according to the search time of the block and/or the storage space of the block, for example, if the size information of the combined code satisfies any one of the search time threshold of the block, the storage space threshold of the block, and the storage space threshold of the block, the size information may be considered to satisfy the storage condition; if any one of the above conditions is not satisfied, the size information is considered to be not satisfied with the storage condition.
Specifically, the process of storing the combination codes according to the comparison result of the attribute information of the combination codes and the storage conditions may include, as shown in fig. 3, specifically steps S310 to S330, wherein:
in step S310, it is determined whether the size information of the combination code satisfies a storage condition. If yes, go to step S320; if not, go to step S330.
In step S320, if the size information of the combined code satisfies a storage condition, storing the combined code in a blockchain;
in step S330, if the size information of the combined code does not satisfy the storage condition, the modification information of the combined code with respect to the stored code or the characteristic value of the combined code is stored to the blockchain, and the combined code is stored independently.
In the embodiment of the disclosure, the size information of the combined code can be compared with the storage condition to obtain a comparison result. And if the comparison result is that the size information meets the storage condition, storing the combined code as a whole. Specifically, the combined code and code submission information can be added to the tail of the blockchain as a block for uplink, so that the blockchain can be updated to obtain a new blockchain. If the comparison result is that the size information does not meet the storage condition, it can be known that the code amount of the combined code is large, the feature information and the code submission information of the combined code can be added into the blockchain as one block, and specifically, the feature information can be modification information or feature value of the combined code. That is, the modification information and code submission information of the combined code may be added as a block to the tail of the blockchain for the uplink and the resulting combined code stored separately elsewhere. Alternatively, the characteristic value of the combined code and the code submitting information can be used as a block and added to the tail of the blockchain for uplink to obtain a new blockchain. The modification information of the combined code may be the modified code content of the combined code relative to the reference code of the last block in the blockchain. The characteristic value of the combination code is used to uniquely represent the specific content of the combination code. Specifically, feature extraction may be performed on the combination codes to obtain feature values of the combination codes. In the feature extraction, a convolutional neural network may be used to extract features of the combined code, or other suitable models or algorithms may be used to obtain feature values. In the embodiment of the disclosure, the combined codes are stored in different modes according to the comparison result of the size information of the combined codes and the storage conditions, so that the combined codes can be stored in the block in a proper mode, the influence on the performance of the block can be avoided, and the stability of the block is improved. When the size information of the combined codes does not meet the storage condition, the modification information or the characteristic value can be stored in the block, so that the storage space occupied by the stored combined codes is reduced, the influence on the retrieval time of the block can be avoided, and the block performance is improved.
When the combined code and code commit information is stored into a block, it can be uplinked using a workload proof, with the resulting block placed at the end of the blockchain to form a new blockchain. The workload evidence means that mining is performed, namely every other time point, the blockchain system generates a random code on the system node, all peer nodes can search the code, and who finds the code, a block is generated, and then a bitcoin is obtained, and the new block can be added to the tail part (uplink for short) of the original blockchain. Thus, the original blockchain can be updated in a journaling way, and a new blockchain can be obtained.
In the embodiment of the disclosure, the code submitting information of the combined code and the target code is stored into the blockchain as one block, so that the information is not tamperable, and the safety and the reliability of the code can be improved. Meanwhile, the information can be used for tracing and disclosing outwards, so that when problematic submitted information or target codes are found, developers and auditors can be quickly positioned according to the information of the block, and the code can be checked and timely repaired, and convenience and guarantee are provided for code repair. In addition, in the embodiment of the disclosure, the codes are combined through the nodes of the blockchain, so that the operation is simple and convenient, various operation instructions do not need to be learned, and the efficiency of code combination is improved. In addition, each node can submit the target code, so that the submitted target code and the reference code are combined, the problem of conflict when a plurality of users operate simultaneously is avoided, the limitation is avoided, and the convenience is improved. The method for code iteration and data storage based on the blockchain technology utilizes the unique characteristics of the blockchain, so that the storage of codes is safer, more stable and easier to manage, and intelligent code merging can be realized.
In an embodiment of the present disclosure, there is further provided a blockchain-based code processing apparatus, referring to fig. 4, the blockchain-based code processing apparatus 400 mainly includes the following modules:
the information determining module 401 is configured to obtain code submission information of an object code if a submission operation of the object code is received;
a code combining module 402, configured to combine the target code and the reference code stored in the blockchain to obtain a combined code;
a code storage module 403, configured to store the combined code and code submission information of the target code to the blockchain.
In one exemplary embodiment of the present disclosure, a code combining module includes: the code downloading module is used for downloading the reference code of the last block stored in the blockchain; and the code merging module is used for merging the target code into the reference code to form the combined code.
In one exemplary embodiment of the present disclosure, the code combining module is configured to: if the target code is determined to be correct according to a collective consensus mechanism, the target code is merged to the reference code to form the combined code.
In one exemplary embodiment of the present disclosure, a code storage module includes: and the storage configuration module is used for storing the combined code to the blockchain according to the attribute information of the combined code and storing the code submission information of the target code to the blockchain.
In an exemplary embodiment of the present disclosure, the attribute information is size information; the storage configuration module includes: the first storage module is used for storing the combined codes if the size information of the combined codes meets the storage conditions; and the second storage module is used for storing the characteristic information of the combined codes to the blockchain and independently storing the combined codes if the size information of the combined codes does not meet the storage condition.
In an exemplary embodiment of the present disclosure, the feature information includes modification information of the combination code with respect to the stored code or a feature value of the combination code.
In one exemplary embodiment of the present disclosure, a code storage module includes: and the block adding module is used for adding the code submission information of the combined code and the target code to the blockchain as a block so as to update the blockchain to obtain a new blockchain.
It should be noted that, the specific details of each module in the above-mentioned code processing apparatus based on the blockchain are described in detail in each step of the corresponding code processing method based on the blockchain, so that the details are not repeated here.
It should be noted that although in the above detailed description several modules or units of a device for action execution are mentioned, such a division is not mandatory. Indeed, the features and functionality of two or more modules or units described above may be embodied in one module or unit in accordance with embodiments of the present disclosure. Conversely, the features and functions of one module or unit described above may be further divided into a plurality of modules or units to be embodied.
Furthermore, although the steps of the methods in the present disclosure are depicted in a particular order in the drawings, this does not require or imply that the steps must be performed in that particular order or that all illustrated steps be performed in order to achieve desirable results. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step to perform, and/or one step decomposed into multiple steps to perform, etc.
In an embodiment of the disclosure, an electronic device capable of implementing the above method is also provided.
Those skilled in the art will appreciate that the various aspects of the present disclosure may be implemented as a system, method, or program product. Accordingly, various aspects of the disclosure may be embodied in the following forms, namely: an entirely hardware embodiment, an entirely software embodiment (including firmware, micro-code, etc.) or an embodiment combining hardware and software aspects may be referred to herein as a "circuit," module "or" system.
An electronic device 500 according to such an embodiment of the present disclosure is described below with reference to fig. 5. The electronic device 500 shown in fig. 5 is merely an example and should not be construed to limit the functionality and scope of use of embodiments of the present disclosure in any way.
As shown in fig. 5, the electronic device 500 is embodied in the form of a general purpose computing device. The components of electronic device 500 may include, but are not limited to: the at least one processing unit 510, the at least one memory unit 520, a bus 530 connecting the different system components (including the memory unit 520 and the processing unit 510), and a display unit 540.
Wherein the storage unit stores program code that is executable by the processing unit 510 such that the processing unit 510 performs steps according to various exemplary embodiments of the present disclosure described in the above-mentioned "exemplary methods" section of the present specification. For example, the processing unit 510 may perform the steps as shown in fig. 2.
The storage unit 520 may include readable media in the form of volatile storage units, such as Random Access Memory (RAM) 5201 and/or cache memory unit 5202, and may further include Read Only Memory (ROM) 5203.
The storage unit 520 may also include a program/utility 5204 having a set (at least one) of program modules 5205, such program modules 5205 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each or some combination of which may include an implementation of a network environment.
Bus 530 may be one or more of several types of bus structures including a memory unit bus or memory unit controller, a peripheral bus, a graphics acceleration interface, a processing unit, or a local bus using any of a variety of bus architectures.
The electronic device 500 may also communicate with one or more external devices 600 (e.g., keyboard, pointing device, bluetooth device, etc.), one or more devices that enable a user to interact with the electronic device 500, and/or any device (e.g., router, modem, etc.) that enables the electronic device 500 to communicate with one or more other computing devices. Such communication may occur through an input/output (I/O) interface 550. Also, electronic device 500 may communicate with one or more networks such as a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the Internet, through network adapter 560. As shown, network adapter 560 communicates with other modules of electronic device 500 over bus 530. It should be appreciated that although not shown, other hardware and/or software modules may be used in connection with electronic device 500, including, but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, data backup storage systems, and the like.
In an embodiment of the present disclosure, there is also provided a computer-readable storage medium having stored thereon a program product capable of implementing the method described above in the present specification. In some possible implementations, various aspects of the disclosure may also be implemented in the form of a program product comprising program code for causing a terminal device to carry out the steps according to the various exemplary embodiments of the disclosure as described in the "exemplary methods" section of this specification, when the program product is run on the terminal device.
A program product for implementing the above-described method according to an embodiment of the present disclosure may employ a portable compact disc read-only memory (CD-ROM) and include program code, and may be run on a terminal device, such as a personal computer. However, the program product of the present disclosure is not limited thereto, and in this document, a readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium can be, for example, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium would include the following: an electrical connection having one or more wires, a portable disk, a hard disk, random Access Memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The computer readable signal medium may include a data signal propagated in baseband or as part of a carrier wave with readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A readable signal medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Program code for carrying out operations of the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C++ or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device, partly on a remote computing device, or entirely on the remote computing device or server. In the case of remote computing devices, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., connected via the Internet using an Internet service provider).
Furthermore, the above-described figures are merely schematic illustrations of processes involved in methods according to embodiments of the present disclosure, and are not intended to be limiting. It will be readily appreciated that the processes shown in the above figures do not indicate or limit the temporal order of these processes. In addition, it is also readily understood that these processes may be performed synchronously or asynchronously, for example, among a plurality of modules.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any adaptations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It is to be understood that the present disclosure is not limited to the precise arrangements and instrumentalities shown in the drawings, and that various modifications and changes may be effected without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (7)

1. A blockchain-based code processing method, comprising:
if the submitting operation of the target code is received, code submitting information of the target code is obtained;
adding the target code to the tail end of the reference code stored in the blockchain for combination processing to obtain a combined code;
storing the combined code to the blockchain according to the attribute information of the combined code, and storing code submission information of the target code to the blockchain;
wherein the storing the combined code to the blockchain and storing code submission information of the object code to the blockchain according to the attribute information of the combined code includes:
if the size information of the combined code meets the storage condition, storing the combined code as a whole;
if the size information of the combined code does not meet the storage condition, storing the characteristic information and the code submitting information of the combined code as a block to the tail of the block chain for uplink, and independently storing the combined code; the characteristic information includes modification information of the combined code with respect to a reference code of a last block in a blockchain or a characteristic value of the combined code.
2. The blockchain-based code processing method of claim 1, wherein combining the object code with a reference code stored in a blockchain to obtain a combined code includes:
downloading the reference code of the last block stored in the block chain;
the object code is incorporated into the reference code to form the combined code.
3. The blockchain-based code processing method of claim 2, wherein incorporating the object code into the reference code to form the combined code includes:
if the target code is determined to be correct according to a collective consensus mechanism, the target code is merged to the reference code to form the combined code.
4. The blockchain-based code processing method of claim 1, wherein storing the combined code and code submission information of the object code to the blockchain includes:
adding the combined code and the code submission information to the blockchain as a block to update the blockchain to obtain a new blockchain; the code submission information is code submission information of the target code.
5. A blockchain-based code processing device, comprising:
the information determining module is used for acquiring code submitting information of the target code if receiving submitting operation of the target code;
the code combining module is used for adding the target code to the tail end of the reference code stored in the blockchain to perform combination processing so as to obtain a combined code;
the code storage module is used for storing the combined code to the blockchain according to the attribute information of the combined code and storing the code submission information of the target code to the blockchain;
wherein the storing the combined code to the blockchain and storing code submission information of the object code to the blockchain according to the attribute information of the combined code includes:
if the size information of the combined code meets the storage condition, storing the combined code as a whole;
if the size information of the combined code does not meet the storage condition, storing the characteristic information and the code submitting information of the combined code as a block to the tail of the block chain for uplink, and independently storing the combined code; the characteristic information includes modification information of the combined code with respect to a reference code of a last block in a blockchain or a characteristic value of the combined code.
6. A computer readable storage medium having stored thereon a computer program, wherein the computer program when executed by a processor implements the blockchain-based code processing method of any of claims 1 to 4.
7. An electronic device, comprising:
a processor;
a memory for storing executable instructions of the processor; and
wherein the processor is configured to perform the blockchain-based code processing method of any of claims 1 to 4 via execution of the executable instructions.
CN202010162068.5A 2020-03-10 2020-03-10 Code processing method and device based on blockchain, storage medium and electronic equipment Active CN111399841B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010162068.5A CN111399841B (en) 2020-03-10 2020-03-10 Code processing method and device based on blockchain, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010162068.5A CN111399841B (en) 2020-03-10 2020-03-10 Code processing method and device based on blockchain, storage medium and electronic equipment

Publications (2)

Publication Number Publication Date
CN111399841A CN111399841A (en) 2020-07-10
CN111399841B true CN111399841B (en) 2024-02-23

Family

ID=71430814

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010162068.5A Active CN111399841B (en) 2020-03-10 2020-03-10 Code processing method and device based on blockchain, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN111399841B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107656734A (en) * 2017-08-21 2018-02-02 北京北信源软件股份有限公司 Update method, system, computer-readable recording medium and the storage control of code release information
CN109086071A (en) * 2018-08-22 2018-12-25 平安普惠企业管理有限公司 A kind of method and server of management software version information

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10438170B2 (en) * 2017-01-05 2019-10-08 International Business Machines Corporation Blockchain for program code credit and programmer contribution in a collective
US10656936B2 (en) * 2018-08-30 2020-05-19 Dell Products L.P. Systems and methods for software integrity validation using blockchain

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107656734A (en) * 2017-08-21 2018-02-02 北京北信源软件股份有限公司 Update method, system, computer-readable recording medium and the storage control of code release information
CN109086071A (en) * 2018-08-22 2018-12-25 平安普惠企业管理有限公司 A kind of method and server of management software version information

Also Published As

Publication number Publication date
CN111399841A (en) 2020-07-10

Similar Documents

Publication Publication Date Title
CN109766497B (en) Ranking list generation method and device, storage medium and electronic equipment
US20140279945A1 (en) Matching transactions in multi-level records
CN110960855B (en) Communication protocol code updating method and device, electronic equipment and storage medium
CN112068874B (en) Continuous integration method and device for software items, terminal equipment and storage medium
CN109325046A (en) Database script generation method, device, medium and electronic equipment
CN113448614A (en) Software project code management method and device, storage medium and electronic equipment
CN111176705B (en) Feature library upgrading method and device
CN111399841B (en) Code processing method and device based on blockchain, storage medium and electronic equipment
US8930939B2 (en) Comparing system engram with product engram to determine compatibility of product with system
US10824587B2 (en) Integrated universal file converter
US10311138B2 (en) Preventing partial change set deployments in content management systems
CN111104125A (en) Intelligent integrated version management method, device, medium and electronic equipment
CN111723134A (en) Information processing method, information processing device, electronic equipment and storage medium
CN110795259A (en) Method and device for analyzing application collapse
CN112286909B (en) Execution state determining method, device, server and storage medium
CN110716946B (en) Method and device for updating feature rule matching library, storage medium and electronic equipment
US20210049008A1 (en) Identifying implicit dependencies between code artifacts
CN111176718A (en) Script online method and device, storage medium and electronic equipment
US11693817B2 (en) Integrated universal file converter
CN113011138B (en) Information processing method, information processing device, electronic equipment and storage medium
US20170212743A1 (en) System and method for reliability, availability, and serviceability
CN110555070A (en) Method and apparatus for outputting information
CN112232533B (en) Product assembly management method and related device
CN110647519B (en) Method and device for predicting missing attribute value in test sample
CN110781188B (en) Form information processing method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant