Disclosure of Invention
The embodiment of the application provides a software serial number management method and device based on a blockchain, which can improve the effectiveness of software serial number management.
In one aspect, the embodiment of the application provides a software serial number management method based on a blockchain, which comprises the following steps:
acquiring a sequence number uplink request corresponding to a target agent object, and acquiring data to be uplink corresponding to the target agent object based on the sequence number uplink request, wherein the data to be uplink comprises target object information, source object information, software information and target sequence number information corresponding to the target agent object;
When detecting that the target serial number information is different from the associated serial number information corresponding to the associated proxy object and the target serial number information exists in a software blockchain, generating a serial number block based on the data to be uplink, and adding the serial number block to the software blockchain, wherein the target proxy object and the associated proxy object are both associated with the source object information.
Wherein the method further comprises:
Acquiring an associated proxy object associated with the source object information based on the source object information in the data to be uplink;
Acquiring associated serial number information from uplink data corresponding to the associated proxy object, and adding the associated serial number information to a serial number set;
When the related sequence number information in the sequence number set is the same as the target sequence number information, confirming that the sequence number uplink request is illegal, and sending abnormal prompt information to the terminal equipment corresponding to the target agent object.
Wherein the method further comprises:
Traversing all blocks contained in the software blockchain based on the target sequence number information in the data to be uplinked;
If the target serial number information does not exist in the software blockchain, the target serial number information is determined to be an abnormal serial number, the serial number uplink request is determined to be illegal, and abnormal prompt information is sent to the terminal equipment corresponding to the target agent object.
Wherein the generating a sequence number block based on the data to be uplinked, adding the sequence number block to the software blockchain, comprises:
Based on the secret key corresponding to the target agent object, signing the data to be uplink;
When the to-be-uplink data signature verification passes, packaging the target object information, the source object information, the software information and the target serial number information into the serial number block;
And verifying the serial number blocks according to a common recognition mechanism, and adding the serial number blocks passing verification to the software blockchain.
The signing the data to be uplink based on the key corresponding to the target agent object includes:
decrypting the digital signature carried by the data to be uplink based on the secret key to obtain a first hash value corresponding to the digital signature;
Performing hash operation on the data to be uplinked based on the hash operation, and generating a second hash value corresponding to the data to be uplinked;
and if the first hash value and the second hash value are detected to be the same, determining that the data to be uplink passes the signature verification.
Wherein the method further comprises:
the method comprises the steps of obtaining a uplink request carrying to-be-uplink software data associated with a source object, wherein the to-be-uplink software data comprises source object information, software information and a sequence number set;
And packaging the source object information, the software information and the sequence number set into a history block, and adding the history block to the software blockchain, wherein the sequence number set comprises the target sequence number information.
Wherein the method further comprises:
when a serial number inquiry request aiming at the target serial number information sent by a request terminal is received, acquiring an associated block corresponding to the target serial number information from the software block chain based on the serial number inquiry request, wherein the associated block comprises the serial number block;
And generating a flow track corresponding to the target serial number information based on the association block, determining production object information corresponding to the target serial number information based on the flow track, and sending the production object information as a query result to the request terminal.
In one aspect, an embodiment of the present application provides a software serial number management device based on a blockchain, including:
The system comprises an acquisition module, a target agent object processing module and a target agent object processing module, wherein the acquisition module is used for acquiring a sequence number uplink request corresponding to the target agent object, and acquiring data to be uplink corresponding to the target agent object based on the sequence number uplink request, wherein the data to be uplink comprises target object information, source object information, software information and target sequence number information corresponding to the target agent object;
And the first uplink module is used for generating a serial number block based on the data to be uplink and adding the serial number block to the software blockchain when detecting that the target serial number information is different from the associated serial number information corresponding to the associated proxy object and the target serial number information exists in the software blockchain, and the target proxy object and the associated proxy object are both associated with the source object information.
Wherein the apparatus further comprises:
The associated object acquisition module is used for acquiring an associated proxy object associated with the source object information based on the source object information in the data to be uplinked;
The serial number adding module is used for acquiring the associated serial number information from the uplink data corresponding to the associated proxy object and adding the associated serial number information to a serial number set;
And the comparison module is used for confirming that the sequence number uplink request is illegal when the associated sequence number information in the sequence number set is the same as the target sequence number information, and sending abnormal prompt information to the terminal equipment corresponding to the target agent object.
Wherein the apparatus further comprises:
The traversing module is used for traversing all blocks contained in the software blockchain based on the target serial number information in the data to be uplinked;
And the detection module is used for determining the target sequence number information as an abnormal sequence number if the target sequence number information does not exist in the software blockchain, determining that the sequence number uplink request is illegal and sending abnormal prompt information to the terminal equipment corresponding to the target agent object.
Wherein the first uplink module includes:
the signature verification unit is used for verifying the data to be linked based on the secret key corresponding to the target agent object;
The block packing unit is used for packing the target object information, the source object information, the software information and the target serial number information into the serial number block when the to-be-uplink data signature verification passes;
and the verification unit is used for verifying the serial number block according to a consensus mechanism and adding the serial number block which passes verification to the software blockchain.
Wherein, the check-in unit includes:
A decryption subunit, configured to decrypt a digital signature carried by the data to be uplink based on the key, and obtain a first hash value corresponding to the digital signature;
The hash operation subunit is used for carrying out hash operation on the data to be uplinked based on hash operation and generating a second hash value corresponding to the data to be uplinked;
And the judging subunit is used for determining that the data to be uplink passes the signature verification if the first hash value is detected to be the same as the second hash value.
Wherein the apparatus further comprises:
The system comprises a source object acquisition module, a uplink request acquisition module, a request processing module and a request processing module, wherein the source object acquisition module is used for acquiring a source object information, a source software information and a sequence number set;
And the second uplink module is used for packaging the source object information, the software information and the sequence number set into a history block, adding the history block into the software blockchain, and the sequence number set comprises the target sequence number information.
Wherein the apparatus further comprises:
The inquiry request acquisition module is used for acquiring an associated block corresponding to the target serial number information from the software block chain based on the serial number inquiry request when receiving the serial number inquiry request aiming at the target serial number information sent by the request terminal;
And the query module is used for generating a flow track corresponding to the target serial number information based on the association block, determining production object information corresponding to the target serial number information based on the flow track, and sending the production object information as a query result to the request terminal.
An aspect of an embodiment of the present application provides a computer device, including a memory and a processor, where the memory stores a computer program, where the computer program is executed by the processor, to cause the processor to perform the steps of the method in an aspect of an embodiment of the present application.
An aspect of the present application provides a computer readable storage medium storing a computer program comprising program instructions which, when executed by a processor, perform the steps of a method as described in an aspect of the present application.
According to the method and the device for processing the target proxy object, the to-be-uplink data corresponding to the target proxy object can be obtained, the to-be-uplink data comprises target object information, source object information, software information and target sequence number information corresponding to the target proxy object, when the fact that the target sequence number information is different from the associated sequence number information corresponding to the associated proxy object and the target sequence number information exists in a software blockchain is detected, a sequence number block is generated according to the to-be-uplink data, the sequence number block is added into the software blockchain, and the target proxy object and the associated proxy object are associated with the source object information. Because of the decentralization and the non-tamper property of the blockchain, the software serial number information is public and transparent to the management node with the inquiry authority, and the accuracy, the reliability and the traceability of the software serial number information record are improved. All software serial numbers produced by manufacturers and the flowing process of the software serial numbers can be recorded in the software blockchain, so that the effectiveness of software serial number management can be improved.
Detailed Description
The following description of the embodiments of the present application will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
The related technical noun explanation of the embodiment of the application is that the software serial number refers to an identification code (similar to a personal identification card number) which is generated by carrying out encryption calculation according to the computer hardware information installed by the user software and consists of a series of numbers, letters or other symbols. In general, when the software is initially installed, a corresponding software serial number needs to be input, and the software can be authenticated. Meanwhile, various functions of the original software can be realized only after the software passes the original verification, and a user can normally install and use the software, acquire upgrading services and the like. In other words, the software serial number may be understood as a technical protection measure taken to prevent piracy, and the copyright owner may control the lifetime of the software through the serial number.
The blockchain (Blockchain) is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission (P2P transmission), consensus mechanism, encryption algorithm and the like, and is essentially a decentralised database, and can be composed of a plurality of serial transaction records (also called blocks) which are connected in series and protect contents by means of cryptography, and the distributed ledgers connected in series by the blockchain can enable multiple parties to record transactions effectively, and can permanently check the transactions (non-falsification). The common recognition mechanism is a mathematical algorithm for establishing trust and obtaining rights among different nodes in the block chain network, in other words, the common recognition mechanism is a mathematical algorithm commonly recognized by all network nodes of the block chain.
Fig. 1 is a schematic diagram of a software sequence number in a ul scenario according to an embodiment of the present application. As shown in fig. 1, the server 10c may be represented as any blockchain node in the blockchain network, the terminal device 10a, the terminal device 10d, and the terminal device 10f may be represented as user terminals corresponding to agents, and the terminal device 10a, the terminal device 10d, and the terminal device 10f may transmit serial number information purchased by agents to the blockchain node in the blockchain network, such as the server 10c. When the agent a purchases the serial number 1 about the software a from the manufacturer a, the terminal device 10a corresponding to the agent a may package the purchased serial number 1 (may be referred to as target serial number information), the software a to which the serial number 1 belongs (may be referred to as software information), the manufacturer a of the serial number 1 (may be referred to as source object information), and the agent a (may be referred to as target object information) into the to-be-uplinked data 10b, and send a data uplinking request to the server 10c, where the data uplinking request may carry the to-be-uplinked data 10b.
After receiving the data to be uploaded by the terminal device 10a, the server 10C may determine all associated agents associated with the agent a based on the source object information in the data to be uploaded 10B, that is, determine the remaining agents having transaction records with the manufacturer a, such as agent B, agent C, etc., and further the server 10C may obtain the data uploaded by all associated agents to the server 10C, such as the data 10e uploaded by the terminal device 10d corresponding to the agent B, the data 10g uploaded by the terminal device 10g corresponding to the agent C, etc., and obtain corresponding serial number information from the data uploaded by all associated agents, that is, obtain the serial number information from the data 10e as the serial number 2, obtain the serial number information from the data 10g as the serial number n, etc. Comparing the serial number 1 in the data to be uplink 10b with the serial number information uploaded by all the associated agents, if the serial number 1 already exists in the serial number information uploaded by all the associated agents, indicating that the serial number 1 uploaded by the agent A is given to other agents by the manufacturer A, namely the agent A does not have the authority of possessing the serial number 1, directly sending serial number abnormality prompt information to the terminal device 10a, stopping executing the subsequent steps, and if the serial number information uploaded by all the associated agents is different from the serial number 1, indicating that the serial number 1 is only allocated to the agent A, and further continuously executing the subsequent steps. Meanwhile, after receiving the data to be uplinked 10b uploaded by the terminal device 10a, the server 10c may also read all data stored in the software blockchain 10h, and detect whether the serial number 1 exists in the software blockchain 10 h. If there is a sequence number 1 in the software blockchain 10h and all the sequence number information uploaded by the associated agents are different from the sequence number 1, the data to be uplinked 10b may be packed into a sequence number block 10i, and after the sequence number block 10i completes consensus, the sequence number block 10i may be added to the software blockchain 10 h. All serial number information produced by a manufacturer and the flowing process of the serial number information can be recorded in the software blockchain 10 h.
It should be noted that the same manufacturer may produce a plurality of serial numbers, and the manufacturer may upload all serial numbers carrying the manufacturer information to the blockchain network, so that the blockchain network records the serial numbers produced by the blockchain network. Then, the manufacturer can sell the produced serial numbers to a plurality of agents, and after the agents receive the serial numbers sold by the manufacturer, the agents can also uplink the serial numbers carrying the agent information and the manufacturer information. It should be appreciated that for the same serial number of the same software, it is not possible to sell it repeatedly to multiple agents, so that it is necessary to detect the serial number information that needs to be uplinked before it is uplinked, and only if none of the remaining agents has purchased the serial number information and the serial number information is indeed produced by the manufacturer.
The terminal device 10a, the terminal device 10d, and the terminal device 10f may include a mobile phone, a tablet computer, a notebook computer, a palm computer, a mobile internet device (mobile INTERNET DEVICE, MID), a wearable device (e.g., a smart watch, a smart bracelet, etc.), and the like.
Fig. 2 is a flowchart of a software serial number management method based on a blockchain according to an embodiment of the present application. As shown in fig. 2, the method may include:
step S101, obtaining a sequence number uplink request corresponding to a target agent object, and obtaining data to be uplink corresponding to the target agent object based on the sequence number uplink request, wherein the data to be uplink comprises target object information, source object information, software information and target sequence number information corresponding to the target agent object;
Specifically, after the target proxy object obtains the target sequence number, the terminal device corresponding to the target proxy object (corresponding to the terminal device 10a in the embodiment corresponding to fig. 1) may upload the target object information corresponding to the target proxy object, the source object information corresponding to the software sequence number, the software information and the target sequence number to the blockchain network together, and send a sequence number uplink request associated with the target proxy object to the blockchain network. After receiving the sequence number uplink request, the node server (corresponding to the server 10c in the embodiment corresponding to fig. 1) uses the target object information corresponding to the target proxy object, the source object information corresponding to the software sequence number, the software information and the target sequence number as the data to be uplink based on the sequence number uplink request.
The target agent object may refer to a user, an enterprise and an agent who purchase a software serial number, the target object information corresponding to the target agent object may be represented as information such as a name, a number and the like of the target agent object, the source object information may refer to information such as a name, a number and the like of a manufacturer and/or an agent selling the software serial number, the software information may refer to information such as a software name, a software version number and the like of software to which the serial number purchased by the target agent object belongs, and the target serial number information may refer to information such as a serial number purchased by the target agent object from the source object and a serial number tag and the like.
For example, the agent a purchases the serial numbers 1 and 2 of the software a from the manufacturer a, and then the agent a can upload the name of the agent a, the name of the manufacturer a, the name and version number of the software a, the serial numbers 1 and 2 to the blockchain network through the terminal to which the agent a belongs, and the node server can take the name of the agent a, the name of the manufacturer a, the name and version number of the software a, the serial numbers 1 and 2 as data to be uploaded after receiving the serial number uplink request sent by the terminal device to which the agent a belongs, where the agent a is a target agent object, the name of the agent a is target object information, the name of the manufacturer a is source object information, the name and version number of the software a are software information, and the serial numbers 1 and 2 are target serial number information. If the agent a purchases the serial numbers 1 and 2 from the manufacturer a and sells the serial numbers 1 to the enterprise a, the enterprise a can upload the name of the enterprise a, the name of the agent a, the name of the manufacturer a, the name and version number of the software a and the serial number 1 to the blockchain network, and the node server can take the name of the enterprise a, the name of the agent a, the name of the manufacturer a, the name and version number of the software a and the serial number 1 as data to be uploaded after receiving the serial number uplink request sent by the terminal device to which the enterprise a belongs, wherein at the moment, the enterprise a is a target agent object, the name of the enterprise a is target object information, the name of the agent a and the name of the manufacturer a are source object information, the name and version number of the software a are software information, and the serial number 1 is target serial number information.
Optionally, in order to prevent the data to be uplinked from being tampered (for example, the data to be uplinked associated with the target proxy object is maliciously intercepted in the uploading process and changed into the data corresponding to the rest of proxy objects, etc.), before uploading the data to be uplinked to the blockchain network, the terminal device corresponding to the target proxy object may generate a digital signature corresponding to the data to be uplinked, so that the node server may check the actually received data, and further determine whether the received data is the data to be uplinked sent by the terminal device corresponding to the target proxy object. Taking the above example as an example, the process of generating a digital signature by using the terminal device corresponding to the target proxy object is specifically described that the proxy a purchases the serial number 1 and the serial number 2 of the software a from the manufacturer a, the terminal device corresponding to the proxy a may take the name of the proxy a, the name of the manufacturer a, the name and version number of the software a, the serial number 1 and the serial number 2 as data to be uplinked, and perform Hash operation on the data to be uplinked by using a Hash algorithm (may also be referred to as a Hash algorithm, or a Hash function, or a Hash algorithm) to convert the data to be uplinked into a Hash value with a fixed length, the terminal device corresponding to the proxy a may generate a key pair, which may include a public key and a private key, the terminal device may notify the public key to all the blockchain nodes in the blockchain network, and the private key is managed by itself. The terminal device can encrypt the hash value converted from the data to be uplink by using the private key to obtain a digital signature corresponding to the data to be uplink (the digital signature can be decrypted by using the public key of the terminal device), and then the data to be uplink carrying the digital signature is uploaded to the blockchain network. The hash algorithm may compress the data or the message into a digest, not only fix the format of the data, but also reduce the data size, and may include, but is not limited to, SHA-1, SHA-224, SHA-256, SHA-384, and SHA-512. Taking the SHA-256 algorithm as an example, the SHA-256 algorithm can generate a 256-bit hash value for any size data, and can generate different hash values for different data.
Optionally, in order to ensure confidentiality of the data to be uplinked, the terminal device corresponding to the target proxy object may also encrypt the data to be uplinked by using the private key. In other words, the data to be uplinked may be ciphertext carrying a digital signature.
Step S102, when detecting that the target serial number information is different from the associated serial number information corresponding to the associated proxy object and the target serial number information exists in the software blockchain, generating a serial number block based on the data to be uplink, and adding the serial number block to the software blockchain, wherein the target proxy object and the associated proxy object are both associated with the source object information.
Specifically, when the node server receives the data to be uplink, it needs to verify the data to be uplink, and only after the data to be uplink passes the verification, it can be packaged into a serial number block. The authentication procedure for the data to be uplinked may include the following:
On the one hand, the node server can acquire the associated proxy object associated with the source object information according to the source object information in the data to be uplink, acquire the associated serial number information from the uplink data corresponding to the associated proxy object, and add the acquired associated serial number information to the serial number set. When the related sequence number information in the sequence number set is the same as the target sequence number information in the data to be uplinked, the fact that the sequence number uplink request is illegal can be confirmed, the data to be uplinked is confirmed to be invalid data to be deleted, and abnormal prompt information is sent to the terminal equipment corresponding to the target agent object, wherein the abnormal prompt information can be that the target sequence number information is used by other agent objects, and the target agent object does not have permission to use the target sequence number information. When the associated sequence number information is not the same as the target sequence number information in the sequence number set, the target sequence number information can be determined not to be used by the rest of the agent objects, and further the subsequent detection process can be performed. For example, a manufacturer may produce a plurality of serial numbers and sell the produced serial numbers to a plurality of agents, who may upload information about the purchased serial numbers to the blockchain network after purchasing the serial numbers to request for the uplink. When the target agent purchases a certain serial number (i.e., target serial number information) from the manufacturer and requests for the uplink, the node server may obtain the rest of agents (i.e., associated agent objects) that purchase serial numbers from the manufacturer and obtain their respective purchased serial numbers from the data uploaded by the rest of agents, and detect whether the serial numbers purchased by the target agent are the same as the serial numbers purchased by the rest of agents, i.e., detect whether the manufacturer repeatedly sells the same serial number to different agents.
On the other hand, the node server can traverse all blocks contained in the software blockchain according to the target sequence number information in the data to be uplinked, when the target sequence number information does not exist in the software blockchain, the target sequence number information can be determined to be an abnormal sequence number, further, the sequence number uplink request can be determined to be illegal, the data to be uplinked is determined to be invalid data to be deleted, and abnormal prompt information is sent to the terminal equipment corresponding to the target agent object, wherein the abnormal prompt information can be that the target sequence number information is a non-legal sequence number, and the legal sequence number is requested to be purchased. When the target serial number information exists in the software blockchain, the target serial number information is indicated to be an original serial number. It should be appreciated that all manufacturers need to uplink all the produced serial numbers after producing the original serial numbers, so if the target serial number information purchased by the target agent object is stored in the software blockchain, the target serial number information is indicated as the original serial number. Only when the target sequence number information in the data to be uplink meets that ① target sequence number information is different from the associated sequence number information corresponding to the associated proxy object, ② target sequence number information is an original sequence number, the data to be uplink is indicated to meet the detection condition, and the data to be uplink can be packaged into sequence number blocks.
In still another aspect, after receiving the data to be uplinked, if the data to be uplinked carries a digital signature, the node server needs to perform signature verification on the data to be uplinked, and a specific signature verification process may include that the node server decrypts the digital signature carried by the data to be uplinked according to a public key of a terminal device corresponding to a target proxy object, obtains a first hash value corresponding to the digital signature, further performs hash operation on the data to be uplinked based on a hash algorithm, generates a second hash value corresponding to the data to be uplinked, if the first hash value is detected to be the same as the second hash value, the data to be uplinked passes through signature verification, determines that an uplinking request is legal, that is, a block is generated on the data to be uplinked, and adds the block after consensus to a software block chain. If the digital signature carried in the data to be uplinked received by the node server is not the digital signature of the terminal equipment corresponding to the target proxy object, namely the digital signature in the data to be uplinked is the digital signature generated by using the fake private key, the node server directly displays decryption failure when decrypting by using the real public key.
Fig. 3 is a schematic diagram of a label verification of data to be uplink according to an embodiment of the present invention. As shown in fig. 3, after receiving the data to be uploaded 20a corresponding to the terminal device and uploaded by the target proxy object, the server 10c may obtain the digital signature 20b carried by the data to be uploaded 20a, decrypt the digital signature 20b by using the public key 20c corresponding to the terminal device and obtain the hash value 1, further, the server 10c may perform a hash operation on the data to be uploaded 20a by using the hash algorithm 20d (the hash algorithm 20d is the hash algorithm adopted by the terminal device to generate the digital signature 20 b), so as to obtain the hash value 2 corresponding to the data to be uploaded 20a, if the hash value 1 is equal to the hash value 2, it indicates that the data to be uploaded 20a is not tampered in the uploading process, and if the hash value 1 is not equal to the hash value 2, it indicates that there is a possibility of tampering in the actual transaction data in the data to be uploaded process, and the hash value is not passed, and delete the data to be uploaded 20 a. It should be understood that, before uploading the data 20a to be uploaded, the client already notifies the server 10c of the public key 20c and the hash algorithm 20d used to generate the digital signature 20b, and if the data 20a to be uploaded is tampered during uploading, the digital signature 20b received by the server 10c is not the digital signature originally generated by the terminal device, and the server 10c cannot solve the digital signature 20b when decrypting the digital signature using the public key 20c corresponding to the terminal device.
It should be noted that, for the above-mentioned detection process of whether the target serial number information is repeated (i.e. whether the target serial number information purchased by the target proxy object is detected to be the same as the associated serial number information purchased by the associated proxy object), the detection process of whether the target serial number information is an original serial number (i.e. whether the target serial number information exists in the software blockchain is detected), and the signature verification process, all are verification performed by the node server after receiving the data to be uploaded, and the three verification processes are not time-sequential. If the node server receives the data to be linked, it can check the label of the data to be linked, and can check whether the target serial number information is a repeated serial number, if the target serial number information is not a repeated serial number, then it can check whether the target serial number information is a legal serial number, if the target serial number information is a legal serial number, it can check whether the target serial number information is a repeated serial number, if not, it can check the label of the data to be linked, and the specific detection and verification sequence is not limited. When the verification process meets the conditions, the node server can package the data to be uplink into a serial number block. Of course, if any one of the above mentioned verification processes does not meet the requirement, the data to be uplink may be determined as invalid data to be deleted, and no subsequent verification is performed, for example, after the node server receives the data to be uplink, the node server performs signature verification first, if the signature verification does not pass, the data to be uplink is directly determined as invalid data to be deleted, and no detection process whether the target sequence number information is repeated or not and no detection process whether the target sequence number information is an original sequence number or not need to be performed.
When the data to be uplink passes the signature verification, and the target serial number information in the data to be uplink is detected to be different from the associated serial number information corresponding to the associated proxy object, and the target serial number information exists in the software blockchain, the node server can package the data to be uplink into serial number blocks, verify the generated serial number blocks according to a consensus mechanism, and the serial number blocks passing the verification can be added to the software blockchain. The specific generation process of the serial number block comprises the steps of obtaining a generation time stamp corresponding to each block in a software block chain, wherein the block with the largest generation time stamp is the latest block recorded in the software block chain, obtaining a hash value corresponding to the latest block and the current time, generating a hash value corresponding to data to be uplinked, generating block head data in the serial number block based on the hash value corresponding to the latest block, the current time and the hash value corresponding to the data to be uplinked, generating block body data of the serial number block based on the data to be uplinked, and generating the serial number block according to the block head data and the block body data. The node server may broadcast the generated sequence number block to the rest of the blockchain nodes in the blockchain network, parse the to-be-uplinked data in the sequence number block through a consensus mechanism, determine whether the target object information, the source object information, the software information and the target sequence number information in the to-be-uplinked data are valid information, if the manufacturer corresponding to the target sequence number information is determined according to the source object information, determine whether the software information and the target sequence number information in the to-be-uplinked data are reasonable or not according to the manufacturer, if the to-be-uplinked data in the sequence number block are determined to be valid data, the sequence number block is verified, and return the verification result to the node server, and when most of the blockchain nodes (such as more than 50% of the blockchain nodes) in the blockchain network return the verification result to the node server, the verification of the sequence number block is verified, and the verified sequence number block is added into the software blockchain.
According to the method and the device for processing the target proxy object, the to-be-uplink data corresponding to the target proxy object can be obtained, the to-be-uplink data comprises target object information, source object information, software information and target sequence number information corresponding to the target proxy object, when the fact that the target sequence number information is different from the associated sequence number information corresponding to the associated proxy object and the target sequence number information exists in a software blockchain is detected, a sequence number block is generated according to the to-be-uplink data, the sequence number block is added into the software blockchain, and the target proxy object and the associated proxy object are associated with the source object information. Because of the decentralization and the non-tamper property of the blockchain, the software serial number information is public and transparent to the management node with the inquiry authority, and the accuracy, the reliability and the traceability of the software serial number information record are improved. All software serial numbers produced by manufacturers and the flowing process of the software serial numbers can be recorded in the software blockchain, so that the effectiveness of software serial number management can be improved.
Fig. 4 is a flowchart of another software serial number management method based on a blockchain according to an embodiment of the present application. As shown in fig. 4, the method may include:
Step S201, obtaining a uplink request carrying to-be-uplink software data associated with a source object, wherein the to-be-uplink software data comprises the source object information, the software information and a sequence number set;
Specifically, before the node server obtains the sequence number uplink request corresponding to the target proxy object, the node server may also receive the uplink request carrying the software data to be uplink associated with the source object. In other words, after the source object generates or purchases the serial number of the software, the generated or purchased serial number (i.e. serial number set, if the source object generates or purchases 5 serial numbers, there are 5 serial numbers in the serial number set), the software information corresponding to the serial number, and the source object information may be uploaded to the blockchain network as the software data to be uplink, and the node server may acquire the software data to be uplink based on the uplink request.
In order to prevent the software data to be uploaded from being tampered in the uploading process, before uploading the software data to be uploaded to the blockchain network, the terminal device corresponding to the source object can also generate a digital signature corresponding to the software data to be uploaded, so that the node server can check the actually received data, and further determine whether the received data is the software data to be uploaded sent by the source object. The process of generating the digital signature may refer to the description of step S101 in the embodiment corresponding to fig. 2, which is not repeated here.
Step S202, packaging the source object information, the software information and the sequence number set into a history block, and adding the history block to the software blockchain;
Specifically, after receiving the software data to be uploaded by the terminal device corresponding to the source object, the node server may also perform signature verification on the received software data to be uploaded, where the signature verification process may refer to the embodiment corresponding to fig. 3 and will not be described herein. The node server may package the software data to be uplink that passes the signature verification into a history block, that is, package source object information, software information and all serial number information in the serial number set into a history block, where the generation process of the history block is similar to the generation process of the serial number block in the embodiment corresponding to fig. 2, and will not be described herein. The serial number set refers to all serial numbers produced by the same manufacturer, and comprises target serial number information and associated serial number information.
Step S203, a sequence number uplink request corresponding to a target agent object is obtained, and data to be uplink corresponding to the target agent object is obtained based on the sequence number uplink request, wherein the data to be uplink comprises target object information, source object information, software information and target sequence number information corresponding to the target agent object;
Step S204, when detecting that the target serial number information is different from the associated serial number information corresponding to the associated proxy object and the target serial number information exists in a software blockchain, generating a serial number block based on the data to be uplink, and adding the serial number block to the software blockchain;
the specific implementation process of step S201 to step S202 may refer to step S101 to step S102 in the embodiment corresponding to fig. 2, which is not described herein.
Step S205, when a serial number inquiry request aiming at the target serial number information sent by a request terminal is received, acquiring an associated block corresponding to the target serial number information from the software block chain based on the serial number inquiry request, wherein the associated block comprises the serial number block;
Specifically, after the user purchases the target serial number information, the target serial number information can be input on the serial number inquiry platform, so that the request terminal to which the serial number inquiry platform belongs sends a serial number inquiry request aiming at the target serial number information to the blockchain network. After receiving the sequence number inquiry request, the node server can determine all blocks stored with the target sequence number information in the software blockchain as associated blocks according to the sequence number inquiry request, wherein the associated blocks can comprise the sequence number blocks and history blocks.
Step S206, generating a flow track corresponding to the target serial number information based on the association block, determining production object information corresponding to the target serial number information based on the flow track, and sending the production object information as a query result to the request terminal.
Specifically, the node server may generate a flow track corresponding to the target serial number information based on the obtained associated block, for example, after the manufacturer produces the target serial number information, the manufacturer information, the software information and the target serial number information are uploaded to the blockchain network, and the blockchain node packages the information into a block and writes the information into the software blockchain, when the manufacturer sells the target serial number information to the agent a, the agent a uploads the information of the agent a, the manufacturer information, the target serial number information and the software information to the blockchain network again, the blockchain node packages the information of the agent a, the information of the manufacturer, the target serial number information and the software information into a block and writes the information into the software blockchain, and when the agent a sells the target serial number information to the user a, the terminal device corresponding to the user a may upload the information of the user a, the information of the agent a, the manufacturer information, the target serial number information and the software information into the blockchain network, and packages the information into the software blockchain by the blockchain node. The flow trace from which the target serial number information can be obtained is manufacturer-agent a-user a. And then the production object information corresponding to the target serial number information can be determined according to the flow track, and the production object information is returned to the request terminal as a query result, so that a user can obtain the source of the target serial number information.
It should be appreciated that when a user or an enterprise purchases a software serial number, the user or the enterprise can input the purchased serial number information on the serial number query platform to query whether the purchased serial number is an authentic serial number, and if so, the source of the purchased serial number (i.e. the production object information) can be further queried. Fig. 5 is a schematic diagram of a scenario of querying a serial number according to an embodiment of the present application. As shown in fig. 5, after the user purchases serial number 123xxxabc, the user may input serial number 123xxxabc on the serial number query platform provided by request terminal 30a for a query. After the user inputs the completion sequence number and selects the query button, the requesting terminal 30a may send a sequence number query request to the server 10c (which may be any blockchain node in the blockchain network, here, the server 10c is taken as an example), and obtain all blocks recorded with the sequence number 123xxxabc from the software blockchain 30g (equivalent to the software blockchain 10h in the embodiment corresponding to fig. 1 above) based on the sequence number query request, if the sequence number 123xxxabc is not present in the software blockchain 30g, the sequence number 123xxxabc may be determined as a pirated sequence number, and if the sequence number 123xxxabc is present in the software blockchain 30g, as shown in fig. 5, the sequence number 123xxxabc is stored in each of the blocks 30b, 30c, and 30d, the blocks 30b, 30c may be referred to as associated blocks corresponding to the sequence number 123 xxxabc. The flow track 30e corresponding to the serial number 123xxxabc can be generated by reading all the data stored in the block 30b, the block 30c and the block 30d, the flow track 30e is specifically a manufacturer a-agent a-enterprise a, and a query result 30f can be obtained based on the flow track 30e, wherein the query result 30f is that the serial number 123xxxabc is an original serial number, and the manufacturer of the serial number 123xxxabc is the manufacturer a. The server 10c may return the query result 30f to the requesting terminal 30a for the user to view the query result 30 f.
According to the method and the device for processing the target proxy object, the to-be-uplink data corresponding to the target proxy object can be obtained, the to-be-uplink data comprises target object information, source object information, software information and target sequence number information corresponding to the target proxy object, when the fact that the target sequence number information is different from the associated sequence number information corresponding to the associated proxy object and the target sequence number information exists in a software blockchain is detected, a sequence number block is generated according to the to-be-uplink data, the sequence number block is added into the software blockchain, and the target proxy object and the associated proxy object are associated with the source object information. Because of the decentralization and the non-tamper property of the blockchain, the software serial number information is public and transparent to the management node with the inquiry authority, and the accuracy, the reliability and the traceability of the software serial number information record are improved. All software serial numbers produced by manufacturers and the flowing process of the software serial numbers can be recorded in the software blockchain, so that the effectiveness of software serial number management can be improved.
Fig. 6 is a schematic structural diagram of a software serial number management device based on a blockchain according to an embodiment of the present application. As shown in fig. 6, the blockchain-based software serial number management device 1 may include an acquisition module 11, a first uplink module 12;
The acquisition module 11 is configured to acquire a sequence number uplink request corresponding to a target proxy object, and acquire to-be-uplink data corresponding to the target proxy object based on the sequence number uplink request, where the to-be-uplink data includes target object information, source object information, software information and target sequence number information corresponding to the target proxy object;
and the first uplink module 12 is configured to generate a sequence number block based on the data to be uplink and add the sequence number block to the software blockchain when it is detected that the target sequence number information is different from the associated sequence number information corresponding to the associated proxy object and the target sequence number information exists in the software blockchain, and the target proxy object and the associated proxy object are both associated with the source object information.
The specific function implementation manner of the obtaining module 11 and the first uplink module 12 may refer to step S101 to step S102 in the embodiment corresponding to fig. 2, which is not described herein.
Referring to fig. 6, the software serial number management device 1 based on blockchain may further include a uplink request obtaining module 13, a second uplink module 14, an associated object obtaining module 15, a serial number adding module 16, a comparing module 17, a traversing module 18, a detecting module 19, a query request obtaining module 20, and a query module 21;
a uplink request obtaining module 13, configured to obtain a uplink request carrying to-be-uplink software data associated with a source object, where the to-be-uplink software data includes the source object information, the software information, and a sequence number set;
A second uplink module 14, configured to package the source object information, the software information, and the sequence number set into a history block, and add the history block to the software blockchain;
An associated object obtaining module 15, configured to obtain an associated proxy object associated with the source object information based on the source object information in the data to be uplink;
The sequence number adding module 16 is configured to obtain associated sequence number information from uplink data corresponding to the associated proxy object, and add the associated sequence number information to a sequence number set;
a comparison module 17, configured to confirm that the sequence number uplink request is illegal when the associated sequence number information in the sequence number set is the same as the target sequence number information, and send exception prompt information to a terminal device corresponding to the target agent object;
A traversing module 18, configured to traverse all blocks included in the software blockchain based on the target sequence number information in the data to be uplink;
The detection module 19 is configured to determine the target sequence number information as an abnormal sequence number if the target sequence number information does not exist in the software blockchain, determine that the sequence number uplink request is illegal, and send abnormal prompt information to a terminal device corresponding to the target agent object;
The query request acquisition module 20 is configured to acquire, when a sequence number query request for the target sequence number information sent by a request terminal is received, an associated block corresponding to the target sequence number information from the software blockchain based on the sequence number query request, where the associated block includes the sequence number block;
And the query module 21 is configured to generate a flow track corresponding to the target serial number information based on the association block, determine production object information corresponding to the target serial number information based on the flow track, and send the production object information as a query result to the request terminal.
The specific function implementation manner of the uplink request obtaining module 13, the second uplink module 14 may refer to step S201-S202 in the embodiment corresponding to fig. 4, the associated object obtaining module 15, the sequence number adding module 16, the comparing module 17, the traversing module 18, the specific function implementation manner of the detecting module 19 may refer to step S102 in the embodiment corresponding to fig. 2, the query request obtaining module 20, and the specific function implementation manner of the query module 21 may refer to step S205-S206 in the embodiment corresponding to fig. 4, which are not repeated herein.
Referring to fig. 6, the first uplink module 12 may include a verification unit 121, a block packing unit 122, and a verification unit 123;
a signing checking unit 121, configured to sign the to-be-signed data based on a key corresponding to the target agent object;
A block packing unit 122, configured to pack the target object information, the source object information, the software information, and the target sequence number information into the sequence number block when the to-be-uplink data tag passes;
And the verification unit 123 is configured to verify the serial number block according to a consensus mechanism, and add the serial number block that passes the verification to the software blockchain.
The specific functional implementation manner of the label checking unit 121, the block packing unit 122, and the verification unit 123 may refer to step S102 in the embodiment corresponding to fig. 2, which is not described herein.
Referring also to fig. 6, the check-in unit 121 may include a decryption subunit 1211, a hash operation subunit 1212, and a judgment subunit 1213;
A decryption subunit 1211, configured to decrypt a digital signature carried by the data to be uplink based on the key, and obtain a first hash value corresponding to the digital signature;
a hash operation subunit 1212, configured to perform hash operation on the data to be uplinked based on hash operation, and generate a second hash value corresponding to the data to be uplinked;
and the judging subunit 1213 is configured to determine that the to-be-uplink data tag passes if the first hash value is detected to be the same as the second hash value.
The specific functional implementation manner of the decryption subunit 1211, the hash operation subunit 1212 and the determination subunit 1213 may refer to step S102 in the embodiment corresponding to fig. 2, which is not described herein.
According to the method and the device for processing the target proxy object, the to-be-uplink data corresponding to the target proxy object can be obtained, the to-be-uplink data comprises target object information, source object information, software information and target sequence number information corresponding to the target proxy object, when the fact that the target sequence number information is different from the associated sequence number information corresponding to the associated proxy object and the target sequence number information exists in a software blockchain is detected, a sequence number block is generated according to the to-be-uplink data, the sequence number block is added into the software blockchain, and the target proxy object and the associated proxy object are associated with the source object information. Because of the decentralization and the non-tamper property of the blockchain, the software serial number information is public and transparent to the management node with the inquiry authority, and the accuracy, the reliability and the traceability of the software serial number information record are improved. All software serial numbers produced by manufacturers and the flowing process of the software serial numbers can be recorded in the software blockchain, so that the effectiveness of software serial number management can be improved.
Fig. 7 is a schematic structural diagram of a computer device according to an embodiment of the present application. As shown in fig. 7, the computer device 1000 may include a processor 1001, a network interface 1004, and a memory 1005, and the computer device 1000 may further include a user interface 1003, and at least one communication bus 1002. Wherein the communication bus 1002 is used to enable connected communication between these components. The user interface 1003 may include a Display (Display), a Keyboard (Keyboard), and the optional user interface 1003 may further include a standard wired interface, a wireless interface, among others. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1004 may be a high-speed RAM memory or a non-volatile memory (non-volatile memory), such as at least one disk memory. The memory 1005 may also optionally be at least one storage device located remotely from the processor 1001. As shown in fig. 7, an operating system, a network communication module, a user interface module, and a device control application may be included in a memory 1005, which is a type of computer-readable storage medium.
In the computer device 1000 shown in fig. 7, the network interface 1004 may provide network communication functions, while the user interface 1003 is mainly used as an interface for providing input to a user, and the processor 1001 may be used to invoke a device control application program stored in the memory 1005 to realize:
acquiring a sequence number uplink request corresponding to a target agent object, and acquiring data to be uplink corresponding to the target agent object based on the sequence number uplink request, wherein the data to be uplink comprises target object information, source object information, software information and target sequence number information corresponding to the target agent object;
When detecting that the target serial number information is different from the associated serial number information corresponding to the associated proxy object and the target serial number information exists in a software blockchain, generating a serial number block based on the data to be uplink, and adding the serial number block to the software blockchain, wherein the target proxy object and the associated proxy object are both associated with the source object information.
It should be understood that the computer device 1000 described in the embodiment of the present application may perform the description of the blockchain-based software serial number management method in the embodiment corresponding to any one of fig. 2 and fig. 4, and may also perform the description of the blockchain-based software serial number management device 1 in the embodiment corresponding to fig. 6, which is not repeated herein. In addition, the description of the beneficial effects of the same method is omitted.
It should be noted that, in addition, the embodiment of the present application further provides a computer readable storage medium, where a computer program executed by the blockchain-based software serial number management device 1 is stored, and the computer program includes program instructions, when executed by the processor, can execute the description of the blockchain-based software serial number management method in any of the embodiments corresponding to fig. 2 and fig. 4, and therefore, a detailed description will not be given here. In addition, the description of the beneficial effects of the same method is omitted. For technical details not disclosed in the embodiments of the computer-readable storage medium according to the present application, please refer to the description of the method embodiments of the present application.
Those skilled in the art will appreciate that implementing all or part of the above-described methods in accordance with the embodiments may be accomplished by way of a computer program stored on a computer readable storage medium, which when executed may comprise the steps of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a random-access Memory (Random Access Memory, RAM), or the like.
The foregoing disclosure is illustrative of the present application and is not to be construed as limiting the scope of the application, which is defined by the appended claims.