CN108388598B - Electronic device, data storage method, and storage medium - Google Patents

Electronic device, data storage method, and storage medium Download PDF

Info

Publication number
CN108388598B
CN108388598B CN201810102247.2A CN201810102247A CN108388598B CN 108388598 B CN108388598 B CN 108388598B CN 201810102247 A CN201810102247 A CN 201810102247A CN 108388598 B CN108388598 B CN 108388598B
Authority
CN
China
Prior art keywords
data
stored
target
field
conversion
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
CN201810102247.2A
Other languages
Chinese (zh)
Other versions
CN108388598A (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.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen 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 Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN201810102247.2A priority Critical patent/CN108388598B/en
Priority to PCT/CN2018/089451 priority patent/WO2019148720A1/en
Publication of CN108388598A publication Critical patent/CN108388598A/en
Application granted granted Critical
Publication of CN108388598B publication Critical patent/CN108388598B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/25Integrating or interfacing systems involving database management systems
    • G06F16/258Data format conversion from or to a database
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2282Tablespace storage structures; Management thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2291User-Defined Types; Storage management thereof

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses an electronic device, a data storage method and a storage medium, wherein the data to be stored is analyzed to determine whether the data to be stored has a certain service attribute, after the data to be stored is analyzed to determine that the data to be stored has the certain service attribute, the data to be stored is replaced by a first target conversion field according to a predetermined first conversion rule, and after the data to be stored is analyzed to determine that the data to be stored does not have the certain service attribute, the data to be stored is replaced by a second target conversion field according to a predetermined second conversion rule; storing the first target translation field or the second target translation field in a predetermined database. The data storage space can be saved, and the implementation is easy.

Description

Electronic device, data storage method, and storage medium
Technical Field
The present invention relates to the field of data storage technologies, and in particular, to an electronic device, a data storage method, and a storage medium.
Background
With the development of computer communication technology, applications in various fields need to store a large amount of data information, and usually, the data information is stored in a predetermined data structure, such as a data table, a view, a sequence, and the like, in a storage structure of a database, such as a table space, a segment, a range, and the like. In practical applications, data stored in a data structure usually needs to be represented by a series of encoding characters (the encoding characters correspond to indexes composed of character string fields with different lengths), which results in large storage space occupation, complex database operation process and poor data readability.
Disclosure of Invention
In view of the above, the present invention provides an electronic device, a data storage method and a storage medium, which can save data storage space and are easy to implement.
To achieve the above object, the present invention provides an electronic device, which includes a memory and a processor connected to the memory, wherein the processor is configured to execute a data storage program stored in the memory, and when the data storage program is executed by the processor, the following steps are implemented:
a1, analyzing whether the data to be stored has a certain service attribute;
a2, if the data to be stored has a certain service attribute, replacing the data to be stored with a first target conversion field according to a predetermined first conversion rule, wherein the data to be stored is a first target code character, and the first target conversion field is smaller than the first target code character;
a3, if the data to be stored does not have the determined service attribute, replacing the data to be stored with a second target conversion field according to a predetermined second conversion rule, wherein the data to be stored is a second target code character, and the second target conversion field is smaller than the second target code character;
a4, storing the first target conversion field or the second target conversion field into a predetermined database.
Further, in the step a2, the step of replacing the data to be stored with a first target conversion field according to a predetermined first conversion rule includes:
acquiring a mapping relation table between a predetermined code character and a corresponding conversion field;
judging whether a first target coding character matched with the data to be stored exists in the mapping relation table or not;
if the data to be stored is matched with the first target code character, acquiring a first target conversion field corresponding to the first target code character, and replacing the part of the data to be stored, which is matched with the first target code character, with the first target conversion field;
if the mapping relation table does not have a first target coding field matched with the data to be stored, generating a first target conversion field matched with the data to be stored according to a conversion field generation rule;
and replacing the data to be stored with the generated first target conversion field.
Further, after the step of replacing the data to be stored with the generated first target conversion field, the method further includes the following steps:
and establishing a corresponding relation between the data to be stored and the generated first target conversion field, and storing the established corresponding relation into the mapping relation table.
Further, in the step a3, the step of replacing the data to be stored with a second target conversion field according to a second predetermined conversion rule includes:
and determining a hash value corresponding to the data to be stored according to a predetermined hash algorithm, wherein the hash value is the second target conversion field.
Further, the first target conversion field and the second target conversion field are both a number combination of a preset length.
In addition, in order to achieve the above object, the present invention further provides a data storage method, including the following steps:
s1, analyzing whether the data to be stored has a determined service attribute;
s2, if the data to be stored has the determined service attribute, replacing the data to be stored with a first target conversion field according to a predetermined first conversion rule, wherein the data to be stored is a first target code character, and the first target conversion field is smaller than the first target code character;
s3, if the data to be stored does not have the determined service attribute, replacing the data to be stored with a second target conversion field according to a predetermined second conversion rule, wherein the data to be stored is a second target code character, and the second target conversion field is smaller than the second target code character;
s4, storing the first target conversion field or the second target conversion field into a predetermined database.
Further, in step S2, the step of replacing the data to be stored with a first target conversion field according to a predetermined first conversion rule includes:
acquiring a mapping relation table between a predetermined code character and a corresponding conversion field;
judging whether a first target coding character matched with the data to be stored exists in the mapping relation table or not;
if the data to be stored is matched with the first target code character, acquiring a first target conversion field corresponding to the first target code character, and replacing the part of the data to be stored, which is matched with the first target code character, with the first target conversion field;
if the mapping relation table does not have a first target coding field matched with the data to be stored, generating a first target conversion field matched with the data to be stored according to a conversion field generation rule;
and replacing the data to be stored with the generated first target conversion field.
Further, after the step of replacing the data to be stored with the generated first target conversion field, the method further includes the following steps:
and establishing a corresponding relation between the data to be stored and the generated first target conversion field, and storing the established corresponding relation into the mapping relation table.
Further, in the step a3, the step of replacing the data to be stored with a second target conversion field according to a second predetermined conversion rule includes:
and determining a hash value corresponding to the data to be stored according to a predetermined hash algorithm, wherein the hash value is the second target conversion field.
Further, to achieve the above object, the present invention also provides a computer-readable storage medium storing a data storage program, which is executable by at least one processor to cause the at least one processor to execute the steps of the data storage method as described above.
Compared with the prior art, the electronic device, the data storage method and the storage medium provided by the invention have the advantages that by analyzing whether the data to be stored has the determined business attribute, and after the data to be stored is analyzed to have the determined business attribute, the data to be stored is replaced by the first target conversion field according to the predetermined first conversion rule, and after the data to be stored is analyzed to have no determined business attribute, the data to be stored is replaced by the second target conversion field according to the predetermined second conversion rule; storing the first target translation field or the second target translation field in a predetermined database. The data storage space can be saved, and the implementation is easy.
Drawings
FIG. 1 is a diagram of an alternative hardware architecture of an electronic device according to the present invention;
FIG. 2 is a block diagram of a data storage program according to an embodiment of the present invention;
FIG. 3 is a flow chart of a preferred embodiment of the data storage method of the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the description relating to "first", "second", etc. in the present invention is for descriptive purposes only and is not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In addition, technical solutions between various embodiments may be combined with each other, but must be realized by a person skilled in the art, and when the technical solutions are contradictory or cannot be realized, such a combination should not be considered to exist, and is not within the protection scope of the present invention.
Fig. 1 is a schematic diagram of an alternative hardware architecture of the electronic device according to the present invention. In this embodiment, the electronic device 10 may include, but is not limited to, a memory 11, a processor 12, and a network interface 13, which may be communicatively connected to each other through a communication bus 14. It is noted that fig. 1 only shows the electronic device 10 with components 11-14, but it is to be understood that not all of the shown components are required to be implemented, and that more or fewer components may be implemented instead.
The memory 11 includes at least one type of computer-readable storage medium, which includes a flash memory, a hard disk, a multimedia card, a card-type memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a Read Only Memory (ROM), an Electrically Erasable Programmable Read Only Memory (EEPROM), a Programmable Read Only Memory (PROM), a magnetic memory, a magnetic disk, an optical disk, and the like. In some embodiments, the storage 11 may be an internal storage unit of the electronic device 10, such as a hard disk or a memory of the electronic device 10. In other embodiments, the memory 11 may also be an external storage device of the electronic apparatus 10, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), or the like, provided on the electronic apparatus 10. Of course, the memory 11 may also include both internal and external storage devices of the electronic apparatus 10. In this embodiment, the memory 11 is generally used for storing an operating system and various application software installed in the electronic device 10, such as a data storage program. Further, the memory 11 may also be used to temporarily store various types of data that have been output or are to be output.
Processor 12 may be a Central Processing Unit (CPU), controller, microcontroller, microprocessor, or other data Processing chip in some embodiments. The processor 12 is generally used to control the overall operation of the electronic device 10. In this embodiment, the processor 12 is used to execute the program code stored in the memory 11 or process data, such as an executed data storage program.
The network interface 13 may include a wireless network interface or a wired network interface, and the network interface 13 is generally used to establish a communication connection between the electronic apparatus 10 and other electronic devices.
The communication bus 14 is used to enable communication connections between the components 11-13.
Fig. 1 shows only an electronic device 10 having components 11-14 and a data storage program, but it is to be understood that not all of the shown components are required to be implemented, and that more or fewer components may be implemented instead.
Optionally, the electronic device 10 may further comprise a user interface (not shown in fig. 1), which may comprise a display, an input unit such as a keyboard, wherein the user interface may further comprise a standard wired interface, a wireless interface, etc.
Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED touch, and the like. Further, the display may also be referred to as a display screen or display unit for displaying user interfaces for processing information in the electronic device 10 and for displaying visualizations.
In one embodiment, the data storage program stored in memory 11, when executed by processor 12, performs the following operations:
A. analyzing whether the data to be stored has a determined service attribute;
in this embodiment, after receiving an instruction to store data, the data storage program loads a first mapping relationship table generated in advance, and stores the first mapping relationship table into the cache, where the data to be stored has a certain service attribute, which means that the data to be stored has a certain storage space and the data to be stored has a certain service meaning, such as a code character of a service caller, a code character of a call path, and the like.
B. If the data to be stored has the determined service attribute, replacing the data to be stored with a first target conversion field according to a predetermined first conversion rule, wherein the data to be stored is a first target code character, and the first target conversion field is smaller than the first target code character;
in this embodiment, the step of replacing the data to be stored with the first target conversion field according to the predetermined first conversion rule is, for example, acquiring a mapping relationship table between a predetermined encoding character and a corresponding conversion field;
judging whether a first target coding character matched with the data to be stored exists in the mapping relation table or not; if the data to be stored is existed, acquiring a first target conversion field corresponding to the first target code character, and replacing the part of the data to be stored, which is matched with the first target code character, with the first target conversion field corresponding to the first target code character;
specifically, matching includes complete matching and partial matching, where complete matching refers to that data to be stored is completely the same as a certain target code character in the mapping relationship table, and partial matching refers to that partial continuous code characters in the data to be stored are completely the same as the target code character, for example, a prefix or a suffix of the data to be stored is completely the same as the target code character.
If the mapping relation table does not have a first target code character matched with the data to be stored, generating a first target conversion field matched with the data to be stored according to a conversion field generation rule; replacing the data to be stored with the first target conversion field, establishing a corresponding relation between the data to be stored and the first target conversion field, and storing the corresponding relation into the mapping relation table;
in this embodiment, the conversion field generation rule may be customized as required, for example, when the target conversion field is a letter, the conversion field may be sequentially arranged and generated according to the letter order, or when the target conversion field is a number, the conversion field may be generated according to a preset data arrangement rule, and the like. Specifically, for example, the code number PA017-CFS _ ILOAN-C-CFS _ APS _ S _ AFA _ APPL _ RISK _ MOD on the consumerCode caller is mapped and converted into a 5-bit fixed length alphabet ABCDE, or converted into a fixed length number 00001 of 5, and the like.
Preferably, the conversion field is a combination of numbers of a preset length.
C. If the data to be stored does not have the determined service attribute, replacing the data to be stored with a second target conversion field according to a predetermined second conversion rule, wherein the data to be stored is a second target code character, and the second target conversion field is smaller than the second target code character;
specifically, the data to be stored includes a plurality of data, and the number of the data changes with different application scenarios or time, so that the size of the storage space of the data to be stored cannot be predetermined, for example, the traceId transaction detail data is the data to be stored without a preset service attribute;
it should be noted that the data to be stored is data generated by statistics over time, such as monitoring data of a CPU, a memory, and the like, which needs to be stored every minute and every second, and the statistical data to be stored in a timed or real-time manner is also data to be stored that does not have a preset service attribute;
the step of replacing the data to be stored with the second target conversion field according to the predetermined second conversion rule may be, for example, determining a hash value corresponding to the data to be stored according to a predetermined hash function, where the hash value is the second target conversion field.
In another embodiment of the present invention, for data that needs to be statistically generated over time, a storage rule may be preset according to an actual statistical scenario, for example, for data that needs to be stored every minute and every second, the preset storage rule is that only one line is stored for each statistical indicator every hour within a preset time, index values corresponding to the statistical indicators are divided into 60 columns and one column per minute, after such a design, only 1 data is stored for 1 hour before, and repeated storage of tag fields is reduced.
D. Storing the first target translation field or the second target translation field in a predetermined database.
It should be noted that when the database needs to be operated, such as querying, reading, and updating, the data to be operated is converted into the operation conversion character according to the first conversion rule, or the data to be operated is converted into the operation conversion character according to the second conversion rule, and the database is correspondingly operated according to the operation conversion character, so that the database operation process is simplified.
As can be seen from the foregoing embodiments, the electronic device provided in the present invention analyzes whether the data to be stored has a certain service attribute, and after the data to be stored has the certain service attribute, replaces the data to be stored with the first target conversion field according to the predetermined first conversion rule, and after the data to be stored does not have the certain service attribute, replaces the data to be stored with the second target conversion field according to the predetermined second conversion rule; storing the first target translation field or the second target translation field in a predetermined database. The data storage space can be saved, and the implementation is easy.
It should be further noted that the data storage program of the present invention may be described by program modules having the same functions according to the different functions implemented by each part of the data storage program. Fig. 2 is a schematic diagram of program modules of a data storage program in an embodiment of an electronic device according to the invention. In this embodiment, the data storage program may be divided into an acquisition module 201, a first conversion module 202, a second conversion module 203, and a storage module 204 according to different functions implemented by each part of the data storage program. As can be appreciated from the above description, the program modules referred to herein are representative of a series of computer program instructions capable of performing certain functions and are more suitable than programs for describing the execution of the data-stored program within the electronic device 10. The functions or operation steps implemented by the module 201-204 are similar to those described above, and are not detailed here, for example, where:
the analysis module 201 is configured to analyze whether the data to be stored has a certain service attribute;
the first conversion module 202 is configured to, if the data to be stored has the determined service attribute, replace the data to be stored with a first target conversion field according to a predetermined first conversion rule, where the data to be stored is a first target encoding character, and the first target conversion field is smaller than the first target encoding character;
the second conversion module 203 is configured to, if the data to be stored does not have the determined service attribute, replace the data to be stored with a second target conversion field according to a predetermined second conversion rule, where the data to be stored is a second target encoding character, and the second target conversion field is smaller than the second target encoding character;
a storage module 204, configured to store the first target conversion field or the second target conversion field in a predetermined database.
In addition, the present invention further provides a data storage method, please refer to fig. 3, where the data storage method includes the following steps:
step S301, analyzing whether the data to be stored has a determined service attribute;
in this embodiment, after receiving an instruction to store data, the data storage program loads a first mapping relationship table generated in advance, and stores the first mapping relationship table into the cache, where the data to be stored has a certain service attribute, which means that the data to be stored has a certain storage space, and the service name of the data to be stored does not change with time, such as a code character of a service caller, a code character of a call path, and the like.
Step S302, if the data to be stored has a certain service attribute, replacing the data to be stored with a first target conversion field according to a predetermined first conversion rule, wherein the data to be stored is a first target code character, and the first target conversion field is smaller than the first target code character;
in this embodiment, the step of replacing the data to be stored with the first target conversion field according to the predetermined first conversion rule may be, for example, acquiring a mapping relationship table between a predetermined encoding character and a corresponding conversion field;
judging whether a first target coding character matched with the data to be stored exists in the mapping relation table or not; if the data to be stored is existed, acquiring a first target conversion field corresponding to the first target code character, and replacing the part of the data to be stored, which is matched with the first target code character, with the first target conversion field corresponding to the first target code character;
specifically, matching includes complete matching and partial matching, where complete matching refers to that data to be stored is completely the same as a certain target code character in the mapping relationship table, and partial matching refers to that partial continuous code characters in the data to be stored are completely the same as the target code character, for example, a prefix or a suffix of the data to be stored is completely the same as the target code character.
If the mapping relation table does not have a first target code character matched with the data to be stored, generating a first target conversion field matched with the data to be stored according to a conversion field generation rule; replacing the data to be stored with the first target conversion field, establishing a corresponding relation between the data to be stored and the first target conversion field, and storing the corresponding relation into the mapping relation table;
in this embodiment, the conversion field generation rule may be customized as required, for example, when the target conversion field is a letter, the conversion field may be sequentially arranged and generated according to the letter order, or when the target conversion field is a number, the conversion field may be generated according to a preset data arrangement rule, and the like. Specifically, for example, the code number PA017-CFS _ ILOAN-C-CFS _ APS _ S _ AFA _ APPL _ RISK _ MOD on the consumerCode caller is mapped and converted into a 5-bit fixed length alphabet ABCDE, or converted into a fixed length number 00001 of 5, and the like.
Preferably, the conversion field is a combination of numbers of a preset length.
Step S303, if the data to be stored does not have the determined service attribute, replacing the data to be stored with a second target conversion field according to a predetermined second conversion rule, wherein the data to be stored is a second target code character, and the second target conversion field is smaller than the second target code character;
specifically, the data to be stored includes a plurality of data, and the number of the data changes with different application scenarios or time, so that the size of the storage space of the data to be stored cannot be predetermined, for example, the traceId transaction detail data is the data to be stored without a preset service attribute;
it should be noted that the data to be stored is data generated by statistics over time, such as monitoring data of a CPU, a memory, and the like, which needs to be stored every minute and every second, and the statistical data to be stored in a timed or real-time manner is also data to be stored that does not have a preset service attribute;
the step of replacing the data to be stored with the second target conversion field according to the predetermined second conversion rule may be, for example, determining a hash value corresponding to the data to be stored according to a predetermined hash function, where the hash value is the second target conversion field.
In another embodiment of the present invention, for data that needs to be statistically generated over time, a storage rule may be preset according to an actual statistical scenario, for example, for data that needs to be stored every minute and every second, the preset storage rule is that only one line is stored for each statistical indicator every hour within a preset time, index values corresponding to the statistical indicators are divided into 60 columns and one column per minute, after such a design, only 1 data is stored for 1 hour before, and repeated storage of tag fields is reduced.
Step S304, storing the first target conversion field or the second target conversion field in a predetermined database.
It should be noted that when the database needs to be operated, such as querying, reading, and updating, the data to be operated is converted into the operation conversion character according to the first conversion rule, or the data to be operated is converted into the operation conversion character according to the second conversion rule, and the database is correspondingly operated according to the operation conversion character, so that the database operation process is simplified.
As can be seen from the foregoing embodiments, the data storage method provided by the present invention includes analyzing whether data to be stored has a certain service attribute, and after the data to be stored has the certain service attribute, replacing the data to be stored with a first target conversion field according to a predetermined first conversion rule, and after the data to be stored does not have the certain service attribute, replacing the data to be stored with a second target conversion field according to a predetermined second conversion rule; storing the first target translation field or the second target translation field in a predetermined database. The data storage space can be saved, and the implementation is easy.
Furthermore, the present invention also provides a computer-readable storage medium, on which a data storage program is stored, which when executed by a processor implements the following operations:
analyzing whether the data to be stored has a determined service attribute;
if the data to be stored has the determined service attribute, replacing the data to be stored with a first target conversion field according to a predetermined first conversion rule, wherein the data to be stored is a first target code character, and the first target conversion field is smaller than the first target code character;
if the data to be stored does not have the determined service attribute, replacing the data to be stored with a second target conversion field according to a predetermined second conversion rule, wherein the data to be stored is a second target code character, and the second target conversion field is smaller than the second target code character;
storing the first target translation field or the second target translation field in a predetermined database.
The embodiment of the computer-readable storage medium of the present invention is substantially the same as the embodiments of the electronic device and the data storage method, and will not be described herein again.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (8)

