WO2021012746A1 - 基于区块链的数据加密方法、装置、电子设备和存储介质 - Google Patents

基于区块链的数据加密方法、装置、电子设备和存储介质 Download PDF

Info

Publication number
WO2021012746A1
WO2021012746A1 PCT/CN2020/088432 CN2020088432W WO2021012746A1 WO 2021012746 A1 WO2021012746 A1 WO 2021012746A1 CN 2020088432 W CN2020088432 W CN 2020088432W WO 2021012746 A1 WO2021012746 A1 WO 2021012746A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
field
document
target
type
Prior art date
Application number
PCT/CN2020/088432
Other languages
English (en)
French (fr)
Inventor
赵达悦
王梦寒
Original Assignee
深圳壹账通智能科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳壹账通智能科技有限公司 filed Critical 深圳壹账通智能科技有限公司
Publication of WO2021012746A1 publication Critical patent/WO2021012746A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/04Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
    • H04L63/0428Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
    • H04L63/0435Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload wherein the sending and receiving network entities apply symmetric encryption, i.e. same key used for encryption and decryption
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/50Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using hash chains, e.g. blockchains or hash trees

Definitions

  • This application relates to the technical field of blockchain, and in particular to blockchain-based data encryption methods, devices, electronic equipment and storage media.
  • Banks and enterprises generally need to maintain relevant business relationships through document data.
  • banks send document data to enterprises, they generally use the advantages of blockchain technology to supervise and have a high degree of trust to upload the document data to the blockchain , So that the corresponding company can view the document data.
  • the inventor realized that there are many companies that cooperate with banks. If the document data for a certain company is uploaded to the chain, the document data for that company can be used by any other blockchain node of the company that cooperates with the bank.
  • this application provides a method based on Blockchain data encryption methods, devices, electronic equipment and storage media.
  • a blockchain-based data encryption method includes:
  • the key for encrypting the field data corresponding to the target field type for which the target enterprise node has access rights in the document data is sent to the target enterprise node, so that the target enterprise node is based on the target enterprise node
  • the key for encrypting the field data corresponding to the target field type with the access authority in the bill data decrypts the encrypted data.
  • an electronic device including a memory and a processor, the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the processor executes the above-mentioned The steps of the blockchain data encryption method.
  • a storage medium storing computer-readable instructions.
  • the one or more processors execute the above-mentioned blockchain-based data encryption A step of.
  • the server side corresponding to the bank node encrypts the field data corresponding to all the field types contained in the document data with a specific key to obtain the encrypted encrypted data, and corresponds to the target field type that the enterprise node has access rights in the document data
  • the key to encrypt the field data is sent to the enterprise node, so that the enterprise node decrypts the encrypted encrypted data based on the key, so that the enterprise corresponding to the enterprise node that receives the receipt data can view the bank node pair receipt
  • the field type for key authorization in the data satisfies the more complex data transmission requirements between the bank and the enterprise; in addition, the enterprise nodes corresponding to other enterprises cooperating with the bank do not have the key, so they can only consult the encrypted document data , And then realize that when the document data is chained, the leakage of the document data can be avoided.
  • Fig. 1 is an implementation flowchart of a block chain-based data encryption method shown in an exemplary embodiment of the present application.
  • Fig. 2 is a specific implementation flowchart of step S120 in the block chain-based data encryption method shown in an exemplary embodiment of the present application.
  • FIG. 3 is a specific implementation flow chart of step S130 in the block chain-based data encryption method shown in an exemplary embodiment of the present application.
  • Fig. 4 is a specific implementation flowchart of step S170 in the block chain-based data encryption method shown in an exemplary embodiment of the present application.
  • Fig. 5 is a block diagram of a block chain-based data encryption device according to an exemplary embodiment of the present application.
  • Fig. 6 is an exemplary block diagram of an electronic device used to implement the above-mentioned blockchain-based data encryption method according to an exemplary embodiment of the present application.
  • Fig. 7 shows a computer-readable storage medium for implementing the above-mentioned blockchain-based data encryption method according to an exemplary embodiment of the present application.
  • Fig. 1 shows a flowchart of the implementation of a blockchain-based data encryption method according to an exemplary embodiment of the present application.
  • the execution subject of the blockchain-based data encryption method in this embodiment is an electronic device, which The device may specifically be the server side corresponding to the bank node in the data blockchain.
  • the blockchain-based data encryption method shown in FIG. 1 may include the following steps S110 to S170, which are described in detail as follows:
  • Step S110 in response to the upload request for uploading the document data entered by the employee account, obtain the document data in the upload request and the document type corresponding to the document data, and respond from the employee account accordingly.
  • the employee level is obtained from the employee information.
  • the upload request is a request received by the server corresponding to the bank node in the data blockchain to upload the document data to the data blockchain.
  • This request can be manually performed by the bank’s employees. Operate the physical buttons or virtual controls provided by the client device corresponding to the bank node to trigger, wherein when the request is triggered, the bill data and the bill type of the bill data are required.
  • the bank employee needs to log in the employee account registered on the server side corresponding to the bank node in the client device in order to trigger the chain request.
  • the employee information includes at least the employee level.
  • the employee level can be the job level of the employee, such as different job levels such as manager and employee.
  • Employee information can also include information such as name, age, and job number.
  • the server side corresponding to the bank node associates the employee account and the employee information corresponding to the employee account to the employee information database.
  • the server side corresponding to the bank node obtains the document data in the chain request and the document type corresponding to the document data in response to the upload request entered by the employee account for uploading the document data.
  • the server side corresponding to the bank node finds the employee information corresponding to the employee account from the employee information database according to the logged-in employee account, and obtains the employee level from the employee information corresponding to the employee account.
  • Step S120 based on the field data corresponding to the field type of the enterprise name in the document data, determine the target enterprise node having access rights to the document data, and obtain the industry type corresponding to the target enterprise node.
  • the documents may specifically be different types of documents such as purchase orders or invoices.
  • the data contained in the document is a data set that contains field data of multiple different field types.
  • the field types contained in the data set can include "company name”, “Payment terms”, “product name”, “quantity” and “unit price”, etc.
  • the server side corresponding to the bank node can determine the target enterprise node that has access rights to the document data based on the information contained in the field data corresponding to the field type of the enterprise name in the document data.
  • the server also obtains the industry type of the enterprise from the enterprise information corresponding to the target enterprise node based on the determined target enterprise node that has access rights to the document data.
  • Figure 2 is a specific implementation flow chart of step S120 in the blockchain-based data encryption method shown in an exemplary embodiment of the present application.
  • the document-based data is the name of the company
  • the step S120 of determining the target enterprise node that has access rights to the document data by the field data corresponding to the field type of, includes:
  • Step S1201 Obtain the enterprise name information contained in the field data corresponding to the field type of the enterprise name in the document data.
  • the server side corresponding to the bank node obtains the enterprise name information contained in the field data corresponding to the field type of the enterprise name in the document data, for example, the field data of the field type of the enterprise name in the document data includes If the company name information is "XX Express Company", then "XX Express Company" is an enterprise that can view the document data.
  • Step S1202 based on the enterprise name information, the relationship table between the enterprise name and the enterprise node, determine the target enterprise node for which the document data has access rights.
  • the server side corresponding to the bank node prestores the relationship table between the enterprise name and the enterprise node in the local database, where the relationship table between the enterprise name and the enterprise node contains the enterprises corresponding to all the enterprises that cooperate with the bank Correspondence between node and company name.
  • step S130 the field data corresponding to all the field types included in the document data are respectively encrypted with a specific key to obtain encrypted encrypted data.
  • the document data is a data set containing field data of multiple different field types
  • the field data corresponding to all the field types contained in the document data can be passed through Encrypted with a specific key to obtain the encrypted encrypted data.
  • the server corresponding to the bank node By encrypting all the field types contained in the document data with a specific key, it is convenient for the server corresponding to the bank node to adaptively adjust some field types in the document data according to data transmission requirements The corresponding field data is authorized for the key.
  • the above-mentioned specific keys are preset keys for different field types, and the keys corresponding to different field types are generally different.
  • Figure 3 is a specific implementation flow chart of step S130 in the block chain-based data encryption method shown in an exemplary embodiment of the present application.
  • the document data includes The field data corresponding to all the field types of are respectively encrypted with a specific key to obtain encrypted data in step S130, including:
  • Step S1301 Obtain all the field types included in the bill data.
  • the server side corresponding to the bank node obtains all the field types contained in the document data based on the document data of all document types and the relationship table of the field types contained in the document data of the document type.
  • Step S1302 Determine a specific key for respectively encrypting field data corresponding to all field types based on a preset relationship table between field types and keys.
  • the server side corresponding to the bank node pre-stores in the local database a relationship table of all field types and the key to encrypt the field data corresponding to the field type.
  • the server side uses the relationship table and all the field types contained in the obtained document data. Determine the specific key used to encrypt the field data corresponding to all field types.
  • step S1303 field data corresponding to all field types are respectively encrypted based on the specific key to obtain encrypted encrypted data.
  • the server corresponding to the bank node separately encrypts the field data corresponding to all field types in the singular data based on the determined specific key to obtain the encrypted encrypted data, which is to obtain the encrypted data set in the document data. Encrypted document data.
  • step S140 the document type, the industry type, and the employee level are input into a preset machine learning model to determine that the target enterprise node is included in the document data.
  • the target field type of the access permission is input into a preset machine learning model to determine that the target enterprise node is included in the document data.
  • the server side corresponding to the bank node needs to adaptively determine the target field type in the document data that has access rights based on the document type, industry type, and employee level.
  • the server side corresponding to the bank node inputs the document type, industry type, and employee level into the preset machine learning model to obtain the target field type of the enterprise node with the query authority in the document data.
  • the machine learning model needs to be trained.
  • the machine learning model determines the enterprise node with the access permission according to the input document type, industry type and employee level.
  • the field type in the document data that has the access permission can be realized according to the bank and enterprise.
  • the data transmission requirements between the documents adaptively determine which field types in the document are the field types that require key authorization to meet the more complex data transmission requirements between banks and enterprises.
  • the machine learning model is obtained by training through training sample data.
  • the machine learning model may be a CNN (Convolutional Neural Network, convolutional neural network) model or a deep neural network model.
  • the feature vector can be generated according to the document type of the existing document data, the industry type of the enterprise corresponding to the enterprise node receiving the document data, and the employee level corresponding to the bank employee, and the target field type with the access permission in the known document data is used as the feature
  • the label of the vector is used to generate the training sample data.
  • the machine learning model is trained through the generated training sample data, and the trained machine learning model is obtained. After the trained machine learning model is obtained, the trained machine learning model can be used to predict how bank employees of different employee levels will be When a certain document data is uploaded to the chain, the target field type in the document data that has the access permission.
  • step S150 the encrypted encrypted data is uploaded to the chain.
  • the encrypted data after encryption is specifically a data set obtained by encrypting field data corresponding to all field types contained in the document data through a specific key, and the server corresponding to the bank node uses the data
  • the set is uploaded to the data blockchain as a whole.
  • Step S160 Obtain a key for encrypting field data corresponding to the target field type for which the target enterprise node has access rights in the document data.
  • the server side corresponding to the bank node obtains the key for encrypting the field data corresponding to the target field type for which the target enterprise node with the access permission has access permission in the document data, so as to facilitate the access
  • the key for encrypting the field data corresponding to the target field type of the permission is sent to the target enterprise node.
  • Step S170 Send the key for encrypting the field data corresponding to the target field type for which the target enterprise node has access rights in the document data to the target enterprise node, so that the target enterprise node is based on the target
  • the key for encrypting the field data corresponding to the target field type for which the enterprise node has access rights in the document data decrypts the encrypted data.
  • the server side corresponding to the bank node sends the key that encrypts the field data corresponding to the target field type for which the enterprise node receiving the document data has access rights in the document data to the enterprise node, so that the enterprise node is based on
  • the key decrypts the encrypted encrypted data, so that the enterprise corresponding to the enterprise node that receives the document data can view the field type that the bank node performs key authorization in the document data, which meets the complexity of the relationship between the bank and the enterprise.
  • the corresponding enterprise nodes of other enterprises do not have the key, they can only access the encrypted document data, which realizes that the document data can be linked to the chain, and the leakage of the document data can be avoided.
  • FIG. 4 is a specific implementation flowchart of step S170 in a block chain-based data encryption method shown in an exemplary embodiment of the present application.
  • the target enterprise The step S170 of sending the encryption key of the field data corresponding to the target field type for which the node has access permission in the document data to the target enterprise node includes:
  • Step S1702 It is judged whether the time for winding up the encrypted data after encryption is within a preset time range for winding up.
  • the key to encrypt the field data corresponding to the target field type for which the target enterprise node has access rights in the document data needs to be sent to the target enterprise node , You can compare the chain time of the encrypted encrypted data with the preset chain time range.
  • the encrypted data is valid data, and key authorization can be performed; when the chain time of the encrypted data is not in the preset chain time range When the time range of the chain is on, the encrypted data after encryption is invalid data, and key authorization cannot be performed
  • step S1703 if the time for the encrypted data after the encryption is within the preset time range for the time, then perform field data corresponding to the target field type for which the target enterprise node has access rights in the document data The encrypted key is sent to the target enterprise node.
  • the encrypted data when the chain time of the encrypted encrypted data is within the preset chain time range, the encrypted data is valid data, and the server corresponding to the bank node sets the target enterprise node in the receipt data
  • the key for encrypting the field data corresponding to the target field type with access rights is sent to the target enterprise node, so that the enterprise node decrypts the encrypted encrypted data based on the key, so that the enterprise node that receives the document data corresponds to Of enterprises can view the field types that the bank node performs key authorization in the document data, which meets the more complex data transmission requirements between the bank and the enterprise.
  • the method before the step S1702 of judging whether the chain time of the encrypted encrypted data is within the preset chain time range, the method further includes:
  • Step S1701 Determine the preset chain time range based on the document type, the industry type, and the relationship table between the document type, the industry type, and the chain time range.
  • the server side corresponding to the bank node determines whether the uploading time of the encrypted encrypted data uploaded to the data blockchain is within the preset effective uploading time range, it can be based on the document type and industry.
  • the relationship table between the type and document type, industry type, and chain time range determines the preset chain time range, and then compares the chain time of the encrypted encrypted data with the preset chain time range to determine the encrypted data Whether the encrypted data of is valid data.
  • FIG. 5 shows a block chain-based data encryption device according to an exemplary embodiment of the present application.
  • the block chain-based data encryption device may be integrated into the above-mentioned electronic equipment, and may specifically include a first An acquisition unit 110, a first processing unit 120, an encryption unit 130, a second processing unit 140, an uplink unit 150, a second acquisition unit 160, and a sending unit 170.
  • the first obtaining unit 110 is configured to respond to an upload request for uploading document data entered by an employee account to obtain the receipt data in the upload request and the document type corresponding to the receipt data, and obtain the receipt
  • the employee level is obtained from the employee information corresponding to the employee account.
  • the first processing unit 120 is configured to determine, based on the field data corresponding to the field type of the enterprise name in the document data, a target enterprise node having access rights to the document data, and obtain the industry type corresponding to the target enterprise node.
  • the encryption unit 130 is configured to encrypt the field data corresponding to all the field types included in the document data with a specific key to obtain encrypted encrypted data.
  • the second processing unit 140 is configured to input the document type, the industry type, and the employee level into a preset machine learning model to determine a target for which the target enterprise node has access rights in the document data Field Type.
  • the on-chain unit 150 is configured to input the document type, the industry type, and the employee level into a preset machine learning model to determine the target field for which the target enterprise node has access rights in the document data Types of.
  • the second obtaining unit 160 is configured to obtain a key for encrypting the field data corresponding to the target field type for which the target enterprise node has access permission in the document data;
  • the sending unit 170 is configured to send the key for encrypting the field data corresponding to the target field type for which the target enterprise node has access rights in the document data to the target enterprise node, so that the target enterprise node is based on
  • the key for encrypting the field data corresponding to the target field type for which the target enterprise node has access rights in the document data decrypts the encrypted data.
  • the encryption unit includes:
  • the first obtaining subunit is used to obtain all the field types included in the document data
  • the first processing subunit is configured to determine a specific key for respectively encrypting field data corresponding to all field types based on a preset relationship table between field types and keys;
  • the encryption subunit is used for separately encrypting field data corresponding to all field types based on the specific key to obtain encrypted encrypted data.
  • the first processing unit includes:
  • the second obtaining subunit is used to obtain the enterprise name information contained in the field data corresponding to the field type of the enterprise name in the document data;
  • the second processing subunit is configured to determine the target enterprise node for which the document data has the access authority based on the enterprise name information, the relationship table between the enterprise name and the enterprise node.
  • the sending unit includes:
  • the judging subunit is used for judging whether the chain time of the encrypted encrypted data is within the preset chain time range
  • the sending subunit is configured to correspond to the target field type for which the target enterprise node has access rights in the document data if the chain time of the encrypted encrypted data is within the preset chain time range
  • the key for encrypting the field data is sent to the target enterprise node. If the chain time of the encrypted encrypted data is within the preset chain time range, the target enterprise node is included in the document data
  • the key for encrypting the field data corresponding to the target field type of the reference authority is sent to the target enterprise node.
  • the sending unit further includes.
  • the third processing sub-unit is configured to determine the preset time range for uploading based on the document type, the industry type, and the relationship table between the document type, the industry type, and the uploading time range.
  • modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory.
  • the features and functions of two or more modules or units described above may be embodied in one module or unit.
  • the features and functions of a module or unit described above can be further divided into multiple modules or units to be embodied.
  • the exemplary embodiments described herein can be implemented by software, or can be implemented by combining software with necessary hardware. Therefore, the technical solution according to the embodiments of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, U disk, mobile hard disk, etc.) or on the network , Including several instructions to make a computing device (which may be a personal computer, a server, a mobile terminal, or a network device, etc.) execute the method according to the embodiment of the present disclosure.
  • a non-volatile storage medium which can be a CD-ROM, U disk, mobile hard disk, etc.
  • Including several instructions to make a computing device which may be a personal computer, a server, a mobile terminal, or a network device, etc.
  • a computer device capable of implementing the above method is also provided.
  • Fig. 6 shows an exemplary block diagram of an electronic device for implementing the above-mentioned blockchain-based data encryption method.
  • the computer device 400 takes the form of a general-purpose computing device.
  • the components of the computer device 400 may include, but are not limited to: the aforementioned at least one processing unit 410, the aforementioned at least one storage unit 420, and a bus 430 connecting different system components (including the storage unit 420 and the processing unit 410).
  • the storage unit stores program code, and the program code can be executed by the processing unit 410, so that the processing unit 410 executes the various exemplary methods described in the "Exemplary Method" section of this specification. Implementation steps.
  • the processing unit 410 may execute the steps of the blockchain data encryption method as shown in FIG. 1.
  • the storage unit 420 may include a readable medium in the form of a volatile storage unit, such as a random access storage unit (RAM) 4201 and/or a cache storage unit 4202, and may further include a read-only storage unit (ROM) 4203.
  • RAM random access storage unit
  • ROM read-only storage unit
  • the storage unit 420 may also include a program/utility tool 4204 having a set of (at least one) program module 4205.
  • program module 4205 includes but is not limited to: an operating system, one or more application programs, other program modules, and program data, Each of these examples or some combination may include the implementation of a network environment.
  • the bus 430 may represent one or more of several types of bus structures, including a storage unit bus or a storage unit controller, a peripheral bus, a graphics acceleration port, a processing unit, or a local area using any bus structure among multiple bus structures. bus.
  • the computer device 400 can also communicate with one or more external devices 600 (such as keyboards, pointing devices, Bluetooth devices, etc.), and can also communicate with one or more devices that enable users to interact with the computer device 400, and/or communicate with Any device (such as a router, modem, etc.) that enables the computer device 400 to communicate with one or more other computing devices. Such communication may be performed through an input/output (I/O) interface 440.
  • the computer device 400 may also communicate with one or more networks (such as a local area network (LAN), a wide area network (WAN), and/or a public network, such as the Internet) through the network adapter 460. As shown in the figure, the network adapter 460 communicates with other modules of the computer device 400 through the bus 430.
  • FIG. 7 is a computer-readable storage medium used to implement the above-mentioned blockchain-based data encryption method according to an exemplary embodiment of the present application.
  • the computer-readable storage medium may be non-volatile. , It can also be volatile.
  • FIG. 7 depicts a program product 500 for implementing the above-mentioned method according to an embodiment of the present application, which may adopt a portable compact disk read-only memory (CD-ROM) and include program code, and may be on a computer device, such as a personal computer run.
  • CD-ROM portable compact disk read-only memory
  • the program product of this application is not limited to this.
  • the readable storage medium can be any tangible medium that contains or stores a program, and the program can be used by or combined with an instruction execution system, device, or device.
  • the program product can use any combination of one or more readable media.
  • the readable medium may be a readable signal medium or a readable storage medium.
  • the readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or a combination of any of the above. More specific examples (non-exhaustive list) of readable storage media include: electrical connections with one or more wires, portable disks, hard disks, random access memory (RAM), read only memory (ROM), erasable Type programmable read only memory (EPROM or flash memory), optical fiber, portable compact disk read only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • General Health & Medical Sciences (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • General Physics & Mathematics (AREA)
  • Bioethics (AREA)
  • Computing Systems (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Databases & Information Systems (AREA)
  • Storage Device Security (AREA)

Abstract

本申请揭示了一种基于区块链的数据加密方法、装置、电子设备和存储介质,属于数据处理的技术领域,其中所述方法包括:响应于员工账号输入的用于将单据数据上链的上链请求,获取所述上链请求中的所述单据数据以及所述单据数据对应的单据类型,并从所述员工账号相应的员工信息中获取员工等级;基于所述单据数据中为企业名称的字段类型对应的字段数据确定对所述单据数据具备查阅权限的目标企业节点,以及获取所述目标企业节点对应的行业类型;对所述单据数据中包含的所有字段类型对应的字段数据分别通过特定密钥进行加密得到加密后的加密数据。本申请提出的方法满足了银行和企业之间较为复杂的数据传输需求,还能避免单据数据的泄露。

Description

基于区块链的数据加密方法、装置、电子设备和存储介质 技术领域
本申请要求于2019年7月24日提交中国专利局、申请号为201910671757.6,发明名称为“基于区块链的数据加密方法、装置、电子设备和存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
本申请涉及区块链的技术领域,特别是涉及基于区块链的数据加密方法、装置、电子设备和存储介质。
背景技术
银行和企业之间一般需要通过单据数据来维持相关的业务关系,银行在将单据数据发给企业时,一般会利用区块链技术共同监督、信任度高的优点,将单据数据上传区块链,以供相应的企业查看单据数据。但是,发明人意识到,与银行合作的企业较多,如果将针对于某个企业的单据数据上链,会造成针对该企业的单据数据可以被任何其它与银行合作的企业的区块链节点所获得,容易造成信息泄露;此外,银行在将不同类型的单据数据传递给相应的企业时,会存在只需要传递单据中部分字段数据的需求,且对于同一个类型的单据,传递给不同的企业时,所需要传递单据中的部分字段数据也存在差异。
因此,现有技术中缺乏一种在将单据数据在上链的情况下能减少单据数据泄露,且满足银行和企业之间的复杂的数据传输需求的方法。
发明概述
技术问题
问题的解决方案
技术解决方案
基于此,为解决缺乏一种在将单据数据在上链的情况下能减少单据数据泄露,且满足银行和企业之间的复杂的数据传输需求的方法的技术问题,本申请提供 了一种基于区块链的数据加密方法、装置、电子设备和存储介质。
第一方面,提供了一种基于区块链的数据加密方法,所述方法包括:
响应于员工账号输入的用于将单据数据上链的上链请求,获取所述上链请求中的所述单据数据以及所述单据数据对应的单据类型,并从所述员工账号相应的员工信息中获取员工等级;
基于所述单据数据中为企业名称的字段类型对应的字段数据确定对所述单据数据具备查阅权限的目标企业节点,以及获取所述目标企业节点对应的行业类型;
对所述单据数据中包含的所有字段类型对应的字段数据分别通过特定密钥进行加密得到加密后的加密数据;
将所述单据类型、所述行业类型、所述员工等级输入至预设的机器学习模型中确定得到所述目标企业节点在所述单据数据中具备查阅权限的目标字段类型;
将所述加密后的加密数据上链;
获取所述目标企业节点在所述单据数据中具备查阅权限的目标字段类型对应的字段数据进行加密的密钥;
将所述目标企业节点在所述单据数据中具备查阅权限的目标字段类型对应的字段数据进行加密的密钥发送至所述目标企业节点,以使得所述目标企业节点基于所述目标企业节点在所述单据数据中具备查阅权限的目标字段类型对应的字段数据进行加密的密钥对所述加密后的加密数据进行解密。
第二方面,提供了一种电子设备,包括存储器和处理器,所述存储器中存储有计算机可读指令,所述计算机可读指令被所述处理器执行时,使得所述处理器执行上述基于区块链的数据加密方法的步骤。
第三方面,提供了一种存储有计算机可读指令的存储介质,所述计算机可读指令被一个或多个处理器执行时,使得一个或多个处理器执行上述基于区块链的数据加密的步骤。
发明的有益效果
有益效果
本公开的实施例提供的技术方案可以包括以下有益效果:
银行节点对应的服务器端对单据数据中包含的所有字段类型对应的字段数据分别通过特定密钥进行加密得到加密后的加密数据,并将企业节点在该单据数据中具备查阅权限的目标字段类型对应的字段数据进行加密的密钥发送至企业节点,以使得该企业节点基于该密钥对加密后的加密数据进行解密,使得接收该单据数据的企业节点所对应的企业能查看到银行节点对单据数据中进行密钥授权的字段类型,满足了银行和企业之间较为复杂的数据传输需求;此外,与银行合作的其它企业对应的企业节点由于没有密钥,因此只能查阅加密后的单据数据,进而实现了将单据数据上链的情况下,还能避免单据数据的泄露。
对附图的简要说明
附图说明
图1是本申请一示例性实施例示出的一种基于区块链的数据加密方法的实现流程图。
图2是本申请一示例性实施例示出的基于区块链的数据加密方法中步骤S120的一种具体实现流程图。
图3是本申请一示例性实施例示出的基于区块链的数据加密方法中步骤S130的一种具体实现流程图。
图4是本申请一示例性实施例示出的基于区块链的数据加密方法中步骤S170的一种具体实现流程图。
图5是本申请一示例性实施例示出的一种基于区块链的数据加密装置的框图。
图6是本申请一示例性实施例示出的一种用于实现上述基于区块链的数据加密方法的电子设备示例框图。
图7是本申请一示例性实施例示出的一种用于实现上述基于区块链的数据加密方法的计算机可读存储介质。
发明实施例
本发明的实施方式
参考图1,图1本申请一示例性实施例示出的基于区块链的数据加密方法的实现流程图,本实施例中的基于区块链的数据加密方法的执行主体为电子设备,该电子设备具体可以为数据区块链中的银行节点对应的服务器端,如图1所示的基 于区块链的数据加密方法可包括如下步骤S110至步骤S170,详细说明如下:
步骤S110,响应于员工账号输入的用于将单据数据上链的上链请求,获取所述上链请求中的所述单据数据以及所述单据数据对应的单据类型,并从所述员工账号相应的员工信息中获取员工等级。
在本申请一个实施例中,上链请求是数据区块链中的银行节点对应的服务器端所接收到的用于将单据数据上传至数据区块链的请求,该请求可以由银行的员工手动操作银行节点对应的客户端设备提供的实体按键或虚拟控件进行触发,其中,请求在触发时,需要上传单据数据以及该单据数据的单据类型。需要说明的是,银行的员工需要在客户端设备中登录在银行节点对应的服务器端所注册的员工账号,才能触发上链请求。
此外,在通过银行节点对应的服务器端请求注册员工账号时,需要输入相应的员工信息,其中,员工信息至少包括员工等级,员工等级可以为员工的职位等级,例如经理和职员等不同的职位等级,员工信息还可以包括姓名、年龄和工号等信息。银行节点对应的服务器端将员工账号和员工账号相应的员工信息关联存储至员工信息库中。
银行节点对应的服务器端响应于员工账号输入的用于将单据数据上链的上链请求,获取上链请求中的单据数据以及单据数据对应的单据类型。银行节点对应的服务器端根据所登录的员工账号从员工信息库中查找到该员工账号相应的员工信息,并从员工账号相应的员工信息中获取员工等级。
步骤S120,基于所述单据数据中为企业名称的字段类型对应的字段数据确定对所述单据数据具备查阅权限的目标企业节点,以及获取所述目标企业节点对应的行业类型。
在本申请一个实施例中,单据具体可以为采购订单或发票等不同类型的单据。其中,单据中包含的数据具体为一个数据集,该数据集包含多个不同字段类型的字段数据,例如当单据类型为采购订单时,该数据集中所包含的字段类型可以包含“企业名称”、“付款条件”、“商品名称”、“数量”以及“单价”等。
银行节点对应的服务器端可以基于单据数据中为企业名称的字段类型对应的字段数据中包含的信息确定对单据数据具备查阅权限的目标企业节点。此外,服 务器端还基于所确定的对单据数据具备查阅权限的目标企业节点,从该目标企业节点对应的企业信息中获取该企业的行业类型。
参阅图2,图2是本申请一示例性实施例示出的基于区块链的数据加密方法中步骤S120的一种具体实现流程图,在本实施例中,所述基于单据数据中为企业名称的字段类型对应的字段数据确定对单据数据具备查阅权限的目标企业节点的步骤S120,包括:
步骤S1201,获取所述单据数据中为企业名称的字段类型对应的字段数据中包含的企业名信息。
在本申请一个实施例中,银行节点对应的服务器端获取单据数据中为企业名称的字段类型对应的字段数据中包含的企业名信息,例如,单据数据中为企业名称的字段类型的字段数据包含的企业名信息为“XX快递公司”,则“XX快递公司”为可以查看该单据数据的企业。
步骤S1202,基于所述企业名信息、企业名与企业节点的关系表确定所述单据数据具备查阅权限的目标企业节点。
在本申请一个实施例中,银行节点对应的服务器端在本地数据库中预存有企业名与企业节点的关系表,其中,企业名与企业节点的关系表包含有与银行合作的所有企业对应的企业节点和企业名之间的对应关系。
继续参照图1所示,在步骤S130中,对所述单据数据中包含的所有字段类型对应的字段数据分别通过特定密钥进行加密得到加密后的加密数据。
在本申请的一个实施例中,由于单据数据为包含多个不同字段类型的字段数据的数据集,在对单据数据进行加密时,可以对单据数据中包含的所有字段类型对应的字段数据分别通过特定密钥进行加密得到加密后的加密数据,通过对单据数据中包含的所有字段类型通过特定密钥进行加密,便于银行节点对应的服务器端根据数据传输需求自适应地对单据数据中部分字段类型对应的字段数据进行密钥的授权。需要说明的是,上述特定密钥为针对不同的字段类型所预设的密钥,不同的字段类型对应的密钥一般不同。
参阅图3,图3是本申请一示例性实施例示出的基于区块链的数据加密方法中步骤S130的一种具体实现流程图,在本实施例中,所述对所述单据数据中包含的 所有字段类型对应的字段数据分别通过特定密钥进行加密得到加密后的加密数据的步骤S130,包括:
步骤S1301,获取所述单据数据中包含的所有字段类型。
银行节点对应的服务器端基于所有单据类型的单据数据和该单据类型的单据数据中所包含的字段类型的关系表去获取单据数据中包含的所有字段类型。
步骤S1302,基于预设的字段类型与密钥的关系表确定用于对所有字段类型对应的字段数据分别进行加密的特定密钥。
银行节点对应的服务器端在本地数据库中预存有所有字段类型和对字段类型对应的字段数据进行加密的密钥的关系表,服务器端根据该关系表,以及所获取单据数据中包含的所有字段类型确定用于对所有字段类型对应的字段数据分别进行加密的特定密钥。
步骤S1303,基于所述特定密钥对所有字段类型对应的字段数据分别进行加密得到加密后的加密数据。
银行节点对应的服务器端基于所确定的特定密钥对单数数据中的所有字段类型对应的字段数据分别进行加密得到加密后的加密数据,即得到对单据数据中的数据集进行加密得到加密后的加密单据数据。
继续参照图1所示,在步骤S140中,将所述单据类型、所述行业类型、所述员工等级输入至预设的机器学习模型中确定得到所述目标企业节点在所述单据数据中具备查阅权限的目标字段类型。
在本申请的一个实施例中,银行的员工在将同一类型的单据数据发送至不同行业类型的企业节点时,需要使得不同企业能查看到的单据中的字段数据不相同,例如,发给快递公司的采购订单中,不应该包含有“单价”以及“付款条件”等字段类型对应的字段数据,由此,在将同一单据数据发送给不同企业对应的企业节点时,单据数据中进行密钥授权的目标字段类型将不相同。此外,在将同一单据数据发送至同一企业的企业节点时,还需要考虑到该员工的员工等级,经理以及职员等不同的员工等级所能下发的同一单据数据中,员工所能对单据数据存在的所有字段类型进行密钥授权时,能进行密钥授权的目标字段类型也不相同。因此,银行节点对应的服务器端需要基于单据类型、行业类型以及员工 等级自适应地确定单据数据中具备查阅权限的目标字段类型。
银行节点对应的服务器端将单据类型、行业类型以及员工等级输入至预设的机器学习模型中得到具备查阅权限的企业节点在单据数据中具备查阅权限的目标字段类型。其中,机器学习模型需要经过训练得到,机器学习模型根据输入的单据类型、行业类型以及员工等级确定得到具备查阅权限的企业节点在单据数据中具备查阅权限的字段类型,从而实现能根据银行和企业之间的数据传输需求自适应地确定单据中哪些字段类型为需要进行密钥授权的字段类型,以满足银行和企业之间较为复杂的数据传输需求。
在本申请的一个实施例中,机器学习模型是通过训练样本数据进行训练得到的。其中,机器学习模型可以是CNN(Convolutional Neural Network,卷积神经网络)模型,或者也可以是深度神经网络模型等。
在本申请的一个实施例中,对机器学习模型进行训练时,可以通过如下步骤。
获取已有的单据数据的单据类型、接收单据数据的企业节点对应的企业的行业类型、银行员工对应的员工等级,以及已知的单据数据中具备查阅权限的目标字段类型生成训练样本数据。
可以根据已有的单据数据的单据类型、接收单据数据的企业节点对应的企业的行业类型、银行员工对应的员工等级生成特征向量,将已知的单据数据中具备查阅权限的目标字段类型作为特征向量的标签来生成训练样本数据。
通过生成的训练样本数据对机器学习模型进行训练,得到训练后的机器学习模型,当在得到训练后的机器学习模型之后,可以通过训练后的机器学习模型来预测不同员工等级的银行员工在将某个单据数据进行上链时,该单据数据中具备查阅权限的目标字段类型。
继续参照图1所示,在步骤S150中,将所述加密后的加密数据上链。
在本申请的一个实施例中,加密后的加密数据具体为对单据数据中包含的所有字段类型对应的字段数据分别通过特定密钥进行加密得到的数据集,银行节点对应的服务器端将该数据集作为一个整体上传至数据区块链中。
步骤S160,获取所述目标企业节点在所述单据数据中具备查阅权限的目标字段类型对应的字段数据进行加密的密钥。
在本申请的一个实施例中,银行节点对应的服务器端获取具备查阅权限的目标企业节点在该单据数据中具备查阅权限的目标字段类型对应的字段数据进行加密的密钥,以便于将具备查阅权限的目标字段类型对应的字段数据进行加密的密钥发送至目标企业节点。
步骤S170,将所述目标企业节点在所述单据数据中具备查阅权限的目标字段类型对应的字段数据进行加密的密钥发送至所述目标企业节点,以使得所述目标企业节点基于所述目标企业节点在所述单据数据中具备查阅权限的目标字段类型对应的字段数据进行加密的密钥对所述加密后的加密数据进行解密。
以上可以看出,银行节点对应的服务器端将接收单据数据的企业节点在单据数据中具备查阅权限的目标字段类型对应的字段数据进行加密的密钥发送至该企业节点,以使得该企业节点基于该密钥对加密后的加密数据进行解密,使得接收该单据数据的企业节点所对应的企业能查看到银行节点对单据数据中进行密钥授权的字段类型,满足了银行和企业之间较为复杂的数据传输需求;此外,其他企业对应的企业节点由于没有密钥,因此只能查阅加密后的单据数据,进而实现了将单据数据上链的情况下,还能避免单据数据的泄露。
参阅图4,图四是本申请一示例性实施例示出的一种基于区块链的数据加密方法中步骤S170的一种具体实现流程图,在本实施例中,所述将所述目标企业节点在所述单据数据中具备查阅权限的目标字段类型对应的字段数据进行加密的密钥发送至所述目标企业节点的步骤S170包括,包括:
步骤S1702,判断所述加密后的加密数据的上链时间是否处于预设的上链时间范围。
在一个实施例中,银行和企业时之间所传递的单据数据,为了保证单据数据的有效性,需要依据单据数据的单据类型以及接收单据数据行业类型设置相应的有效时间范围。因此,为了使得企业所对应的企业节点能获取到有效的单据数据,在需要将目标企业节点在单据数据中具备查阅权限的目标字段类型对应的字段数据进行加密的密钥发送至目标企业节点之前,可以通过将加密后的加密数据的上链时间与预设的上链时间范围进行比较。当加密后的加密数据的上链时间处于预设的上链时间范围时,则加密后的加密数据为有效数据,可以进行 密钥授权;当加密后的加密数据的上链时间不处于预设的上链时间范围时,则加密后的加密数据为无效数据,不能进行密钥授权
步骤S1703,若所述加密后的加密数据的上链时间处于预设的上链时间范围内,则将所述目标企业节点在所述单据数据中具备查阅权限的目标字段类型对应的字段数据进行加密的密钥发送至所述目标企业节点。
在一个实施例中,当加密后的加密数据的上链时间处于预设的上链时间范围时,则加密后的加密数据为有效数据,则银行节点对应的服务器端将目标企业节点在单据数据中具备查阅权限的目标字段类型对应的字段数据进行加密的密钥发送至目标企业节点,使得该企业节点基于该密钥对加密后的加密数据进行解密,使得接收该单据数据的企业节点所对应的企业能查看到银行节点对单据数据中进行密钥授权的字段类型,满足了银行和企业之间较为复杂的数据传输需求。
在本申请一个实施例中,所述判断所述加密后的加密数据的上链时间是否处于预设的上链时间范围的步骤S1702之前,还包括:
步骤S1701,基于所述单据类型、所述行业类型以及单据类型、行业类型和上链时间范围的关系表确定所述预设的上链时间范围。
在本申请一个实施例中,银行节点对应的服务器端在确定上传至数据区块链的加密后的加密数据的上链时间是否处于预设的有效上链时间范围时,可以基于单据类型、行业类型以及单据类型、行业类型和上链时间范围的关系表确定预设的上链时间范围,进而将加密后的加密数据的上链时间与预设的上链时间范围进行比较,以确定加密后的加密数据是否为有效数据。
参考图5,图5是本申请一示例性实施例示出的一种基于区块链的数据加密装置,所述基于区块链的数据加密装置可以集成于上述的电子设备中,具体可以包括第一获取单元110、第一处理单元120、加密单元130、第二处理单元140、上链单元150、第二获取单元160以及发送单元170。
第一获取单元110,用于响应于员工账号输入的用于将单据数据上链的上链请求,获取所述上链请求中的所述单据数据以及所述单据数据对应的单据类型,并从所述员工账号相应的员工信息中获取员工等级。
第一处理单元120,用于基于所述单据数据中为企业名称的字段类型对应的字段数据确定对所述单据数据具备查阅权限的目标企业节点,以及获取所述目标企业节点对应的行业类型。
加密单元130,用于对所述单据数据中包含的所有字段类型对应的字段数据分别通过特定密钥进行加密得到加密后的加密数据。
第二处理单元140,用于将所述单据类型、所述行业类型、所述员工等级输入至预设的机器学习模型中确定得到所述目标企业节点在所述单据数据中具备查阅权限的目标字段类型。
上链单元150,用于将所述单据类型、所述行业类型、所述员工等级输入至预设的机器学习模型中确定得到所述目标企业节点在所述单据数据中具备查阅权限的目标字段类型。
第二获取单元160,用于获取所述目标企业节点在所述单据数据中具备查阅权限的目标字段类型对应的字段数据进行加密的密钥;
发送单元170,用于将所述目标企业节点在所述单据数据中具备查阅权限的目标字段类型对应的字段数据进行加密的密钥发送至所述目标企业节点,以使得所述目标企业节点基于所述目标企业节点在所述单据数据中具备查阅权限的目标字段类型对应的字段数据进行加密的密钥对所述加密后的加密数据进行解密。
可选地,所述加密单元,包括:
第一获取子单元,用于获取所述单据数据中包含的所有字段类型;
第一处理子单元,用于基于预设的字段类型与密钥的关系表确定用于对所有字段类型对应的字段数据分别进行加密的特定密钥;
加密子单元,用于基于所述特定密钥对所有字段类型对应的字段数据分别进行加密得到加密后的加密数据。
可选地,所述第一处理单元,包括:
第二获取子单元,用于获取所述单据数据中为企业名称的字段类型对应的字段数据中包含的企业名信息;
第二处理子单元,用于基于所述企业名信息、企业名与企业节点的关系表确定 所述单据数据具备查阅权限的目标企业节点。
可选地,所述发送单元,包括:
判断子单元,用于判断所述加密后的加密数据的上链时间是否处于预设的上链时间范围;
发送子单元,用于若所述加密后的加密数据的上链时间处于预设的上链时间范围内,则将所述目标企业节点在所述单据数据中具备查阅权限的目标字段类型对应的字段数据进行加密的密钥发送至所述目标企业节点若所述加密后的加密数据的上链时间处于预设的上链时间范围内,则将所述目标企业节点在所述单据数据中具备查阅权限的目标字段类型对应的字段数据进行加密的密钥发送至所述目标企业节点。
可选地,所述发送单元,还包括。
第三处理子单元,用于基于所述单据类型、所述行业类型以及单据类型、行业类型和上链时间范围的关系表确定所述预设的上链时间范围。
上述装置中各个模块的功能和作用的实现过程具体详见上述基于区块链的数据加密方法中对应步骤的实现过程,在此不再赘述。
应当注意,尽管在上文详细描述中提及了用于动作执行的设备的若干模块或者单元,但是这种划分并非强制性的。实际上,根据本公开的实施方式,上文描述的两个或更多模块或者单元的特征和功能可以在一个模块或者单元中具体化。反之,上文描述的一个模块或者单元的特征和功能可以进一步划分为由多个模块或者单元来具体化。
此外,尽管在附图中以特定顺序描述了本公开中方法的各个步骤,但是,这并非要求或者暗示必须按照该特定顺序来执行这些步骤,或是必须执行全部所示的步骤才能实现期望的结果。附加的或备选的,可以省略某些步骤,将多个步骤合并为一个步骤执行,以及/或者将一个步骤分解为多个步骤执行等。
通过以上的实施方式的描述,本领域的技术人员易于理解,这里描述的示例实施方式可以通过软件实现,也可以通过软件结合必要的硬件的方式来实现。因此,根据本公开实施方式的技术方案可以以软件产品的形式体现出来,该软件产品可以存储在一个非易失性存储介质(可以是CD-ROM,U盘,移动硬盘等) 中或网络上,包括若干指令以使得一台计算设备(可以是个人计算机、服务器、移动终端、或者网络设备等)执行根据本公开实施方式的方法。
在本公开的示例性实施例中,还提供了一种能够实现上述方法的计算机设备。参考图6,图6本申请一示例性实施例示出的一种用于实现上述基于区块链的数据加密方法的电子设备示例框图。
如图6所示,计算机设备400以通用计算设备的形式表现。计算机设备400的组件可以包括但不限于:上述至少一个处理单元410、上述至少一个存储单元420、连接不同系统组件(包括存储单元420和处理单元410)的总线430。
其中,所述存储单元存储有程序代码,所述程序代码可以被所述处理单元410执行,使得所述处理单元410执行本说明书上述“示例性方法”部分中描述的根据本申请各种示例性实施方式的步骤。例如,所述处理单元410可以执行如图1中所示的区块链的数据加密方法步骤。
存储单元420可以包括易失性存储单元形式的可读介质,例如随机存取存储单元(RAM)4201和/或高速缓存存储单元4202,还可以进一步包括只读存储单元(ROM)4203。
存储单元420还可以包括具有一组(至少一个)程序模块4205的程序/实用工具4204,这样的程序模块4205包括但不限于:操作系统、一个或者多个应用程序、其它程序模块以及程序数据,这些示例中的每一个或某种组合中可能包括网络环境的实现。
总线430可以为表示几类总线结构中的一种或多种,包括存储单元总线或者存储单元控制器、外围总线、图形加速端口、处理单元或者使用多种总线结构中的任意总线结构的局域总线。
计算机设备400也可以与一个或多个外部设备600(例如键盘、指向设备、蓝牙设备等)通信,还可与一个或者多个使得用户能与该计算机设备400交互的设备通信,和/或与使得该计算机设备400能与一个或多个其它计算设备进行通信的任何设备(例如路由器、调制解调器等等)通信。这种通信可以通过输入/输出(I/O)接口440进行。并且,计算机设备400还可以通过网络适配器460与一个或者多个网络(例如局域网(LAN),广域网(WAN)和/或公共网络,例如因特网 )通信。如图所示,网络适配器460通过总线430与计算机设备400的其它模块通信。应当明白,尽管图中未示出,可以结合计算机设备400使用其它硬件和/或软件模块,包括但不限于:微代码、设备驱动器、冗余处理单元、外部磁盘驱动阵列、RAID系统、磁带驱动器以及数据备份存储系统等。
参考图7所示,图7是本申请一示例性实施例示出的一种用于实现上述基于区块链的数据加密方法的计算机可读存储介质,该计算机可读存储介质可以是非易失性,也可以是易失性。图7描述了根据本申请的实施方式的用于实现上述方法的程序产品500,其可以采用便携式紧凑盘只读存储器(CD-ROM)并包括程序代码,并可以在计算机设备,例如个人电脑上运行。然而,本申请的程序产品不限于此,在本文件中,可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。
所述程序产品可以采用一个或多个可读介质的任意组合。可读介质可以是可读信号介质或者可读存储介质。可读存储介质例如可以为但不限于电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。可读存储介质的更具体的例子(非穷举的列表)包括:具有一个或多个导线的电连接、便携式盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。

Claims (20)

  1. 一种基于区块链的数据加密方法,其中,所述方法包括:
    响应于员工账号输入的用于将单据数据上链的上链请求,获取所述上链请求中的所述单据数据以及所述单据数据对应的单据类型,并从所述员工账号相应的员工信息中获取员工等级;
    基于所述单据数据中为企业名称的字段类型对应的字段数据确定对所述单据数据具备查阅权限的目标企业节点,以及获取所述目标企业节点对应的行业类型;
    对所述单据数据中包含的所有字段类型对应的字段数据分别通过特定密钥进行加密得到加密后的加密数据;
    将所述单据类型、所述行业类型、所述员工等级输入至预设的机器学习模型中确定得到所述目标企业节点在所述单据数据中具备查阅权限的目标字段类型;
    将所述加密后的加密数据上链;
    获取所述目标企业节点在所述单据数据中具备查阅权限的目标字段类型对应的字段数据进行加密的密钥;
    将所述目标企业节点在所述单据数据中具备查阅权限的目标字段类型对应的字段数据进行加密的密钥发送至所述目标企业节点,以使得所述目标企业节点基于所述目标企业节点在所述单据数据中具备查阅权限的目标字段类型对应的字段数据进行加密的密钥对所述加密后的加密数据进行解密。
  2. 根据权利要求1所述的方法,其中,所述对所述单据数据中包含的所有字段类型对应的字段数据分别通过特定密钥进行加密得到加密后的加密数据的步骤,包括:
    获取所述单据数据中包含的所有字段类型;
    基于预设的字段类型与密钥的关系表确定用于对所有字段类型对应的字段数据分别进行加密的特定密钥;
    基于所述特定密钥对所有字段类型对应的字段数据分别进行加密 得到加密后的加密数据。
  3. 根据权利要求1所述的方法,其中,所述基于所述单据数据中为企业名称的字段类型对应的字段数据确定对所述单据数据具备查阅权限的目标企业节点的步骤,包括:
    获取所述单据数据中为企业名称的字段类型对应的字段数据中包含的企业名信息;
    基于所述企业名信息、企业名与企业节点的关系表确定所述单据数据具备查阅权限的目标企业节点。
  4. 根据权利要求1所述的方法,其中,所述将所述目标企业节点在所述单据数据中具备查阅权限的目标字段类型对应的字段数据进行加密的密钥发送至所述目标企业节点的步骤,包括:
    判断所述加密后的加密数据的上链时间是否处于预设的上链时间范围;
    若所述加密后的加密数据的上链时间处于预设的上链时间范围内,则将所述目标企业节点在所述单据数据中具备查阅权限的目标字段类型对应的字段数据进行加密的密钥发送至所述目标企业节点。
  5. 根据权利要求4所述的方法,其中,所述判断所述加密后的加密数据的上链时间是否处于预设的上链时间范围的步骤之前,包括:
    基于所述单据类型、所述行业类型以及单据类型、行业类型和上链时间范围的关系表确定所述预设的上链时间范围。
  6. 一种基于区块链的数据加密装置,其中,所述装置包括:
    第一获取单元,用于响应于员工账号输入的用于将单据数据上链的上链请求,获取所述上链请求中的所述单据数据以及所述单据数据对应的单据类型,并从所述员工账号相应的员工信息中获取员工等级;
    第一处理单元,用于基于所述单据数据中为企业名称的字段类型对应的字段数据确定对所述单据数据具备查阅权限的目标企业节 点,以及获取所述目标企业节点对应的行业类型;
    加密单元,用于对所述单据数据中包含的所有字段类型对应的字段数据分别通过特定密钥进行加密得到加密后的加密数据;
    第二处理单元,用于将所述单据类型、所述行业类型、所述员工等级输入至预设的机器学习模型中确定得到所述目标企业节点在所述单据数据中具备查阅权限的目标字段类型;
    上链单元,用于将所述加密后的加密数据上链;
    第二获取单元,用于获取所述目标企业节点在所述单据数据中具备查阅权限的目标字段类型对应的字段数据进行加密的密钥;
    发送单元,用于将所述目标企业节点在所述单据数据中具备查阅权限的目标字段类型对应的字段数据进行加密的密钥发送至所述目标企业节点,以使得所述目标企业节点基于所述目标企业节点在所述单据数据中具备查阅权限的目标字段类型对应的字段数据进行加密的密钥对所述加密后的加密数据进行解密。
  7. 根据权利要求6所述的装置,其中,所述加密单元,包括:
    第一获取子单元,用于获取所述单据数据中包含的所有字段类型;
    第一处理子单元,用于基于预设的字段类型与密钥的关系表确定用于对所有字段类型对应的字段数据分别进行加密的特定密钥;
    加密子单元,用于基于所述特定密钥对所有字段类型对应的字段数据分别进行加密得到加密后的加密数据。
  8. 根据权利要求6所述的装置,其中,所述第一处理单元,包括:
    第二获取子单元,用于获取所述单据数据中为企业名称的字段类型对应的字段数据中包含的企业名信息;
    第二处理子单元,用于基于所述企业名信息、企业名与企业节点的关系表确定所述单据数据具备查阅权限的目标企业节点。
  9. 根据权利要求6所述的装置,其中,所述发送单元,包括:
    判断子单元,具体用于判断所述加密后的加密数据的上链时间是 否处于预设的上链时间范围;
    发送子单元,用于若所述加密后的加密数据的上链时间处于预设的上链时间范围内,则将所述目标企业节点在所述单据数据中具备查阅权限的目标字段类型对应的字段数据进行加密的密钥发送至所述目标企业节点。
  10. 根据权利要求6所述的装置,所述发送单元,还包括;
    第三处理子单元,用于基于所述单据类型、所述行业类型以及单据类型、行业类型和上链时间范围的关系表确定所述预设的上链时间范围。
  11. 一种电子设备,包括存储器和处理器,所述存储器中存储有计算机可读指令,所述计算机可读指令被所述处理器执行时,使得所述处理器执行基于区块链的数据加密方法,所述基于区块链的数据加密方法,具体包括如下步骤:
    响应于员工账号输入的用于将单据数据上链的上链请求,获取所述上链请求中的所述单据数据以及所述单据数据对应的单据类型,并从所述员工账号相应的员工信息中获取员工等级;
    基于所述单据数据中为企业名称的字段类型对应的字段数据确定对所述单据数据具备查阅权限的目标企业节点,以及获取所述目标企业节点对应的行业类型;
    对所述单据数据中包含的所有字段类型对应的字段数据分别通过特定密钥进行加密得到加密后的加密数据;
    将所述单据类型、所述行业类型、所述员工等级输入至预设的机器学习模型中确定得到所述目标企业节点在所述单据数据中具备查阅权限的目标字段类型;
    将所述加密后的加密数据上链;
    获取所述目标企业节点在所述单据数据中具备查阅权限的目标字段类型对应的字段数据进行加密的密钥;
    将所述目标企业节点在所述单据数据中具备查阅权限的目标字段 类型对应的字段数据进行加密的密钥发送至所述目标企业节点,以使得所述目标企业节点基于所述目标企业节点在所述单据数据中具备查阅权限的目标字段类型对应的字段数据进行加密的密钥对所述加密后的加密数据进行解密。
  12. 根据权利要求11所述的电子设备,其中,所述对所述单据数据中包含的所有字段类型对应的字段数据分别通过特定密钥进行加密得到加密后的加密数据的步骤,包括:
    获取所述单据数据中包含的所有字段类型;
    基于预设的字段类型与密钥的关系表确定用于对所有字段类型对应的字段数据分别进行加密的特定密钥;
    基于所述特定密钥对所有字段类型对应的字段数据分别进行加密得到加密后的加密数据。
  13. 根据权利要求11所述的电子设备,其中,所述基于所述单据数据中为企业名称的字段类型对应的字段数据确定对所述单据数据具备查阅权限的目标企业节点的步骤,包括:
    获取所述单据数据中为企业名称的字段类型对应的字段数据中包含的企业名信息;
    基于所述企业名信息、企业名与企业节点的关系表确定所述单据数据具备查阅权限的目标企业节点。
  14. 根据权利要求11所述的电子设备,其中,所述将所述目标企业节点在所述单据数据中具备查阅权限的目标字段类型对应的字段数据进行加密的密钥发送至所述目标企业节点的步骤,包括:
    判断所述加密后的加密数据的上链时间是否处于预设的上链时间范围;
    若所述加密后的加密数据的上链时间处于预设的上链时间范围内,则将所述目标企业节点在所述单据数据中具备查阅权限的目标字段类型对应的字段数据进行加密的密钥发送至所述目标企业节点。
  15. 根据权利要求14所述的电子设备,其中,所述判断所述加密后的加密数据的上链时间是否处于预设的上链时间范围的步骤之前,包括:
    基于所述单据类型、所述行业类型以及单据类型、行业类型和上链时间范围的关系表确定所述预设的上链时间范围。
  16. 一种存储有计算机可读指令的存储介质,所述计算机可读指令被一个或多个处理器执行时,使得一个或多个处理器执行基于区块链的数据加密方法,所述基于区块链的数据加密方法,具体包括如下步骤:
    响应于员工账号输入的用于将单据数据上链的上链请求,获取所述上链请求中的所述单据数据以及所述单据数据对应的单据类型,并从所述员工账号相应的员工信息中获取员工等级;
    基于所述单据数据中为企业名称的字段类型对应的字段数据确定对所述单据数据具备查阅权限的目标企业节点,以及获取所述目标企业节点对应的行业类型;
    对所述单据数据中包含的所有字段类型对应的字段数据分别通过特定密钥进行加密得到加密后的加密数据;
    将所述单据类型、所述行业类型、所述员工等级输入至预设的机器学习模型中确定得到所述目标企业节点在所述单据数据中具备查阅权限的目标字段类型;
    将所述加密后的加密数据上链;
    获取所述目标企业节点在所述单据数据中具备查阅权限的目标字段类型对应的字段数据进行加密的密钥;
    将所述目标企业节点在所述单据数据中具备查阅权限的目标字段类型对应的字段数据进行加密的密钥发送至所述目标企业节点,以使得所述目标企业节点基于所述目标企业节点在所述单据数据中具备查阅权限的目标字段类型对应的字段数据进行加密的密钥对所述加密后的加密数据进行解密。
  17. 根据权利要求16所述的存储介质,其中,所述对所述单据数据中包含的所有字段类型对应的字段数据分别通过特定密钥进行加密得到加密后的加密数据的步骤,包括:
    获取所述单据数据中包含的所有字段类型;
    基于预设的字段类型与密钥的关系表确定用于对所有字段类型对应的字段数据分别进行加密的特定密钥;
    基于所述特定密钥对所有字段类型对应的字段数据分别进行加密得到加密后的加密数据。
  18. 根据权利要求16所述的存储介质,其中,所述基于所述单据数据中为企业名称的字段类型对应的字段数据确定对所述单据数据具备查阅权限的目标企业节点的步骤,包括:
    获取所述单据数据中为企业名称的字段类型对应的字段数据中包含的企业名信息;
    基于所述企业名信息、企业名与企业节点的关系表确定所述单据数据具备查阅权限的目标企业节点。
  19. 根据权利要求16所述的存储介质,其中,所述将所述目标企业节点在所述单据数据中具备查阅权限的目标字段类型对应的字段数据进行加密的密钥发送至所述目标企业节点的步骤,包括:
    判断所述加密后的加密数据的上链时间是否处于预设的上链时间范围;
    若所述加密后的加密数据的上链时间处于预设的上链时间范围内,则将所述目标企业节点在所述单据数据中具备查阅权限的目标字段类型对应的字段数据进行加密的密钥发送至所述目标企业节点。
  20. 根据权利要求16所述的存储介质,其中,所述判断所述加密后的加密数据的上链时间是否处于预设的上链时间范围的步骤之前,包括:
    基于所述单据类型、所述行业类型以及单据类型、行业类型和上 链时间范围的关系表确定所述预设的上链时间范围。
PCT/CN2020/088432 2019-07-24 2020-04-30 基于区块链的数据加密方法、装置、电子设备和存储介质 WO2021012746A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910671757.6 2019-07-24
CN201910671757.6A CN110474886B (zh) 2019-07-24 2019-07-24 基于区块链的数据加密方法、装置、电子设备和存储介质

Publications (1)

Publication Number Publication Date
WO2021012746A1 true WO2021012746A1 (zh) 2021-01-28

Family

ID=68508844

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/088432 WO2021012746A1 (zh) 2019-07-24 2020-04-30 基于区块链的数据加密方法、装置、电子设备和存储介质

Country Status (2)

Country Link
CN (1) CN110474886B (zh)
WO (1) WO2021012746A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114511392A (zh) * 2022-01-25 2022-05-17 北京中友金审科技有限公司 一种财务数据采集标准方法

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110474886B (zh) * 2019-07-24 2022-04-05 深圳壹账通智能科技有限公司 基于区块链的数据加密方法、装置、电子设备和存储介质
CN110943982B (zh) * 2019-11-21 2021-07-30 深圳壹账通智能科技有限公司 单据数据加密的方法、装置、电子设备和存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107169371A (zh) * 2017-04-27 2017-09-15 北京众享比特科技有限公司 一种基于区块链的数据库操作方法和系统
US20180322587A1 (en) * 2017-05-06 2018-11-08 Adp, Llc Payroll based blockchain identity
CN109670321A (zh) * 2018-11-30 2019-04-23 深圳灵图慧视科技有限公司 数据存储方法、数据查询方法及装置
CN109977697A (zh) * 2019-04-03 2019-07-05 陕西医链区块链集团有限公司 一种区块链的数据授权方法
CN110474886A (zh) * 2019-07-24 2019-11-19 深圳壹账通智能科技有限公司 基于区块链的数据加密方法、装置、电子设备和存储介质

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11132451B2 (en) * 2017-08-31 2021-09-28 Parity Technologies Ltd. Secret data access control systems and methods
CN109462472A (zh) * 2017-09-06 2019-03-12 阿里巴巴集团控股有限公司 数据加密和解密的方法、装置和系统
CN108200079A (zh) * 2018-01-19 2018-06-22 深圳四方精创资讯股份有限公司 基于对称和非对称混合加密的区块链隐私保护方法及装置
CN108563788B (zh) * 2018-04-27 2023-05-23 腾讯科技(深圳)有限公司 基于区块链的数据查询方法、装置、服务器及存储介质
CN108833385A (zh) * 2018-06-01 2018-11-16 深圳崀途科技有限公司 基于联盟链加密的用户数据匿名共享方法
CN109033855B (zh) * 2018-07-18 2020-02-11 腾讯科技(深圳)有限公司 一种基于区块链的数据传输方法、装置及存储介质
CN109995781B (zh) * 2019-03-29 2021-06-22 腾讯科技(深圳)有限公司 数据的传输方法、装置、介质以及设备

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107169371A (zh) * 2017-04-27 2017-09-15 北京众享比特科技有限公司 一种基于区块链的数据库操作方法和系统
US20180322587A1 (en) * 2017-05-06 2018-11-08 Adp, Llc Payroll based blockchain identity
CN109670321A (zh) * 2018-11-30 2019-04-23 深圳灵图慧视科技有限公司 数据存储方法、数据查询方法及装置
CN109977697A (zh) * 2019-04-03 2019-07-05 陕西医链区块链集团有限公司 一种区块链的数据授权方法
CN110474886A (zh) * 2019-07-24 2019-11-19 深圳壹账通智能科技有限公司 基于区块链的数据加密方法、装置、电子设备和存储介质

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114511392A (zh) * 2022-01-25 2022-05-17 北京中友金审科技有限公司 一种财务数据采集标准方法
CN114511392B (zh) * 2022-01-25 2022-08-16 北京中友金审科技有限公司 一种财务数据采集标准方法

Also Published As

Publication number Publication date
CN110474886B (zh) 2022-04-05
CN110474886A (zh) 2019-11-19

Similar Documents

Publication Publication Date Title
WO2021012746A1 (zh) 基于区块链的数据加密方法、装置、电子设备和存储介质
US11403413B2 (en) Avoiding user session misclassification using configuration and activity fingerprints
US20230275884A1 (en) Blockchain systems and methods for user authentication
JP7175550B2 (ja) 鍵を有するリソースロケーター
US10769287B2 (en) Forced data transformation policy
US10833870B2 (en) Cryptographic operations in an isolated collection
US9965645B2 (en) Field level data protection for cloud services using asymmetric cryptography
US11431757B2 (en) Access control using impersonization
US11290446B2 (en) Access to data stored in a cloud
US20180300489A1 (en) Intelligent storage devices with cryptographic functionality
US10091201B2 (en) Mobile device identify factor for access control policies
US9009469B2 (en) Systems and methods for securing data in a cloud computing environment using in-memory techniques and secret key encryption
US9998439B2 (en) Mobile device identify factor for access control policies
US10142100B2 (en) Managing user-controlled security keys in cloud-based scenarios
US20180089451A1 (en) Tokenized links with granular permissions
US8897451B1 (en) Storing secure information using hash techniques
WO2017147762A1 (zh) 基于生物特征实现的交互系统及装置
Epishkina et al. On Attribute-Based Encryption for Access Control to Multidimensional Data Structures
US11695561B2 (en) Decentralized authorization of user access requests in a multi-tenant distributed service architecture
JP7361384B2 (ja) 電子申請の補助方法、電子申請補助システム、電子申請補助システムのプログラム及びその記録媒体
US11785005B2 (en) Secure tunneling with implicit device identification
CN116974790A (zh) 一种自主可控桌面终端的安全行为画像构建方法

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20844731

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20844731

Country of ref document: EP

Kind code of ref document: A1

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 18/03/2022)

122 Ep: pct application non-entry in european phase

Ref document number: 20844731

Country of ref document: EP

Kind code of ref document: A1