File access method, blockchain system, electronic device, computer-readable medium
By implementing file access methods in the blockchain system, the security and immutability of blockchain are utilized to solve the high cost and file leakage problems caused by manpower processing, and safe and efficient file access and management are achieved.
Patent Information
- Application Number
- CN202111423110.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-26
- Publication Date
- 2025-06-27
- Estimated Expiration
- 2041-11-26
AI Technical Summary
In the prior art, the labor cost caused by human processing is too high, and files are easily maliciously monitored during transmission, resulting in a high risk of file leakage.
By implementing the file access method in the blockchain system, after receiving the file access application, the server node determines whether the terminal has access rights, generates executable code and encrypts it and broadcasts it to the blockchain system, so that the terminal can obtain and executes the code to obtain the file.
It effectively reduces the risk of file leakage, avoids the leakage of the actual file storage address, and reduces labor costs, and enhances security by utilizing the immutability of blockchain.
Smart Images

Figure CN114090511B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of blockchain, and particularly relates to a file access method, a blockchain system, an electronic device, and a computer-readable medium. Background Art
[0002] With the development of digital technology, platform digitization has become an important part of digital construction.
[0003] Among them, the digital laboratory platform, as a test operation service platform for internal support / external empowerment, can digitize external services (i.e., services from commission registration to task review, assignment, process tracking, data review, and test reports, etc.), and platformize and cloudify test capabilities and management processes.
[0004] However, in some related technologies, all files (such as test reports) of the laboratory platform are archived in the server. When it is necessary to view the test report, only manual processing can be relied on, such as sharing the test report by sharing the server address, or borrowing untrusted third-party email, social software, etc. to send the test report. This not only causes too high labor costs, but also the shared server address and the process of sending the test report may be maliciously monitored, easily resulting in file leakage. Summary of the Invention
[0005] Therefore, the present invention provides a file access method, a blockchain system, an electronic device, and a computer-readable medium to solve the problems of too high labor costs and easy file leakage caused by manual processing in the prior art.
[0006] To achieve the above object, the first aspect of the present invention provides a file access method, which is used for a blockchain system. The blockchain includes server nodes, and the method includes:
[0007] The server node receives a file access application, and the file access application includes the identifier of the file to be accessed and the identifier of the terminal sending the file access application;
[0008] The server node determines whether the terminal has the permission to access the file to be accessed according to the identifier of the file to be accessed and the identifier of the terminal;
[0009] When the terminal has the permission to access the file to be accessed, the server node generates executable code according to the storage location of the file to be accessed in the blockchain system;
[0010] The server node encrypts the executable code according to a predetermined algorithm, and broadcasts the encrypted executable code to the blockchain system, so that the terminal can obtain and execute the executable code, and the executable code is used to obtain the file to be accessed in the blockchain system.
[0011] Optionally, the server node generates an executable code according to the storage location of the file to be accessed in the blockchain system, including: the server node generates an executable code according to the storage location of the file to be accessed in the blockchain system and the identifier of the terminal; the executable code is further used to embed a watermark for the file to be accessed using the identifier of the terminal.
[0012] Optionally, the blockchain system further includes a terminal node corresponding to the terminal; before the server node receives a file access request, it further includes: the terminal node broadcasts the file access request to the blockchain system; after the server node broadcasts the encrypted executable code to the blockchain system, it further includes: the terminal node receives the encrypted executable code, and decrypts the encrypted executable code according to a predetermined algorithm to obtain the executable code.
[0013] Further optionally, the terminal node broadcasts the file access request to the blockchain system, including: the terminal node signs the file access request using the private key of the terminal node, and broadcasts the signed file access request to the blockchain system; the server node receives the file access request, including: the server node verifies the signature of the received file access request using the public key of the terminal node, and obtains the file access request in the case of successful verification; the server node broadcasts the encrypted executable code to the blockchain system, including: the server node signs the encrypted executable code using the private key of the server node, and broadcasts the signed and encrypted executable code to the blockchain system; the terminal node receives the encrypted executable code, including: the terminal node verifies the signature of the encrypted executable code using the public key of the server node, and obtains the encrypted executable code in the case of successful verification.
[0014] Further optionally, the server node encrypts the executable code according to a predetermined algorithm and broadcasts the encrypted executable code to the blockchain system, including: the server node encrypts the executable code according to a predetermined algorithm using a key; the server node encrypts the key and the encrypted executable code using the public key of the terminal node as broadcast information and broadcasts it to the blockchain system; the terminal node receives the encrypted executable code and decrypts the encrypted executable code according to a predetermined algorithm to obtain the executable code, including: the terminal node decrypts the received broadcast information using the private key of the terminal node to obtain the key and the encrypted executable code; the terminal node decrypts the encrypted executable code according to a predetermined algorithm using the key to obtain the executable code.
[0015] Further optionally, before the terminal node broadcasts the file access request to the blockchain system, it further includes: the terminal registers in the blockchain system to become a terminal node of the blockchain system.
[0016] Optionally, in the case where the file to be accessed is not a free file, the file access request further includes the cost required to access the file to be accessed.
[0017] A second aspect of the present invention provides a blockchain system, the blockchain system includes a server node, and the server node is used for:
[0018] Receiving a file access request, the file access request includes an identifier of the file to be accessed and an identifier of the terminal sending the file access request;
[0019] Judging whether the terminal has the right to access the file to be accessed according to the identifier of the file to be accessed and the identifier of the terminal;
[0020] In the case where the terminal has the right to access the file to be accessed, generating an executable code according to the storage location of the file to be accessed in the blockchain system;
[0021] Encrypting the executable code according to a predetermined algorithm and broadcasting the encrypted executable code to the blockchain system so that the terminal can obtain and execute the executable code, and the executable code is used to obtain the file to be accessed in the blockchain system.
[0022] A third aspect of the present invention provides an electronic device, including:
[0023] One or more processors;
[0024] A storage device on which one or more programs are stored. When the one or more programs are executed by the one or more processors, the one or more processors implement the above-mentioned method;
[0025] One or more I / O interfaces, connected between the processor and the memory, configured to implement information interaction between the processor and the memory.
[0026] In a fourth aspect of the present invention, a computer-readable medium has a computer program stored thereon. When the program is executed by a processor, the above-mentioned method is implemented.
[0027] The present invention has the following advantages:
[0028] The file access method, blockchain system, electronic device, and computer-readable medium of the present invention determine whether a terminal has the permission to access a file to be accessed through the identifier of the terminal, ensuring that a terminal without access permission cannot obtain the file to be accessed, reducing file leakage; providing an executable code for the terminal to obtain the file to be accessed, avoiding the leakage of the actual storage address of the file, and further reducing file leakage. At the same time, the entire process is based on a blockchain system, which can utilize the immutability of the blockchain to prevent the platform party from leaking the file to be accessed, and can also reduce the participation of manpower, reduce labor costs, and avoid waste of human resources. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] The drawings are used to provide a further understanding of the present invention and constitute a part of the specification, and are used together with the following specific embodiments to explain the present invention, but do not constitute a limitation to the present invention.
[0030] Figure 1 It is a schematic diagram of the composition of a blockchain system provided by an embodiment of the present invention;
[0031] Figure 2 It is a schematic flowchart of a file access method provided by an embodiment of the present invention;
[0032] Figure 3 It is a schematic flowchart of some steps of a file access method provided by an embodiment of the present invention;
[0033] Figure 4 It is a schematic flowchart of some steps of a file access method provided by an embodiment of the present invention;
[0034] Figure 5 It is a schematic flowchart of some steps of a file access method provided by an embodiment of the present invention;
[0035] Figure 6 It is a schematic flowchart of some steps of a file access method provided by an embodiment of the present invention;
[0036] Figure 7 A block diagram of a blockchain system provided by an embodiment of the present invention;
[0037] Figure 8 A schematic diagram of the composition of an electronic device provided by an embodiment of the present invention. Specific embodiments
[0038] The following further describes the specific embodiments of the present invention with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are only for the purpose of illustrating and explaining the present invention, and are not used to limit the present invention.
[0039] As used in the present invention, the term "and / or" includes any and all combinations of one or more of the associated listed items.
[0040] The terms used in the present invention are only for describing specific embodiments and are not intended to limit the present invention. As used in the present invention, the singular forms "a" and "the" are also intended to include the plural forms unless the context clearly indicates otherwise.
[0041] When the terms "comprising" and / or "consisting of" are used in the present invention, it is specified that the stated features, wholes, steps, operations, elements, and / or components exist, but do not exclude the existence or addition of one or more other features, wholes, steps, operations, elements, components, and / or their groups.
[0042] The embodiments of the present invention can be described with reference to plan views and / or cross-sectional views by means of the ideal schematic diagrams of the present invention. Therefore, the example illustrations can be modified according to the manufacturing technology and / or tolerances.
[0043] Unless otherwise defined, the meanings of all terms (including technical and scientific terms) used in the present invention are the same as those commonly understood by those of ordinary skill in the art. It will also be understood that terms such as those defined in common dictionaries should be interpreted as having a meaning consistent with their meaning in the relevant art and the context of the present invention, and will not be interpreted as having an idealized or overly formal meaning unless the present invention clearly defines otherwise.
[0044] In a first aspect, an embodiment of the present invention provides a file access method, which can be used to access files on a laboratory platform, such as test reports, etc., and this method is used for a blockchain system.
[0045] As a special distributed database, blockchain is a new application mode of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, and encryption algorithms. Its essence is a decentralized database. Any information that needs to be saved can be written into the blockchain and read from it. Anyone can set up a server, join the blockchain network, and become a node. In the world of blockchain, there is no central node, and each node is equal and stores the entire database. You can write / read data from any node because all nodes will be synchronized in the end to ensure the consistency of the blockchain.
[0046] Narrowly speaking, blockchain is a chain-like data structure formed by combining data blocks in sequence according to time order, and a distributed ledger that is guaranteed to be immutable and unforgeable by cryptographic means. Broadly speaking, blockchain technology is a new distributed infrastructure and computing paradigm that uses a block-chain data structure to verify and store data, uses a distributed node consensus algorithm to generate and update data, uses cryptographic methods to ensure the security of data transmission and access, and uses smart contracts composed of automated script codes to program and operate data.
[0047] Blockchain is a series of data blocks generated by using cryptographic methods. Each data block contains information about a Bitcoin network transaction, which is used to verify the validity (anti-counterfeiting) of the information and generate the next block. Therefore, the information in the blockchain is immutable and has high security.
[0048] Figure 1 It is a schematic diagram of the composition of the blockchain system according to the embodiments of the present invention.
[0049] Refer to Figure 1 , the blockchain system according to the embodiments of the present invention includes server nodes, specifically the file archiving server of the laboratory platform, and the file (such as test reports, etc.) of the laboratory platform is stored on the file archiving server.
[0050] Figure 2 It is a schematic diagram of the process of the file access method according to the embodiments of the present invention.
[0051] Refer to Figure 2 , the file access method according to the embodiments of the present invention specifically includes:
[0052] S201. The server node receives a file access request, which includes the identifier of the file to be accessed and the identifier of the terminal that sends the file access request.
[0053] The server node of the blockchain system receives the file access request sent by the terminal.
[0054] Among them, the file access request sent by the terminal includes the identifier of the file to be accessed (i.e., the file that the terminal wants to access, such as a certain test report) and the identifier of the terminal (specifically, it can be the identifier that distinguishes this terminal from other terminals).
[0055] S202. The server node determines whether the terminal has the permission to access the file to be accessed according to the identifier of the file to be accessed and the identifier of the terminal.
[0056] A permitted access list is preset on the server node (i.e., the file archive server) of the blockchain system. The permitted access list records the identifiers of the terminals that are permitted to access the files on the file archive server. The server node determines whether the terminal that sends the file access request is in the permitted access list according to the identifier of the terminal in the file access request, that is, whether the terminal has the permission to access the file to be accessed.
[0057] S203. When the terminal has the permission to access the file to be accessed, the server node generates executable code according to the storage location of the file to be accessed in the blockchain system.
[0058] When the terminal that sends the file access request has the permission to access the file to be accessed, the server node of the blockchain system generates executable code according to the storage location of the file to be accessed in the blockchain system.
[0059] Among them, the executable code is the code executed by the terminal. The executable code can be used to automatically access the storage location of the file to be accessed in the blockchain system and find the file to be accessed on the blockchain system. That is, after the terminal executes the executable code, it can automatically obtain the file to be accessed.
[0060] S204. The server node encrypts the executable code according to a predetermined algorithm and broadcasts the encrypted executable code to the blockchain system so that the terminal can obtain and execute the executable code, and the executable code is used to obtain the file to be accessed in the blockchain system.
[0061] After generating the executable code, the server node encrypts the executable code according to a predetermined algorithm (specifically, it can be an algorithm agreed with the terminal) and broadcasts the encrypted executable code to the blockchain system.
[0062] The terminal can obtain the encrypted executable code through the blockchain system. The terminal uses the predetermined algorithm, that is, the algorithm agreed with the server node, to decrypt the encrypted executable code, obtains the executable code, and obtains the file to be accessed by executing the executable code.
[0063] In this way, even if an illegal terminal obtains the broadcast information of the server node, it cannot decrypt the broadcast information to obtain the executable code. Even if the illegal terminal obtains the executable code, it cannot obtain the actual storage address of the file, thus avoiding the leakage of the actual storage address of the file.
[0064] In the file access method according to the embodiment of the present invention, it is judged whether the terminal has the permission to access the file to be accessed through the identifier of the terminal, which ensures that the terminal without access permission cannot obtain the file to be accessed, reducing the leakage of the file. By using the executable code for the terminal to obtain the file to be accessed, the leakage of the actual storage address of the file is avoided, further reducing the leakage of the file. At the same time, the whole process is based on the blockchain system, and the immutability of the blockchain can be utilized to avoid the platform party from leaking the file to be accessed. It can also reduce the participation of manpower, reduce the labor cost, and avoid the waste of human resources.
[0065] In some embodiments, referring to Figure 3 , the server node generates an executable code according to the storage location of the file to be accessed in the blockchain system (step S203), including:
[0066] S301. The server node generates an executable code according to the storage location of the file to be accessed in the blockchain system and the identifier of the terminal.
[0067] Wherein, the executable code is also used to embed a watermark for the file to be accessed using the identifier of the terminal.
[0068] The server node of the blockchain system generates an executable code according to the storage location of the file to be accessed in the blockchain system and the identifier of the terminal, and encrypts the executable code using a predetermined algorithm.
[0069] During the execution of the executable code generated by the server node, it automatically accesses the storage location of the file to be accessed in the blockchain system, finds the file to be accessed on the blockchain system, and embeds a watermark for the file to be accessed using the identifier of the terminal.
[0070] The terminal obtains the encrypted executable code through the blockchain system, decrypts the encrypted executable code using a predetermined algorithm to obtain the executable code, and obtains the file to be accessed with the identifier of the terminal embedded therein by executing the executable code.
[0071] Since the file to be accessed obtained by the terminal is the file to be accessed with the identifier of the terminal embedded therein as a watermark, once the file is leaked, the terminal that leaked the file can be judged through the watermark of the leaked file.
[0072] In some embodiments, referring to Figure 1, the blockchain system of the embodiments of the present invention further includes a terminal node corresponding to the terminal. The terminal node is a blockchain node generated when the terminal registers in the blockchain system.
[0073] Then refer to Figure 4 , before the server node receives the file access request, the method further includes:
[0074] S401. The terminal registers in the blockchain system and becomes a terminal node of the blockchain system.
[0075] For example, all users who wish to obtain files (such as test reports) of the archive server can register an account through the terminal in the blockchain system where the archive server is located, become a terminal node of the blockchain system, and after becoming a terminal node, broadcast their public key and their blockchain identifier signed with the private key to the blockchain system in the blockchain for other nodes in the blockchain system to obtain the blockchain identifier of their public key. At the same time, they save their private key.
[0076] S402. The terminal node broadcasts the file access request to the blockchain system.
[0077] When a user wants to view a file of the archive server, that is, the file to be accessed, the user broadcasts the file access request to the blockchain system through the terminal node corresponding to the terminal.
[0078] Among them, the file access request includes the identifier of the file to be accessed and the identifier of the terminal (specifically, it can be the blockchain identifier of the terminal node corresponding to the terminal).
[0079] When the file to be accessed is not a free file, the file access request further includes the Token (cost) required to access the file to be accessed.
[0080] After the server node broadcasts the encrypted executable code to the blockchain system (step S204), the method further includes:
[0081] S403. The terminal node receives the encrypted executable code and decrypts the encrypted executable code according to a predetermined algorithm to obtain the executable code.
[0082] The server node of the blockchain system encrypts the generated executable code according to a predetermined algorithm and broadcasts the encrypted executable code to the blockchain system. The terminal obtains the encrypted executable code by receiving the information broadcast by the server node through the terminal node, decrypts the encrypted executable code using a predetermined algorithm to obtain the executable code, and obtains the file to be accessed by executing the executable code.
[0083] In some embodiments, refer to Figure 5, the terminal node broadcasting the file access application to the blockchain system specifically includes:
[0084] S501. The terminal node signs the file access application with the private key of the terminal node and broadcasts the signed file access application to the blockchain system.
[0085] That is to say, when the terminal node sends the file access application, it signs the file access application with the private key of the terminal node, that is, the file access application broadcast by the terminal node to the blockchain node is the signed file access application.
[0086] Then the server node receiving the file access application includes:
[0087] S502. The server node verifies the signature of the received file access application with the public key of the terminal node. If the verification passes, the file access application is obtained.
[0088] That is to say, after the server node of the blockchain system receives the file access application sent by the terminal node, it first verifies the signature of the received file access application with the public key of the terminal node. If the verification passes, the file access application is obtained.
[0089] Then the server node broadcasts the encrypted executable code to the blockchain system, including:
[0090] S503. The server node signs the encrypted executable code with the private key of the server node and broadcasts the signed and encrypted executable code to the blockchain system.
[0091] After encrypting the executable code, the server node of the blockchain system signs the encrypted executable code with its own private key and broadcasts the signed and encrypted executable code to the blockchain system.
[0092] That is to say, the information broadcast by the server node of the blockchain system to the blockchain system is the executable code signed with the private key of the server node and encrypted using a predetermined algorithm.
[0093] The terminal node receives the encrypted executable code, including:
[0094] S504. The terminal node verifies the signature of the encrypted executable code with the public key of the server node. If the verification passes, the encrypted executable code is obtained.
[0095] After the terminal node receives the information broadcast by the server node, it first verifies the signature of the received information with the public key of the server node. If the verification passes, the encrypted executable code is obtained.
[0096] In some embodiments, referring to Figure 6 , the server node encrypts the executable code according to a predetermined algorithm, and broadcasts the encrypted executable code to the blockchain system (step S204), including:
[0097] S601. The server node encrypts the executable code according to a predetermined algorithm using a key.
[0098] When the server node of the blockchain system confirms that the terminal sending the file access application has the permission to access the file to be accessed, the server node generates an executable code according to the storage location of the file to be accessed in the blockchain system and the identifier of the terminal, and encrypts the executable code according to a predetermined algorithm using a key.
[0099] S602. The server node encrypts the key and the encrypted executable code using the public key of the terminal node as broadcast information, and broadcasts it to the blockchain system.
[0100] The server node encrypts the key and the encrypted executable code using the public key of the terminal node, and signs it using the private key of the server node. The signature and the encrypted executable code are used as broadcast information and broadcast to the blockchain system.
[0101] The terminal node receives the encrypted executable code, and decrypts the encrypted executable code according to a predetermined algorithm to obtain the executable code, including:
[0102] S603. The terminal node uses the private key of the terminal node to decrypt the received broadcast information to obtain the key and the encrypted executable code.
[0103] After receiving the broadcast information, the terminal node verifies the signature of the broadcast information using the public key of the server node. If the verification passes, the terminal node decrypts the broadcast information using the private key of the terminal node to obtain the key and the executable code encrypted according to a predetermined algorithm using the key.
[0104] S604. The terminal node decrypts the encrypted executable code according to a predetermined algorithm using the key to obtain the executable code.
[0105] After the terminal node obtains the key and the executable code encrypted according to a predetermined algorithm using the key, the terminal node decrypts the encrypted executable code according to a predetermined algorithm using the obtained key to obtain the executable code, and obtains the file to be accessed with the identifier of the terminal embedded as a watermark by executing the executable code.
[0106] By encrypting the executable code using a key pair, the security of information transmission is enhanced, preventing other terminals from obtaining the executable code and further avoiding the leakage of files to be accessed.
[0107] The step division of the above various methods is only for clear description. When implemented, they can be combined into one step or some steps can be split into multiple steps. As long as the same logical relationship is included, they are all within the protection scope of this patent; adding insignificant modifications or introducing insignificant designs to the algorithm or process, but without changing the core design of the algorithm and process, are all within the protection scope of this patent.
[0108] In a second aspect, referring to Figure 7 , an embodiment of the present invention provides a blockchain system, which includes server nodes, and the server nodes are used for:
[0109] Receiving a file access application, where the file access application includes the identifier of the file to be accessed and the identifier of the terminal that sends the file access application;
[0110] Judging whether the terminal has the permission to access the file to be accessed according to the identifier of the file to be accessed and the identifier of the terminal;
[0111] When the terminal has the permission to access the file to be accessed, generating an executable code according to the storage location of the file to be accessed in the blockchain system;
[0112] Encrypting the executable code according to a predetermined algorithm, and broadcasting the encrypted executable code to the blockchain system so that the terminal can obtain and execute the executable code, and the executable code is used to obtain the file to be accessed in the blockchain system.
[0113] It should be clear that the present invention is not limited to the specific configurations and processes described in the above embodiments and shown in the figures. For the convenience and brevity of description, the detailed description of known methods is omitted here, and the specific working processes of the systems, modules and units described above can refer to the corresponding processes in the foregoing method embodiments, which will not be elaborated here.
[0114] Referring to Figure 8 , an embodiment of the present invention provides an electronic device, which includes:
[0115] One or more processors 801;
[0116] A memory 802, on which one or more programs are stored. When the one or more programs are executed by the one or more processors, the one or more processors implement the file access method of any one of the above.
[0117] One or more I / O interfaces 803, connected between the processor and the memory, are configured to enable information interaction between the processor and the memory.
[0118] Among them, the processor 801 is a device with data processing capabilities, including but not limited to a central processing unit (CPU), etc.; the memory 802 is a device with data storage capabilities, including but not limited to random access memory (RAM, more specifically such as SDRAM, DDR, etc.), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory (FLASH); the I / O interface (read / write interface) 803 is connected between the processor 801 and the memory 802 and can enable information interaction between the processor 801 and the memory 802, including but not limited to a data bus (Bus), etc.
[0119] In some embodiments, the processor 801, the memory 802, and the I / O interface 803 are interconnected via a bus and then connected to other components of the computing device.
[0120] This embodiment also provides a computer-readable medium, on which a computer program is stored. When the program is executed by the processor, it implements the file access method provided in this embodiment. To avoid repetitive description, the specific steps of the file access method are not elaborated here.
[0121] Those of ordinary skill in the art will understand that all or some of the steps in the above-invented method, and the functional modules / units in the system and device, can be implemented as software, firmware, hardware, and their appropriate combinations. In the hardware implementation, the division of the functional modules / units mentioned above does not necessarily correspond to the division of physical components; for example, one physical component can have multiple functions, or one function or step can be executed by several physical components in cooperation. Some or all of the physical components can be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software can be distributed on a computer-readable medium, which can include a computer storage medium (or non-transitory medium) and a communication medium (or transitory medium). As is well known to those of ordinary skill in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information, such as computer-readable instructions, data structures, program modules, or other data. Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory, or other memory technologies, CD-ROM, digital versatile disk (DVD), or other optical disk storage, magnetic cartridges, tapes, magnetic disk storage, or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer. In addition, as is well known to those of ordinary skill in the art, a communication medium typically contains computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transmission mechanism, and can include any information delivery medium.
[0122] It should be noted that in this document, the term "comprising", "including", or any other variant thereof is intended to cover a non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or device. Without further limitation, an element defined by the phrase "comprising a..." does not exclude the presence of additional identical elements in the process, method, article, or device comprising that element.
[0123] Those skilled in the art will be able to understand that although some of the embodiments described herein include certain features included in other embodiments but not others, the combination of the features of different embodiments means that it is within the scope of this embodiment and forms different embodiments.
[0124] It is understood that the above embodiments are merely exemplary embodiments adopted to illustrate the principles of the present invention. However, the present invention is not limited thereto. For those of ordinary skill in the art, various modifications and improvements can be made without departing from the spirit and essence of the present invention, and these modifications and improvements are also regarded as the protection scope of the present invention.
Claims
1. A file access method, characterized in that , The method is used for a blockchain system, and the blockchain includes server nodes. The method includes: The server node receives a file access application, which includes the identifier of the file to be accessed and the identifier of the terminal that sends the file access application; The server node determines whether the terminal has the permission to access the file to be accessed according to the identifier of the file to be accessed and the identifier of the terminal; When the terminal has the permission to access the file to be accessed, the server node generates executable code according to the storage location of the file to be accessed in the blockchain system; The server node encrypts the executable code according to a predetermined algorithm and broadcasts the encrypted executable code to the blockchain system, so that the terminal can obtain and execute the executable code, and the executable code is used to obtain the file to be accessed in the blockchain system; The server node generates executable code according to the storage location of the file to be accessed in the blockchain system, including: The server node generates executable code according to the storage location of the file to be accessed in the blockchain system and the identifier of the terminal; the executable code is also used to embed a watermark for the file to be accessed using the identifier of the terminal; The executable code is used to obtain the file to be accessed in the blockchain system, including: the executable code is used to automatically access the storage location of the file to be accessed in the blockchain system and find the file to be accessed on the blockchain system.
2. The method according to claim 1, characterized in that , The blockchain system further includes a terminal node corresponding to the terminal; Before the server node receives the file access application, it further includes: The terminal node broadcasts the file access application to the blockchain system; After the server node broadcasts the encrypted executable code to the blockchain system, it further includes: The terminal node receives the encrypted executable code and decrypts the encrypted executable code according to a predetermined algorithm to obtain the executable code.
3. The method according to claim 2, characterized in that , The terminal node broadcasts the file access application to the blockchain system, including: The terminal node signs the file access application using the private key of the terminal node and broadcasts the signed file access application to the blockchain system; The server node receives the file access application, including: The server node verifies the signature of the received file access application using the public key of the terminal node, and obtains the file access application when the verification is passed; The server node broadcasts the encrypted executable code to the blockchain system, including: The server node signs the encrypted executable code using the private key of the server node and broadcasts the signed and encrypted executable code to the blockchain system; The terminal node receives the encrypted executable code, including: The terminal node verifies the signature of the encrypted executable code using the public key of the server node, and obtains the encrypted executable code when the verification is passed.
4. The method according to claim 2, wherein the server node encrypts the executable code according to a predetermined algorithm and broadcasts the encrypted executable code to the blockchain system, including: the server node encrypts the executable code according to a predetermined algorithm using a key; the server node encrypts the key and the encrypted executable code using the public key of the terminal node and broadcasts them as broadcast information to the blockchain system; the terminal node receives the encrypted executable code and decrypts the encrypted executable code according to a predetermined algorithm to obtain the executable code, including: the terminal node decrypts the received broadcast information using the private key of the terminal node to obtain the key and the encrypted executable code; the terminal node decrypts the encrypted executable code according to a predetermined algorithm using the key to obtain the executable code.
5. The method according to claim 2, wherein Before the terminal node broadcasts the file access request to the blockchain system, it further includes: the terminal registers in the blockchain system to become a terminal node of the blockchain system.
6. The method according to claim 1, characterized in that When the file to be accessed is not a free file, the file access request further includes the cost required to access the file to be accessed.
7. A blockchain system, characterized in that, The blockchain system includes a server node, and the server node is used for: receiving a file access request, where the file access request includes an identifier of the file to be accessed and an identifier of the terminal that sends the file access request; judging whether the terminal has the right to access the file to be accessed according to the identifier of the file to be accessed and the identifier of the terminal; when the terminal has the right to access the file to be accessed, generating an executable code according to the storage location of the file to be accessed in the blockchain system; encrypting the executable code according to a predetermined algorithm and broadcasting the encrypted executable code to the blockchain system so that the terminal can obtain and execute the executable code, where the executable code is used to obtain the file to be accessed in the blockchain system; generating the executable code according to the storage location of the file to be accessed in the blockchain system includes: generating an executable code according to the storage location of the file to be accessed in the blockchain system and the identifier of the terminal; the executable code is further used to embed a watermark for the file to be accessed using the identifier of the terminal; the executable code is used to obtain the file to be accessed in the blockchain system, including: the executable code is used to automatically access the storage location of the file to be accessed in the blockchain system and find the file to be accessed on the blockchain system.
8. An electronic device, characterized in that, including: one or more processors; a storage device, on which one or more programs are stored, and when the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1-6; One or more I / O interfaces, connected between the processor and the memory, configured to implement information interaction between the processor and the memory.
9. A computer-readable medium having a computer program stored thereon, the program, when executed by a processor, implementing the method according to any one of claims 1-6.
Citation Information
Patent Citations
File management method and device, server and storage medium
CN113496013A
Systems and methods for securing access rights to resources using cryptography and the blockchain
US20210119764A1