CN115809241A - Data storage method and device, computer equipment and storage medium - Google Patents

Data storage method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN115809241A
CN115809241A CN202211446273.XA CN202211446273A CN115809241A CN 115809241 A CN115809241 A CN 115809241A CN 202211446273 A CN202211446273 A CN 202211446273A CN 115809241 A CN115809241 A CN 115809241A
Authority
CN
China
Prior art keywords
data
target
log
statement
building statement
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.)
Pending
Application number
CN202211446273.XA
Other languages
Chinese (zh)
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 Property and Casualty Insurance Company of China Ltd
Original Assignee
Ping An Property and Casualty Insurance Company of China 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 Property and Casualty Insurance Company of China Ltd filed Critical Ping An Property and Casualty Insurance Company of China Ltd
Priority to CN202211446273.XA priority Critical patent/CN115809241A/en
Publication of CN115809241A publication Critical patent/CN115809241A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the application belongs to the field of big data, and relates to a data storage method, which comprises the following steps: if a data storage request triggered by a user is received, displaying an information filling page; receiving library names, table names and interface description information input by a user; displaying a table building statement template based on the table name, and modifying the table building statement template based on modification information input by a user to obtain a target table building statement; creating a data table based on the target table building statement; acquiring target data corresponding to a log data field based on a log file of a target interface corresponding to the interface description information; and filling the target data into the data table, generating a target data table corresponding to the table name, and storing the target data table into a database corresponding to the library name. The application also provides a data storage device, a computer device and a storage medium. In addition, the application also relates to a block chain technology, and the target data table can be stored in the block chain. The method and the device improve the flexibility and intelligence of log storage.

Description