1. An electronic device, comprising a memory, and a processor coupled to the memory, the processor configured to execute a data storage program stored on the memory, the data storage program when executed by the processor implementing the steps of:
a1, analyzing whether the data to be stored has a certain service attribute;
a2, if the data to be stored has a certain service attribute, replacing the data to be stored with a first target conversion field according to a predetermined first conversion rule, wherein the data to be stored is a first target code character, and the first target conversion field is smaller than the first target code character;
the step of replacing the data to be stored with a first target conversion field according to a predetermined first conversion rule includes:
acquiring a mapping relation table between a predetermined code character and a corresponding conversion field;
judging whether a first target coding character matched with the data to be stored exists in the mapping relation table or not;
if the data to be stored is matched with the first target code character, acquiring a first target conversion field corresponding to the first target code character, and replacing the part of the data to be stored, which is matched with the first target code character, with the first target conversion field;
the matching comprises complete matching and partial matching;
if the mapping relation table does not have a first target coding field matched with the data to be stored, generating a first target conversion field matched with the data to be stored according to a conversion field generation rule;
the conversion fields are sequentially arranged and generated based on alphabetical order or generated based on a preset data arrangement rule, and the conversion fields are field combinations with preset lengths;
replacing the data to be stored with the generated first target conversion field;
a3, if the data to be stored does not have the determined service attribute, replacing the data to be stored with a second target conversion field according to a predetermined second conversion rule, wherein the data to be stored is a second target code character, and the second target conversion field is smaller than the second target code character;
a4, storing the first target conversion field or the second target conversion field into a predetermined database.
2. The electronic device of claim 1, wherein after the step of replacing the data to be stored with the generated first target conversion field, further comprising the steps of:
and establishing a corresponding relation between the data to be stored and the generated first target conversion field, and storing the established corresponding relation into the mapping relation table.
3. The electronic device according to claim 1, wherein in the step a3, the step of replacing the data to be stored with a second target conversion field according to a predetermined second conversion rule comprises:
and determining a hash value corresponding to the data to be stored according to a predetermined hash algorithm, wherein the hash value is the second target conversion field.
4. The electronic device of any of claims 1-3, wherein the first target translation field and the second target translation field are each a combination of numbers of a preset length.
5. A method of storing data, the method comprising the steps of:
s1, analyzing whether the data to be stored has a determined service attribute;
s2, if the data to be stored has the determined service attribute, replacing the data to be stored with a first target conversion field according to a predetermined first conversion rule, wherein the data to be stored is a first target code character, and the first target conversion field is smaller than the first target code character;
the step of replacing the data to be stored with a first target conversion field according to a predetermined first conversion rule includes:
acquiring a mapping relation table between a predetermined code character and a corresponding conversion field;
judging whether a first target coding character matched with the data to be stored exists in the mapping relation table or not;
if the data to be stored is matched with the first target code character, acquiring a first target conversion field corresponding to the first target code character, and replacing the part of the data to be stored, which is matched with the first target code character, with the first target conversion field;
the matching comprises complete matching and partial matching;
if the mapping relation table does not have a first target coding field matched with the data to be stored, generating a first target conversion field matched with the data to be stored according to a conversion field generation rule;
the conversion fields are sequentially arranged and generated based on alphabetical order or generated based on a preset data arrangement rule, and the conversion fields are field combinations with preset lengths;
replacing the data to be stored with the generated first target conversion field;
s3, if the data to be stored does not have the determined service attribute, replacing the data to be stored with a second target conversion field according to a predetermined second conversion rule, wherein the data to be stored is a second target code character, and the second target conversion field is smaller than the second target code character;
s4, storing the first target conversion field or the second target conversion field into a predetermined database.
6. The data storage method of claim 5, wherein after the step of replacing the data to be stored with the generated first target translation field, further comprising the steps of:
and establishing a corresponding relation between the data to be stored and the generated first target conversion field, and storing the established corresponding relation into the mapping relation table.
7. The data storage method according to claim 5, wherein in the step S3, the step of replacing the data to be stored with a second target conversion field according to a predetermined second conversion rule comprises:
and determining a hash value corresponding to the data to be stored according to a predetermined hash algorithm, wherein the hash value is the second target conversion field.
8. A computer readable storage medium storing a data storage program executable by at least one processor to cause the at least one processor to perform the steps of the data storage method as claimed in any one of claims 5 to 7.
CN201810102247.2A 2018-02-01 2018-02-01 Electronic device, data storage method, and storage medium Active CN108388598B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201810102247.2A CN108388598B (en) 2018-02-01 2018-02-01 Electronic device, data storage method, and storage medium
PCT/CN2018/089451 WO2019148720A1 (en) 2018-02-01 2018-06-01 Electronic device, data storage method and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810102247.2A CN108388598B (en) 2018-02-01 2018-02-01 Electronic device, data storage method, and storage medium

