WO2021068605A1 - Data persistence storage method and apparatus, computer device and storage medium - Google Patents

Data persistence storage method and apparatus, computer device and storage medium Download PDF

Info

Publication number
WO2021068605A1
WO2021068605A1 PCT/CN2020/105434 CN2020105434W WO2021068605A1 WO 2021068605 A1 WO2021068605 A1 WO 2021068605A1 CN 2020105434 W CN2020105434 W CN 2020105434W WO 2021068605 A1 WO2021068605 A1 WO 2021068605A1
Authority
WO
WIPO (PCT)
Prior art keywords
channel
channel object
target
target channel
storage
Prior art date
Application number
PCT/CN2020/105434
Other languages
French (fr)
Chinese (zh)
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 WO2021068605A1 publication Critical patent/WO2021068605A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/221Column-oriented storage; Management thereof

Definitions

  • This application relates to the field of data storage technology, and in particular to a data persistent storage method, device, computer equipment, and storage medium.
  • the embodiments of the present application provide a data persistent storage method, device, computer equipment, and storage medium, aiming to solve the problem of low reliability when storing data information in the blockchain technology in the prior art method.
  • an embodiment of the present application provides a data persistent storage method, which includes:
  • a storage channel containing a Channel object is created in the random storage medium of the SDK node corresponding to the user terminal according to the channel creation request;
  • the Channel object corresponding to the channel object acquisition request in the user terminal is acquired as the target Channel object;
  • the target Channel object is initialized and then fed back to the user.
  • an embodiment of the present application provides a data persistent storage device, which includes:
  • a storage channel creation unit configured to, if a channel creation request input by a user is received, create a storage channel containing a Channel object in a random storage medium of the SDK node corresponding to the user terminal according to the channel creation request;
  • Channel object persistent storage unit configured to serialize the Channel object and store it persistently in the SDK node corresponding to the user terminal
  • the target Channel object obtaining unit is configured to obtain the Channel object corresponding to the channel object obtaining request in the user terminal as the target Channel object if the channel object obtaining request input by the user is received;
  • the initialization judgment unit is used to judge whether the target Channel object has been initialized to obtain the initialization judgment result
  • the first feedback unit is configured to feed back the target Channel object to the user if the initial judgment result is yes;
  • the second feedback unit is configured to, if the result of the initialization judgment is negative, initialize the target Channel object and feed it back to the user.
  • an embodiment of the present application provides a computer device, which includes a memory, a processor, and a computer program stored on the memory and running on the processor, and the processor executes the computer
  • the program implements the data persistent storage method described in the first aspect.
  • the embodiments of the present application also provide a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor executes the above-mentioned first On the one hand, the data persistent storage method.
  • the embodiments of the present application provide a data persistent storage method, device, computer equipment, and storage medium. Create a storage channel containing the Channel object according to the channel creation request input by the user, serialize and persistently store the Channel object, obtain the corresponding target Channel object according to the input channel object acquisition request, and check whether the target Channel object has been initialized Make judgments and feed back the initialized target Channel object to the user.
  • the serialized Channel object can be persistently stored, and the target Channel object can be quickly obtained and initialized, which can ensure the high availability of the Channel object and solve the problem of the reliability of the blockchain technology when storing data information.
  • the problem of low sex The problem of low sex.
  • FIG. 1 is a schematic flowchart of a data persistent storage method provided by an embodiment of the application
  • FIG. 2 is a schematic diagram of an application scenario of a data persistent storage method provided by an embodiment of the application
  • FIG. 3 is a schematic diagram of a sub-flow of a data persistent storage method provided by an embodiment of the application
  • FIG. 4 is a schematic diagram of another process of a data persistent storage method provided by an embodiment of the application.
  • FIG. 5 is a schematic diagram of another sub-flow of the data persistent storage method provided by an embodiment of the application.
  • FIG. 6 is a schematic diagram of another sub-flow of the data persistent storage method provided by an embodiment of the application.
  • FIG. 7 is a schematic block diagram of a data persistent storage device provided by an embodiment of the application.
  • FIG. 8 is a schematic block diagram of subunits of a data persistent storage device provided by an embodiment of the application.
  • FIG. 9 is another schematic block diagram of a data persistent storage device provided by an embodiment of the application.
  • FIG. 10 is a schematic block diagram of another subunit of the data persistent storage device provided by an embodiment of the application.
  • FIG. 11 is a schematic block diagram of another subunit of the data persistent storage device provided by an embodiment of the application.
  • FIG. 12 is a schematic block diagram of a computer device provided by an embodiment of this application.
  • FIG. 1 is a schematic flowchart of a data persistent storage method provided by an embodiment of this application
  • FIG. 2 is a schematic diagram of an application scenario of a data persistent storage method provided by an embodiment of this application.
  • the data persistent storage method is applied to the user terminal 10, and the method is executed by application software installed in the user terminal 10.
  • the blockchain network 20 establishes a network connection with the user terminal 10 to realize the transmission of data information.
  • the user terminal 10 is a terminal device used to implement a data persistent storage method to achieve persistent storage of Channel objects, such as a desktop computer, a notebook computer, a tablet computer, or a mobile phone, etc.
  • the blockchain network 30 is a number of devices in the Internet.
  • the terminal equipment and management server are based on a terminal network composed of smart contracts.
  • FIG. 2 only shows one user terminal 10 and the blockchain network 20 for information transmission. In practical applications, the blockchain network 20 can also perform information transmission with multiple user terminals 10 at the same time.
  • the method includes steps S110 to S160.
  • the blockchain network contains multiple user terminals and a management server that manages the user terminals.
  • the management server is the sorting service node in the blockchain network.
  • a user terminal corresponds to an SDK node, and the SDK node is the user terminal.
  • one SDK node can correspond to one or more Peer nodes in the blockchain network, and a storage channel can contain multiple Peer nodes, and each Peer node is associated with a user terminal.
  • the SDK nodes in each storage channel are connected, and the data stored in each storage channel are isolated from each other; the ordering service node can receive transactions that include endorsement signatures, order the transactions or package them to generate blocks, and broadcast the information to the peer node.
  • the ordering service node can Ensure that nodes in the same storage channel receive the same messages and have the same logical sequence; SDK nodes can provide services to users, and one or more Channel objects can be created in one SDK node, and one Channel object in the SDK node is Corresponding to a Peer node included in the SDK node, that is, an SDK node can correspond to one or more Peer nodes, each Channel object belongs to a storage channel in the blockchain network, and a storage channel belongs to All Channel objects are the same, and the Channel object is the data that needs to be persistently stored.
  • Persistent storage of the data corresponding to the Channel object can maintain the high availability of the Channel object.
  • the user can input a channel creation request in the user terminal and create a new storage channel through the user terminal.
  • the channel creation request includes channel name, ordering service node information, peer node information, data signature information, etc., ordering service node information That is the node information of the ordering service node, the Peer node information is the Peer node contained in the storage channel, and the data signature information is the information used to sign the data in the storage channel.
  • the specific information contained in the channel creation request is passed.
  • Information can create a storage channel that contains a Channel object.
  • the user terminal includes a random storage medium corresponding to the SDK node.
  • the random storage medium is the medium used to temporarily store data information, such as the memory in the user terminal.
  • the SDK node includes a The recorded data table and one or more Channel objects. If an SDK node contains a Channel object, the data table of the SDK node contains only one channel record information corresponding to the Channel object; if a SDK node contains a Channel object If multiple Channel objects are included, the data table of the SDK node contains multiple channel record information corresponding to the multiple objects.
  • the corresponding Channel object can be created according to the channel creation request.
  • the created Channel object is stored in the random storage medium of the SDK node; specifically, the Channel object stores the information for creating the storage channel, including the channel name and ordering service node information , Peer node information, data signature information, etc.
  • step S110a is further included after step S110.
  • S110a Send the Channel object to the ordering service node corresponding to the ordering service node information according to the ordering service node information in the Channel object, so as to initialize the Channel object.
  • the Channel object is sent to the ordering service node corresponding to the ordering service node information to initialize the Channel object.
  • the specific information of the created storage channel and the Channel object are only stored in the SDK node that generated the storage channel.
  • the newly created Channel object needs to be The Channel object is initialized. Specifically, the Channel object is sent to the ordering service node corresponding to the ordering service node information in the Channel object. After receiving the Channel object, the ordering service node can send the Channel object to the Peer node information in the Channel object. The Channel object is sent to the SDK node corresponding to the Peer node information.
  • the Peer node information contains one or more Peer nodes. Each Peer node is associated with an SDK node in a user terminal.
  • the storage channel composed of the same Channel object stores and interacts with information, that is, realizes distributed storage of information.
  • S120 Serialize the Channel object and store it persistently in the SDK node corresponding to the user terminal.
  • the SDK node After serializing the Channel object, it is persistently stored in the SDK node corresponding to the user terminal.
  • the SDK node contains the corresponding NAS network disk and database.
  • the NAS network disk is used to persistently store the Channel file corresponding to the Channel object
  • the database is used to record information about the new channel corresponding to the storage channel to which the Channel object belongs. For persistent storage.
  • step S120 includes sub-steps S121, S122, S123, and S124.
  • the Channel object Serializes the Channel object to obtain the Channel file. Because the Channel object is a programming language, in order to persist the information contained in the Channel object, the Channel object needs to be serialized into a Channel file, which is a binary file, so the Channel file can be stored conveniently and persistently. When opening the binary file, users can only see one line of garbled code, so the Channel file can be deserialized to generate the corresponding Channel object before it can be used normally.
  • the Channel file is stored in the NAS network disk corresponding to the SDK node and the storage path information is recorded.
  • the NAS network disk is a readable and writable storage medium corresponding to the SDK node.
  • each SDK node corresponds to a shared NAS network disk.
  • the NAS network disk can store data persistently, and the obtained channel file can be stored. Store it in the corresponding NAS network disk and obtain the corresponding storage path information.
  • the storage path information includes the file name and storage address of the Channel file.
  • the storage path information corresponding to a Channel file is shown in Table 1.
  • S123 Generate new channel record information according to the channel creation request and storage path information.
  • new channel record information is generated. Specifically, the specific information in the channel creation request and the storage path information are obtained, and the corresponding new channel record information is generated.
  • the new channel record information is the summary information of the created storage channel. In the newly added channel record information Including channel name, ordering service node information, peer node information, file name and storage address of the Channel file and other information.
  • the database may be a lightweight SQlite database. Compared with traditional databases such as MySQL or SQL Server, the lightweight database of SQlite stores data more concisely and efficiently.
  • the Channel object cached in the random storage medium can also be stored in the database. If the random storage medium power failure information is lost, the Channel object corresponding to a certain storage channel can be obtained from the database and cached in the random storage medium. Obtain and use the Channel object quickly and easily.
  • the Channel object stored in the user terminal is acquired according to the channel object acquisition request.
  • the user obtains and uses the corresponding Channel object to realize distributed storage of information.
  • the user can obtain the corresponding Channel object by inputting the channel object acquisition request.
  • the channel object acquisition request may include the Channel object name or the channel name.
  • step S130 includes sub-steps S131, S132, S133, S134, and S135.
  • S131 Determine whether there is a Channel object corresponding to the channel object acquisition request in the random storage medium of the SDK node corresponding to the user terminal to obtain a storage determination result.
  • the Channel object is created in the random storage medium of the SDK node. If the user terminal restarts and causes the Channel object stored in the random storage medium to be lost, before obtaining the corresponding Channel object, you can check whether the SDK node's random storage medium exists or not.
  • the Channel object corresponding to the channel object acquisition request is judged. Specifically, the Channel object includes the channel name to which it belongs, and the data in the random storage medium can be queried through the Channel object name or channel name contained in the channel object acquisition request. If the data of the random storage medium queried contains the Channel object corresponding to the channel object acquisition request, the storage judgment result is that it exists; if the Channel object corresponding to the channel object acquisition request is not queried, the judgment result is that it does not exist.
  • the storage judgment result is yes, it indicates that the random storage medium of the current SDK node contains the Channel object corresponding to the channel object acquisition request, and the Channel object can be directly acquired as the target Channel object.
  • the database of the SDK node is retrieved according to the channel object acquisition request to acquire the channel record information corresponding to the channel object acquisition request in the database as target channel record information.
  • the SDK node database can be retrieved according to the channel object acquisition request.
  • the database records the channel record of each storage channel created based on the SDK node Information.
  • the channel record information includes channel name, ordering service node information, peer node information, file name and storage address of the Channel file, and so on. Therefore, the channel record information in the database can be retrieved according to the channel object acquisition request to obtain and The channel object obtains a piece of channel record information corresponding to the request as the target channel record information. If the channel record information corresponding to the channel object acquisition request is not retrieved in the database, the corresponding storage channel is created according to the channel object acquisition request.
  • S134 Obtain, according to the target channel record information, the Channel file stored in the NAS network disk corresponding to the SDK node as the target Channel file as the target Channel file.
  • the channel record information includes the storage address corresponding to the channel, and each storage address points to a Channel file in the corresponding NAS network disk, and the Channel file stored in the corresponding NAS network disk can be obtained according to the storage address as the target Channel file .
  • the target Channel file is deserialized according to the preset deserialization rule to obtain the target Channel object.
  • Each Channel file is a binary file.
  • the deserialization rule is used to deserialize the Channel file to obtain the rule information of the corresponding Channel object.
  • the deserialization rule contains the project name corresponding to the Channel object, and the Channel file is deserialized according to the project name You can get the Channel object.
  • the project name includes the channel name, ordering service node information, peer node information, data signature information, etc.
  • step S130 further includes sub-step S136.
  • the target Channel object that is not stored in the random storage medium can be stored in the random storage medium of the SDK node, that is, the target Channel object is cached and cached to the target Channel object in the random storage medium It is convenient for users to use.
  • S140 Judge whether the target Channel object has been initialized to obtain an initialization judgment result.
  • the target Channel object It is judged whether the target Channel object has been initialized to obtain the initial judgment result. Before feeding back the target Channel object to the user, it is necessary to judge whether the target Channel object has been initialized. In some cases (the user terminal disconnects from the network) although the storage channel containing the Channel object is already in the local SDK of the user terminal Created in the node, but because the Channel object has not been initialized, the ordering service node and other peer nodes corresponding to the storage channel in the blockchain network have not obtained the information of the storage channel, that is, the information cannot be carried out through the storage channel Storage and interaction.
  • the user terminal corresponding to the SDK node of the target Channel object sends the object verification information of the target Channel object to the ordering service node (management server) included in the ordering service node information in the target Channel object, and the object verification information includes the target Channel object.
  • the channel name of the channel to which the target Channel object belongs, the creation time of the channel to which the target Channel object belongs, the ordering service node feeds back the corresponding verification result according to the object verification information, and the verification result includes whether the ordering service node has stored information corresponding to the target Channel object, and obtain the verification
  • the target Channel object is fed back to the user. If the target Channel object has been initialized, that is, the Channel object is available for use, the target Channel object is fed back to the user for use.
  • the target Channel object is initialized and then fed back to the user. If the target Channel object has not been initialized, in order to ensure that the target Channel object obtained by the user can be used, the target object needs to be initialized and then fed back to the user for use, and the target Channel object is sent to the target Channel object.
  • the ordering service node corresponding to the ordering service node information can initialize the target Channel object. The specific initialization process is the same as the above steps. After the user receives the target Channel object that has been initialized, the storage channel corresponding to the target Channel object can be used To store and interact with information is to realize distributed storage of information.
  • a storage channel containing a Channel object is created according to a channel creation request input by a user, the Channel object is serialized and stored persistently, and the request is obtained according to the input channel object Obtain the corresponding target Channel object, judge whether the target Channel object has been initialized, and feed back the initialized target Channel object to the user.
  • the serialized Channel object can be persistently stored, and the target Channel object can be quickly obtained and initialized, which can ensure the high availability of the Channel object and solve the problem of the reliability of the blockchain technology when storing data information. The problem of low sex.
  • the embodiment of the present application also provides a data persistent storage device, which is used to execute any embodiment of the aforementioned data persistent storage method.
  • a data persistent storage device which is used to execute any embodiment of the aforementioned data persistent storage method.
  • FIG. 7, is a schematic block diagram of a data persistent storage device provided by an embodiment of the present application.
  • the data persistent storage device may be configured in the user terminal 10.
  • the data persistent storage device 100 includes a storage channel creation unit 110, a Channel object persistent storage unit 120, a target Channel object acquisition unit 130, an initialization judgment unit 140, a first feedback unit 150, and a second feedback unit 160 .
  • the storage channel creation unit 110 is configured to, if a channel creation request input by a user is received, create a storage channel containing a Channel object in a random storage medium of an SDK node corresponding to the user terminal according to the channel creation request.
  • the data persistent storage device 100 further includes a subunit: a Channel object initialization unit 110a.
  • the Channel object initialization unit 110a is configured to send the Channel object to the ordering service node corresponding to the ordering service node information according to the ordering service node information in the Channel object to initialize the Channel object.
  • the Channel object persistent storage unit 120 is configured to serialize the Channel object and store it persistently in the SDK node corresponding to the user terminal.
  • the Channel object persistent storage unit 120 includes sub-units: a Channel file acquisition unit 121, a Channel file storage unit 122, a newly added channel record information generating unit 123, and a newly added channel record Information storage unit 124.
  • the Channel file obtaining unit 121 is configured to serialize the Channel object to obtain a Channel file.
  • the Channel file storage unit 122 is configured to store the Channel file in the NAS network disk corresponding to the SDK node and obtain storage path information.
  • the newly added channel record information generating unit 123 is configured to generate newly added channel record information according to the channel creation request and storage path information.
  • the newly added channel record information storage unit 124 is configured to store the newly added channel record information in the database of the SDK node.
  • the target Channel object obtaining unit 130 is configured to, if a channel object obtaining request input by a user is received, obtain a Channel object corresponding to the channel object obtaining request in the user terminal as the target Channel object.
  • the target Channel object acquisition unit 130 includes sub-units: a storage judgment unit 131, a first object acquisition unit 132, a target channel record information acquisition unit 133, and a target Channel file acquisition unit 134 And the second object acquisition unit 135.
  • the storage judgment unit 131 is configured to judge whether there is a Channel object corresponding to the channel object acquisition request in the random storage medium of the SDK node corresponding to the user terminal to obtain the storage judgment result.
  • the first object acquisition unit 132 is configured to, if the storage judgment result is yes, acquire the Channel object corresponding to the channel object acquisition request in the random storage medium as the target Channel object.
  • the target channel record information obtaining unit 133 is configured to, if the storage judgment result is no, search the database of the SDK node according to the channel object obtaining request to obtain the database corresponding to the channel object obtaining request The target channel records information.
  • the target Channel file obtaining unit 134 is configured to obtain the Channel file stored in the NAS network disk corresponding to the SDK node as the target Channel file as the target Channel file according to the target channel record information.
  • the second object obtaining unit 135 is configured to deserialize the target Channel file according to a preset deserialization rule to obtain the target Channel object.
  • the target Channel object acquisition unit 130 further includes a subunit: a target Channel object cache unit 136.
  • the target Channel object cache unit 136 is configured to store the target Channel object in a random storage medium of the SDK node, so as to cache the target Channel object.
  • the initialization judgment unit 140 is configured to judge whether the target Channel object has been initialized to obtain the initialization judgment result.
  • the first feedback unit 150 is configured to feed back the target Channel object to the user if the initial judgment result is yes.
  • the second feedback unit 160 is configured to, if the result of the initialization judgment is negative, initialize the target Channel object and feed it back to the user.
  • the data persistent storage device provided in the embodiment of the present application is used to implement the above-mentioned data persistent storage method, create a storage channel containing a Channel object according to a channel creation request input by a user, serialize the Channel object and store it persistently, Obtain the corresponding target Channel object according to the input channel object acquisition request, judge whether the target Channel object has been initialized, and feed back the initialized target Channel object to the user.
  • the serialized Channel object can be persistently stored, and the target Channel object can be quickly obtained and initialized, which can ensure the high availability of the Channel object and solve the problem of the reliability of the blockchain technology when storing data information.
  • the problem of low sex is used to implement the above-mentioned data persistent storage method, create a storage channel containing a Channel object according to a channel creation request input by a user, serialize the Channel object and store it persistently, Obtain the corresponding target Channel object according to the input channel object acquisition request, judge whether the target Channel object has been initialized, and feed back the initialized target Channel
  • the aforementioned data persistent storage device may be implemented in the form of a computer program, and the computer program may run on the computer device as shown in FIG. 12.
  • FIG. 12 is a schematic block diagram of a computer device according to an embodiment of the present application.
  • the computer device 500 includes a processor 502, a memory, and a network interface 505 connected through a system bus 501, where the memory may include a non-volatile storage medium 503 and an internal memory 504.
  • the non-volatile storage medium 503 can store an operating system 5031 and a computer program 5032.
  • the processor 502 can execute the data persistent storage method.
  • the processor 502 is used to provide computing and control capabilities, and support the operation of the entire computer device 500.
  • the internal memory 504 provides an environment for the operation of the computer program 5032 in the non-volatile storage medium 503.
  • the processor 502 can execute the data persistent storage method.
  • the network interface 505 is used for network communication, such as providing data information transmission.
  • the network interface 505 is used for network communication, such as providing data information transmission.
  • FIG. 12 is only a block diagram of part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device 500 to which the solution of the present application is applied. 500 may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
  • the processor 502 is configured to run a computer program 5032 stored in the memory, so as to implement the corresponding function in the aforementioned data persistent storage method.
  • the embodiment of the computer device shown in FIG. 12 does not constitute a limitation on the specific configuration of the computer device.
  • the computer device may include more or less components than those shown in the figure. Or some parts are combined, or different parts are arranged.
  • the computer device may only include a memory and a processor. In such an embodiment, the structures and functions of the memory and the processor are consistent with the embodiment shown in FIG. 12, and will not be repeated here.
  • the processor 502 may be a central processing unit (Central Processing Unit, CPU), and the processor 502 may also be other general-purpose processors, digital signal processors (Digital Signal Processors, DSPs), Application Specific Integrated Circuit (ASIC), Field-Programmable Gate Array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc.
  • the general-purpose processor may be a microprocessor or the processor may also be any conventional processor.
  • a computer-readable storage medium may be a non-volatile computer-readable storage medium, or may be a volatile computer-readable storage medium.
  • the computer-readable storage medium stores a computer program, where the computer program implements the steps included in the aforementioned data persistent storage method when the computer program is executed by a processor.
  • the disclosed equipment, device, and method may be implemented in other ways.
  • the device embodiments described above are only illustrative.
  • the division of the units is only a logical function division. In actual implementation, there may be other division methods, or the units with the same function may be combined into one. Units, for example, multiple units or components can be combined or integrated into another system, or some features can be omitted or not implemented.
  • the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may also be electrical, mechanical or other forms of connection.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of the embodiments of the present application.
  • the functional units in the various embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
  • the above-mentioned integrated unit can be implemented in the form of hardware or software functional unit.
  • the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium.
  • the read storage medium includes several instructions to enable a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application.
  • the aforementioned computer-readable storage media include: U disk, mobile hard disk, Read-Only Memory (ROM, Read-Only Memory), magnetic disk or optical disk and other media that can store program codes.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Software Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