Data storage method and device, computer equipment and storage medium
Technical Field
The present application relates to the field of big data technologies, and in particular, to a data storage method and apparatus, a computer device, and a storage medium.
Background
The log may record information about hardware, software, and system problems in the system, while also monitoring events occurring in the system. Currently, the log is a very common data in the field of financial technology, and many financial technology companies, such as insurance companies, can check the cause of an error or find the trace left by an attacker when the attacker is attacked by the log. However, the inventor finds that the log data storage mode applied to most business systems at present can only store the full amount of log data generated by the interface, so that the information redundancy exists, the data storage resource is wasted, the flexibility of log storage is poor, and the intelligence is lacked.
Disclosure of Invention
An object of the embodiments of the present application is to provide a data storage method, an apparatus, a computer device, and a storage medium, so as to solve the technical problems that the existing log data storage method applied to most service systems can only store the full amount of log data generated by an interface, so that information redundancy exists, data storage resources are wasted, the flexibility of log storage is poor, and intelligence is lacking.
In order to solve the above technical problem, an embodiment of the present application provides a data storage method, which adopts the following technical solutions:
if a data storage request triggered by a user is received, displaying a preset information filling page;
receiving library names, table names and interface description information input by the user on the information filling page;
displaying a preset table building statement template based on the table name, and modifying the table building statement template based on modification information input by the user to obtain a corresponding target table building statement; wherein the modification information includes at least a log data field;
creating a corresponding data table based on the target table building statement;
acquiring target data corresponding to the log data field based on a log file of a target interface corresponding to the interface description information;
and filling the target data into the data table, generating a target data table corresponding to the table name, and storing the target data table into a database corresponding to the library name.
Further, the step of displaying a preset table building statement template based on the table name specifically includes:
acquiring a specified data table corresponding to the table name;
acquiring a table structure of the specified data table;
generating the table building statement template based on the table structure;
and displaying the table building sentence template.
Further, the step of modifying the table building statement template based on the modification information input by the user to obtain a corresponding target table building statement specifically includes:
analyzing a full-scale field corresponding to the target interface based on the interface description information;
displaying all the full-amount fields;
receiving selection information for all the full-size fields input by the user;
acquiring a designated field corresponding to the selection information to obtain a log data field;
and modifying the table building statement template based on the log data field to obtain the target table building statement.
Further, the step of creating a corresponding data table based on the target table building statement specifically includes:
acquiring a preset statement specification;
checking the target table building statement based on the statement specification, and judging whether the target table building statement conforms to the statement specification;
and if the statement specification is met, executing the step of creating the corresponding data table based on the target table building statement.
Further, the step of obtaining the target data corresponding to the log data field based on the log file of the target interface corresponding to the interface description information specifically includes:
reading a log file of the target interface corresponding to the interface description information from the database corresponding to the library name;
performing data screening on the log file based on the log data field, and acquiring field parameter data corresponding to the log data field from the log file;
and taking the field parameter data as the target data.
Further, the step of performing data screening on the log file based on the log data field and acquiring field parameter data corresponding to the log data field from the log file specifically includes:
respectively creating database query sentences corresponding to the log data fields;
executing each database query statement, and acquiring data query results corresponding to each database query statement from the log data in the database;
and taking all the data query results as field parameter data corresponding to the log data fields.
Further, the step of filling the target data into the data table, generating a target data table corresponding to the table name, and storing the target data table into the database corresponding to the library name specifically includes:
filling the target data into parameter filling positions associated with the log data fields contained in the data table in a one-to-one correspondence manner to obtain a filled data table;
taking the filled data table as the target data table;
and storing the target data table into the database.
In order to solve the foregoing technical problem, an embodiment of the present application further provides a data storage device, which adopts the following technical solutions:
the display module is used for displaying a preset information filling page if a data storage request triggered by a user is received;
the receiving module is used for receiving the library name, the table name and the interface description information which are input by the user on the information filling page;
the modification module is used for displaying a preset table building statement template based on the table name and modifying the table building statement template based on modification information input by the user to obtain a corresponding target table building statement; wherein the modification information includes at least a log data field;
the creating module is used for creating a corresponding data table based on the target table building statement;
the acquisition module is used for acquiring target data corresponding to the log data field based on a log file of a target interface corresponding to the interface description information;
and the storage module is used for filling the target data into the data table, generating a target data table corresponding to the table name and storing the target data table into a database corresponding to the library name.
In order to solve the above technical problem, an embodiment of the present application further provides a computer device, which adopts the following technical solutions:
if a data storage request triggered by a user is received, displaying a preset information filling page;
receiving library names, table names and interface description information input by the user on the information filling page;
displaying a preset table building statement template based on the table name, and modifying the table building statement template based on modification information input by the user to obtain a corresponding target table building statement; wherein the modification information includes at least a log data field;
creating a corresponding data table based on the target table building statement;
acquiring target data corresponding to the log data field based on a log file of a target interface corresponding to the interface description information;
and filling the target data into the data table, generating a target data table corresponding to the table name, and storing the target data table into a database corresponding to the library name.
In order to solve the foregoing technical problem, an embodiment of the present application further provides a computer-readable storage medium, which adopts the following technical solutions:
if a data storage request triggered by a user is received, displaying a preset information filling page;
receiving library names, table names and interface description information input by the user on the information filling page;
displaying a preset table building statement template based on the table name, and modifying the table building statement template based on modification information input by the user to obtain a corresponding target table building statement; wherein the modification information includes at least a log data field;
creating a corresponding data table based on the target table building statement;
acquiring target data corresponding to the log data field based on a log file of a target interface corresponding to the interface description information;
and filling the target data into the data table, generating a target data table corresponding to the table name, and storing the target data table into a database corresponding to the library name.
Compared with the prior art, the embodiment of the application mainly has the following beneficial effects:
when a data storage request triggered by a user is received, a preset information filling page is displayed firstly; then receiving library names, table names and interface description information input by a user on the information filling page; then, displaying a preset table building statement template based on the table name, and modifying the table building statement template based on modification information input by a user to obtain a corresponding target table building statement; subsequently, a corresponding data table is created based on the target table building statement; acquiring target data corresponding to the log data field based on the log file of the target interface corresponding to the interface description information; and finally, filling the target data into the data table, generating a target data table corresponding to the table name, and storing the target data table into a database corresponding to the library name. According to the log file processing method and device, the log file corresponding to the target interface in the database is subjected to corresponding data screening through the log storage identification information input by the user, so that only part of log data corresponding to the log data field needs to be stored in the database subsequently, the log data in the log file does not need to be stored in full, the situations of information redundancy and data storage resource waste are effectively avoided, the flexibility and intelligence of log storage are improved, and the use experience of the user is improved.
Drawings
In order to more clearly illustrate the solution of the present application, the drawings needed for describing the embodiments of the present application will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present application, and that other drawings can be obtained by those skilled in the art without inventive effort.
FIG. 1 is an exemplary system architecture diagram in which the present application may be applied;
FIG. 2 is a flow diagram of one embodiment of a data storage method according to the present application;
FIG. 3 is a schematic block diagram of one embodiment of a data storage device according to the present application;
FIG. 4 is a schematic block diagram of one embodiment of a computer device according to the present application.
Detailed Description
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs; the terminology used in the description of the application herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application; the terms "including" and "having," and any variations thereof, in the description and claims of this application and the description of the above figures are intended to cover non-exclusive inclusions. The terms "first," "second," and the like in the description and claims of this application or in the above-described drawings are used for distinguishing between different objects and not for describing a particular order.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the application. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is explicitly and implicitly understood by one skilled in the art that the embodiments described herein can be combined with other embodiments.
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings.
As shown in fig. 1, the system architecture 100 may include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 serves as a medium for providing communication links between the terminal devices 101, 102, 103 and the server 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The user may use the terminal devices 101, 102, 103 to interact with the server 105 via the network 104 to receive or send messages or the like. The terminal devices 101, 102, 103 may have various communication client applications installed thereon, such as a web browser application, a shopping application, a search application, an instant messaging tool, a mailbox client, social platform software, and the like.
The terminal devices 101, 102, 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, e-book readers, MP3 players (Mov I picture experts Group Aud I o Layer I, mpeg compression standard audio Layer 3), MP4 players (Mov I picture experts Group Aud I o Layer I V, mpeg compression standard audio Layer 4), laptop portable computers, desktop computers, and the like.
The server 105 may be a server providing various services, such as a background server providing support for pages displayed on the terminal devices 101, 102, 103.
It should be noted that the data storage method provided in the embodiments of the present application is generally executed by a server/terminal device, and accordingly, the data storage apparatus is generally disposed in the server/terminal device.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
With continued reference to FIG. 2, a flow diagram of one embodiment of a data storage method according to the present application is shown. The data storage method comprises the following steps:
step S201, if a data storage request triggered by a user is received, displaying a preset information-filled page.
In this embodiment, the electronic device (for example, the server/terminal device shown in fig. 1) on which the data storage method operates may obtain the data storage request triggered by the user through a wired connection manner or a wireless connection manner. It should be noted that the wireless connection means may include, but is not limited to, a 3G/4G/5G connection, a wifi connection, a bluetooth connection, a wimax connection, a Z i gbee connection, a UWB (u l t ra W i deband) connection, and other wireless connection means now known or developed in the future. The user can trigger the generation of the data storage request by clicking a preset data storage button. The information filling page is a page which is constructed in advance according to business requirements and needs to be filled with information related to log data storage.
Step S202, receiving the library name, the table name and the interface description information input by the user on the information filling page.
In this embodiment, the library name refers to a name of a database for storing log data of the interface, and the table name may refer to a name of a data table including a table structure corresponding to an actual service requirement of the user. The interface description information refers to interface description information of a target interface, the interface description information and the target interface have a one-to-one correspondence relationship, and the interface description information may include information such as an interface name of the target interface, a parameter entry field and a meal exit field of the target interface. The library name, the table name, and the interface description information may be collectively referred to as log storage identification information.
Step S203, displaying a preset table building statement template based on the table name, and modifying the table building statement template based on modification information input by the user to obtain a corresponding target table building statement; wherein the modification information includes at least a log data field.
In this embodiment, the specific implementation process of displaying the preset table building statement template based on the table name and modifying the table building statement template based on the modification information input by the user to obtain the corresponding target table building statement is described in further detail in the subsequent specific embodiments, and will not be described in detail herein.
And step S204, creating a corresponding data table based on the target table building statement.
In this embodiment, the target table building statement is executed to create the corresponding data table.
Step S205, obtaining target data corresponding to the log data field based on the log file of the target interface corresponding to the interface description information.
In this embodiment, the specific implementation process of obtaining the target data corresponding to the log data field based on the log file of the target interface corresponding to the interface description information is described in further detail in the following specific embodiments, and will not be elaborated herein.
Step S206, filling the target data into the data table, generating a target data table corresponding to the table name, and storing the target data table into the database corresponding to the library name.
In this embodiment, after the target data table is generated, the user may further customize the sequence, naming and remarks of the fields in the target data table, modify the original field names, and support adding or deleting fields on the target data table. In the above-mentioned specific implementation process of filling the target data into the data table, generating the target data table corresponding to the table name, and storing the target data table into the database corresponding to the library name, further details of this will be described in the following specific embodiments, which are not described herein too much.
When a data storage request triggered by a user is received, displaying a preset information filling page; then receiving library names, table names and interface description information input by a user on the information filling page; then, displaying a preset table building statement template based on the table name, and modifying the table building statement template based on modification information input by a user to obtain a corresponding target table building statement; subsequently, a corresponding data table is created based on the target table building statement; acquiring target data corresponding to the log data field based on the log file of the target interface corresponding to the interface description information; and finally, filling the target data into the data table, generating a target data table corresponding to the table name, and storing the target data table into a database corresponding to the library name. According to the method and the device, the log file corresponding to the target interface in the database is subjected to corresponding data screening through the log storage identification information input by the user, so that only part of log data corresponding to the log data field needs to be stored in the database subsequently, the log data in the log file does not need to be stored in full, the situations of information redundancy and data storage resource waste are effectively avoided, the flexibility and intelligence of log storage are improved, and the use experience of the user is improved.
In some optional implementations, the presenting a preset table building statement template based on the table name in step S3 includes the following steps:
and acquiring a specified data table corresponding to the table name.
In this embodiment, the table names of the data tables have a one-to-one mapping relationship with the data tables, and the specified data table corresponding to the table name may be obtained from the database based on the mapping relationship.
And acquiring the table structure of the specified data table.
In this embodiment, the data table is a location in the database where data is stored, and is a structured file. The table structure is used to define fields, types, primary keys, foreign keys, indexes, etc. of a data table.
And generating the table building statement template based on the table structure.
In the present embodiment, a table building statement is a statement for building a data table. After the specified data table corresponding to the table name is obtained, the table structure of the specified data table is read, and then the table building statement can be generated according to the table structure.
And displaying the table building statement template.
In this embodiment, the display mode of the table building statement template is not specifically limited, and may be set according to actual use requirements.
The method comprises the steps of obtaining a specified data table corresponding to a table name; then, acquiring a table structure of the specified data table; and then the table structure is used for generating the table building statement template, and the table building statement template is displayed, so that the table name input by the user is used for generating the matched table building statement template, the user can define the table structure for storing the required log data according to the actual requirement of the user, the flexibility and intelligence of log storage are improved, and the use experience of the user is improved.
In some optional implementation manners of this embodiment, the modifying the table building statement template based on the modification information input by the user in step S3 to obtain a corresponding target table building statement includes the following steps:
and analyzing a full-size field corresponding to the target interface based on the interface description information.
In this embodiment, a target interface corresponding to the interface description information may be determined first. And then automatically analyzing all the corresponding parameter fields, namely the full-quantity fields according to the dictionary structure of the target interface. Wherein the dictionary structure of the target interface supports one or more layers of dictionary structure parsing.
All of the full size fields are shown.
In this embodiment, the display manner of the total field is not specifically limited, and may be set according to actual use requirements.
Receiving selection information for all of the full-size fields input by the user.
In this embodiment, the user can select the fields corresponding to the part of log data to be stored from all the full-size fields according to actual service requirements, so that the use experience of the user is improved.
And acquiring a designated field corresponding to the selection information to obtain the log data field.
In this embodiment, when the designated field corresponding to the selection information is obtained, the designated field is used as the log data field.
And modifying the table building statement template based on the log data field to obtain the target table building statement.
In this embodiment, a field of a data table to be constructed, which is included in the above table building statement template, may be replaced based on the log data field to obtain the target table building statement.
Analyzing a total field corresponding to the target interface based on the interface description information, and displaying all the total fields; then receiving selection information input by the user for all the full-amount fields; then acquiring a designated field corresponding to the selection information to obtain the log data field; and modifying the table building statement template based on the log data field to obtain the target table building statement. According to the embodiment, the log data fields needing to be subjected to key monitoring and storage can be selected from all the full-volume fields corresponding to the target interface based on the personal requirements of the user, and then, all the log data corresponding to the log data fields can be stored subsequently, so that the log data in the log file do not need to be stored in full volume, the situations of information redundancy and data storage resource waste are effectively avoided, the flexibility and intelligence of log storage are improved, and the use experience of the user is improved.
In some alternative implementations, step S204 includes the following steps:
and acquiring a preset statement specification.
In this embodiment, the statement specification is a standard specification that is constructed in advance according to actual service requirements and is used for determining whether a table building statement is qualified. The statement specification can set standard statement format and standard grammar rule of the table building statement
And checking the target table building statement based on the statement specification, and judging whether the target table building statement conforms to the statement specification.
In this embodiment, checking the target table creation statement based on the statement specification means detecting whether the target table creation statement conforms to the standard statement format and conforms to the standard syntax rule.
And if the statement specification is met, executing the step of creating the corresponding data table based on the target table building statement.
In this embodiment, if the target table creation statement conforms to both the standard statement format and the standard grammar rule, it is determined that the target table creation statement conforms to the statement specification. If the detected target table building statement does not accord with the statement specification, modification reminding information corresponding to the statement specification is generated and displayed to remind a user of further modifying the target table building statement, so that the final target table building statement can accord with the statement specification.
After the target table building statement is obtained, the preset statement specification can be intelligently obtained; and further checking the target table building statement based on the statement specification, judging whether the target table building statement conforms to the statement specification, and executing the processing step of creating the corresponding data table based on the target table building statement only when the target table building statement is detected to conform to the statement specification, so that the normalization and the accuracy of the generated target table building statement are effectively ensured, and the processing normalization of the data storage request is improved.
In some optional implementations, step S205 includes the following steps:
and reading the log file of the target interface corresponding to the interface description information from the database corresponding to the library name.
In this embodiment, the database stores log files corresponding to different interfaces, and the log files of each interface have a one-to-one association relationship with each interface. After the target interface is determined based on the interface description information, the log file of the target interface corresponding to the interface description information can be read from the database.
And performing data screening on the log file based on the log data field, and acquiring field parameter data corresponding to the log data field from the log file.
In this embodiment, the file content of the log file may be read first, and the file content may be converted into a corresponding i st table, and then the i st table is traversed based on the log data field in a circulating manner, a target field matched with the log data field is queried from the i st table first, and then the parameter data corresponding to the target field is screened from the i st table, so as to obtain the parameter data.
And taking the field parameter data as the target data.
The method comprises the steps of reading a log file of the target interface corresponding to the interface description information from the database corresponding to the library name; and then, performing data screening on the log file based on the log data field, acquiring field parameter data corresponding to the log data field from the log file, and taking the field parameter data as the target data. By correspondingly screening the log files corresponding to the target interface in the database based on the log data fields, only part of log data corresponding to the log data fields needs to be stored in the database subsequently, so that the log data in the log files does not need to be stored in full, the situations of information redundancy and data storage resource waste are effectively avoided, the flexibility and intelligence of log storage are improved, and the use experience of a user is improved.
In some optional implementation manners of this embodiment, the performing data screening on the log file based on the log data field, and acquiring field parameter data corresponding to the log data field from the log file includes the following steps:
and respectively creating database query sentences respectively corresponding to the log data fields.
In this embodiment, for each log data field, a field identifier corresponding to the log data field may be obtained based on a preset mapping table, and then a file identifier of a log file including the log data field is detected from the database, so that the field identifier and the file identifier are respectively determined as a first preset parameter and a second preset parameter reserved in a preset structured query statement SQL, and a database query statement corresponding to the log data field is obtained.
And executing each database query statement, and acquiring data query results corresponding to each database query statement from the log data in the database.
In this embodiment, by executing each database query statement, a data query result corresponding to the database query statement may be obtained from the log data in the database.
And taking all the data query results as field parameter data corresponding to the log data fields.
The method comprises the steps of respectively creating database query sentences corresponding to log data fields; then executing each database query statement, and acquiring data query results corresponding to each database query statement from the log data in the database; and then taking all the data query results as field parameter data corresponding to the log data fields. According to the method and the device, the corresponding database query statement is constructed based on the log data field, so that the field parameter data corresponding to the log data field can be quickly and accurately acquired from the log data in the database by executing the database query statement and used as the target data, and the acquisition efficiency and the data accuracy of the target data are guaranteed.
In some optional implementations of this embodiment, step S206 includes the following steps:
and filling the target data into parameter filling positions associated with the log data fields contained in the data table in a one-to-one correspondence manner to obtain the filled data table.
In this embodiment, for each target data, the target data may be filled into a parameter filling position included in the data table to which a target data field corresponding to the target data belongs, that is, a data column to which the target data field belongs.
And taking the filled data table as the target data table.
And storing the target data table into the database.
In this embodiment, after the target data table is completely stored in the database, the log file of the target interface in the database may be further deleted, so as to release the available space of the database.
The target data are filled into parameter filling positions associated with the log data fields contained in the data table in a one-to-one correspondence mode to obtain a filled data table, and the filled data table is used as the target data table; and the target data table is stored in the database, so that the target data in the data table can be accurately filled, the data accuracy of the generated target data table is ensured, and the storage accuracy of the target data table is ensured.
It is emphasized that, to further ensure the privacy and security of the target data table, the target data table may also be stored in a node of a block chain.
The block chain referred by the application is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, an encryption algorithm and the like. The block chain (B l ockcha i n), which is essentially a decentralized database, is a string of data blocks associated by using cryptography, and each data block contains information of a batch of network transactions, which is used for verifying the validity (anti-counterfeiting) of the information and generating the next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, and the like.
The embodiment of the application can acquire and process related data based on an artificial intelligence technology. The artificial intelligence (Art I f I c I a l I nte l I gene, AI) is a theory, method, technique and application system for simulating, extending and expanding human intelligence by using a digital computer or a machine controlled by a digital computer, sensing environment, acquiring knowledge and obtaining the best result by using the knowledge.
The artificial intelligence base technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technologies, operation/interaction systems, mechatronics, and the like. The artificial intelligence software technology mainly comprises a computer vision technology, a robot technology, a biological recognition technology, a voice processing technology, a natural language processing technology, machine learning/deep learning and the like.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware associated with computer readable instructions, which can be stored in a computer readable storage medium, and when executed, the processes of the embodiments of the methods described above can be included. The storage medium may be a non-volatile storage medium such as a magnetic disk, an optical disk, a Read-only Memory (ROM), or a Random Access Memory (RAM).
It should be understood that, although the steps in the flowcharts of the figures are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and may be performed in other orders unless explicitly stated herein. Moreover, at least a portion of the steps in the flow chart of the figure may include multiple sub-steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of execution is not necessarily sequential, but may be performed alternately or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
With further reference to fig. 3, as an implementation of the method shown in fig. 2, the present application provides an embodiment of a data storage device, which corresponds to the embodiment of the method shown in fig. 2, and which can be applied to various electronic devices.
As shown in fig. 3, the data storage device 300 according to the present embodiment includes: a presentation module 301, a receiving module 302, a modifying module 303, a creating module 304, an obtaining module 305, and a storing module 306. Wherein:
the display module 301 is configured to display a preset information filling page if a data storage request triggered by a user is received;
a receiving module 302, configured to receive a library name, a table name, and interface description information that are input by the user on the information filling page;
a modification module 303, configured to display a preset table building statement template based on the table name, and modify the table building statement template based on modification information input by the user to obtain a corresponding target table building statement; wherein the modification information includes at least a log data field;
a creating module 304, configured to create a corresponding data table based on the target table creation statement;
an obtaining module 305, configured to obtain target data corresponding to the log data field based on a log file of a target interface corresponding to the interface description information;
the storage module 306 is configured to fill the target data into the data table, generate a target data table corresponding to the table name, and store the target data table in the database corresponding to the library name.
In this embodiment, the operations performed by the modules or units are in one-to-one correspondence with the steps of the data storage method in the foregoing embodiment, and are not described herein again.
In some optional implementations of this embodiment, the receiving module 302 includes:
the first acquisition submodule is used for acquiring a specified data table corresponding to the table name;
the second obtaining submodule is used for obtaining the table structure of the specified data table;
a generating submodule for generating the table building statement template based on the table structure;
and the first display submodule is used for displaying the table building statement template.
In this embodiment, the operations executed by the modules or units respectively correspond to the steps of the data storage method in the foregoing embodiment one by one, and are not described herein again.
In some optional implementations of this embodiment, the receiving module 302 further includes:
the analysis submodule is used for analyzing a full field corresponding to the target interface based on the interface description information;
the second display submodule is used for displaying all the full-scale fields;
the receiving submodule is used for receiving selection information input by the user and used for all the full-quantity fields;
a third obtaining submodule, configured to obtain a specified field corresponding to the selection information, and obtain the log data field;
and the modification submodule is used for modifying the table building statement template based on the log data field to obtain the target table building statement.
In this embodiment, the operations executed by the modules or units respectively correspond to the steps of the data storage method in the foregoing embodiment one to one, and are not described herein again.
In some optional implementations of this embodiment, the creating module 304 includes:
the fourth obtaining sub-module is used for obtaining a preset statement specification;
the checking submodule is used for checking the target table building statement based on the statement specification and judging whether the target table building statement conforms to the statement specification;
and the execution submodule is used for executing the step of creating the corresponding data table based on the target table building statement if the statement specification is met.
In this embodiment, the operations executed by the modules or units respectively correspond to the steps of the data storage method in the foregoing embodiment one by one, and are not described herein again.
In some optional implementations of this embodiment, the obtaining module 305 includes:
the reading sub-module is used for reading a log file of the target interface corresponding to the interface description information from the database corresponding to the library name;
the screening submodule is used for screening the log file based on the log data field and acquiring field parameter data corresponding to the log data field from the log file;
and the first determining submodule is used for taking the field parameter data as the target data.
In this embodiment, the operations executed by the modules or units respectively correspond to the steps of the data storage method in the foregoing embodiment one by one, and are not described herein again.
In some optional implementations of this embodiment, the screening submodule includes:
the creating unit is used for respectively creating database query sentences corresponding to the log data fields;
the acquisition unit is used for executing each database query statement and acquiring data query results corresponding to each database query statement from the log data in the database;
and the determining unit is used for taking all the data query results as field parameter data corresponding to the log data fields.
In this embodiment, the operations executed by the modules or units respectively correspond to the steps of the data storage method in the foregoing embodiment one by one, and are not described herein again.
In some optional implementations of this embodiment, the storage module 306 includes:
the filling submodule is used for filling the target data into parameter filling positions associated with the log data fields contained in the data table in a one-to-one correspondence mode to obtain a filled data table;
a second determining submodule, configured to use the filled data table as the target data table;
and the storage submodule is used for storing the target data table into the database.
In this embodiment, the operations executed by the modules or units respectively correspond to the steps of the data storage method in the foregoing embodiment one by one, and are not described herein again.
In order to solve the technical problem, an embodiment of the present application further provides a computer device. Referring to fig. 4, fig. 4 is a block diagram of a basic structure of a computer device according to the present embodiment.
The computer device 4 comprises a memory 41, a processor 42, a network interface 43 communicatively connected to each other via a system bus. It is noted that only computer device 4 having components 41-43 is shown, but it is understood that not all of the shown components are required to be implemented, and that more or fewer components may be implemented instead. AS will be understood by those skilled in the art, the computer device herein is a device capable of automatically performing numerical calculation and/or information processing according to preset or stored instructions, and the hardware thereof includes, but is not limited to, a microprocessor, an application specific integrated circuit (App I cat I on pec I C I integrated C I rcu t, AS ic), a programmable Gate array (F I e D-programmable Gate Ar ray, FPGA), a digital Processor (D I g ta l S I gn a Processor, DSP), an embedded device, and the like.
The computer device can be a desktop computer, a notebook, a palm computer, a cloud server and other computing devices. The computer equipment can carry out man-machine interaction with a user through a keyboard, a mouse, a remote controller, a touch panel or voice control equipment and the like.
The memory 41 includes at least one type of readable storage medium including 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, etc. In some embodiments, the memory 41 may be an internal storage unit of the computer device 4, such as a hard disk or a memory of the computer device 4. In other embodiments, the memory 41 may also be an external storage device of the computer device 4, such as a plug-in hard disk, a Smart Memory Card (SMC), a Secure digital (Secure D i g i ta l, SD) Card, a flash memory Card (F l ash Card), and the like, which are provided on the computer device 4. Of course, the memory 41 may also include both internal and external storage devices of the computer device 4. In this embodiment, the memory 41 is generally used for storing an operating system installed in the computer device 4 and various types of application software, such as computer readable instructions of a data storage method. Further, the memory 41 may also be used to temporarily store various types of data that have been output or are to be output.
The processor 42 may be a Central Processing Unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chip in some embodiments. The processor 42 is typically used to control the overall operation of the computer device 4. In this embodiment, the processor 42 is configured to execute computer readable instructions stored in the memory 41 or process data, such as computer readable instructions for executing the data storage method.
The network interface 43 may comprise a wireless network interface or a wired network interface, and the network interface 43 is generally used for establishing communication connection between the computer device 4 and other electronic devices.
Compared with the prior art, the embodiment of the application mainly has the following beneficial effects:
in the embodiment of the application, when a data storage request triggered by a user is received, a preset information filling page is displayed firstly; then receiving library names, table names and interface description information input by a user on the information filling page; then, displaying a preset table building statement template based on the table name, and modifying the table building statement template based on modification information input by a user to obtain a corresponding target table building statement; subsequently, a corresponding data table is created based on the target table building statement; acquiring target data corresponding to the log data field based on the log file of the target interface corresponding to the interface description information; and finally, filling the target data into the data table, generating a target data table corresponding to the table name, and storing the target data table into a database corresponding to the library name. According to the log file processing method and device, the log file corresponding to the target interface in the database is subjected to corresponding data screening through the log storage identification information input by the user, so that only part of log data corresponding to the log data field needs to be stored in the database subsequently, the log data in the log file does not need to be stored in full, the situations of information redundancy and data storage resource waste are effectively avoided, the flexibility and intelligence of log storage are improved, and the use experience of the user is improved.
The present application further provides another embodiment, which is to provide a computer-readable storage medium storing computer-readable instructions executable by at least one processor to cause the at least one processor to perform the steps of the data storage method as described above.
Compared with the prior art, the embodiment of the application mainly has the following beneficial effects:
in the embodiment of the application, when a data storage request triggered by a user is received, a preset information filling page is displayed firstly; then receiving library names, table names and interface description information input by a user on the information filling page; then, displaying a preset table building statement template based on the table name, and modifying the table building statement template based on modification information input by a user to obtain a corresponding target table building statement; subsequently, a corresponding data table is created based on the target table building statement; acquiring target data corresponding to the log data field based on the log file of the target interface corresponding to the interface description information; and finally, filling the target data into the data table, generating a target data table corresponding to the table name, and storing the target data table into a database corresponding to the library name. According to the log file processing method and device, the log file corresponding to the target interface in the database is subjected to corresponding data screening through the log storage identification information input by the user, so that only part of log data corresponding to the log data field needs to be stored in the database subsequently, the log data in the log file does not need to be stored in full, the situations of information redundancy and data storage resource waste are effectively avoided, the flexibility and intelligence of log storage are improved, and the use experience of the user is improved.
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 application 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 application.
It is to be understood that the above-described embodiments are merely illustrative of some, but not restrictive, of the broad invention, and that the appended drawings illustrate preferred embodiments of the invention and do not limit the scope of the invention. This application is capable of embodiments in many different forms and the embodiments are provided so that this disclosure will be thorough and complete. Although the present application has been described in detail with reference to the foregoing embodiments, it will be apparent to one skilled in the art that modifications can be made to the embodiments described in the foregoing detailed description, or equivalents can be substituted for some of the features described therein. All equivalent structures made by using the contents of the specification and the drawings of the present application are directly or indirectly applied to other related technical fields and are within the protection scope of the present application.

