Pattern storage method, system, device, equipment and storage medium
By using the B* tree storage structure on blockchain node devices, the problem of low digitization of silk patterns is solved, digital storage and rights confirmation of patterns are realized, and the added value and circulation value of silk products are enhanced.
Patent Information
- Application Number
- CN202210188890.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-28
- Publication Date
- 2025-03-25
- Estimated Expiration
- 2042-02-28
AI Technical Summary
The degree of digitization of silk patterns is low, which leads to high-quality designs and patterns being easily imitated after production, resulting in low added value of industrial products and serious homogeneity.
Through blockchain technology, silk patterns are stored on blockchain node devices, and the storage structure of the B* tree is used to store the original patterns and reorganized patterns based on reorganization indication information to realize digital storage and rights confirmation of patterns.
The digital storage of patterns is realized, which facilitates the confirmation of rights and protects pattern intellectual property rights, which is conducive to the maximization of the circulation and production value of silk products.
Smart Images

Figure CN114625693B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of blockchain technology, and in particular to a pattern storage method, system, device, equipment and storage medium. Background Art
[0002] Silk is a symbol of Chinese culture and has made an indelible contribution to the development of world human civilization. Chinese silk is world-famous for its excellent quality, exquisite colors and rich cultural connotations.
[0003] At present, the degree of digitization of silk products is relatively low. Many silk patterns have not been digitized and universalized, and the digital patterns have not been stored. As a result, high-quality designs and patterns are easily imitated after production, resulting in low added value and serious homogeneity of silk industry products. Summary of the invention
[0004] The present application provides a pattern storage method, system, device, equipment and storage medium to solve the technical problem of low digitization degree of silk patterns in the prior art.
[0005] In a first aspect, an embodiment of the present application provides a pattern storage method applicable to a blockchain node device, the method comprising:
[0006] Obtain at least one original pattern;
[0007] Acquire at least one recombined pattern and recombined indication information of each of the at least one recombined pattern;
[0008] Wherein, for each of the recombined patterns, the recombined pattern is obtained by recombining at least one sub-pattern; wherein the sub-pattern is the at least one original pattern, or one of the remaining patterns in the at least one recombined pattern except the recombined pattern; the recombined indication information is used to characterize the recombined relationship and recombined mode when the at least one sub-pattern is recombined into the recombined pattern;
[0009] According to the reorganization indication information, the at least one original pattern and the at least one reorganized pattern are stored.
[0010] Optionally, obtaining at least one recombined pattern includes:
[0011] Obtaining a reorganization operation for the at least one original pattern;
[0012] In response to the reorganization operation, the at least one reorganized pattern is generated.
[0013] Optionally, storing the at least one original pattern and the at least one reorganized pattern according to the reorganization indication information includes:
[0014] The at least one original pattern and the at least one reorganized pattern are stored based on the reorganization indication information through a storage structure of a B* tree.
[0015] Optionally, storing the at least one original pattern and the at least one reorganized pattern based on the reorganization indication information through a B* tree storage structure includes:
[0016] For each of the recombined patterns, storage is performed in the following manner:
[0017] storing the reorganized pattern as a root node;
[0018] Determine, according to the reorganization indication information, to reorganize into at least one sub-pattern of the reorganized pattern;
[0019] Each of the at least one sub-pattern is stored as a child node of the root node.
[0020] Optionally, the data structure of the root node includes at least: a root pattern hash, a sub-pattern list hash, a pattern identifier, and a sub-pattern hash of each of the at least one sub-pattern; and storing the recombined pattern as the root node includes:
[0021] The upper chain stores the reorganized pattern, and calculates the hash of the reorganized pattern as the root pattern hash;
[0022] Calculate the respective sub-pattern hashes of the at least one sub-pattern, and then calculate the overall hash of the at least one sub-pattern hash as the sub-pattern list hash;
[0023] Using the reorganization indication information as the pattern identifier;
[0024] A pointer is used to make at least one of the sub-pattern hashes point to the corresponding sub-node.
[0025] Optionally, also include:
[0026] Obtaining a production instruction for a specified pattern; wherein the specified pattern is any one of the at least one original pattern and the at least one reorganized pattern;
[0027] Counting the number of production times for the designated pattern and / or extracting the production batch in the production instruction;
[0028] The production times and / or the production batches are stored on the chain, and a block hash and a transaction hash storing the production times and / or the production batches are generated.
[0029] In a second aspect, an embodiment of the present application provides a pattern storage system, including: a client and a blockchain node device;
[0030] The client is used to generate at least one original pattern and at least one reorganized pattern, and record the reorganization indication information of each of the at least one reorganized pattern; send the at least one original pattern, the at least one reorganized pattern, and the reorganization indication information of each of the at least one reorganized pattern to the blockchain node device;
[0031] Wherein, for each of the recombined patterns, the recombined pattern is obtained by recombining at least one sub-pattern; wherein the sub-pattern is the at least one original pattern, or one of the remaining patterns in the at least one recombined pattern except the recombined pattern; the recombined indication information is used to characterize the recombined relationship and recombined mode when the at least one sub-pattern is recombined into the recombined pattern;
[0032] The blockchain node device is used to store the at least one original pattern and the at least one reorganized pattern according to the reorganization indication information.
[0033] In a third aspect, an embodiment of the present application provides a pattern storage device, comprising:
[0034] A first acquisition module, used to acquire at least one original pattern;
[0035] A second acquisition module, used to acquire at least one recombined pattern and recombined indication information of each of the at least one recombined pattern;
[0036] Wherein, for each of the recombined patterns, the recombined pattern is obtained by recombining at least one sub-pattern; wherein the sub-pattern is the at least one original pattern, or one of the remaining patterns in the at least one recombined pattern except the recombined pattern; the recombined indication information is used to characterize the recombined relationship and recombined mode when the at least one sub-pattern is recombined into the recombined pattern;
[0037] The storage module is used to store the at least one original pattern and the at least one reorganized pattern according to the reorganization indication information.
[0038] In a fourth aspect, an embodiment of the present application provides an electronic device, comprising: a processor, a memory, and a communication bus, wherein the processor and the memory communicate with each other via the communication bus;
[0039] The memory is used to store computer programs;
[0040] The processor is used to execute the program stored in the memory to implement the pattern storage method described in the first aspect.
[0041] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the pattern storage method described in the first aspect.
[0042] The above technical solution provided by the embodiment of the present application has the following advantages compared with the prior art: the method provided by the embodiment of the present application realizes the digital storage of patterns by uniquely recording at least one original pattern and a reorganized pattern through a blockchain, which facilitates the confirmation of ownership, is beneficial to the protection of the intellectual property rights of patterns, and realizes the maximization of the circulation value and production value of silk products. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0044] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0045] Figure 1 A schematic diagram of the structure of a pattern storage system provided in an embodiment of the present application;
[0046] Figure 2 A schematic diagram of a flow chart of a pattern storage method provided in an embodiment of the present application;
[0047] Figure 3 A schematic diagram of the storage structure of a B* tree provided in an embodiment of the present application;
[0048] Figure 4 A schematic diagram of the business process of pattern storage provided in an embodiment of the present application;
[0049] Figure 5 A schematic diagram of the process of generating digital collections on a blockchain node device provided in an embodiment of the present application;
[0050] Figure 6 A schematic diagram of the structure of a pattern storage device provided in an embodiment of the present application;
[0051] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0052] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0053] In order to solve the technical problem of low digitization degree of silk patterns in the prior art, the embodiment of the present application provides a pattern storage method, which digitizes silk products and stores them on the chain, so as to maximize the circulation value of physical products and digital products through on-chain property confirmation and transfer of digital product ownership, thereby maximizing the creation and production value of silk products.
[0054] Before introducing in detail a pattern storage method provided by an embodiment of the present application, first, Figure 1 A pattern storage system provided in an embodiment of the present application is introduced. Figure 1 As shown, the pattern storage system mainly includes: a client 101 and a blockchain node device 102;
[0055] The client 101 is used to generate at least one original pattern and at least one reorganized pattern, and record the reorganization indication information of each of the at least one reorganized pattern; send the at least one original pattern, the at least one reorganized pattern and the reorganization indication information of each of the at least one reorganized pattern to the blockchain node device 102;
[0056] Wherein, for each of the recombined patterns, the recombined pattern is obtained by recombining at least one sub-pattern; wherein the sub-pattern is the at least one original pattern, or one of the remaining patterns in the at least one recombined pattern except the recombined pattern; the recombined indication information is used to characterize the recombined relationship and recombined mode when the at least one sub-pattern is recombined into the recombined pattern;
[0057] The blockchain node device 102 is used to store the at least one original pattern and the at least one reorganized pattern according to the reorganization indication information.
[0058] In the specific implementation, the data interface of the blockchain node device and the client (for example, drawing software) can be connected. After the user draws the pattern through the client, such as drawing software, a digital file is formed and exported. The digital file is then transmitted to the blockchain node device through the data interface. Specifically, the digital file can be stored in the file storage server of the blockchain node device, and a hash value (pattern hash) that uniquely marks its validity can be generated through a hash algorithm (for example, SM2 (national secret algorithm) or ECDSA (elliptic curve digital signature algorithm)). The hash value is associated with the digital file in the file storage server and supports fast retrieval.
[0059] In the embodiment of the present application, the original patterns and reorganized patterns are stored through blockchain node devices, thereby realizing the digitization of silk products and enabling the patterns to be preserved. If they are subsequently imitated, the ownership can also be confirmed through the patterns stored on the blockchain node devices, thereby maximizing the circulation value of physical products and digital products, thereby maximizing the creation and production value of silk products.
[0060] Combine the following Figure 2 A pattern storage method provided in an embodiment of the present application is described in detail. Figure 2 As shown, a pattern storage method provided in an embodiment of the present application specifically includes the following steps:
[0061] Step 201, obtaining at least one original pattern;
[0062] The original pattern refers to the silk pattern created by the silk brand and the artist, which is different from the reorganized pattern obtained by reorganizing other patterns. The original pattern can be sorted out by the silk brand and the artist into silk products, and then copied by the designer, and the pattern vector is made online through Vector Magic, Adobe Illustrator, CorelDraw, etc., and the SVG (scalable vector graphics) file is generated and exported to obtain the original pattern.
[0063] Step 202, obtaining at least one recombined pattern and recombined indication information of each of the at least one recombined pattern;
[0064] Wherein, for each of the recombined patterns, the recombined pattern is obtained by recombining at least one sub-pattern; wherein the sub-pattern is the at least one original pattern, or one of the remaining patterns in the at least one recombined pattern except the recombined pattern; the recombined indication information is used to characterize the recombined relationship and recombined mode when the at least one sub-pattern is recombined into the recombined pattern;
[0065] In specific implementation, the reorganized pattern may be composed of the original pattern or the other reorganized patterns; it may also be composed of the original pattern and the other reorganized patterns. A reorganized pattern may be composed of one pattern or multiple patterns. For example, taking the reorganized pattern composed of an original pattern as an example, the original pattern can be rotated at different angles and arranged in different positions, for example, to form a flower pattern, thereby forming a new pattern, which is the reorganized pattern.
[0066] In a specific embodiment, obtaining at least one recombined pattern includes: obtaining a recombined operation for the at least one original pattern; and generating the at least one recombined pattern in response to the recombined operation.
[0067] In the specific implementation, the patterns can be recombined by dragging and dropping. The same pattern can be used multiple times in the new combination. At the same time, the position and rotation angle of the pattern, as well as the sub-patterns that the recombined pattern is composed of are recorded.
[0068] Step 203: store the at least one original pattern and the at least one reorganized pattern according to the reorganization indication information.
[0069] When storing the original pattern and the reorganized pattern, their respective hash values can be calculated respectively, and the corresponding relationship between the hash value and the respective pattern can be recorded. At the same time, according to the reorganization indication information, the combination relationship between the original pattern and the reorganized pattern during reorganization can be stored.
[0070] At present, in blockchain technology, the Merkle tree data structure is usually used to mark and store digital products, giving digital products a unique hash value. However, this method of authenticating digital products is too simple. For digital products composed of complex elements, this authentication method is too simple and cannot explain the source and ownership of the design elements used in digital products. Disputes may still arise in the future due to product copyright issues.
[0071] In order to solve this technical problem, in an embodiment of the present application, the at least one original pattern and the at least one reorganized pattern are stored based on the reorganization indication information through a B* tree storage structure.
[0072] B* tree is a search tree and a variant of B+ tree. The differences between them are:
[0073] 1) First, there is the problem of the number of keywords. The number of keywords initialized by the B+ tree is cei(m / 2), and the number of keywords initialized by the B* tree is (cei(2 / 3*m)); where cei(*) represents rounding up; m represents the number of child nodes;
[0074] 2) When a B+ tree node is full, it will split, while when a B* tree node is full, it will check whether the sibling node is full (because each node has a pointer to the sibling node). If the sibling node is not full, the keyword is transferred to the sibling node. If the sibling node is full, 1 / 3 of the data from the current node and the sibling node is taken out to create a new node;
[0075] This means that the B* tree has a stronger search capability. At the same time, its non-leaf nodes can be associated with nodes of the same level through pointers, and can also show multiple reuse relationships in complex pattern designs, which is very suitable for complex pattern design scenarios. The B* tree can store a large amount of data, and is also very suitable for the needs of complex patterns that require multi-field markings. Therefore, the embodiment of the present application chooses to use the B* tree data structure to complete the formation of the pattern data model.
[0076] In the embodiment of the present application, by uniquely recording at least one original pattern and a reorganized pattern through a blockchain node device, digital storage of the pattern is achieved, which is convenient for property rights confirmation, beneficial to the protection of the intellectual property rights of the pattern, and realizes the maximization of the circulation value and production value of silk products.
[0077] In a specific implementation, each of the recombined patterns is stored in the following manner: the recombined pattern is stored as a root node; at least one sub-pattern recombined into the recombined pattern is determined according to the recombination indication information; and each of the at least one sub-pattern is stored as a sub-node of the root node.
[0078] The data structure of the root node at least includes: a root pattern hash, a sub-pattern list hash, a pattern identifier and a sub-pattern hash of each of the at least one sub-patterns; the storing of the recombined pattern as the root node includes: storing the recombined pattern on a chain, and calculating the hash of the recombined pattern as the root pattern hash; calculating the sub-pattern hash of each of the at least one sub-pattern, and then calculating the overall hash of at least one of the sub-pattern hashes as the sub-pattern list hash; using the recombined indication information as the pattern identifier; and using a pointer to point at least one of the sub-pattern hashes to the corresponding subnodes.
[0079] It should be noted here that the root node is relative, not absolute, and the root node may also be a child node of other nodes in the entire B* tree. For example: if the root node is also a child node of a target node, the data structure of the root node also includes: an associated pattern list hash, and the associated pattern list hash can be used to represent the positional association relationship between the pattern of the root node and the remaining sub-patterns corresponding to the target node except the pattern of the root node in the sub-pattern corresponding to the target node. For example: the sub-pattern of the target node is composed of A pattern, B pattern and C pattern, where A pattern and B pattern are adjacent, B pattern and A pattern and C pattern are adjacent. If A pattern is the aforementioned root pattern, then for the data structure of the root pattern A, the associated pattern list hash is the hash of the B pattern, and then the hash is calculated to obtain the hash value. If pattern B is the aforementioned root pattern, then in the data structure of root pattern B, the associated pattern list hash is the hash of pattern A and the hash of pattern C, and then the hash is calculated as a whole to obtain the hash value.
[0080] If the root node is not a child of other nodes, the associated pattern list hash is empty.
[0081] In fact, no matter it is a root node or a child node, its data structure is consistent, basically consisting of pattern hash, sub-pattern list hash, associated pattern list hash, pattern identifier, sub-pattern hash, associated pattern pointer, etc.; if it is not involved, the relevant data value can be empty.
[0082] In order to facilitate understanding of using a B* tree to store at least one original pattern and at least one reorganized pattern, further explanation is given in conjunction with a specific example.
[0083] like Figure 3 As shown, this specific example is explained using a three-layer B* tree as an example. In this specific example, pattern G is reorganized from pattern D, pattern E and pattern F, wherein pattern D is reorganized from pattern A, pattern B and pattern C. When storing, pattern G is the root node, pattern D, pattern E and pattern F are secondary nodes, and pattern A, pattern B and pattern C are leaf nodes.
[0084] The root node data includes: root pattern hash, sub-pattern list hash, associated pattern list hash, a series of pattern identifiers and sub-pattern hash; the sub-pattern hash is associated with the secondary node by means of a pointer;
[0085] The data composition of the secondary node includes: the primary sub-pattern hash, the secondary pattern list hash, the associated pattern list hash, a series of pattern identifiers, the associated pattern pointer, and the secondary sub-pattern hash of the leaf node; wherein the secondary sub-pattern hash of the leaf node is associated downwards by means of a pointer;
[0086] The data composition of the leaf node includes: secondary sub-pattern hash, associated pattern list hash, and associated pattern pointer (when this node is a leaf node, the pointer will not point to the same-level node). Since the leaf node is the original pattern, there is no sub-pattern list hash.
[0087] In the above description of B* tree, the storage of multiple types of data is mentioned. Combined with the application scenarios of actual pattern design, the content stored on any node is explained as follows:
[0088] Root pattern hash: The hash value obtained by calculating all elements of the final recombined pattern through the hash algorithm;
[0089] Sub-pattern list hash: the value obtained by hashing the hash list of all related sub-patterns of the combined recombined pattern;
[0090] Hash of associated pattern list: the hash value obtained by computing the hash algorithm on the list of all patterns associated with the pattern (similar patterns, variant patterns, or position-related patterns);
[0091] Pattern identifier: including but not limited to detailed information of each sub-pattern, rotation angle of sub-pattern, identifier of sub-pattern combination, identifier of sub-pattern displacement and direction, hash of sub-pattern, etc.;
[0092] Sub-pattern hash: One of the sub-patterns that constitutes the root pattern, encrypts its key information through the hash algorithm, and outputs the hash value;
[0093] Associated pattern pointer: represents the association between sub-patterns of non-leaf nodes, which can help record the relationship between patterns and facilitate quick search for all components of a complex pattern.
[0094] In the embodiment of the present application, the storage structure of the B* tree realizes the recording of the entire life cycle and production process of the digital pattern. At the same time, the fast search characteristics of the B* tree combined with the complex pattern combination will be very helpful in confirming all the components of the pattern. At the same time, all elements can be quickly searched separately, and the storage of complex pattern identifiers is supported. The generated pattern and its sub-patterns are associated through the data structure of the blockchain and the B* tree, providing a comprehensive data structure level proof of the pattern relationship, maximizing the value of the digital collection and improving the retrieval efficiency.
[0095] In order to further understand the technical solution provided by the embodiments of the present application, Figure 4 and Figure 5 The technical solution provided in the embodiment of the present application is further described. Figure 4 Description of the business process for pattern storage, Figure 5 The process of generating digital collections on blockchain node devices.
[0096] like Figure 4 As shown, in terms of business process, there are mainly the following steps:
[0097] 1) Silk brands and artists organize existing silk patterns;
[0098] 2) Designers copy patterns and make pattern vector images online (supported by many software on the market, such as VectorMagic, Adobe Illustrator, CorelDraw, etc.);
[0099] 3) Generate and export an SVG file of the vector map, wherein the SVG file includes: a coordinate system and coordinate points of the positioning vector map;
[0100] 4) Store multiple SVG files to form a pattern library;
[0101] 5) Based on the mapping software, all patterns can be recombined by dragging and dropping. The same pattern can be used multiple times in new combinations. At the same time, the position, rotation angle and other information of the pattern can be recorded;
[0102] 6) Designers can view all the patterns they manage, and are also supported to create new patterns independently;
[0103] 7) Newly designed or combined patterns (reorganized patterns) support simultaneous circulation online (digital collections) and offline (physical goods).
[0104] Figure 4 The business process shown is similar to Figure 5 The generation process of digital collections on the blockchain node devices shown is roughly one-to-one.
[0105] like Figure 5 As shown in the figure, the process of generating digital collections on blockchain node devices includes:
[0106] 1) Build a blockchain platform and connect it to the data interface of the drawing software to identify patterns saved and exported by users;
[0107] 2) Mark the vector diagram by means of a coordinate system to form an original digital file;
[0108] 3) The original digital file is transmitted to the file storage server of the blockchain platform through the data interface, and a hash value (i.e., pattern hash) that uniquely marks its validity is generated through a hash algorithm (SM2 or ECDSA). The hash value is associated with the original digital file in the file storage server and supports fast retrieval, forming the initial data structure of the blockchain platform (e.g., Merkle tree);
[0109] 4) Generate a blockchain digital pattern library by managing the pattern hash in a unified manner, which constitutes the leaf node data source of the B* tree;
[0110] 5) Define the leaf node data structure of the B* tree, including but not limited to: pattern combination identifier, pattern displacement and direction identifier, pattern hash, associated pattern hash list, sub-pattern hash list, etc.;
[0111] 6) The combination of multiple patterns is realized through the reorganization operation. During the combination process, the original pattern is used as a leaf node, and the new pattern (reorganized pattern) formed by the combination becomes the root node;
[0112] 7) After the high-quality pattern becomes the new root node, the pattern can be produced multiple times, and different block hashes and transaction hashes can be generated according to the number of productions for marking.
[0113] In the embodiments of the present application, the physical manufacturing industry is combined with information technology to increase the degree of informatization of traditional industrial enterprises; the added value of products is increased by supporting personalized design and customization; the indivisibility and uniqueness of the digital product identification are retained, but through the B* tree data structure combined with the block chain storage structure of the blockchain, a technical model for combining multiple patterns to form a new pattern is provided, which increases the liquidity of digital products from a technical perspective, enriches the technical models and implementation methods of digital products, and makes the reorganization of elements in multiple digital products possible.
[0114] Rejuvenation, personalization, and intelligent manufacturing will be the melody of the future textile and garment industry. However, the current silk industry has problems such as low degree of digitization, low added value, and serious homogenization. The blockchain gives silk products and patterns unique identification, supporting designers to create based on existing patterns. This method is different from the traditional blockchain, which is mainly stored and indexed through the Merkle tree. While the embodiment of the present application uses the Merkle tree to store blocks, it chooses to use the B* tree data structure to mark and reorganize the associated digital patterns that have undergone secondary creation (reorganization); in this way, image information can be stored, which is more convenient for the rapid combination and traversal query of pattern data, while ensuring the efficient use of data. Through the combination of online and offline methods, digital designs are quickly implemented and produced, realizing the interconnection of resources between the digital world and the real world.
[0115] Based on the same concept, a pattern storage device is provided in the embodiment of the present application, which is suitable for a blockchain node device. The specific implementation of the device can be found in the description of the method embodiment part, and the repetitive parts will not be repeated. Figure 6 As shown, the device mainly includes:
[0116] A first acquisition module 601 is used to acquire at least one original pattern;
[0117] The second acquisition module 602 is used to acquire at least one recombined pattern and the recombined indication information of each of the at least one recombined pattern;
[0118] Wherein, for each of the recombined patterns, the recombined pattern is obtained by recombining at least one sub-pattern; wherein the sub-pattern is the at least one original pattern, or one of the remaining patterns in the at least one recombined pattern except the recombined pattern; the recombined indication information is used to characterize the recombined relationship and recombined mode when the at least one sub-pattern is recombined into the recombined pattern;
[0119] The storage module 603 is used to store the at least one original pattern and the at least one reorganized pattern according to the reorganization indication information.
[0120] In a specific embodiment, the second acquisition module 602 is used to acquire a reorganization operation for the at least one original pattern; and generate the at least one reorganized pattern in response to the reorganization operation.
[0121] In a specific embodiment, the storage module 603 is used to store the at least one original pattern and the at least one reorganized pattern based on the reorganization indication information through a B* tree storage structure.
[0122] In a specific embodiment, the storage module 603 is used to store each of the recombined patterns in the following manner: storing the recombined pattern as a root node; determining at least one sub-pattern recombined into the recombined pattern according to the recombination indication information; and storing each of the at least one sub-pattern as a sub-node of the root node.
[0123] In a specific embodiment, the storage module 603 is used to store the recombined pattern on the chain and calculate the hash of the recombined pattern as the root pattern hash when the data structure of the root node includes at least: a root pattern hash, a sub-pattern list hash, a pattern identifier and a sub-pattern hash of each of the at least one sub-patterns; calculate the sub-pattern hash of each of the at least one sub-patterns, and then calculate the overall hash of at least one of the sub-pattern hashes as the sub-pattern list hash; use the recombinant indication information as the pattern identifier; and use a pointer to point at least one of the sub-pattern hashes to the corresponding child node.
[0124] In a specific embodiment, the pattern storage device also includes: a production record module, used to obtain production instructions for a specified pattern; wherein the specified pattern is any one of the at least one original pattern and the at least one reorganized pattern; counting the number of production times for the specified pattern and / or extracting the production batch in the production instruction; storing the number of production times and / or the production batch on the chain, and generating a block hash and a transaction hash that store the number of production times and / or the production batch.
[0125] Based on the same concept, an electronic device is also provided in the embodiment of the present application, such as Figure 7 As shown, the electronic device mainly includes: a processor 701, a memory 702 and a communication bus 703, wherein the processor 701 and the memory 702 communicate with each other through the communication bus 703. The memory 702 stores a program executable by the processor 701, and the processor 701 executes the program stored in the memory 702 to implement the following steps:
[0126] Obtain at least one original pattern;
[0127] Acquire at least one recombined pattern and recombined indication information of each of the at least one recombined pattern;
[0128] Wherein, for each of the recombined patterns, the recombined pattern is obtained by recombining at least one sub-pattern; wherein the sub-pattern is the at least one original pattern, or one of the remaining patterns in the at least one recombined pattern except the recombined pattern; the recombined indication information is used to characterize the recombined relationship and recombined mode when the at least one sub-pattern is recombined into the recombined pattern;
[0129] According to the reorganization indication information, the at least one original pattern and the at least one reorganized pattern are stored.
[0130] The communication bus 703 mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The communication bus 703 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 7 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0131] The memory 702 may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Alternatively, the memory may also be at least one storage device located away from the processor 701.
[0132] The above-mentioned processor 701 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc., and can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components.
[0133] In another embodiment of the present application, a computer-readable storage medium is provided, in which a computer program is stored. When the computer program is executed on a computer, the computer executes a pattern storage method described in the above embodiment.
[0134] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer instruction is loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network or other programmable device. The computer instruction can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instruction is transmitted from a website site, a computer, a server or a data center by wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server, a data center, etc. that contains one or more available media integration. The available medium can be a magnetic medium (such as a floppy disk, a hard disk, a magnetic tape, etc.), an optical medium (such as a DVD) or a semiconductor medium (such as a solid-state hard disk), etc.
[0135] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0136] The foregoing is merely a specific embodiment of the present invention, which enables those skilled in the art to understand or implement the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features claimed herein.
Claims
1. A pattern storage method, characterized in that: Applicable to a blockchain node device, the method comprises: Obtain at least one original pattern; Acquire at least one recombined pattern and recombined indication information of each of the at least one recombined pattern; Wherein, for each of the recombined patterns, the recombined pattern is obtained by recombining at least one sub-pattern; wherein the sub-pattern is the at least one original pattern, or one of the remaining patterns in the at least one recombined pattern except the recombined pattern; the recombined indication information is used to characterize the recombined relationship and recombined mode when the at least one sub-pattern is recombined into the recombined pattern; According to the reorganization indication information, storing the at least one original pattern and the at least one reorganized pattern; The storing of the at least one original pattern and the at least one reorganized pattern according to the reorganization indication information comprises: storing the at least one original pattern and the at least one reorganized pattern based on the reorganization indication information through a B* tree storage structure; The storage structure of the B* tree stores the at least one original pattern and the at least one reorganized pattern based on the reorganization indication information, including: for each of the reorganized patterns, storing in the following manner: storing the reorganized pattern as a root node; determining at least one sub-pattern reorganized into the reorganized pattern according to the reorganization indication information; and storing each of the at least one sub-pattern as a child node of the root node.
2. The pattern storage method according to claim 1, characterized in that: The obtaining of at least one recombined pattern comprises: Obtaining a reorganization operation for the at least one original pattern; In response to the reorganization operation, the at least one reorganized pattern is generated.
3. The pattern storage method according to claim 1, characterized in that: The data structure of the root node at least includes: a root pattern hash, a sub-pattern list hash, a pattern identifier, and a sub-pattern hash of each of the at least one sub-pattern; storing the recombined pattern as a root node includes: The upper chain stores the reorganized pattern, and calculates the hash of the reorganized pattern as the root pattern hash; Calculate the respective sub-pattern hash of the at least one sub-pattern, and then calculate the overall hash of at least one of the sub-pattern hashes as the sub-pattern list hash; Using the reorganization indication information as the pattern identifier; A pointer is used to make at least one of the sub-pattern hashes point to the corresponding sub-node.
4. The pattern storage method according to any one of claims 1 to 3, characterized in that: Also includes: Obtaining a production instruction for a specified pattern; wherein the specified pattern is any one of the at least one original pattern and the at least one reorganized pattern; Counting the number of production times for the designated pattern and / or extracting the production batch in the production instruction; The production times and / or the production batches are stored on the chain, and a block hash and a transaction hash storing the production times and / or the production batches are generated.
5. A pattern storage system, characterized in that: include: Client and blockchain node devices; The client is used to generate at least one original pattern and at least one recombined pattern, and record the recombined indication information of each of the at least one recombined pattern; Sending the at least one original pattern, the at least one reorganized pattern, and the reorganization indication information of each of the at least one reorganized pattern to the blockchain node device; Wherein, for each of the recombined patterns, the recombined pattern is obtained by recombining at least one sub-pattern; wherein the sub-pattern is the at least one original pattern, or one of the remaining patterns in the at least one recombined pattern except the recombined pattern; the recombined indication information is used to characterize the recombined relationship and recombined mode when the at least one sub-pattern is recombined into the recombined pattern; The blockchain node device is used to store the at least one original pattern and the at least one reorganized pattern according to the reorganization instruction information; The storing of the at least one original pattern and the at least one reorganized pattern according to the reorganization indication information comprises: storing the at least one original pattern and the at least one reorganized pattern based on the reorganization indication information through a B* tree storage structure; The storage structure of the B* tree stores the at least one original pattern and the at least one reorganized pattern based on the reorganization indication information, including: for each of the reorganized patterns, storing in the following manner: storing the reorganized pattern as a root node; determining at least one sub-pattern reorganized into the reorganized pattern according to the reorganization indication information; and storing each of the at least one sub-pattern as a child node of the root node.
6. A pattern storage device, characterized in that: Applicable to block node equipment, the device comprises: A first acquisition module, used to acquire at least one original pattern; A second acquisition module, used to acquire at least one recombined pattern and recombined indication information of each of the at least one recombined pattern; Wherein, for each of the recombined patterns, the recombined pattern is obtained by recombining at least one sub-pattern; wherein the sub-pattern is the at least one original pattern, or one of the remaining patterns in the at least one recombined pattern except the recombined pattern; the recombined indication information is used to characterize the recombined relationship and recombined mode when the at least one sub-pattern is recombined into the recombined pattern; A storage module, used for storing the at least one original pattern and the at least one reorganized pattern according to the reorganization indication information; The storing of the at least one original pattern and the at least one reorganized pattern according to the reorganization indication information comprises: storing the at least one original pattern and the at least one reorganized pattern based on the reorganization indication information through a B* tree storage structure; The storage structure of the B* tree stores the at least one original pattern and the at least one reorganized pattern based on the reorganization indication information, including: for each of the reorganized patterns, storing in the following manner: storing the reorganized pattern as a root node; determining at least one sub-pattern reorganized into the reorganized pattern according to the reorganization indication information; and storing each of the at least one sub-pattern as a child node of the root node.
7. An electronic device, characterized in that: include: A processor, a memory and a communication bus, wherein the processor and the memory communicate with each other via the communication bus; The memory is used to store computer programs; The processor is used to execute the program stored in the memory to implement the pattern storage method described in any one of claims 1 to 4.
8. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the pattern storage method according to any one of claims 1 to 4 is implemented.
Citation Information
Patent Citations
Time-ordered storage structure and quick query method
CN111209591A