A data persistence storage method and apparatus, a computer device and a storage medium. Said method comprises: creating, according to a channel creation request inputted by a user, a storage channel containing a channel object; performing serialization on the channel object and then persistently storing same; acquiring, according to an inputted channel object acquisition request, a corresponding target channel object; determining whether the target channel object has been initialized; and feeding the initialized target channel object back to the user. The present invention belongs to the technical field of data storage. On the basis of a hierarchical storage technology, the serialized channel object can be persistently stored, and the target channel object can be quickly acquired and initialized, thereby ensuring high availability of the channel object, and solving the problem of low reliability when data information is stored by using the blockchain technology.

Description

数据持久化存储方法、装置、计算机设备及存储介质Data persistent storage method, device, computer equipment and storage medium
本申请要求于2019年10月12日提交中国专利局、申请号为201910968903.1,发明名称为“数据持久化存储方法、装置、计算机设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of a Chinese patent application filed with the Chinese Patent Office on October 12, 2019, the application number is 201910968903.1, and the invention title is "Data Persistent Storage Method, Device, Computer Equipment, and Storage Medium". The entire content is approved The reference is incorporated in this application.
技术领域Technical field
本申请涉及数据存储技术领域,尤其涉及一种数据持久化存储方法、装置、计算机设备及存储介质。This application relates to the field of data storage technology, and in particular to a data persistent storage method, device, computer equipment, and storage medium.
背景技术Background technique
在基于Fabric区块链对数据信息进行存储时,需通过每一用户终端对应SDK(Software Development Kit,软件开发工具包)节点的Channel对象执行智能合约,然而在用户终端运行过程中会发生错误导致用户终端重启,则用户终端的随机存储介质中所保存的Channel对象在重启后全部丢失,发明人发现重启后的用户终端无法正确执行智能合约,导致对数据进行存储时可靠性不高。因而,现有的基于Fabric区块链对数据信息进行存储的方法存在可靠性不高的问题。When storing data information based on the Fabric blockchain, it is necessary to execute the smart contract through the Channel object of the SDK (Software Development Kit) node corresponding to each user terminal. However, errors will occur during the operation of the user terminal. When the user terminal restarts, all the Channel objects stored in the random storage medium of the user terminal are lost after the restart. The inventor found that the restarted user terminal cannot correctly execute the smart contract, resulting in low reliability when storing data. Therefore, the existing method for storing data information based on the Fabric blockchain has the problem of low reliability.
发明内容Summary of the invention
本申请实施例提供了一种数据持久化存储方法、装置、计算机设备及存储介质,旨在解决现有技术方法中的区块链技术对数据信息进行存储时可靠性不高的问题。The embodiments of the present application provide a data persistent storage method, device, computer equipment, and storage medium, aiming to solve the problem of low reliability when storing data information in the blockchain technology in the prior art method.
第一方面,本申请实施例提供了一种数据持久化存储方法,其包括:In the first aspect, an embodiment of the present application provides a data persistent storage method, which includes:
若接收到用户所输入的通道创建请求,根据所述通道创建请求在所述用户终端对应的SDK节点的随机存储介质中创建包含Channel对象的存储通道;If a channel creation request input by the user is received, a storage channel containing a Channel object is created in the random storage medium of the SDK node corresponding to the user terminal according to the channel creation request;
对所述Channel对象进行序列化后持久化存储至所述用户终端对应的SDK节点中;Serialize the Channel object and store it persistently in the SDK node corresponding to the user terminal;
若接收到用户所输入的通道对象获取请求,获取所述用户终端中与所述通道对象获取请求对应的Channel对象作为目标Channel对象;If the channel object acquisition request input by the user is received, the Channel object corresponding to the channel object acquisition request in the user terminal is acquired as the target Channel object;
对所述目标Channel对象是否已被初始化进行判断以得到初始化判断结果;Judging whether the target Channel object has been initialized to obtain an initialization judgment result;
若所述初始化判断结果为是,将所述目标Channel对象反馈至所述用户;If the initial judgment result is yes, feedback the target Channel object to the user;
若所述初始化判断结果为否,对所述目标Channel对象进行初始化后反馈至所述用户。If the initialization judgment result is no, the target Channel object is initialized and then fed back to the user.
第二方面,本申请实施例提供了一种数据持久化存储装置,其包括:In the second aspect, an embodiment of the present application provides a data persistent storage device, which includes:
存储通道创建单元,用于若接收到用户所输入的通道创建请求,根据所述通道创建请求在所述用户终端对应的SDK节点的随机存储介质中创建包含Channel对象的存储通道;A storage channel creation unit, configured to, if a channel creation request input by a user is received, create a storage channel containing a Channel object in a random storage medium of the SDK node corresponding to the user terminal according to the channel creation request;
Channel对象持久化存储单元,用于对所述Channel对象进行序列化后持久化存储至所述用户终端对应的SDK节点中;Channel object persistent storage unit, configured to serialize the Channel object and store it persistently in the SDK node corresponding to the user terminal;
目标Channel对象获取单元,用于若接收到用户所输入的通道对象获取请求,获取所述用户终端中与所述通道对象获取请求对应的Channel对象作为目标Channel对象;The target Channel object obtaining unit is configured to obtain the Channel object corresponding to the channel object obtaining request in the user terminal as the target Channel object if the channel object obtaining request input by the user is received;
初始化判断单元,用于对所述目标Channel对象是否已被初始化进行判断以得到初始化判断结果;The initialization judgment unit is used to judge whether the target Channel object has been initialized to obtain the initialization judgment result;
第一反馈单元,用于若所述初始化判断结果为是,将所述目标Channel对象反馈至所述用户;The first feedback unit is configured to feed back the target Channel object to the user if the initial judgment result is yes;
第二反馈单元,用于若所述初始化判断结果为否,对所述目标Channel对象进行初始化后反馈至所述用户。The second feedback unit is configured to, if the result of the initialization judgment is negative, initialize the target Channel object and feed it back to the user.
第三方面,本申请实施例又提供了一种计算机设备,其包括存储器、处理器及存储在所述存储器上并可在所述处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现上述第一方面所述的数据持久化存储方法。In a third aspect, an embodiment of the present application provides a computer device, which includes a memory, a processor, and a computer program stored on the memory and running on the processor, and the processor executes the computer The program implements the data persistent storage method described in the first aspect.
第四方面,本申请实施例还提供了一种计算机可读存储介质,其中所述计算机可读存储介质存储有计算机程序,所述计算机程序当被处理器执行时使所述处理器执行上述第一方面所述的数据持久化存储方法。In a fourth aspect, the embodiments of the present application also provide a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor executes the above-mentioned first On the one hand, the data persistent storage method.
本申请实施例提供了一种数据持久化存储方法、装置、计算机设备及存储介质。根据用户所输入的通道创建请求创建包含Channel对象的存储通道,对Channel对象进行序列化并持久化存储,根据所输入的通道对象获取请求获取对应的目标Channel对象,对目标Channel对象是否已被初始化进行判断,并将初始化后的目标Channel对象反馈至用户。通过上述方法,可对序列化后的Channel对象进行持久化存储,且可快速获取得到目标Channel对象并进行初始化,可确保Channel对象的高可用性,解决了区块链技术对数据信息进行存储时可靠性不高的问题。The embodiments of the present application provide a data persistent storage method, device, computer equipment, and storage medium. Create a storage channel containing the Channel object according to the channel creation request input by the user, serialize and persistently store the Channel object, obtain the corresponding target Channel object according to the input channel object acquisition request, and check whether the target Channel object has been initialized Make judgments and feed back the initialized target Channel object to the user. Through the above method, the serialized Channel object can be persistently stored, and the target Channel object can be quickly obtained and initialized, which can ensure the high availability of the Channel object and solve the problem of the reliability of the blockchain technology when storing data information. The problem of low sex.
附图说明Description of the drawings
为了更清楚地说明本申请实施例技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to explain the technical solutions of the embodiments of the present application more clearly, the following will briefly introduce the drawings used in the description of the embodiments. Obviously, the drawings in the following description are some embodiments of the present application. Ordinary technicians can obtain other drawings based on these drawings without creative work.
图1为本申请实施例提供的数据持久化存储方法的流程示意图;FIG. 1 is a schematic flowchart of a data persistent storage method provided by an embodiment of the application;
图2为本申请实施例提供的数据持久化存储方法的应用场景示意图;2 is a schematic diagram of an application scenario of a data persistent storage method provided by an embodiment of the application;
图3为本申请实施例提供的数据持久化存储方法的子流程示意图;FIG. 3 is a schematic diagram of a sub-flow of a data persistent storage method provided by an embodiment of the application;
图4为本申请实施例提供的数据持久化存储方法的另一流程示意图;FIG. 4 is a schematic diagram of another process of a data persistent storage method provided by an embodiment of the application;
图5为本申请实施例提供的数据持久化存储方法的另一子流程示意图;5 is a schematic diagram of another sub-flow of the data persistent storage method provided by an embodiment of the application;
图6为本申请实施例提供的数据持久化存储方法的另一子流程示意图;FIG. 6 is a schematic diagram of another sub-flow of the data persistent storage method provided by an embodiment of the application;
图7为本申请实施例提供的数据持久化存储装置的示意性框图;FIG. 7 is a schematic block diagram of a data persistent storage device provided by an embodiment of the application;
图8为本申请实施例提供的数据持久化存储装置的子单元示意性框图;FIG. 8 is a schematic block diagram of subunits of a data persistent storage device provided by an embodiment of the application; FIG.
图9为本申请实施例提供的数据持久化存储装置的另一示意性框图;FIG. 9 is another schematic block diagram of a data persistent storage device provided by an embodiment of the application;
图10为本申请实施例提供的数据持久化存储装置的另一子单元示意性框图;FIG. 10 is a schematic block diagram of another subunit of the data persistent storage device provided by an embodiment of the application; FIG.
图11为本申请实施例提供的数据持久化存储装置的另一子单元示意性框图;11 is a schematic block diagram of another subunit of the data persistent storage device provided by an embodiment of the application;
图12为本申请实施例提供的计算机设备的示意性框图。FIG. 12 is a schematic block diagram of a computer device provided by an embodiment of this application.
具体实施方式Detailed ways
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的 实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The technical solutions in the embodiments of the present application will be described clearly and completely in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all of them. Based on the embodiments in this application, all other embodiments obtained by a person of ordinary skill in the art without creative work shall fall within the protection scope of this application.
应当理解,当在本说明书和所附权利要求书中使用时,术语“包括”和“包含”指示所描述特征、整体、步骤、操作、元素和/或组件的存在,但并不排除一个或多个其它特征、整体、步骤、操作、元素、组件和/或其集合的存在或添加。It should be understood that when used in this specification and appended claims, the terms "including" and "including" indicate the existence of the described features, wholes, steps, operations, elements and/or components, but do not exclude one or The existence or addition of multiple other features, wholes, steps, operations, elements, components, and/or collections thereof.
还应当理解,在此本申请说明书中所使用的术语仅仅是出于描述特定实施例的目的而并不意在限制本申请。如在本申请说明书和所附权利要求书中所使用的那样,除非上下文清楚地指明其它情况,否则单数形式的“一”、“一个”及“该”意在包括复数形式。It should also be understood that the terms used in the specification of this application are only for the purpose of describing specific embodiments and are not intended to limit the application. As used in the specification of this application and the appended claims, unless the context clearly indicates other circumstances, the singular forms "a", "an" and "the" are intended to include plural forms.
还应当进一步理解,在本申请说明书和所附权利要求书中使用的术语“和/或”是指相关联列出的项中的一个或多个的任何组合以及所有可能组合,并且包括这些组合。It should be further understood that the term "and/or" used in the specification and appended claims of this application refers to any combination and all possible combinations of one or more of the associated listed items, and includes these combinations .
请参阅图1,图1是本申请实施例提供的数据持久化存储方法的流程示意图;图2为本申请实施例提供的数据持久化存储方法的应用场景示意图。该数据持久化存储方法应用于用户终端10中,该方法通过安装于用户终端10中的应用软件进行执行,区块链网络20通过与用户终端10建立网络连接实现数据信息的传输。用户终端10即是用于执行数据持久化存储方法以实现对Channel对象进行持久化存储的终端设备,例如台式电脑、笔记本电脑、平板电脑或手机等,区块链网络30即是互联网中多台终端设备及管理服务器基于智能合约所组成的终端网络。图2中仅仅示意出一台用户终端10与区块链网络20进行信息传输,在实际应用中,该区块链网络20也可与多台用户终端10同时进行信息传输。Please refer to FIG. 1. FIG. 1 is a schematic flowchart of a data persistent storage method provided by an embodiment of this application; FIG. 2 is a schematic diagram of an application scenario of a data persistent storage method provided by an embodiment of this application. The data persistent storage method is applied to the user terminal 10, and the method is executed by application software installed in the user terminal 10. The blockchain network 20 establishes a network connection with the user terminal 10 to realize the transmission of data information. The user terminal 10 is a terminal device used to implement a data persistent storage method to achieve persistent storage of Channel objects, such as a desktop computer, a notebook computer, a tablet computer, or a mobile phone, etc. The blockchain network 30 is a number of devices in the Internet. The terminal equipment and management server are based on a terminal network composed of smart contracts. FIG. 2 only shows one user terminal 10 and the blockchain network 20 for information transmission. In practical applications, the blockchain network 20 can also perform information transmission with multiple user terminals 10 at the same time.
如图1所示,该方法包括步骤S110~S160。As shown in Fig. 1, the method includes steps S110 to S160.
S110、若接收到用户所输入的通道创建请求,根据所述通道创建请求在所述用户终端对应的SDK节点的随机存储介质中创建包含Channel对象的存储通道。S110: If a channel creation request input by the user is received, create a storage channel containing a Channel object in a random storage medium of the SDK node corresponding to the user terminal according to the channel creation request.
若接收到用户所输入的通道创建请求,根据所述通道创建请求在所述用户终端对应的SDK节点的随机存储介质中创建包含Channel对象的存储通道。区块链网络中包含多个用户终端以及对用户终端进行管理的管理服务器,管理服务器即为区块链网络中的排序服务节点,一台用户终端对应包含一个SDK节点,SDK节点即为用户终端中的软件开发工具包(Software Development Kit),一个SDK节点可对应区块链网络中的一个或多个Peer节点,一个存储通道可包含多个Peer节点,每一个Peer节点即与一台用户终端中的SDK节点关联,每一存储通道内所存储的数据互相隔离;排序服务节点可接收包含背书签名的交易、对交易进行排序或打包生成区块、将信息广播给Peer节点,排序服务节点可保证同一个存储通道内的节点接收到相同的消息并且有相同的逻辑顺序;SDK节点即可为用户提供服务,一个SDK节点中可创建一个或多个Channel对象,SDK节点中的一个Channel对象即与该SDK节点所包含的一个Peer节点相对应,也即是一个SDK节点可对应一个或多个Peer节点,每一Channel对象隶属于区块链网络中的一个存储通道,一个存储通道所隶属的所有Channel对象均相同,Channel对象即为所需进行持久化存储的数据,对Channel对象对应的数据进行持久化存储即可保持Channel对象的高可用性,通过一个存储通道内的多个Channel对象即可实现对信息进行分布式存储。用户可在用户终端中输入通道创建请求并通过该用户终端创建新的存储通 道,具体的,通道创建请求中包含通道名称、排序服务节点信息、Peer节点信息、数据签名信息等,排序服务节点信息即是排序服务节点的节点信息,Peer节点信息即为该存储通道内所包含的Peer节点,数据签名信息即是用于对存储通道内数据进行签名的信息,通过通道创建请求中所包含的具体信息即可创建得到包含Channel对象的存储通道。If a channel creation request input by the user is received, a storage channel containing a Channel object is created in the random storage medium of the SDK node corresponding to the user terminal according to the channel creation request. The blockchain network contains multiple user terminals and a management server that manages the user terminals. The management server is the sorting service node in the blockchain network. A user terminal corresponds to an SDK node, and the SDK node is the user terminal. In the Software Development Kit (Software Development Kit), one SDK node can correspond to one or more Peer nodes in the blockchain network, and a storage channel can contain multiple Peer nodes, and each Peer node is associated with a user terminal. The SDK nodes in each storage channel are connected, and the data stored in each storage channel are isolated from each other; the ordering service node can receive transactions that include endorsement signatures, order the transactions or package them to generate blocks, and broadcast the information to the peer node. The ordering service node can Ensure that nodes in the same storage channel receive the same messages and have the same logical sequence; SDK nodes can provide services to users, and one or more Channel objects can be created in one SDK node, and one Channel object in the SDK node is Corresponding to a Peer node included in the SDK node, that is, an SDK node can correspond to one or more Peer nodes, each Channel object belongs to a storage channel in the blockchain network, and a storage channel belongs to All Channel objects are the same, and the Channel object is the data that needs to be persistently stored. Persistent storage of the data corresponding to the Channel object can maintain the high availability of the Channel object. You can use multiple Channel objects in a storage channel. Realize distributed storage of information. The user can input a channel creation request in the user terminal and create a new storage channel through the user terminal. Specifically, the channel creation request includes channel name, ordering service node information, peer node information, data signature information, etc., ordering service node information That is the node information of the ordering service node, the Peer node information is the Peer node contained in the storage channel, and the data signature information is the information used to sign the data in the storage channel. The specific information contained in the channel creation request is passed. Information can create a storage channel that contains a Channel object.
用户终端中包括与SDK节点对应的一个随机存储介质,随机存储介质即是用于对数据信息进行临时性存储的介质,例如用户终端中的内存,SDK节点中包括一个用于对通道记录信息进行记录的数据表以及一个或多个Channel对象,若某一SDK节点中包含一个Channel对象,则该SDK节点的数据表中仅包含一条与该Channel对象对应的通道记录信息;若某一SDK节点中包含多个Channel对象,则该SDK节点的数据表中包含多个对象分别对应的多条通道记录信息。根据通道创建请求即可创建对应的Channel对象,所创建的Channel对象存储于SDK节点的随机存储介质中;具体的,Channel对象中存储有所创建存储通道的信息,包括通道名称、排序服务节点信息、Peer节点信息、数据签名信息等。The user terminal includes a random storage medium corresponding to the SDK node. The random storage medium is the medium used to temporarily store data information, such as the memory in the user terminal. The SDK node includes a The recorded data table and one or more Channel objects. If an SDK node contains a Channel object, the data table of the SDK node contains only one channel record information corresponding to the Channel object; if a SDK node contains a Channel object If multiple Channel objects are included, the data table of the SDK node contains multiple channel record information corresponding to the multiple objects. The corresponding Channel object can be created according to the channel creation request. The created Channel object is stored in the random storage medium of the SDK node; specifically, the Channel object stores the information for creating the storage channel, including the channel name and ordering service node information , Peer node information, data signature information, etc.
在一实施例中,如图3所示,步骤S110之后还包括步骤S110a。In an embodiment, as shown in FIG. 3, step S110a is further included after step S110.
S110a、根据所述Channel对象中的排序服务节点信息将所述Channel对象发送至与所述排序服务节点信息对应的排序服务节点,以对所述Channel对象进行初始化。S110a: Send the Channel object to the ordering service node corresponding to the ordering service node information according to the ordering service node information in the Channel object, so as to initialize the Channel object.
根据所述Channel对象中的排序服务节点信息将所述Channel对象发送至与所述排序服务节点信息对应的排序服务节点,以对所述Channel对象进行初始化。创建存储通道后,所创建的存储通道的具体信息及Channel对象均只存储于生成该存储通道的SDK节点中,为使新创建的Channel对象实现对信息进行分布式存储的功能,需对新创建的Channel对象进行初始化,具体的,将Channel对象发送至与该Channel对象中的排序服务节点信息对应的排序服务节点,排序服务节点接收到Channel对象即可根据该Channel对象中的Peer节点信息,将Channel对象发送至Peer节点信息对应的SDK节点中,Peer节点信息中包含一个或多个Peer节点,每一个Peer节点与一台用户终端中的SDK节点关联,即可通过多个SDK节点所包含的同一Channel对象所组成的存储通道进行信息的存储及交互,也即是实现对信息进行分布式存储。According to the ordering service node information in the Channel object, the Channel object is sent to the ordering service node corresponding to the ordering service node information to initialize the Channel object. After the storage channel is created, the specific information of the created storage channel and the Channel object are only stored in the SDK node that generated the storage channel. In order for the newly created Channel object to realize the function of distributed storage of information, the newly created Channel object needs to be The Channel object is initialized. Specifically, the Channel object is sent to the ordering service node corresponding to the ordering service node information in the Channel object. After receiving the Channel object, the ordering service node can send the Channel object to the Peer node information in the Channel object. The Channel object is sent to the SDK node corresponding to the Peer node information. The Peer node information contains one or more Peer nodes. Each Peer node is associated with an SDK node in a user terminal. The storage channel composed of the same Channel object stores and interacts with information, that is, realizes distributed storage of information.
S120、对所述Channel对象进行序列化后持久化存储至所述用户终端对应的SDK节点中。S120: Serialize the Channel object and store it persistently in the SDK node corresponding to the user terminal.
对所述Channel对象进行序列化后持久化存储至所述用户终端对应的SDK节点中。具体的,SDK节点包含与之对应的NAS网盘及数据库,NAS网盘用于对与Channel对象对应的Channel文件进行持久化存储,数据库用于对Channel对象所属存储通道对应的新增通道记录信息进行持久化存储。After serializing the Channel object, it is persistently stored in the SDK node corresponding to the user terminal. Specifically, the SDK node contains the corresponding NAS network disk and database. The NAS network disk is used to persistently store the Channel file corresponding to the Channel object, and the database is used to record information about the new channel corresponding to the storage channel to which the Channel object belongs. For persistent storage.
在一实施例中,如图4所示,步骤S120包括子步骤S121、S122、S123和S124。In an embodiment, as shown in FIG. 4, step S120 includes sub-steps S121, S122, S123, and S124.
S121、对所述Channel对象进行序列化以得到Channel文件。S121. Serialize the Channel object to obtain a Channel file.
对所述Channel对象进行序列化以得到Channel文件。由于Channel对象为程序语言,为对Channel对象所包含的信息进行持久化保存,需将Channel对象序列化为Channel文件,Channel文件为一个二进制文件,因此可对Channel文件进行方便、持久化地存储。打开二进制文件用户只能看到一行乱码,因此对Channel文件进行反序列化生成相应的Channel对象 才能正常使用。Serialize the Channel object to obtain the Channel file. Because the Channel object is a programming language, in order to persist the information contained in the Channel object, the Channel object needs to be serialized into a Channel file, which is a binary file, so the Channel file can be stored conveniently and persistently. When opening the binary file, users can only see one line of garbled code, so the Channel file can be deserialized to generate the corresponding Channel object before it can be used normally.
S122、将所述Channel文件存储至所述SDK节点对应的NAS网盘中并获取存储路径信息。S122. Store the Channel file in the NAS network disk corresponding to the SDK node and obtain storage path information.
将所述Channel文件存储至所述SDK节点对应的NAS网盘中并记录存储路径信息。NAS网盘为与SDK节点对应的一个可读写的存储介质,例如,每一SDK节点均对应一个共享的NAS网盘,NAS网盘可对数据进行持久化存储,可将所得到的Channel文件存储至对应的NAS网盘中并获取相应的存储路径信息。存储路径信息中包括Channel文件的文件名及存储地址。The Channel file is stored in the NAS network disk corresponding to the SDK node and the storage path information is recorded. The NAS network disk is a readable and writable storage medium corresponding to the SDK node. For example, each SDK node corresponds to a shared NAS network disk. The NAS network disk can store data persistently, and the obtained channel file can be stored. Store it in the corresponding NAS network disk and obtain the corresponding storage path information. The storage path information includes the file name and storage address of the Channel file.
例如,某一Channel文件对应的存储路径信息如表1所示。For example, the storage path information corresponding to a Channel file is shown in Table 1.
文件名file name 存储地址Storage address
org1-mychannelorg1-mychannel /network_resources/org1-mychannel.channel/network_resources/org1-mychannel.channel
表1Table 1
S123、根据所述通道创建请求、存储路径信息生成新增通道记录信息。S123: Generate new channel record information according to the channel creation request and storage path information.
根据所述通道创建请求、存储路径信息生成新增通道记录信息。具体的,获取通道创建请求中的具体信息以及存储路径信息,生成对应的新增通道记录信息,新增通道记录信息即为对所创建的存储通道进行记录的摘要信息,新增通道记录信息中包括通道名称、排序服务节点信息、Peer节点信息、Channel文件的文件名及存储地址等信息。According to the channel creation request and the storage path information, new channel record information is generated. Specifically, the specific information in the channel creation request and the storage path information are obtained, and the corresponding new channel record information is generated. The new channel record information is the summary information of the created storage channel. In the newly added channel record information Including channel name, ordering service node information, peer node information, file name and storage address of the Channel file and other information.
S124、将所述新增通道记录信息存储至所述SDK节点的数据库中。S124. Store the newly added channel record information in the database of the SDK node.
将所述新增通道记录信息存储至所述SDK节点的数据库中。将新增通道记录信息存储至对应SDK节点的数据库中即可完成存储通道的创建,将新增通道记录信息进行存储后,即可通过数据库中所存储的新增通道记录信息对相应存储通道的信息进行检索,以方便用户的使用,其中,所述数据库可以是SQlite轻量级数据库,相比MySQL或SQLServer等传统类型的数据库,SQlite轻量级数据库对数据进行存储时更加简洁高效。此外,还可将随机存储介质中所缓存的Channel对象存储至数据库中,若随机存储介质断电信息丢失,可从数据库中获取某一存储通道对应Channel对象缓存至随机存储介质中,以使用户快捷方便地对Channel对象进行获取及使用。Store the newly added channel record information in the database of the SDK node. Store the new channel record information in the database corresponding to the SDK node to complete the creation of the storage channel. After storing the new channel record information, you can use the new channel record information stored in the database to compare the corresponding storage channel Information is retrieved to facilitate the use of users. The database may be a lightweight SQlite database. Compared with traditional databases such as MySQL or SQL Server, the lightweight database of SQlite stores data more concisely and efficiently. In addition, the Channel object cached in the random storage medium can also be stored in the database. If the random storage medium power failure information is lost, the Channel object corresponding to a certain storage channel can be obtained from the database and cached in the random storage medium. Obtain and use the Channel object quickly and easily.
S130、若接收到用户所输入的通道对象获取请求,获取所述用户终端中与所述通道对象获取请求对应的Channel对象作为目标Channel对象。S130. If a channel object acquisition request input by a user is received, acquire a Channel object corresponding to the channel object acquisition request in the user terminal as a target Channel object.
若接收到用户所输入的通道对象获取请求,根据所述通道对象获取请求获取所述用户终端中所存储的Channel对象。用户通过获取相应的Channel对象并进行使用,以实现对信息的分布式存储,用户可通过输入通道对象获取请求获取相应的Channel对象,通道对象获取请求中可以包括Channel对象名称或通道名称。If the channel object acquisition request input by the user is received, the Channel object stored in the user terminal is acquired according to the channel object acquisition request. The user obtains and uses the corresponding Channel object to realize distributed storage of information. The user can obtain the corresponding Channel object by inputting the channel object acquisition request. The channel object acquisition request may include the Channel object name or the channel name.
在一实施例中,如图5所示,步骤S130包括子步骤S131、S132、S133、S134和S135。In an embodiment, as shown in FIG. 5, step S130 includes sub-steps S131, S132, S133, S134, and S135.
S131、判断所述用户终端对应的SDK节点的随机存储介质中是否存在与所述通道对象获取请求对应的Channel对象以得到存储判断结果。S131: Determine whether there is a Channel object corresponding to the channel object acquisition request in the random storage medium of the SDK node corresponding to the user terminal to obtain a storage determination result.
判断所述用户终端对应的SDK节点的随机存储介质中是否存在与所述通道对象获取请 求对应的Channel对象以得到存储判断结果。Channel对象创建于SDK节点的随机存储介质中,若用户终端重启导致随机存储介质中所存储的Channel对象丢失,在获取对应Channel对象之前,可先对SDK节点的随机存储介质中是否存在与所述通道对象获取请求对应的Channel对象进行判断,具体的,Channel对象中包括其所属的通道名称,可通过通道对象获取请求中所包含的Channel对象名称或通道名称对随机存储介质中的数据进行查询,若查询到随机存储介质的数据中包含与通道对象获取请求对应的Channel对象,则存储判断结果为存在;若未查询到与通道对象获取请求对应的Channel对象,则判断结果为不存在。It is judged whether there is a Channel object corresponding to the channel object acquisition request in the random storage medium of the SDK node corresponding to the user terminal to obtain the storage judgment result. The Channel object is created in the random storage medium of the SDK node. If the user terminal restarts and causes the Channel object stored in the random storage medium to be lost, before obtaining the corresponding Channel object, you can check whether the SDK node's random storage medium exists or not. The Channel object corresponding to the channel object acquisition request is judged. Specifically, the Channel object includes the channel name to which it belongs, and the data in the random storage medium can be queried through the Channel object name or channel name contained in the channel object acquisition request. If the data of the random storage medium queried contains the Channel object corresponding to the channel object acquisition request, the storage judgment result is that it exists; if the Channel object corresponding to the channel object acquisition request is not queried, the judgment result is that it does not exist.
S132、若所述存储判断结果为是,获取所述随机存储介质中与所述通道对象获取请求对应的Channel对象作为目标Channel对象。S132: If the storage judgment result is yes, acquire the Channel object corresponding to the channel object acquisition request in the random storage medium as the target Channel object.
若存储判断结果为是,则表明当前SDK节点的随机存储介质中包含与通道对象获取请求对应的Channel对象,则可直接获取该Channel对象作为目标Channel对象。If the storage judgment result is yes, it indicates that the random storage medium of the current SDK node contains the Channel object corresponding to the channel object acquisition request, and the Channel object can be directly acquired as the target Channel object.
S133、若所述存储判断结果为否,根据所述通道对象获取请求对所述SDK节点的数据库进行检索,以获取所述数据库中与所述通道对象获取请求对应的目标通道记录信息。S133: If the storage judgment result is no, search the database of the SDK node according to the channel object acquisition request to acquire target channel record information corresponding to the channel object acquisition request in the database.
若所述存储判断结果为否,根据所述通道对象获取请求对所述SDK节点的数据库进行检索,以获取所述数据库中与所述通道对象获取请求对应的通道记录信息作为目标通道记录信息。若随机存储介质中不包含与通道对象获取请求对应的Channel对象,则可根据通道对象获取请求对SDK节点的数据库进行检索,数据库中记录了基于该SDK节点所创建的每一存储通道的通道记录信息,通道记录信息中包括通道名称、排序服务节点信息、Peer节点信息、Channel文件的文件名及存储地址等信息,因此可根据通道对象获取请求对数据库中的通道记录信息进行检索,以获取与通道对象获取请求对应的一条通道记录信息作为目标通道记录信息。若数据库中未检索到与通道对象获取请求对应的通道记录信息,则根据通道对象获取请求创建对应的存储通道。If the storage judgment result is no, the database of the SDK node is retrieved according to the channel object acquisition request to acquire the channel record information corresponding to the channel object acquisition request in the database as target channel record information. If the random storage medium does not contain the Channel object corresponding to the channel object acquisition request, the SDK node database can be retrieved according to the channel object acquisition request. The database records the channel record of each storage channel created based on the SDK node Information. The channel record information includes channel name, ordering service node information, peer node information, file name and storage address of the Channel file, and so on. Therefore, the channel record information in the database can be retrieved according to the channel object acquisition request to obtain and The channel object obtains a piece of channel record information corresponding to the request as the target channel record information. If the channel record information corresponding to the channel object acquisition request is not retrieved in the database, the corresponding storage channel is created according to the channel object acquisition request.
S134、根据所述目标通道记录信息获取与所述SDK节点对应的NAS网盘中所存储的Channel文件作为目标Channel文件作为目标Channel文件。S134: Obtain, according to the target channel record information, the Channel file stored in the NAS network disk corresponding to the SDK node as the target Channel file as the target Channel file.
根据所述目标通道记录信息获取与所述SDK节点对应的NAS网盘中所存储的Channel文件作为目标Channel文件作为目标Channel文件。通道记录信息中包括该通道对应的存储地址,每一存储地址均指向对应NAS网盘中的一个Channel文件,即可根据该存储地址获取对应NAS网盘中所存储的Channel文件,作为目标Channel文件。Acquire the Channel file stored in the NAS network disk corresponding to the SDK node as the target Channel file according to the target channel record information as the target Channel file. The channel record information includes the storage address corresponding to the channel, and each storage address points to a Channel file in the corresponding NAS network disk, and the Channel file stored in the corresponding NAS network disk can be obtained according to the storage address as the target Channel file .
S135、根据预置反序列化规则对所述目标Channel文件进行反序列化以得到目标Channel对象。S135. Deserialize the target Channel file according to a preset deserialization rule to obtain a target Channel object.
根据预置反序列化规则对所述目标Channel文件进行反序列化以得到目标Channel对象。每一Channel文件均为一个二进制文件,直接打开Channel文件则用户仅能看到一行乱码,因此需通过预置反序列化规则对该目标Channel文件进行反序列化,得到对应的目标Channel对象。反序列化规则即是用于对Channel文件进行反序列化以获取对应Channel对象的规则信息,具体的,反序列化规则包含与Channel对象对应的项目名称,根据项目名称对Channel文件进行反序列化即可得到Channel对象,项目名称包括通道名称、排序服务节点信息、Peer 节点信息、数据签名信息等。The target Channel file is deserialized according to the preset deserialization rule to obtain the target Channel object. Each Channel file is a binary file. When the Channel file is opened directly, the user can only see one line of garbled characters. Therefore, the target Channel file needs to be deserialized through the preset deserialization rules to obtain the corresponding target Channel object. The deserialization rule is used to deserialize the Channel file to obtain the rule information of the corresponding Channel object. Specifically, the deserialization rule contains the project name corresponding to the Channel object, and the Channel file is deserialized according to the project name You can get the Channel object. The project name includes the channel name, ordering service node information, peer node information, data signature information, etc.
在一实施例中,如图6所示,步骤S130还包括子步骤S136。In an embodiment, as shown in FIG. 6, step S130 further includes sub-step S136.
S136、将所述目标Channel对象存储至所述SDK节点的随机存储介质中,以对所述目标Channel对象进行缓存。S136. Store the target Channel object in a random storage medium of the SDK node, so as to cache the target Channel object.
在获取到目标Channel对象后,可将未存储于随机存储介质中的目标Channel对象存储至SDK节点的随机存储介质,也即是对目标Channel对象进行缓存,缓存至随机存储介质中的目标Channel对象可方便用户进行使用。After obtaining the target Channel object, the target Channel object that is not stored in the random storage medium can be stored in the random storage medium of the SDK node, that is, the target Channel object is cached and cached to the target Channel object in the random storage medium It is convenient for users to use.
S140、对所述目标Channel对象是否已被初始化进行判断以得到初始化判断结果。S140: Judge whether the target Channel object has been initialized to obtain an initialization judgment result.
对所述目标Channel对象是否已被初始化进行判断以得到初始化判断结果。在将目标Channel对象反馈至用户之前,还需对目标Channel对象是否已被初始化进行判断,由于某些情况下(用户终端断开网络连接)虽然包含Channel对象的存储通道已在用户终端本地的SDK节点中创建,但由于Channel对象未进行初始化,区块链网络中该存储通道对应的排序服务节点及其他Peer节点并未获取到该存储通道的信息,也即是无法通过该存储通道进行信息的存储及交互。具体的,通过该目标Channel对象对应SDK节点的用户终端向目标Channel对象中排序服务节点信息所包含的排序服务节点(管理服务器)发送目标Channel对象的对象验证信息,对象验证信息中包括目标Channel对象所属通道的通道名称、目标Channel对象所属通道的创建时间,排序服务节点根据对象验证信息反馈对应的验证结果,验证结果中包括排序服务节点中是否已存储与目标Channel对象对应的信息,获取该验证结果即可对目标Channel对象是否已被初始化进行判断,若排序服务节点中已存储与目标Channel对象对应的信息,则初始化判断结果为是;若排序服务节点中未存储与目标Channel对象对应的信息,则初始化判断结果为否。It is judged whether the target Channel object has been initialized to obtain the initial judgment result. Before feeding back the target Channel object to the user, it is necessary to judge whether the target Channel object has been initialized. In some cases (the user terminal disconnects from the network) although the storage channel containing the Channel object is already in the local SDK of the user terminal Created in the node, but because the Channel object has not been initialized, the ordering service node and other peer nodes corresponding to the storage channel in the blockchain network have not obtained the information of the storage channel, that is, the information cannot be carried out through the storage channel Storage and interaction. Specifically, the user terminal corresponding to the SDK node of the target Channel object sends the object verification information of the target Channel object to the ordering service node (management server) included in the ordering service node information in the target Channel object, and the object verification information includes the target Channel object. The channel name of the channel to which the target Channel object belongs, the creation time of the channel to which the target Channel object belongs, the ordering service node feeds back the corresponding verification result according to the object verification information, and the verification result includes whether the ordering service node has stored information corresponding to the target Channel object, and obtain the verification As a result, it can be judged whether the target Channel object has been initialized. If the information corresponding to the target Channel object has been stored in the ordering service node, the result of the initialization judgment is Yes; if the information corresponding to the target Channel object is not stored in the ordering service node , The initial judgment result is no.
S150、若所述初始化判断结果为是,将所述目标Channel对象反馈至所述用户。S150: If the initial judgment result is yes, feed back the target Channel object to the user.
若所述初始化判断结果为是,将所述目标Channel对象反馈至所述用户。若目标Channel对象已完成初始化,即该Channel对象可进行使用,则将目标Channel对象反馈至用户进行使用。If the initial judgment result is yes, the target Channel object is fed back to the user. If the target Channel object has been initialized, that is, the Channel object is available for use, the target Channel object is fed back to the user for use.
S160、若所述初始化判断结果为否,对所述目标Channel对象进行初始化后反馈至所述用户。S160: If the initialization judgment result is no, initialize the target Channel object and feed it back to the user.
若所述初始化判断结果为否,对所述目标Channel对象进行初始化后反馈至所述用户。若目标Channel对象未完成初始化,为确保用户所获取到的目标Channel对象可进行使用,则需对目标对象进行初始化后再反馈至用户进行使用,将目标Channel对象发送至与该目标Channel对象中的排序服务节点信息对应的排序服务节点,即可对目标Channel对象进行初始化,具体初始化过程与上述步骤相同,用户接收到已完成初始化的目标Channel对象后,即可使用该目标Channel对象对应的存储通道进行信息的存储及交互,也即是实现对信息进行分布式存储。If the initialization judgment result is no, the target Channel object is initialized and then fed back to the user. If the target Channel object has not been initialized, in order to ensure that the target Channel object obtained by the user can be used, the target object needs to be initialized and then fed back to the user for use, and the target Channel object is sent to the target Channel object. The ordering service node corresponding to the ordering service node information can initialize the target Channel object. The specific initialization process is the same as the above steps. After the user receives the target Channel object that has been initialized, the storage channel corresponding to the target Channel object can be used To store and interact with information is to realize distributed storage of information.
在本申请实施例所提供的数据持久化存储方法中,根据用户所输入的通道创建请求创建包含Channel对象的存储通道,对Channel对象进行序列化并持久化存储,根据所输入的通 道对象获取请求获取对应的目标Channel对象,对目标Channel对象是否已被初始化进行判断,并将初始化后的目标Channel对象反馈至用户。通过上述方法,可对序列化后的Channel对象进行持久化存储,且可快速获取得到目标Channel对象并进行初始化,可确保Channel对象的高可用性,解决了区块链技术对数据信息进行存储时可靠性不高的问题。In the data persistent storage method provided by the embodiment of the present application, a storage channel containing a Channel object is created according to a channel creation request input by a user, the Channel object is serialized and stored persistently, and the request is obtained according to the input channel object Obtain the corresponding target Channel object, judge whether the target Channel object has been initialized, and feed back the initialized target Channel object to the user. Through the above method, the serialized Channel object can be persistently stored, and the target Channel object can be quickly obtained and initialized, which can ensure the high availability of the Channel object and solve the problem of the reliability of the blockchain technology when storing data information. The problem of low sex.
本申请实施例还提供一种数据持久化存储装置,该数据持久化存储装置用于执行前述数据持久化存储方法的任一实施例。具体地,请参阅图7,图7是本申请实施例提供的数据持久化存储装置的示意性框图。该数据持久化存储装置可以配置于用户终端10中。The embodiment of the present application also provides a data persistent storage device, which is used to execute any embodiment of the aforementioned data persistent storage method. Specifically, please refer to FIG. 7, which is a schematic block diagram of a data persistent storage device provided by an embodiment of the present application. The data persistent storage device may be configured in the user terminal 10.
如图7所示,数据持久化存储装置100包括存储通道创建单元110、Channel对象持久化存储单元120、目标Channel对象获取单元130、初始化判断单元140、第一反馈单元150和第二反馈单元160。As shown in FIG. 7, the data persistent storage device 100 includes a storage channel creation unit 110, a Channel object persistent storage unit 120, a target Channel object acquisition unit 130, an initialization judgment unit 140, a first feedback unit 150, and a second feedback unit 160 .
存储通道创建单元110,用于若接收到用户所输入的通道创建请求,根据所述通道创建请求在所述用户终端对应的SDK节点的随机存储介质中创建包含Channel对象的存储通道。The storage channel creation unit 110 is configured to, if a channel creation request input by a user is received, create a storage channel containing a Channel object in a random storage medium of an SDK node corresponding to the user terminal according to the channel creation request.
其他发明实施例中,如图9所示,所述数据持久化存储装100还包括子单元:Channel对象初始化单元110a。In other embodiments of the invention, as shown in FIG. 9, the data persistent storage device 100 further includes a subunit: a Channel object initialization unit 110a.
Channel对象初始化单元110a,用于根据所述Channel对象中的排序服务节点信息将所述Channel对象发送至与所述排序服务节点信息对应的排序服务节点,以对所述Channel对象进行初始化。The Channel object initialization unit 110a is configured to send the Channel object to the ordering service node corresponding to the ordering service node information according to the ordering service node information in the Channel object to initialize the Channel object.
Channel对象持久化存储单元120,用于对所述Channel对象进行序列化后持久化存储至所述用户终端对应的SDK节点中。The Channel object persistent storage unit 120 is configured to serialize the Channel object and store it persistently in the SDK node corresponding to the user terminal.
其他发明实施例中,如图8所示,所述Channel对象持久化存储单元120包括子单元:Channel文件获取单元121、Channel文件存储单元122、新增通道记录信息生成单元123和新增通道记录信息存储单元124。In other embodiments of the invention, as shown in FIG. 8, the Channel object persistent storage unit 120 includes sub-units: a Channel file acquisition unit 121, a Channel file storage unit 122, a newly added channel record information generating unit 123, and a newly added channel record Information storage unit 124.
Channel文件获取单元121,用于对所述Channel对象进行序列化以得到Channel文件。The Channel file obtaining unit 121 is configured to serialize the Channel object to obtain a Channel file.
Channel文件存储单元122,用于将所述Channel文件存储至所述SDK节点对应的NAS网盘中并获取存储路径信息。The Channel file storage unit 122 is configured to store the Channel file in the NAS network disk corresponding to the SDK node and obtain storage path information.
新增通道记录信息生成单元123,用于根据所述通道创建请求、存储路径信息生成新增通道记录信息。The newly added channel record information generating unit 123 is configured to generate newly added channel record information according to the channel creation request and storage path information.
新增通道记录信息存储单元124,用于将所述新增通道记录信息存储至所述SDK节点的数据库中。The newly added channel record information storage unit 124 is configured to store the newly added channel record information in the database of the SDK node.
目标Channel对象获取单元130,用于若接收到用户所输入的通道对象获取请求,获取所述用户终端中与所述通道对象获取请求对应的Channel对象作为目标Channel对象。The target Channel object obtaining unit 130 is configured to, if a channel object obtaining request input by a user is received, obtain a Channel object corresponding to the channel object obtaining request in the user terminal as the target Channel object.
其他发明实施例中,如图10所示,所述目标Channel对象获取单元130包括子单元:存储判断单元131、第一对象获取单元132、目标通道记录信息获取单元133、目标Channel文件获取单元134和第二对象获取单元135。In other embodiments of the invention, as shown in FIG. 10, the target Channel object acquisition unit 130 includes sub-units: a storage judgment unit 131, a first object acquisition unit 132, a target channel record information acquisition unit 133, and a target Channel file acquisition unit 134 And the second object acquisition unit 135.
存储判断单元131,用于判断所述用户终端对应的SDK节点的随机存储介质中是否存在与所述通道对象获取请求对应的Channel对象以得到存储判断结果。The storage judgment unit 131 is configured to judge whether there is a Channel object corresponding to the channel object acquisition request in the random storage medium of the SDK node corresponding to the user terminal to obtain the storage judgment result.
第一对象获取单元132,用于若所述存储判断结果为是,获取所述随机存储介质中与所述通道对象获取请求对应的Channel对象作为目标Channel对象。The first object acquisition unit 132 is configured to, if the storage judgment result is yes, acquire the Channel object corresponding to the channel object acquisition request in the random storage medium as the target Channel object.
目标通道记录信息获取单元133,用于若所述存储判断结果为否,根据所述通道对象获取请求对所述SDK节点的数据库进行检索,以获取所述数据库中与所述通道对象获取请求对应的目标通道记录信息。The target channel record information obtaining unit 133 is configured to, if the storage judgment result is no, search the database of the SDK node according to the channel object obtaining request to obtain the database corresponding to the channel object obtaining request The target channel records information.
目标Channel文件获取单元134,用于根据所述目标通道记录信息获取与所述SDK节点对应的NAS网盘中所存储的Channel文件作为目标Channel文件作为目标Channel文件。The target Channel file obtaining unit 134 is configured to obtain the Channel file stored in the NAS network disk corresponding to the SDK node as the target Channel file as the target Channel file according to the target channel record information.
第二对象获取单元135,用于根据预置反序列化规则对所述目标Channel文件进行反序列化以得到目标Channel对象。The second object obtaining unit 135 is configured to deserialize the target Channel file according to a preset deserialization rule to obtain the target Channel object.
其他发明实施例中,如图11所示,所述目标Channel对象获取单元130还包括子单元:目标Channel对象缓存单元136。In other embodiments of the invention, as shown in FIG. 11, the target Channel object acquisition unit 130 further includes a subunit: a target Channel object cache unit 136.
目标Channel对象缓存单元136,用于将所述目标Channel对象存储至所述SDK节点的随机存储介质中,以对所述目标Channel对象进行缓存。The target Channel object cache unit 136 is configured to store the target Channel object in a random storage medium of the SDK node, so as to cache the target Channel object.
初始化判断单元140,用于对所述目标Channel对象是否已被初始化进行判断以得到初始化判断结果。The initialization judgment unit 140 is configured to judge whether the target Channel object has been initialized to obtain the initialization judgment result.
第一反馈单元150,用于若所述初始化判断结果为是,将所述目标Channel对象反馈至所述用户。The first feedback unit 150 is configured to feed back the target Channel object to the user if the initial judgment result is yes.
第二反馈单元160,用于若所述初始化判断结果为否,对所述目标Channel对象进行初始化后反馈至所述用户。The second feedback unit 160 is configured to, if the result of the initialization judgment is negative, initialize the target Channel object and feed it back to the user.
在本申请实施例所提供的数据持久化存储装置用于执行上述数据持久化存储方法,根据用户所输入的通道创建请求创建包含Channel对象的存储通道,对Channel对象进行序列化并持久化存储,根据所输入的通道对象获取请求获取对应的目标Channel对象,对目标Channel对象是否已被初始化进行判断,并将初始化后的目标Channel对象反馈至用户。通过上述方法,可对序列化后的Channel对象进行持久化存储,且可快速获取得到目标Channel对象并进行初始化,可确保Channel对象的高可用性,解决了区块链技术对数据信息进行存储时可靠性不高的问题。The data persistent storage device provided in the embodiment of the present application is used to implement the above-mentioned data persistent storage method, create a storage channel containing a Channel object according to a channel creation request input by a user, serialize the Channel object and store it persistently, Obtain the corresponding target Channel object according to the input channel object acquisition request, judge whether the target Channel object has been initialized, and feed back the initialized target Channel object to the user. Through the above method, the serialized Channel object can be persistently stored, and the target Channel object can be quickly obtained and initialized, which can ensure the high availability of the Channel object and solve the problem of the reliability of the blockchain technology when storing data information. The problem of low sex.
上述数据持久化存储装置可以实现为计算机程序的形式,该计算机程序可以在如图12所示的计算机设备上运行。The aforementioned data persistent storage device may be implemented in the form of a computer program, and the computer program may run on the computer device as shown in FIG. 12.
请参阅图12,图12是本申请实施例提供的计算机设备的示意性框图。Please refer to FIG. 12, which is a schematic block diagram of a computer device according to an embodiment of the present application.
参阅图12,该计算机设备500包括通过系统总线501连接的处理器502、存储器和网络接口505,其中,存储器可以包括非易失性存储介质503和内存储器504。Referring to FIG. 12, the computer device 500 includes a processor 502, a memory, and a network interface 505 connected through a system bus 501, where the memory may include a non-volatile storage medium 503 and an internal memory 504.
该非易失性存储介质503可存储操作系统5031和计算机程序5032。该计算机程序5032被执行时,可使得处理器502执行数据持久化存储方法。The non-volatile storage medium 503 can store an operating system 5031 and a computer program 5032. When the computer program 5032 is executed, the processor 502 can execute the data persistent storage method.
该处理器502用于提供计算和控制能力,支撑整个计算机设备500的运行。The processor 502 is used to provide computing and control capabilities, and support the operation of the entire computer device 500.
该内存储器504为非易失性存储介质503中的计算机程序5032的运行提供环境,该计算机程序5032被处理器502执行时,可使得处理器502执行数据持久化存储方法。The internal memory 504 provides an environment for the operation of the computer program 5032 in the non-volatile storage medium 503. When the computer program 5032 is executed by the processor 502, the processor 502 can execute the data persistent storage method.
该网络接口505用于进行网络通信,如提供数据信息的传输等。本领域技术人员可以理解,图12中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的计算机设备500的限定,具体的计算机设备500可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。The network interface 505 is used for network communication, such as providing data information transmission. Those skilled in the art can understand that the structure shown in FIG. 12 is only a block diagram of part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device 500 to which the solution of the present application is applied. 500 may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
其中,所述处理器502用于运行存储在存储器中的计算机程序5032,以实现上述的数据持久化存储方法中对应的功能。Wherein, the processor 502 is configured to run a computer program 5032 stored in the memory, so as to implement the corresponding function in the aforementioned data persistent storage method.
本领域技术人员可以理解,图12中示出的计算机设备的实施例并不构成对计算机设备具体构成的限定,在其他实施例中,计算机设备可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。例如,在一些实施例中,计算机设备可以仅包括存储器及处理器,在这样的实施例中,存储器及处理器的结构及功能与图12所示实施例一致,在此不再赘述。Those skilled in the art can understand that the embodiment of the computer device shown in FIG. 12 does not constitute a limitation on the specific configuration of the computer device. In other embodiments, the computer device may include more or less components than those shown in the figure. Or some parts are combined, or different parts are arranged. For example, in some embodiments, the computer device may only include a memory and a processor. In such an embodiment, the structures and functions of the memory and the processor are consistent with the embodiment shown in FIG. 12, and will not be repeated here.
应当理解,在本申请实施例中,处理器502可以是中央处理单元(Central Processing Unit,CPU),该处理器502还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。其中,通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。It should be understood that in this embodiment of the application, the processor 502 may be a central processing unit (Central Processing Unit, CPU), and the processor 502 may also be other general-purpose processors, digital signal processors (Digital Signal Processors, DSPs), Application Specific Integrated Circuit (ASIC), Field-Programmable Gate Array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor.
在本申请的另一实施例中提供计算机可读存储介质。该计算机可读存储介质可以为非易失性的计算机可读存储介质,也可以是易失性的计算机可读存储介质。该计算机可读存储介质存储有计算机程序,其中计算机程序被处理器执行时实现上述的数据持久化存储方法中所包含的步骤。In another embodiment of the present application, a computer-readable storage medium is provided. The computer-readable storage medium may be a non-volatile computer-readable storage medium, or may be a volatile computer-readable storage medium. The computer-readable storage medium stores a computer program, where the computer program implements the steps included in the aforementioned data persistent storage method when the computer program is executed by a processor.
所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,上述描述的设备、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、计算机软件或者二者的结合来实现,为了清楚地说明硬件和软件的可互换性,在上述说明中已经按照功能一般性地描述了各示例的组成及步骤。这些功能究竟以硬件还是软件方式来执行取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。Those skilled in the art can clearly understand that, for the convenience and conciseness of description, the specific working process of the above-described equipment, device, and unit can refer to the corresponding process in the foregoing method embodiment, which will not be repeated here. A person of ordinary skill in the art may be aware that the units and algorithm steps of the examples described in the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of both, in order to clearly illustrate the hardware and software Interchangeability, in the above description, the composition and steps of each example have been generally described in accordance with the function. Whether these functions are executed by hardware or software depends on the specific application and design constraint conditions of the technical solution. Professionals and technicians can use different methods for each specific application to implement the described functions, but such implementation should not be considered beyond the scope of this application.
在本申请所提供的几个实施例中,应该理解到,所揭露的设备、装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为逻辑功能划分,实际实现时可以有另外的划分方式,也可以将具有相同功能的单元集合成一个单元,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另外,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口、装置或单元的间接耦合或通信连接,也可以是电的,机械的或其它的形式连接。In the several embodiments provided in this application, it should be understood that the disclosed equipment, device, and method may be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods, or the units with the same function may be combined into one. Units, for example, multiple units or components can be combined or integrated into another system, or some features can be omitted or not implemented. In addition, the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may also be electrical, mechanical or other forms of connection.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元 上。可以根据实际的需要选择其中的部分或者全部单元来实现本申请实施例方案的目的。The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of the embodiments of the present application.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以是两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, the functional units in the various embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or software functional unit.
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分,或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个计算机可读存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的计算机可读存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、磁碟或者光盘等各种可以存储程序代码的介质。If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application is essentially or the part that contributes to the existing technology, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product can be stored in a computer. The read storage medium includes several instructions to enable a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned computer-readable storage media include: U disk, mobile hard disk, Read-Only Memory (ROM, Read-Only Memory), magnetic disk or optical disk and other media that can store program codes.
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到各种等效的修改或替换,这些修改或替换都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以权利要求的保护范围为准。The above are only specific implementations of this application, but the protection scope of this application is not limited to this. Anyone familiar with the technical field can easily think of various equivalents within the technical scope disclosed in this application. Modifications or replacements, these modifications or replacements shall be covered within the scope of protection of this application. Therefore, the protection scope of this application should be subject to the protection scope of the claims.