Claims (10)

1. A method of storing data, comprising the steps of:
if a data storage request triggered by a user is received, displaying a preset information filling page;
receiving library names, table names and interface description information input by the user on the information filling page;
displaying a preset table building statement template based on the table name, and modifying the table building statement template based on modification information input by the user to obtain a corresponding target table building statement; wherein the modification information includes at least a log data field;
creating a corresponding data table based on the target table building statement;
acquiring target data corresponding to the log data field based on a log file of a target interface corresponding to the interface description information;
and filling the target data into the data table, generating a target data table corresponding to the table name, and storing the target data table into a database corresponding to the library name.
2. The data storage method of claim 1, wherein the step of presenting the preset table building statement template based on the table name specifically comprises:
acquiring a specified data table corresponding to the table name;
acquiring a table structure of the specified data table;
generating the table building statement template based on the table structure;
and displaying the table building statement template.
3. The data storage method according to claim 1, wherein the step of modifying the table building statement template based on the modification information input by the user to obtain the corresponding target table building statement specifically comprises:
analyzing a full-scale field corresponding to the target interface based on the interface description information;
displaying all the full-amount fields;
receiving selection information for all the full-size fields input by the user;
acquiring a designated field corresponding to the selection information to obtain a log data field;
and modifying the table building statement template based on the log data field to obtain the target table building statement.
4. The data storage method according to claim 1, wherein the step of creating the corresponding data table based on the target table building statement specifically includes:
acquiring a preset statement specification;
checking the target table building statement based on the statement specification, and judging whether the target table building statement conforms to the statement specification;
and if the statement specification is met, executing the step of creating the corresponding data table based on the target table building statement.
5. The data storage method according to claim 1, wherein the step of obtaining the target data corresponding to the log data field based on the log file of the target interface corresponding to the interface description information specifically includes:
reading a log file of the target interface corresponding to the interface description information from the database corresponding to the library name;
performing data screening on the log file based on the log data field, and acquiring field parameter data corresponding to the log data field from the log file;
and taking the field parameter data as the target data.
6. The data storage method according to claim 5, wherein the step of performing data screening on the log file based on the log data field and acquiring field parameter data corresponding to the log data field from the log file specifically comprises:
respectively creating database query sentences respectively corresponding to the log data fields;
executing each database query statement, and acquiring data query results corresponding to each database query statement from the log data in the database;
and taking all the data query results as field parameter data corresponding to the log data fields.
7. The data storage method according to claim 1, wherein the step of filling the target data into the data table, generating a target data table corresponding to the table name, and storing the target data table into the database corresponding to the library name specifically comprises:
filling the target data into parameter filling positions associated with the log data fields contained in the data table in a one-to-one correspondence manner to obtain a filled data table;
taking the filled data table as the target data table;
and storing the target data table into the database.
8. A data storage device, comprising:
the display module is used for displaying a preset information filling page if a data storage request triggered by a user is received;
the receiving module is used for receiving the library name, the table name and the interface description information which are input by the user on the information filling page;
the modification module is used for displaying a preset table building statement template based on the table name and modifying the table building statement template based on modification information input by the user to obtain a corresponding target table building statement; wherein the modification information includes at least a log data field;
the creating module is used for creating a corresponding data table based on the target table building statement;
the acquisition module is used for acquiring target data corresponding to the log data field based on the log file of the target interface corresponding to the interface description information;
and the storage module is used for filling the target data into the data table, generating a target data table corresponding to the table name and storing the target data table into a database corresponding to the library name.
9. A computer device comprising a memory having computer readable instructions stored therein and a processor which when executed implements the steps of a data storage method as claimed in any one of claims 1 to 7.
10. A computer readable storage medium having computer readable instructions stored thereon which, when executed by a processor, implement the steps of the data storage method of any one of claims 1 to 7.
CN202211446273.XA 2022-11-18 2022-11-18 Data storage method and device, computer equipment and storage medium Pending CN115809241A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211446273.XA CN115809241A (en) 2022-11-18 2022-11-18 Data storage method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211446273.XA CN115809241A (en) 2022-11-18 2022-11-18 Data storage method and device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115809241A true CN115809241A (en) 2023-03-17

