A data storage method and apparatus for a digital coil system
By adopting a semi-structured data model and a non-relational database in the digital steel coil system, the data storage structure was optimized, solving the problem of storage expansion in the digital steel coil system and achieving storage space savings and performance improvements.
Patent Information
- Application Number
- CN202211280279.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-19
- Publication Date
- 2026-02-27
- Estimated Expiration
- 2042-10-19
AI Technical Summary
In existing technologies, the data storage capacity of digital steel coil systems is constantly expanding, leading to frequent hardware upgrades and increased usage costs.
A semi-structured data model and a non-relational database (such as MongoDB or Redis) are used to store digital steel coil information. The ID field is set as the primary key, and the process number, steel coil number, and process parameter number are used as indexes. Gzip compression is used to compress detailed process parameter information to optimize the data storage structure.
It greatly saves storage space, meets the increasing data storage needs of digital steel coils, reduces storage costs, and improves system performance.
Smart Images

Figure CN115544305B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the technical field of data storage and management, and particularly relates to a data storage method and device for a digital steel coil system. BACKGROUND
[0002] A digital steel coil is a series of data sets attached to and related to a physical steel coil. The full-process visualization and digitization of cold-rolled products in the form of a digital steel coil can provide a perfect, accurate and reliable data basis for subsequent big data analysis and mining, and is the most critical step to realize an intelligent factory. Data management and storage are one of the most core processes of a digital steel coil. A series of information such as equipment data, operation records, energy consumption data, defect data, process data, cost data and user information are collected into unified data. In a database, the collected data is uniformly coded, and is assigned according to the length direction with the steel coil as a carrier, thereby producing a digital steel coil synchronized with the physical steel coil.
[0003] A typical digital steel coil uses a relational database to store digital steel coil information, adopts a master-slave table, and the storage structure is as follows:
[0004] Master table:
[0005] No. Field Name Data Type Remark 1 ID int auto-increment, primary key (or GUID) 2 Process No. varchar index 3 Steel Coil No. varchar index
[0006] Slave table:
[0007]
[0008]
[0009] However, as the system continues to run, it is found that the storage capacity of the data is constantly expanding, and the hardware configuration designed in the early stage needs to be upgraded regularly to meet the increasing data demand, which undoubtedly increases the use cost. SUMMARY
[0010] The present application aims to overcome the defects of the prior art and provides a data storage method for a digital steel coil system. The method for storing a digital steel coil can greatly save storage space and can meet the increasing data storage demand of a digital steel coil.
[0011] The technical solution of the present application is as follows: the present application discloses a data storage method for a digital steel coil system, comprising the following steps:
[0012] A semi-structured data model for expressing digital steel coil information is set, and a digital steel coil table is established in the database to correspond to the semi-structured data model one by one; the data structure of the semi-structured data model includes: an ID field, a process number, a steel coil number, a process parameter number, and detailed information of the process parameter;
[0013] A process information table is established in the database, including two fields, the first field is a process number, the data type is a digital type, and is set as a primary key; the second field is a process number name, the data type is a string type, and is set as an index;
[0014] A steel coil number information table is established in the database, including two fields, the first field is a steel coil number, the data type is a digital type, and is set as a primary key; the second field is a steel coil number, the data type is a string type, and is set as an index;
[0015] A parameter information table is established in the database, including two fields, the first field is a parameter number, the data type is a digital type, and is set as a primary key; the second field is a parameter name, the data type is a string type, and is set as an index;
[0016] The production information is obtained to form a digital steel coil, the digital steel coil includes a process number, a steel coil number, a process parameter name, and detailed information of a process parameter, each digital steel coil is assigned a unique ID, and the ID is stored in the digital steel coil table, the process information table, the steel coil number information table, and the parameter information table.
[0017] The data stored in the digital steel coil table is in the semi-structured mode described in S1.
[0018] Further, the data type of the ID field is int, the data type of the process number is byte, the data type of the steel coil number is int, and the data type of the process parameter number is short; the data type of the detailed information of the process parameter is a byte array.
[0019] Further, the ID field is set as a primary key, the process number, the steel coil number, and the process parameter number are all set as indexes; the detailed information of the process parameter is detailed process data of the process number, the steel coil number, and the process parameter number, and includes a group of lengths and values corresponding to the lengths.
[0020] A global static variable is used to assign a unique ID field to each digital steel coil. Each time the data is taken out, it is incremented by 1 to ensure that the data taken out next time is different.
[0021] Further, the procedure number name is a string, and after obtaining the procedure number name, the procedure information table is queried with the procedure number name, if at least one row of result is queried, the procedure number of the first row of result is returned, otherwise, the maximum procedure number in the procedure information table is obtained, if the procedure information table is empty, the maximum procedure number is 0, then the maximum procedure number is added by 1 to form a new procedure number, the new procedure number and the queried procedure number name are inserted into the procedure information table, and then the new procedure number is returned to the digital steel coil table storage.
[0022] Further, the steel coil number is a string, and after obtaining the steel coil number, the steel coil number information table is queried with the steel coil number, if at least one row of result is queried, the steel coil number of the first row of result is returned, otherwise, the maximum steel coil number in the steel coil number information table is obtained, if the steel coil number information table is empty, the maximum steel coil number is 0, then the maximum steel coil number is added by 1 to form a new steel coil number, the new steel coil number and the queried steel coil number are inserted into the steel coil number information table, and then the new steel coil number is returned to the digital steel coil table storage.
[0023] Further, the parameter name is a string, and after obtaining the parameter name, the parameter information table is queried with the parameter name, if at least one row of result is queried, the parameter number of the first row of result is returned, otherwise, the maximum parameter number in the parameter information table is obtained, if the parameter information table is empty, the maximum parameter number is 0, then the maximum parameter number is added by 1 to form a new parameter number, the new parameter number and the queried parameter name are inserted into the parameter information table, and then the new parameter number is returned to the digital steel coil table storage.
[0024] Further, according to the specified procedure number, the specified steel coil, the specified parameter, a series of lengths and the process parameter values at the lengths, the information is converted into a byte array and stored in the digital steel coil table as detailed information of the process parameter, and the conversion steps are as follows:
[0025] An empty byte array re1 is created.
[0026] Each length is parsed into a byte array and then appended to re1 in turn.
[0027] Each length is parsed into a byte array and then appended to re1 in turn.
[0028] re1 is compressed to obtain a new byte array re2, which is stored in the digital steel coil table.
[0029] Further, the database adopts a non-relational database.
[0030] Further, the database adopts MongoDB or Redis.
[0031] The application discloses a data storage device for a digital steel coil system, comprising a memory for storing a program;
[0032] and a processor for implementing the steps of the data storage method as described above when executing the program.
[0033] The application has at least the following beneficial effects:
[0034] The application records various parameters of a steel coil and process information at each length by using a semi-structured data structure for digital steel coil storage. The method of the application can greatly save storage space and meet the increasing data storage and management requirements of digital steel coils.
[0035] The application proposes using a non-relational database to store digital steel coils, which can significantly improve performance. BRIEF DESCRIPTION OF DRAWINGS
[0036] In order to more clearly illustrate the technical solutions in the embodiments of the application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or the prior art description. Obviously, the drawings in the following description only constitute some embodiments of the application, and for those skilled in the art, other drawings can be obtained without creative labor based on these drawings.
[0037] Figure 1 The flowchart of the data storage method for a digital steel coil system provided by the embodiments of the application. DETAILED DESCRIPTION
[0038] The technical solutions in the embodiments of the application will be described clearly and completely below with reference to the drawings in the embodiments of the application. Obviously, the described embodiments only constitute some embodiments of the application, rather than all the embodiments. Based on the embodiments in the application, all other embodiments obtained by those skilled in the art without creative labor fall within the protection scope of the application.
[0039] The terms "first", "second" are only used for description purpose, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined with "first", "second" can explicitly or implicitly include one or more of the features.
[0040] Referring to Figure 1 The embodiments of the application provide a data storage method for a digital steel coil system, comprising the following steps:
[0041] A semi-structured data model for expressing digital steel coil information is set, and a digital steel coil table is established in the database corresponding to the semi-structured data model one by one; the data structure of the semi-structured data model includes: ID field, process number, steel coil number, process parameter number, and detailed information of the process parameter;
[0042] The data type of the ID field is int, the data type of the process number is byte, the data type of the steel coil number is int, and the data type of the process parameter number is short; the data type of the detailed information of the process parameter is a byte array.
[0043] The specific data structure is as follows:
[0044] No. Field Name Data Type Remark 1 ID int auto-increment, primary key (or GUID) 2 Process No. byte index 3 Steel Coil No. int index 4 Parameter No. short index 5 Length and Value of the Parameter array
[0045] The detailed information of the process parameter is the detailed process data of the process number, the steel coil number, and the process parameter number, and includes a set of length and the corresponding value. The length and value of the parameter are an array, and the specific structure of each record is as follows:
[0046] No. Field Name Data Type Remark 1 Length ushort 2 Value float
[0047] The ID field is set as the primary key, and the process number, the steel coil number, and the process parameter number are set as indexes.
[0048] A process information table is established in the database, including two fields, the first field is process number, the data type is numerical, and is set as the primary key; the second field is process number name, the data type is string, and is set as the index;
[0049] A steel coil number information table is established in the database, including two fields, the first field is the number of the steel coil number, the data type is numerical, and is set as the primary key; the second field is the steel coil number, the data type is string, and is set as the index;
[0050] A parameter information table is established in the database, including two fields, the first field is the parameter number, the data type is numerical, and is set as the primary key; the second field is the parameter name, the data type is string, and is set as the index;
[0051] The production information is acquired to form a digital steel coil, the digital steel coil including a process number, a steel coil number, a process parameter name, and process parameter detailed information, each digital steel coil is assigned a unique ID, and the ID is stored in the digital steel coil table, the process information table, the steel coil number information table, and the parameter information table in correspondence with the digital steel coil information. The data stored in the digital steel coil table is in the semi-structured mode, and the unique ID is assigned to each digital steel coil, which requires that the values of the ID field are different. A typical processing mode is to use a global static variable, which is incremented by 1 after each data is taken out to ensure that the data taken out next time is different.
[0052] The flowchart shown is only the flowchart of one specific embodiment of the present application and cannot be used to limit the flowchart of the present application. The order of establishing the digital steel coil table, the process information table, the steel coil number information table, and the parameter information table in the database of the present application can be adjusted as needed. Figure 1 The flowchart shown is only the flowchart of one specific embodiment of the present application and cannot be used to limit the flowchart of the present application. The order of establishing the digital steel coil table, the process information table, the steel coil number information table, and the parameter information table in the database of the present application can be adjusted as needed.
[0053] Further, the process number name is a string, after the process number name is obtained, the process number name is queried from the process information table, if at least one row of results is queried, the process number number of the first row of results is returned, otherwise, the maximum process number number in the process information table is obtained, if the process information table is empty, the maximum process number number is 0, then the maximum process number number is incremented by 1 to form a new process number number, the new process number number and the queried process number name are inserted into the process information table in correspondence, and then the new process number number is returned to the digital steel coil table for storage.
[0054] Further, the steel coil number is a string, after the steel coil number is obtained, the steel coil number is queried from the steel coil number information table, if at least one row of results is queried, the steel coil number number of the first row of results is returned, otherwise, the maximum steel coil number number in the steel coil number information table is obtained, if the steel coil number information table is empty, the maximum steel coil number number is 0, then the maximum steel coil number number is incremented by 1 to form a new steel coil number number, the new steel coil number number and the queried steel coil number are inserted into the steel coil number information table in correspondence, and then the new steel coil number number is returned to the digital steel coil table for storage.
[0055] Further, the parameter name is a string, after the parameter name is obtained, the parameter name is queried from the parameter information table, if at least one row of results is queried, the parameter number of the first row of results is returned, otherwise, the maximum parameter number in the parameter information table is obtained, if the parameter information table is empty, the maximum parameter number is 0, then the maximum parameter number is incremented by 1 to form a new parameter number, the new parameter number and the queried parameter name are inserted into the parameter information table in correspondence, and then the new parameter number is returned to the digital steel coil table for storage.
[0056] Further, according to the production information, a series of lengths and process parameter values at the lengths of a specified process number, a specified steel coil and a specified parameter are obtained, the information is converted into a byte array, and the byte array is stored in the digital steel coil table as detailed information of the process parameter.
[0057] A empty byte array re1 is created;
[0058] Each length is parsed into a byte array, and then appended to re1 in sequence;
[0059] The process parameter values at each length are parsed into a byte array, and then appended to re1 in sequence;
[0060] The re1 is GZip compressed to obtain a new byte array re2, and the re2 is stored in the digital steel coil table.
[0061] In view of the real scene of the digital steel coil system, the optimization analysis of the application is as follows:
[0062] The process number is usually represented by a string, and the length is between 5 and 10. Since the process number of steel is limited, for example, hot continuous rolling, pickling, 1# cold rolling mill, 2# cold rolling mill, 1# continuous annealing, 2# continuous annealing, 3# continuous annealing and the like. The process will not be operated for 30 times. A byte (range 0-255) can be used for type storage, which can save 80-90% of space.
[0063] The steel coil number is usually represented by a string, and the length is between 12 and 25. It mainly contains numbers and may contain letters. A hash table is established, and an int (up to 210 million) of four bytes is used to map the steel coil number. Without considering the space of the hash table, this can save 67-84% of space.
[0064] The parameter name is usually represented by a string, and the length is between 5 and 30. For example, rolling force, rotating speed and the like. A short (range -32768-32767) of two bytes can be used for type storage, which can save 60-93% of space.
[0065] The length is usually represented by double, which occupies 8 bytes. Actually, the length of cold rolled strip steel is between 800 and 6000 m, that is, the number range is (0-6000). In the application scene of digital steel coil, the precision of 0.1 m is sufficient, so a ushort (range 0-65535) of two bytes can be used to store the real length by dividing by 10. At this time, 75% of space can be saved.
[0066] The value is usually represented by double, which occupies 8 bytes. A float of four bytes can be used to represent, which can save 50% of space.
[0067] Based on the semi-structured data storage method of the present application, the storage space can be greatly saved. Considering that NoSQL has a flexible data model, it can process unstructured / semi-structured big data. And NoSQL is easy to realize scalability (upward expansion and horizontal expansion), and the price is low. The automatic sharding of NoSQL can easily make a distributed system to ensure the stability and speed of the storage system. Based on the dynamic mode of NoSQL, data can be stored without defining the mode, making the development simple.
[0068] Therefore, it is more optimal to use non-relational data (NoSQL) to store digital steel rolls, which can significantly improve performance. For example, MongoDB or Redis.
[0069] Of course, the present application can also use a traditional relational database (Oracle 20c, SQL Server 2016, MySQL 5.7, PostgreSQL 9.2 and later versions supporting JSON) to store the above semi-structured data, wherein the length and value of the parameter are stored using JSON.
[0070] The present application proposes to store semi-structured data using a relational database, and the key is to store the specific length process information using a JSON field. In a relational database that does not support JSON, the specific length process information can also be stored using a binary stream, i.e., designed as a blob format. For the binary stream, Gzip can be used to compress the binary stream to further reduce the storage space.
[0071] Based on the same inventive concept, the present application also provides a data storage device for a digital steel roll system, comprising a memory for storing a program;
[0072] and a processor for executing the program to implement the steps of the above data storage method.
[0073] It should be understood that the specific order or hierarchy of steps in the disclosed processes are examples of exemplary approaches. Based on design preferences, it should be understood that the specific order or hierarchy of steps in the processes can be rearranged while remaining within the scope of the present disclosure. The accompanying method claims present elements of the various steps in exemplary order, and are not intended to be limited to the specific order or hierarchy presented.
[0074] In the detailed description above, various features are grouped together in single embodiments for the purpose of streamlining the disclosure. This method of disclosure should not be interpreted as reflecting a necessity to disclose features in any single patent. Rather, according to the inventive concept, features can be combined in any single patent in one or more claims. Thus, the disclosure hereof is to be understood as being illustrative of the inventive concept and not a limitation thereof. For example, not every aspect of the creative process is described with every embodiment. It is contemplated that the creative process is a dynamic process that will necessitate implementation of new techniques by those skilled in the art. Those skilled in the art will appreciate that, in the development of this creative process, numerous implementation-specific decisions can be made. These implementation-specific decisions can vary from one implementation to another, and from one environment to another. Those skilled in the art will appreciate that such a development effort might be time-consuming, but that, otherwise, such efforts would not be a contribution to the art of the present disclosure, and would form no part of this disclosure. In this regard, details are not provided hereinafter in order to not unnecessarily obscure the disclosure. Other steps will readily occur to those skilled in the art. In the art and practice contributing to the disclosure, modifications
[0075] Those skilled in the art will further appreciate that the various illustrative logical blocks, modules, circuits, and algorithm steps described in connection with the embodiments disclosed herein can be implemented as electronic hardware, computer software, or combinations of both. To clearly illustrate this interchangeability of hardware and software, various illustrative components, blocks, modules, circuits, and steps have been described above generally in terms of their functionality. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the overall system. Skilled artisans can implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present disclosure.
[0076] The steps of a method or algorithm described in connection with the embodiments disclosed herein can be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module can reside in RAM memory, flash memory, ROM memory, EPROM memory, EEPROM memory, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor such that the processor can read information from, and write information to, the storage medium. In the alternative, the storage medium can be integral to the processor. The processor and the storage medium can reside in an ASIC. The ASIC can reside in a user terminal. In the alternative, the processor and the storage medium can reside as discrete components in a user terminal. The previous description of the disclosure is provided to enable any person skilled in the art to make or use the disclosure. Various modifications to the disclosure will be readily apparent to those skilled in the art, and the generic principles defined herein can be applied to other variations without departing from the scope of the disclosure. For example, one of ordinary skill in the art will immediately appreciate that the disclosure can be implemented in network computing environments with many types of computer system configurations, including, but not limited to, distributed computing environments, multiprocessor systems, microprocessor-based or programmable consumer electronics, networked personal computers, minicomputers, mainframe computers, and the like. The disclosure can also be practiced in distributed computing environments where tasks are performed by local and remote processing
[0077] For a software implementation, the techniques described herein can be implemented with modules (e.g., procedures, functions, and so on) that perform the functions described herein. The software codes can be stored in memory units and executed by processors. The memory unit can be implemented within the processor or external to the processor, in which case it can be communicatively coupled to the processor via various means as is known in the art.
[0078] The above description includes examples of one or more embodiments. Of course, not all possible combinations of components or methods described above can be claimed as an embodiment or employed as described above, but one of ordinary skill in the art will recognize that further modifications and permutations of various embodiments are possible. It is intended to claim all such alterations and modifications to the embodiments described herein as falling within the scope of the appended claims. Additionally, any one of the terms "comprising", "including", and "containing" shall be read expansively and without limitation. None of the terms "including", "comprising", and "containing" and variations thereof as used herein are meant to be construed in an exhaustive sense. That is, "including", "comprising", and "containing" are used to mean "including, but not limited to". Further, any one of the terms "or" and "and" shall be read expansively and without limitation. Only terms clearly indicated to the contrary will be interpreted as for an either / or or as exclusivity.
Claims
1. A data storage method for a digital coil system, characterized by: It comprises the following steps: Set a semi-structured data model for expressing digital coil information, and establish a digital coil table in the database corresponding to the semi-structured data model; the data structure of the semi-structured data model comprises: an ID field, a process number, a coil number, a process parameter number, and detailed information of the process parameter; Establish a process information table in the database, containing two fields, the first field being a process number, and the data type being a number type, and being set as a primary key; the second field being a process number name, and the data type being a string type, and being set as an index; Establish a coil number information table in the database, containing two fields, the first field being a coil number, and the data type being a number type, and being set as a primary key; the second field being a coil number, and the data type being a string type, and being set as an index; Establish a parameter information table in the database, containing two fields, the first field being a parameter number, and the data type being a number type, and being set as a primary key; the second field being a parameter name, and the data type being a string type, and being set as an index; Obtain production information to form a digital coil, the digital coil comprising a process number, a coil number, a process parameter name, and detailed information of a process parameter, assign a unique ID to each digital coil, and store the ID and the digital coil information in the digital coil table, the process information table, the coil number information table, and the parameter information table; According to the production information, obtain a series of lengths and process parameter values at the lengths of a specified process number, a specified coil, and a specified parameter, convert the information into a byte array, and store the byte array as detailed information of the process parameter in the digital coil table, the conversion steps being as follows: Create an empty byte array re1; Iterate through each length, parse it into a byte array, and then append it to re1 in turn; Iterate through the process parameter values at each length, parse them into a byte array, and then append them to re1 in turn; Compress re1 to obtain a new byte array re2, and store re2 in the digital coil table.
2. The data storage method for a digital coil system of claim 1, wherein: The data type of the ID field is int, the data type of the process number is byte, the data type of the coil number is int, and the data type of the process parameter number is short; the data type of the detailed information of the process parameter is a byte array.
3. The data storage method for a digital coil system of claim 1, wherein: Set the ID field as a primary key, set the process number, the coil number, and the process parameter number as indexes; the detailed information of the process parameter is detailed process data of the process number, the coil number, and the process parameter number, and comprises a group of lengths and values corresponding to the lengths.
4. The data storage method for a digital coil system of claim 1, wherein: The process number name is a string, after obtaining the process number name, query the process number name from the process information table, if at least one row of result is queried, return the process number of the first row of result, otherwise, obtain the maximum process number from the process information table, if the process information table is empty, the maximum process number is 0, then add 1 to the maximum process number to form a new process number, insert the new process number and the queried process number name into the process information table, and then return the new process number to the digital coil table for storage.
5. The data storage method for a digital coil system of claim 1, wherein: The steel coil number is a string, after obtaining the steel coil number, the steel coil number information table is queried with the steel coil number, if at least one row of result is queried, the steel coil number number of the first row of result is returned; otherwise, the maximum steel coil number number in the steel coil number information table is obtained, if the steel coil number information table is empty, the maximum steel coil number number is 0, then the maximum steel coil number number is added by 1 to form a new steel coil number number, the new steel coil number number and the queried steel coil number are inserted into the steel coil number information table, and then the new steel coil number number is returned to the digital steel coil table storage.
6. The data storage method for a digital coil system of claim 1, wherein: The parameter name is a string, after obtaining the parameter name, the parameter information table is queried with the parameter name, if at least one row of result is queried, the parameter number of the first row of result is returned; otherwise, the maximum parameter number in the parameter information table is obtained, if the parameter information table is empty, the maximum parameter number is 0, then the maximum parameter number is added by 1 to form a new parameter number, the new parameter number and the queried parameter name are inserted into the parameter information table, and then the new parameter number is returned to the digital steel coil table storage. The database adopts a non-relational database.
7. The data storage method for a digital coil system of claim 1, wherein: The database adopts MongoDB or Redis.
8. The data storage method for a digital coil system of claim 1 or 7, wherein: The data storage method comprises the following steps:
9. A data storage device for a digital coil system, characterized by: The database adopts a non-relational database. The database adopts MongoDB or Redis. The data storage method comprises the following steps: The data storage method comprises the following steps: The data storage method comprises the following steps: The data storage method comprises the following steps: The data storage method comprises the following steps: The data storage method comprises the following steps: The data storage method comprises the following steps: The data storage method comprises the following steps: The data storage method comprises the following steps: The data storage method comprises the following steps: The data storage method comprises the following steps: The data storage method comprises the following steps: The data storage method comprises the following steps: The data storage method comprises the following steps: The data storage method comprises the following steps: The data storage method comprises the following steps: The data storage method comprises the following steps: The data storage method comprises the following steps: The data storage method comprises the following steps: The data storage method comprises the following steps: The data storage method comprises the following steps: The data storage method comprises the following steps: The data storage method comprises the following steps: The data storage method comprises the following steps: The data storage method comprises the following steps: The data storage method comprises the following steps: The data storage method comprises the following steps: The data storage method comprises the following steps: The data storage method comprises the following steps:
Citation Information
Patent Citations
Steel coil tracking method for cold-rolled silicon steel rewinding
CN112989582A
Plant information management device
JP2019101960A