Claims (20)

  1. 一种数据持久化存储方法,应用于用户终端,其中,所述数据持久化存储方法包括:A method for persistent storage of data, applied to a user terminal, wherein the method for persistent storage of data includes:
    若接收到用户所输入的通道创建请求,根据所述通道创建请求在所述用户终端对应的SDK节点的随机存储介质中创建包含Channel对象的存储通道;If a channel creation request input by the user is received, a storage channel containing a Channel object is created in the random storage medium of the SDK node corresponding to the user terminal according to the channel creation request;
    对所述Channel对象进行序列化后持久化存储至所述用户终端对应的SDK节点中;Serialize the Channel object and store it persistently in the SDK node corresponding to the user terminal;
    若接收到用户所输入的通道对象获取请求,获取所述用户终端中与所述通道对象获取请求对应的Channel对象作为目标Channel对象;If the channel object acquisition request input by the user is received, the Channel object corresponding to the channel object acquisition request in the user terminal is acquired as the target Channel object;
    对所述目标Channel对象是否已被初始化进行判断以得到初始化判断结果;Judging whether the target Channel object has been initialized to obtain an initialization judgment result;
    若所述初始化判断结果为是,将所述目标Channel对象反馈至所述用户;If the initial judgment result is yes, feedback the target Channel object to the user;
    若所述初始化判断结果为否,对所述目标Channel对象进行初始化后反馈至所述用户。If the initialization judgment result is no, the target Channel object is initialized and then fed back to the user.
  2. 根据权利要求1所述的数据持久化存储方法,其中,所述对所述Channel对象进行序列化后持久化存储至所述用户终端对应的SDK节点中,包括:The data persistent storage method according to claim 1, wherein the serializing the Channel object and then persistently storing it in the SDK node corresponding to the user terminal comprises:
    对所述Channel对象进行序列化以得到Channel文件;Serialize the Channel object to obtain a Channel file;
    将所述Channel文件存储至所述SDK节点对应的NAS网盘中并获取存储路径信息;Store the Channel file in the NAS network disk corresponding to the SDK node and obtain storage path information;
    根据所述通道创建请求、存储路径信息生成新增通道记录信息;Generating new channel record information according to the channel creation request and storage path information;
    将所述新增通道记录信息存储至所述SDK节点的数据库中。Store the newly added channel record information in the database of the SDK node.
  3. 根据权利要求1所述的数据持久化存储方法,其中,所述根据所述通道创建请求在所述用户终端对应SDK节点的随机存储介质中创建包含Channel对象的存储通道之后,还包括:The data persistent storage method according to claim 1, wherein after the creation of a storage channel containing a Channel object in a random storage medium corresponding to the SDK node of the user terminal according to the channel creation request, the method further comprises:
    根据所述Channel对象中的排序服务节点信息将所述Channel对象发送至与所述排序服务节点信息对应的排序服务节点,以对所述Channel对象进行初始化。According to the ordering service node information in the Channel object, the Channel object is sent to the ordering service node corresponding to the ordering service node information to initialize the Channel object.
  4. 根据权利要求1所述的数据持久化存储方法,其中,所述获取所述用户终端中与所述通道对象获取请求对应的Channel对象作为目标Channel对象,包括:The method for persistent storage of data according to claim 1, wherein said acquiring a Channel object corresponding to said channel object acquisition request in said user terminal as a target Channel object comprises:
    判断所述用户终端对应的SDK节点的随机存储介质中是否存在与所述通道对象获取请求对应的Channel对象以得到存储判断结果;Judging whether there is a Channel object corresponding to the channel object acquisition request in the random storage medium of the SDK node corresponding to the user terminal to obtain a storage judgment result;
    若所述存储判断结果为是,获取所述随机存储介质中与所述通道对象获取请求对应的Channel对象作为目标Channel对象;If the storage judgment result is yes, acquire the Channel object corresponding to the channel object acquisition request in the random storage medium as the target Channel object;
    若所述存储判断结果为否,根据所述通道对象获取请求对所述SDK节点的数据库进行检索,以获取所述数据库中与所述通道对象获取请求对应的目标通道记录信息;If the storage judgment result is no, search the database of the SDK node according to the channel object acquisition request to acquire target channel record information in the database corresponding to the channel object acquisition request;
    根据所述目标通道记录信息获取与所述SDK节点对应的NAS网盘中所存储的Channel文件作为目标Channel文件;Acquiring, according to the target channel record information, the Channel file stored in the NAS network disk corresponding to the SDK node as the target Channel file;
    根据预置反序列化规则对所述目标Channel文件进行反序列化以得到目标Channel对象。The target Channel file is deserialized according to the preset deserialization rule to obtain the target Channel object.
  5. 根据权利要求4所述的数据持久化存储方法,其中,所述根据预置反序列化规则对所述目标Channel文件进行反序列化以得到目标Channel对象之后,还包括:The data persistent storage method according to claim 4, wherein after the deserializing the target Channel file according to a preset deserialization rule to obtain the target Channel object, the method further comprises:
    将所述目标Channel对象存储至所述SDK节点的随机存储介质中,以对所述目标Channel对象进行缓存。The target Channel object is stored in a random storage medium of the SDK node to cache the target Channel object.
  6. 根据权利要求1所述的数据持久化存储方法,其中,所述对所述目标Channel对象是否已被初始化进行判断以得到初始化判断结果,包括:The data persistent storage method according to claim 1, wherein said determining whether the target Channel object has been initialized to obtain an initialization determination result comprises:
    与所述目标Channel对象的对应SDK节点的用户终端向所述目标Channel对象中排序服务节点信息所包含的排序服务节点发送目标Channel对象的对象验证信息,以获取所述排序服务节点根据所述对象验证信息反馈的验证结果;The user terminal of the SDK node corresponding to the target Channel object sends the object verification information of the target Channel object to the ordering service node included in the ordering service node information in the target Channel object to obtain the ordering service node according to the object. The verification result of the verification information feedback;
    判断所述验证结果中所述排序服务节点是否已存储与所述目标Channel对象对应的信息,得到是否完成初始化的初始化判断结果。Determine whether the ordering service node has stored the information corresponding to the target Channel object in the verification result, and obtain an initialization judgment result of whether the initialization is completed.
  7. 根据权利要求2所述的数据持久化存储方法,其中,所述数据库为轻量级数据库。The data persistent storage method according to claim 2, wherein the database is a lightweight database.
  8. 一种数据持久化存储装置,其中,包括:A data persistent storage device, which includes:
    存储通道创建单元,用于若接收到用户所输入的通道创建请求,根据所述通道创建请求在所述用户终端对应的SDK节点的随机存储介质中创建包含Channel对象的存储通道;A storage channel creation unit, configured to, if a channel creation request input by a user is received, create a storage channel containing a Channel object in a random storage medium of the SDK node corresponding to the user terminal according to the channel creation request;
    Channel对象持久化存储单元,用于对所述Channel对象进行序列化后持久化存储至所述用户终端对应的SDK节点中;Channel object persistent storage unit, configured to serialize the Channel object and store it persistently in the SDK node corresponding to the user terminal;
    目标Channel对象获取单元,用于若接收到用户所输入的通道对象获取请求,获取所述用户终端中与所述通道对象获取请求对应的Channel对象作为目标Channel对象;The target Channel object obtaining unit is configured to obtain the Channel object corresponding to the channel object obtaining request in the user terminal as the target Channel object if the channel object obtaining request input by the user is received;
    初始化判断单元,用于对所述目标Channel对象是否已被初始化进行判断以得到初始化判断结果;The initialization judgment unit is used to judge whether the target Channel object has been initialized to obtain the initialization judgment result;
    第一反馈单元,用于若所述初始化判断结果为是,将所述目标Channel对象反馈至所述用户;The first feedback unit is configured to feed back the target Channel object to the user if the initial judgment result is yes;
    第二反馈单元,用于若所述初始化判断结果为否,对所述目标Channel对象进行初始化后反馈至所述用户。The second feedback unit is configured to, if the result of the initialization judgment is negative, initialize the target Channel object and feed it back to the user.
  9. 一种计算机设备,包括存储器、处理器及存储在所述存储器上并可在所述处理器上运行的计算机程序,其中,所述处理器执行所述计算机程序时实现以下步骤:A computer device includes a memory, a processor, and a computer program that is stored on the memory and can run on the processor, wherein the processor implements the following steps when the processor executes the computer program:
    若接收到用户所输入的通道创建请求,根据所述通道创建请求在所述用户终端对应的SDK节点的随机存储介质中创建包含Channel对象的存储通道;If a channel creation request input by the user is received, a storage channel containing a Channel object is created in the random storage medium of the SDK node corresponding to the user terminal according to the channel creation request;
    对所述Channel对象进行序列化后持久化存储至所述用户终端对应的SDK节点中;Serialize the Channel object and store it persistently in the SDK node corresponding to the user terminal;
    若接收到用户所输入的通道对象获取请求,获取所述用户终端中与所述通道对象获取请求对应的Channel对象作为目标Channel对象;If the channel object acquisition request input by the user is received, the Channel object corresponding to the channel object acquisition request in the user terminal is acquired as the target Channel object;
    对所述目标Channel对象是否已被初始化进行判断以得到初始化判断结果;Judging whether the target Channel object has been initialized to obtain an initialization judgment result;
    若所述初始化判断结果为是,将所述目标Channel对象反馈至所述用户;If the initial judgment result is yes, feedback the target Channel object to the user;
    若所述初始化判断结果为否,对所述目标Channel对象进行初始化后反馈至所述用户。If the initialization judgment result is no, the target Channel object is initialized and then fed back to the user.
  10. 根据权利要求9所述的计算机设备,其中,所述对所述Channel对象进行序列化后持久化存储至所述用户终端对应的SDK节点中,包括:The computer device according to claim 9, wherein the serializing the Channel object and then storing it persistently in the SDK node corresponding to the user terminal comprises:
    对所述Channel对象进行序列化以得到Channel文件;Serialize the Channel object to obtain a Channel file;
    将所述Channel文件存储至所述SDK节点对应的NAS网盘中并获取存储路径信息;Store the Channel file in the NAS network disk corresponding to the SDK node and obtain storage path information;
    根据所述通道创建请求、存储路径信息生成新增通道记录信息;Generating new channel record information according to the channel creation request and storage path information;
    将所述新增通道记录信息存储至所述SDK节点的数据库中。Store the newly added channel record information in the database of the SDK node.
  11. 根据权利要求9所述的计算机设备,其中,所述根据所述通道创建请求在所述用户终端对应SDK节点的随机存储介质中创建包含Channel对象的存储通道之后,还包括:The computer device according to claim 9, wherein after the creation of a storage channel containing a Channel object in a random storage medium of the SDK node corresponding to the user terminal according to the channel creation request, the method further comprises:
    根据所述Channel对象中的排序服务节点信息将所述Channel对象发送至与所述排序服务节点信息对应的排序服务节点,以对所述Channel对象进行初始化。According to the ordering service node information in the Channel object, the Channel object is sent to the ordering service node corresponding to the ordering service node information to initialize the Channel object.
  12. 根据权利要求9所述的计算机设备,其中,所述获取所述用户终端中与所述通道对象获取请求对应的Channel对象作为目标Channel对象,包括:The computer device according to claim 9, wherein said acquiring a Channel object corresponding to said channel object acquisition request in said user terminal as a target Channel object comprises:
    判断所述用户终端对应的SDK节点的随机存储介质中是否存在与所述通道对象获取请求对应的Channel对象以得到存储判断结果;Judging whether there is a Channel object corresponding to the channel object acquisition request in the random storage medium of the SDK node corresponding to the user terminal to obtain a storage judgment result;
    若所述存储判断结果为是,获取所述随机存储介质中与所述通道对象获取请求对应的Channel对象作为目标Channel对象;If the storage judgment result is yes, acquire the Channel object corresponding to the channel object acquisition request in the random storage medium as the target Channel object;
    若所述存储判断结果为否,根据所述通道对象获取请求对所述SDK节点的数据库进行检索,以获取所述数据库中与所述通道对象获取请求对应的目标通道记录信息;If the storage judgment result is no, search the database of the SDK node according to the channel object acquisition request to acquire target channel record information in the database corresponding to the channel object acquisition request;
    根据所述目标通道记录信息获取与所述SDK节点对应的NAS网盘中所存储的Channel文件作为目标Channel文件;Acquiring, according to the target channel record information, the Channel file stored in the NAS network disk corresponding to the SDK node as the target Channel file;
    根据预置反序列化规则对所述目标Channel文件进行反序列化以得到目标Channel对象。The target Channel file is deserialized according to the preset deserialization rule to obtain the target Channel object.
  13. 根据权利要求12所述的计算机设备,其中,所述根据预置反序列化规则对所述目标Channel文件进行反序列化以得到目标Channel对象之后,还包括:11. The computer device according to claim 12, wherein after said deserializing said target Channel file according to preset deserialization rules to obtain a target Channel object, the method further comprises:
    将所述目标Channel对象存储至所述SDK节点的随机存储介质中,以对所述目标Channel对象进行缓存。The target Channel object is stored in a random storage medium of the SDK node to cache the target Channel object.
  14. 根据权利要求9所述的计算机设备,其中,所述对所述目标Channel对象是否已被初始化进行判断以得到初始化判断结果,包括:9. The computer device according to claim 9, wherein said determining whether the target Channel object has been initialized to obtain an initialization determination result comprises:
    与所述目标Channel对象的对应SDK节点的用户终端向所述目标Channel对象中排序服务节点信息所包含的排序服务节点发送目标Channel对象的对象验证信息,以获取所述排序服务节点根据所述对象验证信息反馈的验证结果;The user terminal of the SDK node corresponding to the target Channel object sends the object verification information of the target Channel object to the ordering service node included in the ordering service node information in the target Channel object to obtain the ordering service node according to the object. The verification result of the verification information feedback;
    判断所述验证结果中所述排序服务节点是否已存储与所述目标Channel对象对应的信息,得到是否完成初始化的初始化判断结果。Determine whether the ordering service node has stored the information corresponding to the target Channel object in the verification result, and obtain an initialization judgment result of whether the initialization is completed.
  15. 根据权利要求10所述的计算机设备,其中,所述数据库为轻量级数据库。The computer device according to claim 10, wherein the database is a lightweight database.
  16. 一种计算机可读存储介质,其中,所述计算机可读存储介质存储有计算机程序,所述计算机程序当被处理器执行时使所述处理器执行以下操作:A computer-readable storage medium, wherein the computer-readable storage medium stores a computer program that, when executed by a processor, causes the processor to perform the following operations:
    若接收到用户所输入的通道创建请求,根据所述通道创建请求在所述用户终端对应的SDK节点的随机存储介质中创建包含Channel对象的存储通道;If a channel creation request input by the user is received, a storage channel containing a Channel object is created in the random storage medium of the SDK node corresponding to the user terminal according to the channel creation request;
    对所述Channel对象进行序列化后持久化存储至所述用户终端对应的SDK节点中;Serialize the Channel object and store it persistently in the SDK node corresponding to the user terminal;
    若接收到用户所输入的通道对象获取请求,获取所述用户终端中与所述通道对象获取请求对应的Channel对象作为目标Channel对象;If the channel object acquisition request input by the user is received, the Channel object corresponding to the channel object acquisition request in the user terminal is acquired as the target Channel object;
    对所述目标Channel对象是否已被初始化进行判断以得到初始化判断结果;Judging whether the target Channel object has been initialized to obtain an initialization judgment result;
    若所述初始化判断结果为是,将所述目标Channel对象反馈至所述用户;If the initial judgment result is yes, feedback the target Channel object to the user;
    若所述初始化判断结果为否,对所述目标Channel对象进行初始化后反馈至所述用户。If the initialization judgment result is no, the target Channel object is initialized and then fed back to the user.
  17. 根据权利要求16所述的计算机可读存储介质,其中,所述对所述Channel对象进行序列化后持久化存储至所述用户终端对应的SDK节点中,包括:The computer-readable storage medium according to claim 16, wherein the serializing the Channel object and then storing it persistently in the SDK node corresponding to the user terminal comprises:
    对所述Channel对象进行序列化以得到Channel文件;Serialize the Channel object to obtain a Channel file;
    将所述Channel文件存储至所述SDK节点对应的NAS网盘中并获取存储路径信息;Store the Channel file in the NAS network disk corresponding to the SDK node and obtain storage path information;
    根据所述通道创建请求、存储路径信息生成新增通道记录信息;Generating new channel record information according to the channel creation request and storage path information;
    将所述新增通道记录信息存储至所述SDK节点的数据库中。Store the newly added channel record information in the database of the SDK node.
  18. 根据权利要求16所述的计算机可读存储介质,其中,所述根据所述通道创建请求在所述用户终端对应SDK节点的随机存储介质中创建包含Channel对象的存储通道之后,还包括:The computer-readable storage medium according to claim 16, wherein after the creation of a storage channel containing Channel objects in a random storage medium of the SDK node corresponding to the user terminal according to the channel creation request, the method further comprises:
    根据所述Channel对象中的排序服务节点信息将所述Channel对象发送至与所述排序服务节点信息对应的排序服务节点,以对所述Channel对象进行初始化。According to the ordering service node information in the Channel object, the Channel object is sent to the ordering service node corresponding to the ordering service node information to initialize the Channel object.
  19. 根据权利要求16所述的计算机可读存储介质,其中,所述获取所述用户终端中与所述通道对象获取请求对应的Channel对象作为目标Channel对象,包括:The computer-readable storage medium according to claim 16, wherein said acquiring a Channel object corresponding to said channel object acquisition request in said user terminal as a target Channel object comprises:
    判断所述用户终端对应的SDK节点的随机存储介质中是否存在与所述通道对象获取请求对应的Channel对象以得到存储判断结果;Judging whether there is a Channel object corresponding to the channel object acquisition request in the random storage medium of the SDK node corresponding to the user terminal to obtain a storage judgment result;
    若所述存储判断结果为是,获取所述随机存储介质中与所述通道对象获取请求对应的Channel对象作为目标Channel对象;If the storage judgment result is yes, acquire the Channel object corresponding to the channel object acquisition request in the random storage medium as the target Channel object;
    若所述存储判断结果为否,根据所述通道对象获取请求对所述SDK节点的数据库进行检索,以获取所述数据库中与所述通道对象获取请求对应的目标通道记录信息;If the storage judgment result is no, search the database of the SDK node according to the channel object acquisition request to acquire target channel record information in the database corresponding to the channel object acquisition request;
    根据所述目标通道记录信息获取与所述SDK节点对应的NAS网盘中所存储的Channel文件作为目标Channel文件;Acquiring, according to the target channel record information, the Channel file stored in the NAS network disk corresponding to the SDK node as the target Channel file;
    根据预置反序列化规则对所述目标Channel文件进行反序列化以得到目标Channel对象。The target Channel file is deserialized according to the preset deserialization rule to obtain the target Channel object.
  20. 根据权利要求19所述的计算机可读存储介质,其中,所述根据预置反序列化规则对所述目标Channel文件进行反序列化以得到目标Channel对象之后,还包括:The computer-readable storage medium according to claim 19, wherein after the deserializing the target Channel file according to a preset deserialization rule to obtain the target Channel object, the method further comprises:
    将所述目标Channel对象存储至所述SDK节点的随机存储介质中,以对所述目标Channel对象进行缓存。The target Channel object is stored in a random storage medium of the SDK node to cache the target Channel object.