Publications (2)

Publication Number Publication Date
CN108388598A CN108388598A (en) 2018-08-10
CN108388598B true CN108388598B (en) 2022-04-22

Family

ID=63074937

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810102247.2A Active CN108388598B (en) 2018-02-01 2018-02-01 Electronic device, data storage method, and storage medium

Country Status (2)

Country Link
CN (1) CN108388598B (en)
WO (1) WO2019148720A1 (en)

Families Citing this family (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109389510A (en) * 2018-08-13 2019-02-26 中国平安人寿保险股份有限公司 Electronic device, loss ratio Incidence calculus method and storage medium
WO2020077563A1 (en) * 2018-10-17 2020-04-23 北京比特大陆科技有限公司 Data storage method and apparatus, and electronic device and computer readable storage medium
CN111274586B (en) * 2018-12-04 2024-04-05 北京京东尚科信息技术有限公司 Method and device for storing data
CN111078682A (en) * 2019-10-17 2020-04-28 贝壳技术有限公司 Service data index construction method and system
CN113127694A (en) * 2019-12-31 2021-07-16 深圳云天励飞技术有限公司 Data storage method and device, electronic equipment and storage medium
CN111274249A (en) * 2020-01-19 2020-06-12 深圳前海微众银行股份有限公司 User image data storage optimization method, device and readable storage medium
CN111581213B (en) * 2020-05-06 2024-02-13 北京金堤科技有限公司 Information recording method, device and equipment
CN113722286A (en) * 2020-05-26 2021-11-30 杭州海康威视数字技术股份有限公司 Space-time data compression method, device, server and storage medium
CN111782148B (en) * 2020-06-30 2023-09-05 中国工商银行股份有限公司 Data storage control method and device, electronic equipment and storage medium
CN112182084A (en) * 2020-09-27 2021-01-05 上海亚新建设工程有限公司 Data format-based data automatic processing method and equipment
CN112364022B (en) * 2020-11-11 2023-11-03 贵州新凯润信息技术服务有限公司 Information deduction management method, device, computer equipment and readable storage medium
CN112347142B (en) * 2020-11-17 2024-03-01 上海幻电信息科技有限公司 Data processing method and device
CN112434015B (en) * 2020-12-08 2022-08-19 新华三大数据技术有限公司 Data storage method and device, electronic equipment and medium
CN115563187B (en) * 2022-10-17 2023-08-04 中航信移动科技有限公司 Data conversion method, storage medium and electronic equipment
CN116909688B (en) * 2023-09-14 2024-01-26 中移(苏州)软件技术有限公司 Database calling method and device, storage medium and electronic equipment

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106354617A (en) * 2016-08-29 2017-01-25 广州华多网络科技有限公司 Program compression log file output method and device
CN106446272A (en) * 2016-10-20 2017-02-22 北京百度网讯科技有限公司 Method and device for sending data
CN106815267A (en) * 2015-12-01 2017-06-09 中兴通讯股份有限公司 Date storage method and device

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7490331B2 (en) * 2003-03-04 2009-02-10 International Business Machines Corporation Mapping to and from native type formats
CN101132607B (en) * 2006-08-22 2011-07-20 上海贝尔阿尔卡特股份有限公司 Access gateway, base station and method for evolutionary multimedia broadcast multicast business
CN100536479C (en) * 2006-10-10 2009-09-02 华为技术有限公司 Service establishing, executing, mapping system and method
AU2011213842B2 (en) * 2010-09-03 2013-02-07 Tata Consultancy Services Limited A system and method of managing mapping information
CN102307136B (en) * 2011-07-06 2014-12-24 杭州华三通信技术有限公司 Method for processing message and device thereof
CN105138562A (en) * 2015-07-23 2015-12-09 小米科技有限责任公司 Data processing method and device of relational database
US10394822B2 (en) * 2015-09-25 2019-08-27 Mongodb, Inc. Systems and methods for data conversion and comparison
CN107168866B (en) * 2016-03-08 2021-02-02 阿里巴巴集团控股有限公司 Parameter analysis method and device for configuration file
CN107066591A (en) * 2017-04-18 2017-08-18 北京思特奇信息技术股份有限公司 A kind of method and device handled business

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106815267A (en) * 2015-12-01 2017-06-09 中兴通讯股份有限公司 Date storage method and device
CN106354617A (en) * 2016-08-29 2017-01-25 广州华多网络科技有限公司 Program compression log file output method and device
CN106446272A (en) * 2016-10-20 2017-02-22 北京百度网讯科技有限公司 Method and device for sending data

Also Published As

Publication number Publication date
WO2019148720A1 (en) 2019-08-08
CN108388598A (en) 2018-08-10

Similar Documents

Publication Publication Date Title
CN108388598B (en) Electronic device, data storage method, and storage medium
CN108427705B (en) Electronic device, distributed system log query method and storage medium
CN112765271A (en) Block chain transaction index storage method and device, computer equipment and medium
CN108768929B (en) Electronic device, credit investigation feedback message analysis method and storage medium
CN110597511B (en) Page automatic generation method, system, terminal equipment and storage medium
CN108415925B (en) Electronic device, data call log generation and query method and storage medium
CN110278143B (en) E-mail data processing method and device, computer equipment and storage medium
CN108449313B (en) Electronic device, Internet service system risk early warning method and storage medium
CN108491304B (en) electronic device, business system risk control method and storage medium
CN111400380A (en) Method for checking table data, electronic device and storage medium
CN112631924A (en) Automatic testing method and device, computer equipment and storage medium
CN112631911A (en) Automatic testing method and device, computer equipment and storage medium
CN111258799A (en) Error reporting information processing method, electronic device and computer readable storage medium
CN108243254B (en) Electronic device, method for releasing application upgrading version and storage medium
CN115712422A (en) Form page generation method and device, computer equipment and storage medium
CN112306473B (en) Program interface parameter transmission method, system and related equipment
CN113434122A (en) Multi-role page creation method and device, server and readable storage medium
CN113032275A (en) Method and device for testing field, electronic equipment and storage medium
CN108052521B (en) Coordinated data display method, application server and storage medium
CN110166530B (en) Processing method based on micro-service return value, electronic device and computer equipment
CN111221470A (en) Data processing method, electronic device and storage medium
CN110727576A (en) Web page testing method, device, equipment and storage medium
CN109840080B (en) Character attribute comparison method and device, storage medium and electronic equipment
CN113760237A (en) Compiling address updating method and device, terminal equipment and readable storage medium
CN114625372A (en) Automatic component compiling method and device, computer 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