Data storage method and system, terminal and storage medium
By performing type identification and structural analysis of the data collected by the equipment, determining the marking method and performing marking processing, the problem of the inability to quickly confirm the data source during data extraction in the prior art is solved, which improves processing efficiency and reduces the error rate.
Patent Information
- Application Number
- CN202411315853.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-20
- Publication Date
- 2025-01-03
AI Technical Summary
In the prior art, the data collected by the device is stored directly in the database, resulting in the inability to quickly confirm the data source during data extraction, resulting in a long processing time and prone to errors.
By performing type identification and structural analysis of the stored data, determining the data marking method, and marking the data according to the data type, including different marking methods of single data type and batch data type, ensuring that the data is marked before storage.
This enables rapid identification of data sources, improves processing efficiency and reduces the possibility of data errors.
Smart Images

Figure CN119248779A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a data storage method, system, terminal and computer-readable storage medium. Background Art
[0002] As more and more business scenarios are created, more and more data is generated. In order to prevent data loss, the generated data needs to be stored in the corresponding database. However, the database stores a variety of data. If the data in the database needs to be extracted later, the source of the data needs to be analyzed, so as to extract the corresponding data based on the source of the data.
[0003] At present, in the prior art, the data collected by the equipment is directly stored in the database. When data extraction is required, the data source cannot be quickly confirmed, resulting in a long processing time, low processing efficiency, and prone to errors.
[0004] Therefore, the prior art still needs to be improved and developed. Summary of the invention
[0005] The main purpose of the present invention is to provide a data storage method, system, terminal and storage medium, aiming to solve the problem in the prior art that the data collected by the device is directly stored in the database, and when data extraction is required, the source of the data cannot be quickly confirmed, resulting in a long processing time, low processing efficiency, and easy errors.
[0006] To achieve the above object, the present invention provides a data storage method, which comprises the following steps:
[0007] Acquire the data to be stored collected by the target device, identify and process the type of the data to be stored to obtain the target data type, and determine the data marking method according to the target data type;
[0008] The data to be stored is marked according to the data marking method to obtain target storage data, and the target storage data is stored in a corresponding database.
[0009] Optionally, the data storage method, wherein the step of acquiring the data to be stored collected by the target device, identifying the type of the data to be stored to obtain a target data type, and determining a data labeling method according to the target data type, specifically includes:
[0010] Acquire the data to be stored collected by the target device, and perform structural analysis on the data to be stored to obtain corresponding analysis results;
[0011] Matching the data type of the data to be stored according to the analysis result to obtain a target data type, wherein the data type includes a single data type and a batch data type;
[0012] If the target data type is a single data type, calling a first marking method, and using the first marking method as a data marking method for the data to be stored;
[0013] If the target data type is a batch data type, a second marking method is called and the second marking method is used as a data standard-reaching method for the stored data.
[0014] Optionally, in the data storage method, the first labeling method includes first device node information, first software version number, first database summary information, storage timestamp, first device location information and first label summary information.
[0015] Optionally, in the data storage method, the second labeling method includes second device node information, second software version number, second database summary information, data last update time, second device location information and second label summary information.
[0016] Optionally, the data storage method, wherein if the data marking method of the data to be stored is the first marking method, marking the data to be stored according to the data marking method to obtain target storage data, and storing the target storage data in a corresponding database, specifically includes:
[0017] Acquire the field position of the data to be stored, wherein the field position includes the data head end and the data end;
[0018] The data to be stored is marked at the field position by the first marking method to obtain target storage data, and the target storage data is stored in a corresponding database.
[0019] Optionally, the data storage method, wherein if the data marking method of the data to be stored is the second marking method, marking the data to be stored according to the data marking method to obtain target storage data, and storing the target storage data in a corresponding database, specifically includes:
[0020] Integrate the data to be stored to obtain target data to be stored, and obtain the marking position of the target data to be stored;
[0021] The target data to be stored is marked at the marking position by the second marking method to obtain target storage data, and the target storage data is stored in a corresponding database.
[0022] Optionally, the data storage method, wherein the data to be stored is marked according to the data marking method to obtain target storage data, and the target storage data is stored in a corresponding database, and then further includes:
[0023] If a data retrieval instruction is detected, the data retrieval instruction is analyzed and processed to obtain an instruction analysis result, the database is marked and matched according to the instruction analysis result to obtain a matching result, and the corresponding target data is retrieved according to the matching result.
[0024] Optionally, in the data storage method, the data storage system comprises:
[0025] A data analysis module is used to obtain the data to be stored collected by the target device, identify the type of the data to be stored, obtain the target data type, and determine the data marking method according to the target data type;
[0026] The data marking module is used to mark the data to be stored according to the data marking method to obtain target storage data, and store the target storage data in a corresponding database.
[0027] In addition, to achieve the above-mentioned purpose, the present invention also provides a terminal, wherein the terminal includes: a memory, a processor, and a data storage program stored in the memory and executable on the processor, and when the data storage program is executed by the processor, the steps of the data storage method described above are implemented.
[0028] In addition, to achieve the above-mentioned purpose, the present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a data storage program, and when the data storage program is executed by a processor, the steps of the data storage method as described above are implemented.
[0029] In the present invention, the data to be stored collected by the target device is obtained, the type of the data to be stored is identified and processed to obtain the target data type, and the data labeling method is determined according to the target data type; the data to be stored is labeled according to the data labeling method to obtain the target storage data, and the target storage data is stored in the corresponding database. The present invention labels the data to be stored and stores it in the corresponding database after processing, so that the source of the data can be quickly confirmed to improve processing efficiency and reduce errors. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1 is a flow chart of a preferred embodiment of the data storage method of the present invention;
[0031] Figure 2 It is a structural diagram of a preferred embodiment of the data storage system of the present invention;
[0032] Figure 3 It is a schematic diagram of the operating environment of a preferred embodiment of the terminal of the present invention. DETAILED DESCRIPTION
[0033] In order to make the purpose, technical solution and advantages of the present invention clearer and more specific, the present invention is further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0034] It should be noted that if the embodiments of the present invention involve directional indications (such as up, down, left, right, front, back, etc.), the directional indications are only used to explain the relative position relationship, movement status, etc. between the components under a certain specific posture (as shown in the accompanying drawings). If the specific posture changes, the directional indication will also change accordingly.
[0035] In addition, if there are descriptions involving "first", "second", etc. in the embodiments of the present invention, the descriptions of "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or suggesting their relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the ability of ordinary technicians in the field to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such a combination of technical solutions does not exist and is not within the scope of protection required by the present invention.
[0036] The data storage method described in the preferred embodiment of the present invention is as follows: Figure 1 As shown, the data storage method includes the following steps:
[0037] Step S10: Acquire the data to be stored collected by the target device, identify the type of the data to be stored to obtain a target data type, and determine a data marking method according to the target data type.
[0038] The step S10 comprises:
[0039] Step S11, acquiring the data to be stored collected by the target device, and performing structural analysis on the data to be stored to obtain corresponding analysis results;
[0040] Step S12: matching the data type of the data to be stored according to the analysis result to obtain a target data type, wherein the data type includes a single data type and a batch data type;
[0041] Step S13: encrypting the file to be shared according to the ciphertext and the target key to obtain a target shared file;
[0042] Step S14: If the target data type is a batch data type, a second marking method is retrieved and used as a data standard-compliant method for the stored data.
[0043] Specifically, as more and more business scenarios are created, more and more data is generated. In order to prevent data loss, the generated data needs to be stored in a corresponding database. However, the database stores a variety of data. If the data in the database needs to be extracted later, the source of the data needs to be analyzed, so as to extract the corresponding data according to the source of the data. In the prior art, the data collected by the device is directly stored in the database. When data extraction is required, the source of the data cannot be quickly confirmed, resulting in a long processing time, low processing efficiency, and easy errors. A data storage method proposed in the present invention performs corresponding marking processing on the data before storing the corresponding data in the database to realize the confirmation of the data source, thereby improving processing efficiency and reducing data errors. The specific processing process is to obtain the data to be stored collected by the target device, and perform structural analysis on the data to be stored to obtain the corresponding analysis result; the data type of the data to be stored is matched according to the analysis result to obtain the target data type, wherein the data type includes a single data type and a batch data type; the single data type refers to the type of the data to be stored is a type of only a single data, and the batch data type refers to the type of the data to be stored is a type including multiple data.
[0044] After obtaining the target data type of the data to be stored, it is necessary to determine the corresponding marking method according to the target data type, wherein the identifier used by the marking method is a DSC (Data Security Context) data identifier, and the structure of the DSC data identifier includes device, operation, data, time and location; if the target data type is a single data type, the first marking method is called, and the first marking method is used as the data marking method for the data to be stored; wherein the first marking method includes first device node information, first software version number, first database summary information, storage timestamp, first device location information and first label summary information; if the target data type is a batch data type, the second marking method is called, and the second marking method is used as the data compliance method for the stored data, wherein the second marking method includes second device node information, second software version number, second database summary information, data last updated time, second device location information and second label summary information.
[0045] Step S20: marking the data to be stored according to the data marking method to obtain target storage data, and storing the target storage data in a corresponding database.
[0046] Specifically, in an embodiment of the present invention, when a corresponding compliance method is determined according to the target data type of the data to be stored, that is, if the target data type is a single data type, the first marking method is used as the data marking method of the data to be stored; if the target data type is a batch data type, the second marking method is used as the data compliance method of the stored data, and then the data to be stored needs to be marked. The specific marking process is: if the data marking method of the data to be stored is the first marking method, the field position of the data to be stored is obtained, wherein the field position includes the data head and the data end; the data to be stored is marked at the field position by the first marking method, for example, the data to be stored is marked at the data end according to the first marking method to obtain the target storage data, for example , the structure of the target storage data is data to be stored, first device node information, first software version number, first database summary information, storage timestamp, first device location information and first label summary information, and the target storage data is stored in the corresponding database; if the data marking method of the data to be stored is the second marking method, the data to be stored is integrated and processed to obtain the target data to be stored, and the marking position of the target data to be stored is obtained; the target data to be stored is marked at the marking position by the second marking method to obtain the target storage data, for example, the structure of the target storage data is data to be stored, second device node information, second software version number, second database summary information, data last update time, second device location information and second label summary information, and the target storage data is stored in the corresponding database. The present invention marks the data to be stored, and stores it in the corresponding database after the processing is completed, so that the source of the data can be quickly confirmed to improve processing efficiency and reduce errors.
[0047] Furthermore, in an embodiment of the present invention, after marking the data to be stored according to the data marking method to obtain target storage data, and storing the target storage data in a corresponding database, it also includes: if a data retrieval instruction is detected, the data retrieval instruction is analyzed and processed to obtain an instruction analysis result, wherein the purpose of obtaining the instruction analysis result is to subsequently match the tag of the data stored in the database, so as to quickly confirm the source of the data, so as to accurately extract the corresponding data; thereafter, the database is marked and matched according to the instruction analysis result to obtain a matching result, for example, the matching result is a tag of the first marking method, namely, the first device node information, the first software version number, the first database summary information, the storage timestamp, the first device location information and the first label summary information; after obtaining the corresponding matching result, the corresponding target data is retrieved according to the matching result, for example, the structure of the target data is the data to be stored, the first device node information, the first software version number, the first database summary information, the storage timestamp, the first device location information and the first label summary information.
[0048] Furthermore, if Figure 2 As shown, based on the above data storage method, the present invention also provides a data storage system accordingly, and the data storage system includes:
[0049] The data analysis module 51 is used to obtain the data to be stored collected by the target device, identify the type of the data to be stored, obtain the target data type, and determine the data marking method according to the target data type;
[0050] The data marking module 52 is used to mark the data to be stored according to the data marking method to obtain target storage data, and store the target storage data in a corresponding database.
[0051] Furthermore, if Figure 3 As shown, based on the above data storage method, the present invention also provides a terminal, which includes a processor 10, a memory 20 and a display 30. Figure 3 Only some components of the terminal are shown, but it should be understood that it is not required to implement all of the components shown, and more or fewer components may be implemented instead.
[0052] The memory 20 may be an internal storage unit of the terminal in some embodiments, such as a hard disk or memory of the terminal. The memory 20 may also be an external storage device of the terminal in other embodiments, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (SecureDigital, SD) card, a flash card (Flash Card), etc. equipped on the terminal. Further, the memory 20 may also include both an internal storage unit of the terminal and an external storage device. The memory 20 is used to store application software and various types of data installed in the terminal, such as the program code of the installation terminal, etc. The memory 20 may also be used to temporarily store data that has been output or is to be output. In one embodiment, a data storage program 40 is stored on the memory 20, and the data storage program 40 may be executed by the processor 10, thereby realizing the data storage method in the present application.
[0053] In some embodiments, the processor 10 may be a central processing unit (CPU), a microprocessor or other data processing chip, configured to run program codes stored in the memory 20 or process data, such as executing a data storage method.
[0054] In some embodiments, the display 30 may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, etc. The display 30 is used to display information on the terminal and to display a visual user interface. The components 10-30 of the terminal communicate with each other via a system bus.
[0055] In one embodiment, when the processor 10 executes the data storage program 40 in the memory 20, the following steps are implemented:
[0056] Acquire the data to be stored collected by the target device, identify and process the type of the data to be stored to obtain the target data type, and determine the data marking method according to the target data type;
[0057] The data to be stored is marked according to the data marking method to obtain target storage data, and the target storage data is stored in a corresponding database.
[0058] The step of acquiring the data to be stored collected by the target device, identifying the type of the data to be stored to obtain the target data type, and determining the data marking method according to the target data type specifically includes:
[0059] Acquire the data to be stored collected by the target device, and perform structural analysis on the data to be stored to obtain corresponding analysis results;
[0060] Matching the data type of the data to be stored according to the analysis result to obtain a target data type, wherein the data type includes a single data type and a batch data type;
[0061] If the target data type is a single data type, calling a first marking method, and using the first marking method as a data marking method for the data to be stored;
[0062] If the target data type is a batch data type, a second marking method is called and the second marking method is used as a data standard-reaching method for the stored data.
[0063] The first marking method includes first device node information, first software version number, first database summary information, storage timestamp, first device location information and first label summary information.
[0064] The second marking method includes second device node information, second software version number, second database summary information, data last update time, second device location information and second label summary information.
[0065] Among them, if the data marking method of the data to be stored is the first marking method, marking the data to be stored according to the data marking method to obtain target storage data, and storing the target storage data in the corresponding database specifically includes:
[0066] Acquire the field position of the data to be stored, wherein the field position includes the data head end and the data end;
[0067] The data to be stored is marked at the field position by the first marking method to obtain target storage data, and the target storage data is stored in a corresponding database.
[0068] Among them, if the data marking method of the data to be stored is the second marking method, marking the data to be stored according to the data marking method to obtain target storage data, and storing the target storage data in the corresponding database specifically includes:
[0069] Integrate the data to be stored to obtain target data to be stored, and obtain the marking position of the target data to be stored;
[0070] The target data to be stored is marked at the marking position by the second marking method to obtain target storage data, and the target storage data is stored in a corresponding database.
[0071] The method further includes marking the data to be stored according to the data marking method to obtain target storage data, and storing the target storage data in a corresponding database, and then:
[0072] If a data retrieval instruction is detected, the data retrieval instruction is analyzed and processed to obtain an instruction analysis result, the database is marked and matched according to the instruction analysis result to obtain a matching result, and the corresponding target data is retrieved according to the matching result.
[0073] The present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a data storage program, and when the data storage program is executed by a processor, the steps of the data storage method described above are implemented.
[0074] It should be noted that, in this article, the terms "include", "comprises" or any other variations 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, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0075] Of course, those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing related hardware (such as a processor, a controller, etc.) through a computer program, and the program can be stored in a computer-readable storage medium that can be read by a computer, and the program can include the processes of the above-mentioned method embodiments when executed. The computer-readable storage medium can be a memory, a disk, an optical disk, etc.
[0076] It should be understood that the application of the present invention is not limited to the above examples. For ordinary technicians in this field, improvements or changes can be made based on the above description. All these improvements and changes should fall within the scope of protection of the claims attached to the present invention.
Claims
1. A data storage method, characterized in that: The data storage method includes: Acquire the data to be stored collected by the target device, identify the type of the data to be stored, obtain the target data type, and determine the data marking method according to the target data type; The data to be stored is marked according to the data marking method to obtain target storage data, and the target storage data is stored in a corresponding database.
2. The data storage method according to claim 1, characterized in that: The acquiring of the data to be stored collected by the target device, identifying and processing the type of the data to be stored to obtain a target data type, and determining a data labeling method according to the target data type specifically includes: Acquire the data to be stored collected by the target device, and perform structural analysis on the data to be stored to obtain corresponding analysis results; Matching the data type of the data to be stored according to the analysis result to obtain a target data type, wherein the data type includes a single data type and a batch data type; If the target data type is a single data type, calling a first marking method, and using the first marking method as a data marking method for the data to be stored; If the target data type is a batch data type, a second marking method is called and the second marking method is used as a data standard-reaching method for the stored data.
3. The data storage method according to claim 2, characterized in that: The first labeling method includes first device node information, first software version number, first database summary information, storage timestamp, first device location information and first label summary information.
4. The data storage method according to claim 2, characterized in that: The second labeling method includes second device node information, second software version number, second database summary information, data last update time, second device location information and second label summary information.
5. The data storage method according to claim 3, characterized in that: If the data marking method of the data to be stored is the first marking method, marking the data to be stored according to the data marking method to obtain target storage data, and storing the target storage data in a corresponding database specifically includes: Acquire the field position of the data to be stored, wherein the field position includes the data head end and the data end; The data to be stored is marked at the field position by the first marking method to obtain target storage data, and the target storage data is stored in a corresponding database.
6. The data storage method according to claim 4, characterized in that: If the data marking method of the data to be stored is the second marking method, marking the data to be stored according to the data marking method to obtain target storage data, and storing the target storage data in a corresponding database specifically includes: Integrate the data to be stored to obtain target data to be stored, and obtain the marking position of the target data to be stored; The target data to be stored is marked at the marking position by the second marking method to obtain target storage data, and the target storage data is stored in a corresponding database.
7. The data storage method according to claim 1, characterized in that: The method further comprises: marking the data to be stored according to the data marking method to obtain target storage data, and storing the target storage data in a corresponding database; and then: If a data retrieval instruction is detected, the data retrieval instruction is analyzed and processed to obtain an instruction analysis result, the database is marked and matched according to the instruction analysis result to obtain a matching result, and the corresponding target data is retrieved according to the matching result.
8. A data storage system, characterized in that: The data storage system includes: A data analysis module is used to obtain the data to be stored collected by the target device, identify the type of the data to be stored, obtain the target data type, and determine the data marking method according to the target data type; The data marking module is used to mark the data to be stored according to the data marking method to obtain target storage data, and store the target storage data in a corresponding database.
9. A terminal, characterized in that: The terminal includes a memory, a processor, and a data storage program stored in the memory and executable on the processor. When the data storage program is executed by the processor, the steps of the data storage method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and the computer-readable storage medium stores a data storage program, and when the data storage program is executed by a processor, the steps of the data storage method according to any one of claims 1 to 7 are implemented.