PCT/CN2020/105434 2019-10-12 2020-07-29 Data persistence storage method and apparatus, computer device and storage medium WO2021068605A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910968903.1 2019-10-12
CN201910968903.1A CN111104456A (en) 2019-10-12 2019-10-12 Data persistence storage method and device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
WO2021068605A1 true WO2021068605A1 (en) 2021-04-15

Family

ID=70421425

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/105434 WO2021068605A1 (en) 2019-10-12 2020-07-29 Data persistence storage method and apparatus, computer device and storage medium

Country Status (2)

Country Link
CN (1) CN111104456A (en)
WO (1) WO2021068605A1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111104456A (en) * 2019-10-12 2020-05-05 深圳壹账通智能科技有限公司 Data persistence storage method and device, computer equipment and storage medium
CN113741796B (en) * 2020-07-16 2024-04-16 北京沃东天骏信息技术有限公司 Data persistence method and device for terminal application

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2005029314A1 (en) * 2003-08-21 2005-03-31 Microsoft Corporation Storage platform for organizing, searching, and sharing data
CN105450679A (en) * 2014-08-06 2016-03-30 杭州海康威视系统技术有限公司 Method and system for performing data cloud storage
CN109391647A (en) * 2017-08-04 2019-02-26 杭州海康威视系统技术有限公司 Storage resource recovery method, apparatus and system
CN110196680A (en) * 2018-03-27 2019-09-03 腾讯科技(深圳)有限公司 Data processing method, device and storage medium
CN110245059A (en) * 2019-05-20 2019-09-17 平安普惠企业管理有限公司 A kind of data processing method, equipment and storage medium
CN111104456A (en) * 2019-10-12 2020-05-05 深圳壹账通智能科技有限公司 Data persistence storage method and device, computer equipment and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2005029314A1 (en) * 2003-08-21 2005-03-31 Microsoft Corporation Storage platform for organizing, searching, and sharing data
CN105450679A (en) * 2014-08-06 2016-03-30 杭州海康威视系统技术有限公司 Method and system for performing data cloud storage
CN109391647A (en) * 2017-08-04 2019-02-26 杭州海康威视系统技术有限公司 Storage resource recovery method, apparatus and system
CN110196680A (en) * 2018-03-27 2019-09-03 腾讯科技(深圳)有限公司 Data processing method, device and storage medium
CN110245059A (en) * 2019-05-20 2019-09-17 平安普惠企业管理有限公司 A kind of data processing method, equipment and storage medium
CN111104456A (en) * 2019-10-12 2020-05-05 深圳壹账通智能科技有限公司 Data persistence storage method and device, computer equipment and storage medium

