CN110694275B - Data storage method, device and equipment - Google Patents

Data storage method, device and equipment Download PDF

Info

Publication number
CN110694275B
CN110694275B CN201910931470.2A CN201910931470A CN110694275B CN 110694275 B CN110694275 B CN 110694275B CN 201910931470 A CN201910931470 A CN 201910931470A CN 110694275 B CN110694275 B CN 110694275B
Authority
CN
China
Prior art keywords
target object
identification information
character string
data
byte stream
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910931470.2A
Other languages
Chinese (zh)
Other versions
CN110694275A (en
Inventor
王欢
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Kingsoft Internet Security Software Co Ltd
Original Assignee
Beijing Kingsoft Internet Security Software Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Kingsoft Internet Security Software Co Ltd filed Critical Beijing Kingsoft Internet Security Software Co Ltd
Priority to CN201910931470.2A priority Critical patent/CN110694275B/en
Publication of CN110694275A publication Critical patent/CN110694275A/en
Application granted granted Critical
Publication of CN110694275B publication Critical patent/CN110694275B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/60Generating or modifying game content before or while executing the game program, e.g. authoring tools specially adapted for game development or game-integrated level editor
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/70Game security or game management aspects
    • A63F13/77Game security or game management aspects involving data related to game devices or game servers, e.g. configuration data, software version or amount of memory

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Business, Economics & Management (AREA)
  • Computer Security & Cryptography (AREA)
  • General Business, Economics & Management (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Storage Device Security (AREA)

Abstract

The application provides a data storage method, a device and equipment, wherein the method comprises the following steps: acquiring application program data, and determining a target object from the application program data; carrying out serialization processing on the target object to generate a byte stream; the target object is stored according to the byte stream. This can improve the data storage efficiency.

Description

Data storage method, device and equipment
Technical Field
The present disclosure relates to the field of data processing technologies, and in particular, to a data storage method, apparatus, and device.
Background
Data storage is an essential function of an application program. For example, during the design and development of gaming applications, there may be a need to store data such as the number of checkpoints currently passed by a player, the level of the player, the number of medals owned, weapons, props, etc., which are typically stored locally on the device.
The current units engine supports storing Int, float, string three types of data, and has low storage efficiency, so a scheme capable of storing data more efficiently is needed.
Disclosure of Invention
The present application aims to solve, at least to some extent, one of the technical problems in the related art.
Therefore, a first object of the present application is to propose a data storage method to improve data storage efficiency.
A second object of the present application is to propose a data storage device.
A third object of the present application is to provide a data reading method.
A fourth object of the present application is to provide a data reading apparatus.
A fifth object of the present application is to propose a terminal device.
A sixth object of the present application is to propose a computer readable storage medium.
An embodiment of a first aspect of the present application provides a data storage method, including:
acquiring application program data, and determining a target object from the application program data;
carrying out serialization processing on the target object to generate a byte stream;
and storing the target object according to the byte stream.
According to the data storage method, the target object is determined from the application program data by acquiring the application program data. And then, carrying out serialization processing on the target object, generating a byte stream, and storing the target object according to the byte stream. Therefore, the storage efficiency is improved, the complexity of encoding is reduced, and the generation of data anomalies is also reduced.
In addition, the data storage method according to the above embodiment of the present application may further have the following additional technical features:
optionally, the determining the target object from the application program data includes: analyzing the application program data and acquiring identification information of each object in the application program data; analyzing the identification information, determining the identification information as an object capable of being identified in a serialization manner, and taking the object capable of being identified in the serialization manner as the target object.
Optionally, the target object includes a plurality of members, and after determining the target object from the application data, the method further includes: analyzing the application program data to obtain identification information of each member in the target object; analyzing the identification information, determining the identification information as a target member of the nonsequential identification, and removing the target member from the target object.
Optionally, the serializing the target object, generating the byte stream includes: calling a preset data processing interface to perform serialization processing on the target object to generate a first character string in a target format; encrypting the first character string according to a preset secret key and an encryption algorithm to generate an encrypted second character string; converting the second string into a byte stream.
An embodiment of a second aspect of the present application proposes a data storage device comprising:
the determining module is used for acquiring application program data and determining a target object from the application program data;
the processing module is used for carrying out serialization processing on the target object to generate a byte stream;
and the storage module is used for storing the target object according to the byte stream.
According to the data storage device, the target object is determined from the application program data by acquiring the application program data. And then, carrying out serialization processing on the target object, generating a byte stream, and storing the target object according to the byte stream. Therefore, the storage efficiency is improved, the complexity of encoding is reduced, and the generation of data anomalies is also reduced.
In addition, the data storage method according to the above embodiment of the present application may further have the following additional technical features:
optionally, the determining module is specifically configured to: analyzing the application program data and acquiring identification information of each object in the application program data; analyzing the identification information, determining the identification information as an object capable of being identified in a serialization manner, and taking the object capable of being identified in the serialization manner as the target object.
Optionally, the apparatus further comprises: the analysis module is used for analyzing the application program data and acquiring the identification information of each member in the target object; analyzing the identification information, determining the identification information as a target member of the nonsequential identification, and removing the target member from the target object.
Optionally, the processing module is specifically configured to: calling a preset data processing interface to perform serialization processing on the target object to generate a first character string in a target format; encrypting the first character string according to a preset secret key and an encryption algorithm to generate an encrypted second character string; converting the second string into a byte stream.
An embodiment of a third aspect of the present application provides a data reading method, including:
reading a stored byte stream, wherein the byte stream is obtained by carrying out serialization processing on a target object in application program data;
and performing deserialization processing on the byte stream to obtain an object reading result.
The data reading method according to the above embodiment of the present application may further have the following additional technical features:
optionally, the performing deserialization processing on the byte stream, and obtaining the object reading result includes: converting the byte stream into a third character string, wherein the third character string is obtained by encrypting according to a preset secret key and an encryption algorithm; decrypting the third character string according to the secret key and a decryption algorithm corresponding to the encryption algorithm to generate a decrypted fourth character string; and performing deserialization processing on the fourth character string to obtain an object reading result.
An embodiment of a fourth aspect of the present application proposes a data reading apparatus, including:
the reading module is used for reading the stored byte stream, wherein the byte stream is obtained by carrying out serialization processing on a target object in application program data;
and the processing module is used for performing deserialization processing on the byte stream to obtain an object reading result.
The data reading device according to the above embodiment of the present application may further have the following additional technical features:
optionally, the processing module is specifically configured to: converting the byte stream into a third character string, wherein the third character string is obtained by encrypting according to a preset secret key and an encryption algorithm; decrypting the third character string according to the secret key and a decryption algorithm corresponding to the encryption algorithm to generate a decrypted fourth character string; and performing deserialization processing on the fourth character string to obtain an object reading result.
An embodiment of a fifth aspect of the present application proposes a terminal device, including a processor and a memory; wherein the processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory for implementing the data storage method as described in the embodiment of the first aspect.
An embodiment of a sixth aspect of the present application proposes a computer readable storage medium, on which a computer program is stored, which program, when being executed by a processor, implements a data storage method according to an embodiment of the first aspect.
Additional aspects and advantages of the application will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the application.
Drawings
Fig. 1 is a flow chart of a data storage method according to an embodiment of the present application;
FIG. 2 is a flowchart illustrating another data storage method according to an embodiment of the present disclosure;
FIG. 3 is a flowchart illustrating another data storage method according to an embodiment of the present disclosure;
fig. 4 is a flowchart of a data reading method according to an embodiment of the present application;
FIG. 5 is a schematic diagram of a data storage device according to an embodiment of the present disclosure;
FIG. 6 is a schematic diagram of another data storage device according to an embodiment of the present disclosure;
fig. 7 is a schematic structural diagram of a data reading device according to an embodiment of the present application;
fig. 8 shows a block diagram of an exemplary terminal device suitable for use in implementing embodiments of the present application.
Detailed Description
Embodiments of the present application are described in detail below, examples of which are illustrated in the accompanying drawings, wherein the same or similar reference numerals refer to the same or similar elements or elements having the same or similar functions throughout. The embodiments described below by referring to the drawings are exemplary and intended for the purpose of explaining the present application and are not to be construed as limiting the present application.
Data storage is an essential function of an application program. For example, during the design and development of game applications, there may be a need to store data such as the number of checkpoints currently passed by a player, the level of the player, the number of gold tokens owned, weapons, props, etc., which are typically stored locally on the device, such as in a memory card of a mobile terminal, for a game application on the mobile terminal.
In the related art, a unit (a game development tool) engine only supports storing Int, float, string type data, when storing complex objects, the data of the type needs to be stored one by one, so that the storage efficiency is low, reading and writing of partial variables are easy to miss, data abnormality is caused, and the complexity of encoding is increased.
The embodiment of the application provides a data storage method which can directly store Object objects, improves storage efficiency, reduces coding complexity and reduces generation of data anomalies.
Data storage methods, devices and equipment according to embodiments of the present application are described below with reference to the accompanying drawings.
Fig. 1 is a flow chart of a data storage method according to an embodiment of the present application, as shown in fig. 1, where the method includes:
step 101, acquiring application program data, and determining a target object from the application program data.
In this embodiment, when storing the data of the application program, the application program data may be acquired first, and the target object to be stored may be determined from the application program data. The target Object may include an Object, such as Transform, vector, vector3, and the like, and the target Object may also include an Object of Int, float, string or the like.
The implementation manner of determining the target object from the application program data can be various, and is described below.
In one embodiment of the present application, a serializable flag may be set in advance for an object that needs to be stored. Further, after the application data is acquired, the application data is analyzed, and identification information of each object in the application data is acquired. Further, the identification information of each object is analyzed, the identification information is determined to be the object with the serializable identification, and the identification information is determined to be the object with the serializable identification as the target object. The serializable flag may be set as needed, for example, may be set according to a combination of numerals, letters, and symbols, and is not particularly limited herein.
As one example, taking a game class application as an example, a serializable identification may be pre-set for a player's class. And further obtains the game data generated by the application program, determines the class of the player from the game data, and determines the target object according to the class of the player so as to further store the player data object.
In one embodiment of the present application, the class of the object to be stored may be preset. Further, after the application data is acquired, the application data is analyzed, the category of each object in the application data is acquired, the analyzed category is compared with a preset category, and the object with the analyzed category consistent with the preset category is taken as a target object. For example, the preset category may include an Object.
Step 102, serializing the target object to generate byte stream.
Step 103, storing the target object according to the byte stream.
In this embodiment, after determining the target object from the application data, the target object may be serialized to generate a byte stream, and then the target object is stored according to the converted byte stream.
As an example, the target object serialization may be implemented by way of an object input-output stream, generating a byte stream in binary form, and further storing the generated byte stream in a local file. Further, the byte stream is obtained by reading the local file, and then the byte stream is subjected to deserialization processing, so that an object reading result is obtained, and the storage and the reading of the target object are realized.
According to the data storage method, the target object is determined from the application program data by acquiring the application program data. And then, carrying out serialization processing on the target object, generating a byte stream, and storing the target object according to the byte stream. Therefore, the Object can be directly stored, the storage efficiency is improved, the complexity of coding is reduced, and the generation of data abnormality is also reduced.
Based on the above embodiment, further, by setting the serializable identifier and the deserializable identifier, the data storage method of the embodiment of the application can selectively store the object members, avoid storing members which do not need to be stored, and reduce the occupation of space.
Fig. 2 is a flow chart of another data storage method according to an embodiment of the present application, as shown in fig. 2, before performing serialization processing on a target object to generate a byte stream, the method includes:
step 201, acquiring application program data, analyzing the application program data, and acquiring identification information of each object in the application program data.
Step 202, analyzing the identification information, determining the identification information as an object capable of being identified in a serialization manner, and taking the object with the identification information capable of being identified in a serialization manner as a target object.
As an example, a system. Further, application data is acquired and analyzed, and an object provided with a [ system.serizable ] identifier is specified as a target object.
And 203, analyzing the application program data to obtain the identification information of each member in the target object.
In step 204, the identification information is analyzed, the identification information is determined to be a target member which can not be identified in a serialization manner, and the target member is removed from the target object.
In this embodiment, the nonsequential identifier may be set in advance for the member that does not need to be stored in the object. Further, after the target object is determined, identification information of each member in the target object is acquired. Further, analyzing the identification information of each member, determining the identification information as a member with the nonsequable identification, and removing the identification information as a member with the nonsequable identification from the target object. Wherein, the nonsequential identification can be set according to the needs, for example, the identification can be carried out according to the combination of numbers, letters and symbols, and the nonsequential identification is not particularly limited herein.
As an example, a [ system.non-serialized ] flag may be set in advance for fields in the target object that do not need to be stored. Further, after the target object is determined, a field with a [ system.NonSerialized ] identifier is set in the target object is obtained through analysis, and the field comprising the identifier is removed from the target object so as to further sequence the processed target object.
According to the data storage method, the sequentiable identification and the nonsequential identification are set, the target object to be stored is determined according to the sequentiable identification, and the member not to be stored is determined according to the nonsequential identification, so that the member in the object can be selectively stored, the member not to be stored is prevented from being stored, and the occupation of space is reduced.
Based on the above embodiment, further, the data storage method according to the embodiment of the present application may further encrypt the stored data, thereby improving security.
Fig. 3 is a flow chart of another data storage method provided in the embodiment of the present application, as shown in fig. 3, step 102 and step 103 in the foregoing embodiment specifically include the following steps:
step 301, calling a preset data processing interface to perform serialization processing on a target object, and generating a first character string in a target format.
In this embodiment, a preset data processing interface may be invoked to perform serialization processing on the target object, so as to generate a first string in the target format, so as to facilitate encryption based on the first string. The target format may be set as desired, including but not limited to Json format.
As an example, a target object is serialized through the newtonsft Json library (a library that supports serialization and deserialization of dictionaries) to generate a Json string.
Step 302, the first character string is encrypted according to a preset key and an encryption algorithm, and an encrypted second character string is generated.
In this embodiment, a key and an encryption algorithm for encryption may be preset, and then the first string is encrypted according to the key and the encryption algorithm, so as to generate an encrypted second string. The encryption algorithm may be selected as needed, and includes, but is not limited to, AES (Advanced Encryption Standard ) algorithm, DES (Data Encryption Standard, data encryption standard) algorithm, and the like.
As an example, byte substitution, row shifting, column confusion operations are performed on the first string, and then an exclusive or operation is performed according to a preset key, thereby generating an encrypted second string.
Step 303, converting the second character string into a byte stream, and storing the target object according to the byte stream.
As an example, the encrypted second string may be converted into a byte stream by way of an input-output stream, and the converted byte stream may be stored in a local file. Therefore, the data encryption storage is realized, and the security is improved.
Further, after step 303, the method further comprises:
step 304, the stored byte stream is read and converted into a third string.
As an example, the local file may be read by way of an input-output stream, the stored byte stream is retrieved, and the stored byte stream is converted to a third string. Optionally, the third string and the second string are in the same format.
And 305, carrying out decryption processing on the third character string according to the secret key and a decryption algorithm corresponding to the encryption algorithm, and generating a decrypted fourth character string.
In this embodiment, a key and a decryption algorithm for decryption may be preset, and further, the third string may be decrypted according to the key and the decryption algorithm, to generate a decrypted fourth string. The decryption algorithm corresponds to the encryption algorithm in the foregoing step, and for example, decryption processing may be performed by an inverse operation of the encryption algorithm.
Step 306, performing deserialization processing on the fourth character string to obtain an object reading result.
As an example, the object reading result is obtained by performing deserialization processing on the fourth character string by using the newtonsft Json library to obtain the target object before the serialization processing.
According to the data storage method, the target object is subjected to serialization processing by calling the preset data processing interface, and the first character string in the target format is generated. And further, encrypting the first character string according to a preset secret key and an encryption algorithm to generate an encrypted second character string. Further, the second string is converted into a byte stream, and the target object is stored according to the byte stream. Therefore, the stored data is encrypted while the Object is stored, and the security is improved. In addition, the complex objects can be directly stored, the data of types such as Int are not required to be stored one by one, and the efficiency is improved.
Based on the above embodiment, after the application data is stored, data reading can also be achieved, and a data reading process will be described below.
Fig. 4 is a flowchart of a data reading method according to an embodiment of the present application, as shown in fig. 4, where the method includes:
step 401, read the stored byte stream.
The byte stream is obtained by serializing the target object in the application program data.
Step 402, performing deserialization processing on the byte stream to obtain an object reading result.
As an example, the byte stream is obtained by reading a local file, and then the byte stream is subjected to deserialization processing, so as to obtain an object reading result, thereby realizing the storage and reading of the target object.
In one embodiment of the present application, step 402 includes: and converting the byte stream into a third character string, wherein the third character string is obtained by encrypting according to a preset secret key and an encryption algorithm. Further, the third character string is decrypted according to the secret key and a decryption algorithm corresponding to the encryption algorithm, and a decrypted fourth character string is generated; and performing deserialization processing on the fourth character string to obtain an object reading result. The foregoing explanation of steps 304-306 is equally applicable to the present embodiment, and will not be repeated here.
According to the data reading method, the stored byte stream is read, and the byte stream is subjected to deserialization processing, so that an object reading result is obtained. Thus, the Object can be read, and efficiency is improved.
In order to implement the above embodiment, the present application further proposes a data storage device.
Fig. 5 is a schematic structural diagram of a data storage device according to an embodiment of the present application, as shown in fig. 5, where the device includes: a determining module 10, a processing module 20, a storing module 30.
The determining module 10 is configured to obtain application data, and determine a target object from the application data.
And the processing module 20 is used for carrying out serialization processing on the target object to generate a byte stream.
A storage module 30 for storing the target object according to the byte stream.
As a possible implementation, the determining module 10 is specifically configured to: analyzing the application program data and acquiring the identification information of each object in the application program data; analyzing the identification information, determining the identification information as an object capable of being identified in a serialization manner, and taking the object with the identification information capable of being identified in the serialization manner as a target object.
On the basis of fig. 5, the device shown in fig. 6 further comprises: a parsing module 40.
The parsing module 40 is configured to parse the application data, and obtain identification information of each member in the target object; analyzing the identification information, determining the identification information as a target member which can not be identified in a serialization manner, and removing the target member from the target object.
As a possible implementation, the processing module 20 is specifically configured to: calling a preset data processing interface to perform serialization processing on a target object to generate a first character string in a target format; encrypting the first character string according to a preset secret key and an encryption algorithm to generate an encrypted second character string; the second string is converted into a byte stream.
It should be noted that, the explanation of the data storage method in the foregoing embodiment is equally applicable to the data storage device in this embodiment, and will not be repeated here.
According to the data storage device, the target object is determined from the application program data by acquiring the application program data. And then, carrying out serialization processing on the target object, generating a byte stream, and storing the target object according to the byte stream. Therefore, the Object can be directly stored, the storage efficiency is improved, the complexity of coding is reduced, and the generation of data abnormality is also reduced.
Fig. 7 is a schematic structural diagram of a data reading device according to an embodiment of the present application, as shown in fig. 7, where the device includes: a reading module 50, a processing module 60.
The reading module 50 is configured to read the stored byte stream, where the byte stream is obtained by performing serialization processing on the target object in the application data.
The processing module 60 is configured to perform deserialization processing on the byte stream, and obtain an object reading result.
As a possible implementation, the processing module 60 is specifically configured to: converting the byte stream into a third character string, wherein the third character string is obtained by encrypting according to a preset secret key and an encryption algorithm; decrypting the third character string according to the secret key and a decryption algorithm corresponding to the encryption algorithm to generate a decrypted fourth character string; and performing deserialization processing on the fourth character string to obtain an object reading result.
According to the data reading device, the stored byte stream is read, and the byte stream is subjected to deserialization processing, so that an object reading result is obtained. Thus, the Object can be read, and efficiency is improved.
In order to implement the above embodiment, the present application further proposes a terminal device, including a processor and a memory; wherein the processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory for implementing the data storage method according to any of the foregoing embodiments.
The application also provides a terminal device, which comprises a processor and a memory; wherein the processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory for implementing the data reading method according to any of the foregoing embodiments.
To achieve the above embodiments, the present application also proposes a computer program product implementing a data storage method according to any of the preceding embodiments when instructions in the computer program product are executed by a processor.
In order to implement the above embodiments, the present application also proposes a computer-readable storage medium, on which a computer program is stored, which program, when being executed by a processor, implements a data storage method according to any of the previous embodiments.
The present application also proposes a computer-readable storage medium, on which a computer program is stored, which program, when being executed by a processor, implements a data reading method as described in any of the foregoing embodiments.
Fig. 8 shows a block diagram of an exemplary terminal device suitable for use in implementing embodiments of the present application. The terminal device 12 shown in fig. 8 is only an example, and should not impose any limitation on the functions and scope of use of the embodiments of the present application.
As shown in fig. 8, the terminal device 12 is in the form of a general purpose computing device. The components of terminal device 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, a bus 18 that connects the various system components, including the system memory 28 and the processing units 16.
Bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor, and a local bus using any of a variety of bus architectures. By way of example, and not limitation, such architectures include industry Standard architecture (Industry Standard Architecture; hereinafter ISA) bus, micro channel architecture (Micro Channel Architecture; hereinafter MAC) bus, enhanced ISA bus, video electronics standards Association (Video Electronics Standards Association; hereinafter VESA) local bus, and peripheral component interconnect (Peripheral Component Interconnection; hereinafter PCI) bus.
Terminal device 12 typically includes a variety of computer system readable media. Such media can be any available media that is accessible by terminal device 12 and includes both volatile and nonvolatile media, removable and non-removable media.
Memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (Random Access Memory; hereinafter: RAM) 30 and/or cache memory 32. Terminal device 12 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 34 may be used to read from or write to non-removable, nonvolatile magnetic media (not shown in FIG. 8, commonly referred to as a "hard disk drive"). Although not shown in fig. 8, a magnetic disk drive for reading from and writing to a removable non-volatile magnetic disk (e.g., a "floppy disk"), and an optical disk drive for reading from or writing to a removable non-volatile optical disk (e.g., a compact disk read only memory (Compact Disc Read Only Memory; hereinafter CD-ROM), digital versatile read only optical disk (Digital Video Disc Read Only Memory; hereinafter DVD-ROM), or other optical media) may be provided. In such cases, each drive may be coupled to bus 18 through one or more data medium interfaces. Memory 28 may include at least one program product having a set (e.g., at least one) of program modules configured to carry out the functions of the embodiments of the present application.
A program/utility 40 having a set (at least one) of program modules 42 may be stored in, for example, memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each or some combination of which may include an implementation of a network environment. Program modules 42 generally perform the functions and/or methods in the embodiments described herein.
Terminal device 12 may also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), one or more devices that enable a user to interact with the computer system/server 12, and/or any devices (e.g., network card, modem, etc.) that enable the computer system/server 12 to communicate with one or more other computing devices. Such communication may occur through an input/output (I/O) interface 22. Also, the terminal device 12 may communicate with one or more networks, such as a local area network (Local Area Network; hereinafter: LAN), a wide area network (Wide Area Network; hereinafter: WAN) and/or a public network, such as the Internet, via the network adapter 20. As shown, network adapter 20 communicates with other modules of terminal device 12 over bus 18. It should be appreciated that although not shown, other hardware and/or software modules may be used in connection with terminal device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, data backup storage systems, and the like.
The processing unit 16 executes various functional applications and data processing by running programs stored in the system memory 28, for example, implementing the methods mentioned in the foregoing embodiments.
In the description of the present application, it should be understood that the terms "first," "second," and the like are used for descriptive purposes only and are not to be construed as indicating or implying a relative importance or an implicit indication of the number of technical features being indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include at least one such feature. In the description of the present application, the meaning of "plurality" is at least two, such as two, three, etc., unless explicitly defined otherwise.
In the description of the present specification, a description referring to terms "one embodiment," "some embodiments," "examples," "specific examples," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the present application. In this specification, schematic representations of the above terms are not necessarily directed to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, the different embodiments or examples described in this specification and the features of the different embodiments or examples may be combined and combined by those skilled in the art without contradiction.
Although embodiments of the present application have been shown and described above, it will be understood that the above embodiments are illustrative and not to be construed as limiting the application, and that variations, modifications, alternatives, and variations may be made to the above embodiments by one of ordinary skill in the art within the scope of the application.

Claims (8)

1. A method of data storage, comprising:
presetting an object category to be stored and a serializable identification of an object;
acquiring application program data, and determining a target object from the application program data;
carrying out serialization processing on the target object to generate a byte stream;
storing the target object according to the byte stream;
the determining a target object from the application program data comprises: analyzing the application program data, acquiring the category of each object in the application program data and the identification information of each object, comparing the analyzed category with a preset category, taking the object with the analyzed category consistent with the preset category as a target object, analyzing the identification information, determining the identification information as an object capable of being identified in a serialization manner, and taking the identification information as an object capable of being identified in a serialization manner as the target object;
the serializing the target object to generate a byte stream includes:
calling a preset data processing interface to perform serialization processing on the target object to generate a first character string in a target format;
encrypting the first character string according to a preset secret key and an encryption algorithm to generate an encrypted second character string, wherein the encrypting comprises the following steps: performing byte substitution, row shifting and column confusion operation on the first character string, performing exclusive OR operation according to a preset secret key, and generating an encrypted second character string;
converting the second string into a byte stream.
2. The method of claim 1, wherein the target object comprises a plurality of members, and after determining the target object from the application data, further comprising:
analyzing the application program data to obtain identification information of each member in the target object;
analyzing the identification information, determining the identification information as a target member of the nonsequential identification, and removing the target member from the target object.
3. A data reading method, comprising:
reading a stored byte stream, wherein the byte stream is obtained by carrying out serialization processing on a target object in application program data, wherein the target object is an object with a preset object type and an object serializable identification which need to be stored, the application program data is analyzed to obtain the type of each object in the application program data and the identification information of each object, the analyzed type is compared with a preset type, the object with the analyzed type consistent with the preset type is taken as the target object, the identification information is analyzed, the identification information is determined to be the object with the serializable identification, and the identification information is the object with the serializable identification as the target object;
performing deserialization processing on the byte stream to obtain an object reading result,
the step of performing deserialization processing on the byte stream to obtain an object reading result comprises the following steps:
converting the byte stream into a third character string, wherein the third character string is obtained by encrypting according to a preset secret key and an encryption algorithm;
and carrying out decryption processing on the third character string according to the secret key and a decryption algorithm corresponding to the encryption algorithm, generating a decrypted fourth character string, and carrying out deserialization processing on the fourth character string to obtain an object reading result, wherein the decryption processing is the inverse operation of the encryption algorithm.
4. A data storage device, comprising:
the determining module is used for acquiring application program data and determining a target object from the application program data;
the processing module is used for carrying out serialization processing on the target object to generate a byte stream;
a storage module for storing the target object according to the byte stream; the determining module is specifically configured to: presetting an object category to be stored and a serializable identification of an object;
analyzing the application program data, acquiring the category of each object in the application program data and the identification information of each object, comparing the analyzed category with a preset category, taking the object with the analyzed category consistent with the preset category as a target object, analyzing the identification information, determining the identification information as an object capable of being identified in a serialization manner, and taking the identification information as an object capable of being identified in a serialization manner as the target object;
the processing module is specifically configured to:
calling a preset data processing interface to perform serialization processing on the target object to generate a first character string in a target format;
encrypting the first character string according to a preset secret key and an encryption algorithm to generate an encrypted second character string, wherein the encrypting comprises the following steps: performing byte substitution, row shifting and column confusion operation on the first character string, performing exclusive OR operation according to a preset secret key, and generating an encrypted second character string;
converting the second string into a byte stream.
5. The apparatus as recited in claim 4, further comprising:
the analysis module is used for analyzing the application program data and acquiring the identification information of each member in the target object;
analyzing the identification information, determining the identification information as a target member of the nonsequential identification, and removing the target member from the target object.
6. A data reading apparatus, comprising:
the reading module is used for reading the stored byte stream, wherein the byte stream is obtained by carrying out serialization processing on target objects in application program data, the target objects are objects with the types of objects to be stored and serializable identifications of the objects, the types of the objects in the application program data and the identification information of the objects are obtained through analysis of the application program data, the obtained types are compared with the preset types, the objects with the types identical to the preset types are obtained through analysis and are used as target objects, the identification information is analyzed, the identification information is determined to be the objects with the serializable identifications, and the identification information is the objects with the serializable identifications and is used as the target objects;
the processing module is used for performing deserialization processing on the byte stream to obtain an object reading result;
the processing module is specifically configured to:
converting the byte stream into a third character string, wherein the third character string is obtained by encrypting according to a preset secret key and an encryption algorithm;
performing decryption processing on the third character string according to the secret key and a decryption algorithm corresponding to the encryption algorithm to generate a decrypted fourth character string, wherein the decryption processing is the inverse operation of the encryption algorithm;
and performing deserialization processing on the fourth character string to obtain an object reading result.
7. A terminal device comprising a processor and a memory;
wherein the processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory for implementing the data storage method according to any one of claims 1-2 or the data reading method according to claim 3.
8. A computer-readable storage medium, on which a computer program is stored, characterized in that the program, when being executed by a processor, implements a data storage method according to any one of claims 1-2, or a data reading method according to claim 3.
CN201910931470.2A 2019-09-29 2019-09-29 Data storage method, device and equipment Active CN110694275B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910931470.2A CN110694275B (en) 2019-09-29 2019-09-29 Data storage method, device and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910931470.2A CN110694275B (en) 2019-09-29 2019-09-29 Data storage method, device and equipment

Publications (2)

Publication Number Publication Date
CN110694275A CN110694275A (en) 2020-01-17
CN110694275B true CN110694275B (en) 2024-01-02

Family

ID=69197275

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910931470.2A Active CN110694275B (en) 2019-09-29 2019-09-29 Data storage method, device and equipment

Country Status (1)

Country Link
CN (1) CN110694275B (en)

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7664882B2 (en) * 2004-02-21 2010-02-16 Microsoft Corporation System and method for accessing multimedia content
CN102981884B (en) * 2012-11-22 2016-03-30 用友优普信息技术有限公司 Serializing device and sequencing method
WO2016023160A1 (en) * 2014-08-11 2016-02-18 华为技术有限公司 Method and device for loading view of application and electronic terminal
US10496595B2 (en) * 2017-12-14 2019-12-03 Mellanox Technologies, Ltd. Method for zero-copy object serialization and deserialization

Also Published As

Publication number Publication date
CN110694275A (en) 2020-01-17

Similar Documents

Publication Publication Date Title
CN107612683B (en) Encryption and decryption method, device, system, equipment and storage medium
US8681976B2 (en) System and method for device dependent and rate limited key generation
US20130014267A1 (en) Computer protocol generation and obfuscation
TWI642294B (en) Computer program product , system and method of cipher message with authentication instruction
CN108830096B (en) Data processing method and device, electronic equipment and storage medium
EP3519941B1 (en) Instruction to provide true random numbers
US20180287779A1 (en) White-box cryptography method and apparatus for preventing side channel analysis
CN110312054B (en) Image encryption and decryption method, related device and storage medium
CN110190951B (en) Power consumption attack method and system for DES algorithm L register turning
CN112487253B (en) User invitation code generation method, verification method, device, equipment and storage medium
US20030206630A1 (en) Method and apparatus for generating pseudo-random numbers
CN114760052A (en) Bank Internet of things platform key generation method and device, electronic equipment and medium
CN114553532A (en) Data secure transmission method and device, electronic equipment and storage medium
CN113946863A (en) Data encryption storage method, system, equipment and storage medium
CN110694275B (en) Data storage method, device and equipment
US20230025870A1 (en) Password authentication apparatus, password authentication method, and computer readable medium
CN116361833A (en) Verification method and device and terminal equipment
AU2021100948A4 (en) Enhancing cyber security using high speed hybrid authentication technique
CN116204903A (en) Financial data security management method and device, electronic equipment and storage medium
CN116664123A (en) Digital wallet design method based on blockchain technology
CN116015633A (en) Data encryption method, data decryption method and related devices
CN111062053B (en) Method, device, equipment and medium for processing biological characteristic data
CN110032832B (en) Web application processing method and device
CN118018200B (en) Encryption and decryption realization method and device
CN112149140A (en) Prediction method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant