A data storage method, system, and readable storage medium
The data storage method uses sliding character windows and gap character associations to secure data by obscuring its structure, preventing data leaks from simple encryption-based storage methods.
Patent Information
- Application Number
- CN202210991193.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-18
- Publication Date
- 2025-07-15
- Estimated Expiration
- 2042-08-18
AI Technical Summary
In the prior art, data information characters are encrypted and stored in segments, and there is a risk of data leakage. Intruders can obtain complete data by splicing character segments.
The first character window is randomly sliding the data information string to form the box-selected and unboxed character segments, and is associated with the preset interval character segments to form the target data information string; then slide through the second character window to store segments in a small distance.
Even if the intruder forces decryption, it is impossible to splice data according to the semantics of the character segments, which improves the confidentiality of the data and realizes secure segmented storage.
Smart Images

Figure CN115344877B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of data storage, and in particular relates to a data storage method, system, and readable storage medium. Background Art
[0002] With the accelerating progress of social informatization, more and more enterprises conduct office work through information technologies such as the Internet. Whether it is between departments within an enterprise or between an enterprise and external parties, a large amount of file data will be generated during the process of office work through information technologies. Some of these file data are extremely important and need to be stored for a long time.
[0003] In existing data storage, data information characters are often simply segmented and encrypted for storage. In this way, after an intruder forcibly decrypts each data information character segment, they can splice the required data information character segments according to the semantics of each data information character segment to obtain the entire string of data information characters, thus posing a risk of data leakage. Summary of the Invention
[0004] Based on this, the purpose of the present invention is to provide a data storage method, system, and readable storage medium to solve the technical problem in the prior art that storing data after segmenting and encrypting data information characters leads to insecure data storage.
[0005] A data storage method according to an embodiment of the present invention includes:
[0006] Obtain a data set, where the data set contains at least one data information string;
[0007] Determine whether the length of the at least one data information string exceeds a preset length;
[0008] If the length of the at least one data information string exceeds the preset length, slide a preset first character window to frame the data information characters in the at least one data information string, obtaining at least one framed data information character segment and at least one unframed data information character segment, where the sliding rule of the first character window is that the sliding distance of the first character window is random and the sliding distance is greater than the length of the first character window;
[0009] Associate the at least one unframed data information character segment with a preset interval character segment, and splice the preset interval character segment with the at least one framed data information character segment based on the positional relationship between the at least one framed data information character segment and the at least one unframed data information character segment to form at least one target data information string;
[0010] Selectively highlight at least one target data information character segment from the obtained at least one target data information string based on a preset second character window, where the sliding rule of the second character window is that the sliding distance of the second character window is less than the length of the second character window;
[0011] Store the at least one target data information character segment in a target memory.
[0012] In addition, according to a data storage method of the above embodiment of the present invention, the following additional technical features may also be included:
[0013] Further, after determining whether the length of the at least one data information string exceeds a preset length, the method further includes:
[0014] If the length of the at least one data information string does not exceed the preset length, insert a preset interval character at any position of the at least one data information string until the length of the at least one data information string exceeds the preset length.
[0015] Further, the length of the preset character window is less than the preset length.
[0016] Further, the associating the at least one unselected data information character segment with a preset interval character segment includes:
[0017] Obtain a preset interval character segment, where the length of the preset interval character segment is equal to the length of the at least one unselected data information character segment;
[0018] Associate the at least one unselected data information character segment with the preset interval character segment based on a preset association relationship.
[0019] Further, the storing the at least one target data information character segment in a target memory includes:
[0020] Obtain an identifier of the at least one target data information character segment;
[0021] Based on the identifier of the at least one target data information character segment, store the at least one target data information character segment in a target memory.
[0022] According to an embodiment of the present invention, a data storage system includes:
[0023] An acquisition module configured to acquire a data set, where the data set includes at least one data information string;
[0024] A judgment module configured to judge whether the length of the at least one data information string exceeds a preset length;
[0025] A first box selection module, configured to, if the length of the at least one data information string exceeds a preset length, slide a preset first character window to box the data information characters in the at least one data information string, so as to obtain at least one boxed data information character segment and at least one unboxed data information character segment, wherein the sliding rule of the first character window is that the sliding distance of the first character window is random and the sliding distance is greater than the length of the first character window;
[0026] A splicing module, configured to associate at least one unboxed data information character segment with a preset interval character segment, and splice the preset interval character segment with at least one boxed data information character segment based on the positional relationship between at least one boxed data information character segment and at least one unboxed data information character segment, so as to form at least one target data information string;
[0027] A second box selection module, configured to box the obtained at least one target data information string based on a preset second character window, so as to obtain at least one boxed target data information character segment, wherein the sliding rule of the second character window is that the sliding distance of the second character window is less than the length of the second character window;
[0028] A storage module, configured to store the at least one target data information character segment in a target memory.
[0029] The present invention further provides an electronic device, which includes: at least one processor, and a memory communicatively connected to the at least one processor, wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor, so that the at least one processor can execute the data storage method according to any embodiment of the present invention.
[0030] The present invention further proposes a computer-readable storage medium, on which a computer program is stored, and the computer program includes program instructions, and when the program instructions are executed by a computer, the computer is enabled to execute the data storage method according to any embodiment of the present invention.
[0031] The data storage method, system, and readable storage medium of the present application use a first character window to select a data information string exceeding a preset length, obtaining a selected data information character segment and an unselected data information character segment, and replacing the unselected data information character segment with a preset interval character segment, so that the preset interval character segment and the selected data information character segment are re - spliced to form a target data information string. This realizes that even if an intruder forcibly decrypts each data information character segment, they cannot splice the required data information character segments according to the semantics of each data information character segment, effectively improving the confidentiality effect of the data information string. Moreover, by using a second character window to select the target data information string, the purpose of segmented storage of the target data information string is achieved, solving the problem of insecure data storage caused by segmented encryption and storage of data information characters. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for description in the embodiments will be briefly introduced below. Obviously, the accompanying drawings in the following description are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0033] Figure 1 It is a flowchart of a data storage method provided by an embodiment of the present invention;
[0034] Figure 2 It is a schematic diagram of the first character window sliding on the data information string provided by a specific embodiment of the present invention;
[0035] Figure 3 It is a schematic diagram of the second character window sliding on the target data information string provided by a specific embodiment of the present invention;
[0036] Figure 4 It is a structural block diagram of a data storage system provided by an embodiment of the present invention;
[0037] Figure 5 It is a schematic structural diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0038] To facilitate understanding of the present invention, the present invention will be described more comprehensively below with reference to the relevant accompanying drawings. Several embodiments of the present invention are given in the accompanying drawings. However, the present invention can be implemented in many different forms and is not limited to the embodiments described herein. On the contrary, the purpose of providing these embodiments is to make the disclosure of the present invention more thorough and comprehensive.
[0039] Please refer to Figure 1, which shows a flowchart of a data storage method provided by an embodiment of the present invention.
[0040] As Figure 1 shown, the data storage method includes steps S01 to S06.
[0041] Step S01, obtain a data set, where the data set contains at least one data information string.
[0042] Step S02, determine whether the length of the at least one data information string exceeds a preset length.
[0043] In specific implementation, by determining whether the length of the at least one data information string exceeds the preset length, it is possible to pre-determine whether the length of the at least one data information string to be processed is suitable for subsequent operations. When the length of the at least one data information string to be processed is less than the preset length, it means that the length of the at least one data information string to be processed is too short, so that the subsequent sliding of the preset first character window cannot selectively frame the at least one data information string to be processed. For example: the length of a certain data information string to be processed is 5 bytes, and the set preset length is 10 bytes. If a first character window with a length of 6 bytes is directly used to frame the 5-byte data information string, then the data information string will be completely framed by the first character window at the first time, and the unframed data information character segment cannot be obtained.
[0044] It should be noted that the length of the first character window is randomly set and its length is less than the preset length. However, when the length of the first character window is too short, it will increase the amount of data to be processed subsequently. Therefore, in order to improve the efficiency of data processing, the length of the first character window should not be set too short.
[0045] Specifically, for the case where the length of the data information string does not exceed the preset length, the method adopted in this embodiment is: if the length of the at least one data information string does not exceed the preset length, then insert a preset interval character at any position of the at least one data information string until the length of the at least one data information string exceeds the preset length.
[0046] Step S03, if the length of the at least one data information string exceeds the preset length, then slide the preset first character window to frame the data information characters in the at least one data information string, and obtain at least one framed data information character segment and at least one unframed data information character segment.
[0047] In specific implementation, the sliding rule of the first character window is that the sliding distance of the first character window is random and the sliding distance is greater than the length of the first character window.
[0048] Specifically, by adopting the method of randomly sliding the first character window, when the first character window frames the data information string, unframed data information character segments with inconsistent lengths and framed data information character segments with consistent lengths can be obtained, achieving the purpose of irregular segmentation of the data information string.
[0049] In a specific embodiment, as Figure 2 shown, a first character window with a length of 4 bytes slides on a certain data information string to be processed. The sliding distance for the first time is 7 bytes, the sliding distance for the second time is 8 bytes, and the sliding distance for the third time is 9 bytes, so as to obtain unframed data information character segments with different lengths.
[0050] Step S04: Associate at least one unframed data information character segment with a preset interval character segment, and splice the preset interval character segment with at least one framed data information character segment based on the positional relationship between at least one framed data information character segment and at least one unframed data information character segment to form at least one target data information string.
[0051] In specific implementation, obtain a preset interval character segment, where the length of the preset interval character segment is equal to the length of at least one unframed data information character segment, and associate at least one unframed data information character segment with the preset interval character segment based on a preset association relationship.
[0052] It should be noted that obtaining the preset interval character segment includes: obtaining a first random number, setting the number of bytes of the first preset interval character segment according to the first random number; obtaining a second random number, setting the number of bytes of the second preset interval character segment according to the second random number; obtaining a current timestamp character segment, and calculating the current bit value of each byte of the preset interval character segment according to the current timestamp character segment; where the current bit value of each byte of the preset interval character segment is the current bit value of each byte of the first preset interval character segment or the current bit value of each byte of the second preset interval character segment; generating a first preset interval character segment according to the number of bytes of the first preset interval character segment and the current bit value of each byte thereof; generating a second preset interval character segment according to the number of bytes of the second preset interval character segment and the current bit value of each byte thereof; and obtaining the preset interval character segment according to the first preset interval character segment and the second preset interval character segment.
[0053] Specifically, perform a unique relationship mapping between the generated preset interval field and at least one unframed data information character segment, so as to associate at least one unframed data information character segment with the preset interval character segment.
[0054] Step S05: Based on a preset second character window, perform box selection on the obtained at least one target data information string to obtain at least one target data information character segment selected by the box.
[0055] In specific implementation, the sliding rule of the second character window is that the sliding distance of the second character window is less than the length of the second character window.
[0056] It should be noted that by sliding the second character window with the sliding rule that the sliding distance of the second character window is less than the length of the second character window, the characters in a certain target data information character segment are partially repeated with the characters in the previous target data information character segment, so that the user can conveniently reorganize the split target data information character segments only according to the repeated characters in the subsequent process.
[0057] In a specific embodiment, as Figure 3 shown, a second character window with a length of 4 bytes is slid on a certain target data string to be processed, and the sliding distance each time is 3 bytes, so that the first character of the current target data string is repeated with the last character of the previous target data string.
[0058] Step S06: Store the at least one target data information character segment in a target memory.
[0059] In specific implementation, obtain the identifier of the at least one target data information character segment, and based on the identifier of the at least one target data information character segment, store the at least one target data information character segment in the target memory.
[0060] In summary, the method of the present application uses a first character window to perform box selection on a data information string exceeding a preset length to obtain a data information character segment selected by the box and a data information character segment not selected by the box, and replaces the data information character segment not selected by the box with a preset interval character segment, and splices the preset interval character segment and the data information character segment selected by the box to form a target data information string, realizing that even if an intruder performs forced decryption on each data information character segment, the required data information character segments cannot be spliced according to the semantics of each data information character segment, effectively improving the confidentiality effect of the data information string, and by using a second character window to perform box selection on the target data information string, the purpose of segmented storage of the target data information string is realized, and the problem of insecure data storage caused by segmented encryption of data information characters and then storage is solved.
[0061] Please refer to Figure 4 , which shows a structural block diagram of a data storage system of the present application.
[0062] As Figure 4As shown, the data storage system 10 includes:
[0063] An acquisition module 11, configured to acquire a data set, where the data set contains at least one data information string;
[0064] A judgment module 12, configured to judge whether the length of the at least one data information string exceeds a preset length;
[0065] A first selection module 13, configured to, if the length of the at least one data information string exceeds the preset length, slide a preset first character window to select data information characters in the at least one data information string, obtaining at least one selected data information character segment and at least one unselected data information character segment, where the sliding rule of the first character window is that the sliding distance of the first character window is random and the sliding distance is greater than the length of the first character window;
[0066] A splicing module 14, configured to associate at least one unselected data information character segment with a preset interval character segment, and splice the preset interval character segment with the at least one selected data information character segment based on the positional relationship between the at least one selected data information character segment and the at least one unselected data information character segment, forming at least one target data information string;
[0067] A second selection module 15, configured to select the at least one obtained target data information string based on a preset second character window, obtaining at least one selected target data information character segment, where the sliding rule of the second character window is that the sliding distance of the second character window is less than the length of the second character window;
[0068] A storage module 16, configured to store the at least one target data information character segment in a target memory.
[0069] It should be understood that Figure 4 the modules described in Figure 1 correspond to the respective steps in the method described with reference to Figure 4 Thus, the operations, features, and corresponding technical effects described above for the method also apply to
[0070] In some other embodiments, the embodiments of the present invention further provide a computer-readable storage medium, on which a computer program is stored. When the program instructions are executed by a processor, the processor is caused to execute the surgical instrument inventory method in any of the above method embodiments;
[0071] As an implementation manner, the computer-readable storage medium of the present invention stores computer-executable instructions, and the computer-executable instructions are set as:
[0072] Obtain a data set, where the data set contains at least one data information string;
[0073] Judge whether the length of the at least one data information string exceeds a preset length;
[0074] If the length of the at least one data information string exceeds the preset length, slide a preset first character window to frame the data information characters in the at least one data information string, and obtain at least one framed data information character segment and at least one unframed data information character segment, where the sliding rule of the first character window is that the sliding distance of the first character window is random and the sliding distance is greater than the length of the first character window;
[0075] Associate at least one unframed data information character segment with a preset interval character segment, and splice the preset interval character segment with at least one framed data information character segment based on the positional relationship between at least one framed data information character segment and at least one unframed data information character segment to form at least one target data information string;
[0076] Based on a preset second character window, frame the at least one obtained target data information string to obtain at least one framed target data information character segment, where the sliding rule of the second character window is that the sliding distance of the second character window is less than the length of the second character window;
[0077] Store the at least one target data information character segment in a target memory.
[0078] A computer-readable storage medium may include a storage program area and a storage data area. Among them, the storage program area can store an operating system and application programs required for at least one function; the storage data area can store data created according to the use of the surgical instrument inventory device, etc. In addition, the computer-readable storage medium may include high-speed random access memory, and may also include memories, such as at least one magnetic disk storage device, a flash memory device, or other non-volatile solid-state storage devices. In some embodiments, the computer-readable storage medium may optionally include a memory remotely provided with respect to the processor, and these remote memories can be connected to the surgical instrument inventory device through a network. Examples of the above network include but are not limited to the Internet, an enterprise intranet, a local area network, a mobile communication network, and combinations thereof.
[0079] Figure 5 It is a schematic structural diagram of an electronic device provided by an embodiment of the present invention, as Figure 5As shown in the figure, the device includes: a processor 21 and a memory 22. The electronic device may further include: an input device 23 and an output device 24. The processor 21, the memory 22, the input device 23, and the output device 24 may be connected through a bus or other means. Figure 5 Taking the connection through the bus as an example. The memory 22 is the above-mentioned computer-readable storage medium. The processor 21 executes various functional applications and data processing of the server by running non-volatile software programs, instructions, and modules stored in the memory 22, that is, implements the surgical instrument inventory method in the above method embodiment. The input device 23 can receive input digital or character information, and generate key signal inputs related to user settings and function controls of the surgical instrument inventory device. The output device 24 may include display devices such as a display screen.
[0080] The above electronic device can execute the method provided by the embodiment of the present invention, and has corresponding functional modules and beneficial effects for executing the method. For technical details not described in detail in this embodiment, reference can be made to the method provided by the embodiment of the present invention.
[0081] As an implementation manner, the above electronic device is applied to a surgical instrument inventory device and is used for a client, including: at least one processor; and a memory communicatively connected to the at least one processor; wherein, the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to:
[0082] Obtain a data set, where the data set contains at least one data information string;
[0083] Judge whether the length of the at least one data information string exceeds a preset length;
[0084] If the length of the at least one data information string exceeds the preset length, slide a preset first character window to frame the data information characters in the at least one data information string, and obtain at least one framed data information character segment and at least one unframed data information character segment, where the sliding rule of the first character window is that the sliding distance of the first character window is random and the sliding distance is greater than the length of the first character window;
[0085] Associate the at least one unframed data information character segment with a preset interval character segment, and splice the preset interval character segment with the at least one framed data information character segment based on the positional relationship between the at least one framed data information character segment and the at least one unframed data information character segment to form at least one target data information string;
[0086] Performing a box selection on the obtained at least one target data information string based on a preset second character window to obtain at least one target data information character segment selected by the box, wherein the sliding rule of the second character window is that the sliding distance of the second character window is less than the length of the second character window;
[0087] Storing the at least one target data information character segment in a target memory.
[0088] Those skilled in the art can understand that the logic and / or steps represented in the flowchart or described in other ways herein, for example, can be considered as a definite sequence list of executable instructions for implementing logical functions, and can be specifically implemented in any computer-readable medium for use by an instruction execution system, apparatus, or device (such as a computer-based system, a system including a processor, or other systems that can fetch and execute instructions from the instruction execution system, apparatus, or device), or used in combination with these instruction execution systems, apparatus, or devices. For the purposes of this specification, a "computer-readable medium" can be any device that can contain, store, communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
[0089] More specific examples (non-exhaustive list) of computer-readable media include the following: an electrical connection portion (electronic device) having one or more wirings, a portable computer disk cartridge (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory
[0090] (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, a computer-readable medium can even be paper or other suitable media on which the program can be printed, because the program can be obtained electronically, for example, by optically scanning the paper or other media, followed by editing, interpretation, or other suitable processing as necessary, and then stored in a computer memory.
[0091] It should be understood that various parts of the present invention can be implemented by hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, any one or a combination of the following techniques well known in the art can be used: discrete logic circuits having logic gate circuits for implementing logical functions on data signals, application-specific integrated circuits having suitable combinational logic gate circuits, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.
[0092] In the description of this specification, the descriptions referring to terms such as "one embodiment", "some embodiments", "examples", "specific examples", or "some examples", etc., mean that the specific features, structures, materials, or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described can be combined in a suitable manner in any one or more embodiments or examples.
[0093] The above-described embodiments merely represent several implementation manners of the present invention. The descriptions thereof are relatively specific and detailed, but should not be construed as a limitation on the scope of the patent for the present invention. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present invention, several modifications and improvements can still be made, and these all belong to the protection scope of the present invention. Therefore, the protection scope of the patent for the present invention shall be subject to the appended claims.
Claims
1. A data storage method, characterized in that, Comprising: Obtain a data set, where the data set contains at least one data information string; Determine whether the length of the at least one data information string exceeds a preset length; If the length of the at least one data information string exceeds the preset length, slide a preset first character window to frame the data information characters in the at least one data information string, obtaining at least one framed data information character segment and at least one unframed data information character segment, where the sliding rule of the first character window is that the sliding distance of the first character window is random and the sliding distance is greater than the length of the first character window; Associate the at least one unframed data information character segment with a preset interval character segment, and splice the preset interval character segment with the at least one framed data information character segment based on the position relationship between the at least one framed data information character segment and the at least one unframed data information character segment, forming at least one target data information string; Frame the at least one obtained target data information string based on a preset second character window, obtaining at least one framed target data information character segment, where the sliding rule of the second character window is that the sliding distance of the second character window is less than the length of the second character window; Store the at least one target data information character segment in a target memory.
2. The data storage method according to claim 1, wherein After determining whether the length of the at least one data information string exceeds the preset length, the method further includes: If the length of the at least one data information string does not exceed the preset length, insert a preset interval character at any position of the at least one data information string until the length of the at least one data information string exceeds the preset length.
3. The data storage method according to claim 1, characterized in that The preset character window length is less than the preset length.
4. A data storage method according to claim 1, wherein, The associating the at least one unframed data information character segment with a preset interval character segment includes: Obtain a preset interval character segment, where the length of the preset interval character segment is equal to the length of the at least one unframed data information character segment; Associate the at least one unframed data information character segment with the preset interval character segment based on a preset association relationship.
5. A data storage method according to claim 1, characterized in that, The storing the at least one target data information character segment in a target memory includes: Obtain the identifier of the at least one target data information character segment; Based on the identifier of the at least one target data information character segment, store the at least one target data information character segment in a target memory.
6. A data storage system, characterized in that, Comprising: An obtaining module, configured to obtain a data set, where the data set contains at least one data information string; A judging module, configured to judge whether the length of the at least one data information string exceeds a preset length; A first box selection module, configured to, if the length of the at least one data information string exceeds a preset length, slide a preset first character window to box the data information characters in the at least one data information string, so as to obtain at least one boxed data information character segment and at least one unboxed data information character segment, wherein the sliding rule of the first character window is that the sliding distance of the first character window is random and the sliding distance is greater than the length of the first character window; A splicing module, configured to associate at least one unboxed data information character segment with a preset interval character segment, and splice the preset interval character segment with at least one boxed data information character segment based on the positional relationship between at least one boxed data information character segment and at least one unboxed data information character segment, so as to form at least one target data information string; A second box selection module, configured to box the obtained at least one target data information string based on a preset second character window, so as to obtain at least one boxed target data information character segment, wherein the sliding rule of the second character window is that the sliding distance of the second character window is less than the length of the second character window; A storage module, configured to store the at least one target data information character segment in a target memory.
7. An electronic device, characterized in that, Comprising: At least one processor, and a memory communicatively connected to the at least one processor, wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method according to any one of claims 1 to 5.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Password transmission method, terminal, server and readable storage medium
CN112637140A
File transmission method and device for message processing of file data
CN114785773A