Also Published As

Publication number Publication date
CN111104456A (en) 2020-05-05

Similar Documents

Publication Publication Date Title
CN111344706B (en) Method and system for managing transactions on blockchain
US20230275855A1 (en) Searchable peer-to-peer system through instant messaging based topic indexes
US10789085B2 (en) Selectively providing virtual machine through actual measurement of efficiency of power usage
US9594644B2 (en) Converting a serial transaction schedule to a parallel transaction schedule
US7499926B1 (en) Maintaining and replicating chat histories
US9300578B2 (en) Large receive offload functionality for a system on chip
US10382380B1 (en) Workload management service for first-in first-out queues for network-accessible queuing and messaging services
US20140304242A1 (en) Storage system for eliminating duplicated data
US20110197032A1 (en) Cache coordination between data sources and data recipients
WO2017054454A1 (en) Method, device, terminal, server, and system for accessing usb device
WO2020220764A1 (en) Blockchain-based data compression and query method and apparatus, and electronic device
WO2020220536A1 (en) Data backup method and device, and computer readable storage medium
WO2021068605A1 (en) Data persistence storage method and apparatus, computer device and storage medium
WO2021139224A1 (en) Method and apparatus for file backup in cloud scenario, and medium and electronic device
US10917484B2 (en) Identifying and managing redundant digital content transfers
US20160196188A1 (en) Failure recovery of a task state in batch-based stream processing
US20190325043A1 (en) Method, device and computer program product for replicating data block
TW202004592A (en) Method and apparatus for correcting transaction causal sequence, and electronic device
CN113051102B (en) File backup method, device, system, storage medium and computer equipment
US20210064561A1 (en) Flexible datapath offload chaining
US11914529B2 (en) Systems, methods, and devices for time synchronized storage delivery
CN111373377B (en) Method and system for error handling between a requester and a provider
US9172729B2 (en) Managing message distribution in a networked environment
US11314603B2 (en) Recovery image downloads via data chunks
CN113726885A (en) Method and device for adjusting flow quota

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: 20873788

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

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 180822)

122 Ep: pct application non-entry in european phase

Ref document number: 20873788

Country of ref document: EP

Kind code of ref document: A1