Family

ID=85483514

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211446273.XA Pending CN115809241A (en) 2022-11-18 2022-11-18 Data storage method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115809241A (en)

Similar Documents

Publication Publication Date Title
CN112181835A (en) Automatic testing method and device, computer equipment and storage medium
CN115712422A (en) Form page generation method and device, computer equipment and storage medium
CN115794437A (en) Calling method and device of microservice, computer equipment and storage medium
CN116956326A (en) Authority data processing method and device, computer equipment and storage medium
CN116453125A (en) Data input method, device, equipment and storage medium based on artificial intelligence
CN116383787A (en) Page creation method, page creation device, computer equipment and storage medium
CN115757075A (en) Task abnormity detection method and device, computer equipment and storage medium
CN114968725A (en) Task dependency relationship correction method and device, computer equipment and storage medium
CN114510908A (en) Data export method and device, computer equipment and storage medium
CN115809241A (en) Data storage method and device, computer equipment and storage medium
CN117421233A (en) Annotation-based code generation method, annotation-based code generation device, computer equipment and storage medium
CN116820443A (en) Data analysis method, device, computer equipment and storage medium
CN117217684A (en) Index data processing method and device, computer equipment and storage medium
CN116932486A (en) File generation method, device, computer equipment and storage medium
CN115731057A (en) Information generation method and device, computer equipment and storage medium
CN116738948A (en) Data processing method, device, computer equipment and storage medium
CN117278510A (en) Message sending method, device, computer equipment and storage medium
CN117251468A (en) Query processing method, device, computer equipment and storage medium
CN115904657A (en) Document generation method and device, computer equipment and storage medium
CN116932090A (en) Tool pack loading method, device, computer equipment and storage medium
CN116933733A (en) Text input display method, device, equipment and storage medium thereof
CN116932739A (en) Data generation method, device, equipment and storage medium based on artificial intelligence
CN115080045A (en) Link generation method and device, computer equipment and storage medium
CN116627416A (en) Page configuration method, page configuration device, computer equipment and storage medium
CN117076775A (en) Information data processing method, information data processing 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