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

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

Info

Publication number
CN115686939A
CN115686939A CN202211324667.8A CN202211324667A CN115686939A CN 115686939 A CN115686939 A CN 115686939A CN 202211324667 A CN202211324667 A CN 202211324667A CN 115686939 A CN115686939 A CN 115686939A
Authority
CN
China
Prior art keywords
target
json
data table
data
target data
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
CN202211324667.8A
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.)
Hunan Changyin May 8th Consumer Finance Co ltd
Original Assignee
Hunan Changyin May 8th Consumer Finance 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 Hunan Changyin May 8th Consumer Finance Co ltd filed Critical Hunan Changyin May 8th Consumer Finance Co ltd
Priority to CN202211324667.8A priority Critical patent/CN115686939A/en
Publication of CN115686939A publication Critical patent/CN115686939A/en
Pending legal-status Critical Current

Links

Images

Landscapes

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

Abstract

The present application relates to a data backup method, apparatus, computer device, storage medium and computer program product. The method comprises the following steps: acquiring a target data table, and determining a target field in the target data table; determining the time period of each time point contained in the target field according to each time point; packaging the number of target time points in the same time period and a target field corresponding to the target time point number to the same json corpus according to json strings to obtain a plurality of json corpuses corresponding to a target data table; and storing a plurality of json full sets corresponding to the target data table into the same backup table to obtain the backup table with a plurality of storage records. By adopting the method, the consumption of storage resources can be reduced.

Description

Data backup 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 backup method, apparatus, computer device, storage medium, and computer program product.
Background
With the development of internet technology, the amount of data generated by each industry is larger and larger, and data needs to be backed up while being generated. The traditional data backup mode is to perform full-field general backup on newly added data every day, so that all newly added data are backed up in a database.
However, when the amount of data is large, backing up the full amount of data may consume too much storage resources of the system, and may also affect other transaction operations of the system.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a data backup method, apparatus, computer device, computer readable storage medium and computer program product capable of reducing resource consumption.
In a first aspect, the present application provides a data backup method, including:
acquiring a target data table, and determining a target field in the target data table;
aiming at each time point contained in the target field, determining a time period of each time point;
packaging the target point number in the same time period and a target field corresponding to the target point number to the same json corpus according to json strings to obtain a plurality of json corpuses corresponding to the target data table;
and storing a plurality of json full sets corresponding to the target data table into the same backup table to obtain a backup table with a plurality of storage records.
In one embodiment, the obtaining a target data table and determining a target field in the target data table includes:
acquiring the system type of a system generating a target data table;
determining a target data table based on the system type of the system;
determining candidate fields in the target data table based on the content of the target data table;
and determining the fields meeting the backup condition in the candidate fields as target fields.
In one embodiment, the step of packaging the target point numbers in the same time period and the target field corresponding to the target point numbers to the same json corpus according to json strings to obtain a plurality of json corpuses corresponding to the target data table includes:
aiming at each point number, packaging the point number and a target field corresponding to the point number according to a json string to obtain a plurality of json subsets;
and taking the time period of the time point number as the identifier of the json subset, and carrying out secondary packaging on the json subsets with the same identifier according to the json strings to obtain a plurality of json full sets corresponding to the target data table.
In one embodiment, the storing the multiple json full sets corresponding to the target data table into the same backup table to obtain a backup table with multiple storage records includes:
establishing a backup table corresponding to the target data table according to the table name of the target data table;
and storing a plurality of json full sets to which the target data table belongs in the backup table.
In one embodiment, the method further comprises:
acquiring a data query instruction, and extracting a data table identifier and a time node carried in the data query instruction;
performing time point number query on a temporary table based on the data table identifier and the time node;
and when the time point number inquired by the data inquiry command does not exist in the temporary table at present, carrying out reservation inquiry on the temporary table to obtain an inquiry result corresponding to the data inquiry command.
In one embodiment, when the time point queried by the data query instruction does not exist in the temporary table currently, performing reservation query on the temporary table to obtain a query result corresponding to the data query instruction, including:
acquiring a data query index established based on the time period and the identification of the target data table;
determining a target json corpus corresponding to the data query instruction by taking the data table identification and the time node as search terms according to the data query index;
decoding the target json complete set, and storing the time point obtained by decoding to the temporary table to obtain an updated temporary table;
and inquiring the time points in the updated temporary table to obtain an inquiry result corresponding to the data inquiry instruction.
In a second aspect, the present application further provides a data backup apparatus, including:
the data acquisition module is used for acquiring a target data table and determining a target field in the target data table;
a time period determining module, configured to determine, for each time point included in the target field, a time period in which each time point is located;
the data encapsulation module is used for encapsulating the target point number in the same time period and the target field corresponding to the target point number to the same json corpus according to json strings to obtain a plurality of json corpuses corresponding to the target data table;
and the data backup module is used for storing a plurality of json full sets corresponding to the target data table into the same backup table to obtain the backup table with a plurality of storage records.
In a third aspect, the present application further provides a computer device comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above method when executing the computer program.
In a fourth aspect, the present application also provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of the method described above.
In a fifth aspect, the present application also provides a computer program product comprising a computer program which, when executed by a processor, performs the steps of the method described above.
According to the data backup method, the data backup device, the computer equipment, the storage medium and the computer program product, by acquiring each time point contained in the target field in the target data table, the data amount to be backed up can be reduced under the condition of ensuring the accuracy and the completeness of the time point, so that the excessive consumption of storage resources is avoided. And then, a large number of time points and corresponding target fields in the target data table are packaged into a record by packaging the points and the corresponding target fields in the same json full set in a json string mode, and each obtained record is stored in a backup table, so that the consumption of storage resources is further reduced.
Drawings
FIG. 1 is a diagram of an application environment of a data backup method in one embodiment;
FIG. 2 is a flowchart illustrating a data backup method according to an embodiment;
FIG. 3 is a flowchart illustrating a data backup method according to another embodiment;
FIG. 4 is a flowchart illustrating a data backup method according to another embodiment;
FIG. 5 is a diagram illustrating backup and use of points in time in one embodiment;
FIG. 6 is a block diagram of a data backup apparatus according to an embodiment;
FIG. 7 is a diagram illustrating an internal structure of a computer device according to an embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application 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 present application and are not intended to limit the present application.
The data backup method provided by the embodiment of the application can be applied to the application environment shown in fig. 1. Wherein the terminal 102 communicates with the server 104 via a network. The data storage system may store data that the server 104 needs to process. The data storage system may be integrated on the server 104, or may be located on the cloud or other network server. After determining the target data table that needs to be backed up in the system, the server 104 analyzes each field in the target data table to determine the target field that needs to be backed up in the target data table. For each time point included in each target field in the target data table, after obtaining the time period of each time point, the server 104 packages the target time point in the same time period and the target field corresponding to the target time point in the same json full set according to the json character string form, so as to obtain a plurality of json full sets corresponding to the target data table. After the target time points in the target data table are packaged, the server 104 stores a plurality of json full sets obtained by packaging into corresponding backup tables by using one json full set as one record, so as to obtain a backup table with a plurality of storage records. The terminal 102 may be, but not limited to, various personal computers, notebook computers, smart phones, tablet computers, internet of things devices and portable wearable devices, and the internet of things devices may be smart speakers, smart televisions, smart air conditioners, smart car-mounted devices, and the like. The portable wearable device can be a smart watch, a smart bracelet, a head-mounted device, and the like. The server 104 may be implemented as a stand-alone server or as a server cluster comprised of multiple servers.
In one embodiment, as shown in fig. 2, a data backup method is provided, which is described by taking the method as an example applied to the server 104 in fig. 1, and includes the following steps:
step 202, obtain the target data table, determine the target field in the target data table.
The target data table refers to a core data table which must be backed up in a system or a platform. For example, in a system of a financial company, the core data table mainly includes a customer's borrow table, a receipt table, and the like. The target field refers to the core field in the target data table that must be backed up. For example, the core elements of the loan balance, interest, penalty, etc. in the customer's loan schedule.
Specifically, for each different system or platform, after acquiring a target data table that needs to be backed up, the server analyzes each field in the target data table, thereby determining a target field in the target data table.
Step 204, determining a time period of each time point included in the target field for each time point.
The time point number refers to the quantity state of the object at a certain point in time or the final data volume at the end of a time period. For example, the total population at the end of each year, the final price of stock at the end of each weekday, and the daily inventory of goods, all belong to the time points.
The time period is a period from when the time count starts to change to when the time count stops, and may be understood as a time period during which the time count is generated. For example, on day 5 month 23, company a pays X for developing company business, and on day 5 month 24, company a pays Y for developing company business, then day 5 month 23 is the time period of timeslotting X, and day 5 month 24 is the time period of timeslotting Y. For example, if company a paid M for its cultural construction in 2020 and N for its cultural construction in 2021, 2020 is the time period of time point M and 2021 is the time period of time point N.
Specifically, after acquiring each time point included in the target field in the target data table, the server determines a time period of each time point according to the generation time of each time point.
And step 206, packaging the target point number in the same time period and the target field corresponding to the target point number to the same json corpus according to the json strings to obtain a plurality of json corpuses corresponding to the target data table.
The json string encapsulation refers to encapsulation processing of the time point number by adopting a JavaScript object representation method, and mainly comprises the steps of calling a relevant module and converting the time point number into a json character string form. The json corpus is a set obtained by encapsulating a plurality of target time points in the same time period.
Specifically, after determining the time period of each time point, the server converts the number of target points in the same period and the target field corresponding to the target time point into json character strings according to the form of the json string, and encapsulates the json character strings into the same json full set, so as to obtain a plurality of json full sets corresponding to the target data table.
And 208, storing a plurality of json full sets corresponding to the target data table into the same backup table to obtain a backup table with a plurality of storage records.
Specifically, the server uses one json corpus as one record, and stores a plurality of json corpuses corresponding to the target data table into the backup table corresponding to the target data table, so as to obtain the backup table with a plurality of storage records.
In the data backup method, by acquiring each time point contained in the target field in the target data table, the data amount to be backed up can be reduced under the condition of ensuring the accuracy and the integrity of the time point, so that the excessive consumption of storage resources is avoided. And then, by packaging the target point number and the corresponding target field with the same time period in the target data table into the same json full set according to the json string form, a large amount of time points can be packaged into one record, and each obtained record is stored into a backup table, so that the consumption of storage resources is further reduced.
In one embodiment, as shown in fig. 3, obtaining the target data table, and determining the target field in the target data table includes:
step 302, obtain the system type to which the system generating the target data table belongs.
The system type refers to the main service type of the system generating the data table. For example, in a product production department, a main business is to produce a product, and a system type of a system of the production department is a related type such as product production.
Step 304, determining a target data table based on the system type of the system.
Specifically, after determining the system type according to the service type mainly responsible for each system, the server determines the corresponding target data table according to the system type to which each system belongs.
Step 306, based on the content of the target data table, determining candidate fields in the target data table.
The content of the target data table refers to the data content described in the target data table. The candidate field refers to an element in the target data table, and may be understood as a column name for storing data. For example, the borrowing table mainly includes elements such as a customer name, a loan balance, interest, and penalty. For another example, there are candidate fields such as name and contact number in the address book database.
And step 308, determining the fields meeting the backup condition in the candidate fields as target fields.
The condition that the backup is met means that the backed-up fields and the time points contained in the fields have integrity and accuracy, so that the requirement of a user on data can be completely met when the user uses the stored time points, and the condition of data loss or inaccuracy cannot occur. For example, candidate fields such as name, telephone, address and the like exist in the address book data table, and when the two fields of the name and the telephone are backed up, the integrity and the accuracy of the backed-up data can be ensured, so that the two fields of the name and the telephone are target fields meeting the backup conditions in the candidate fields. Meanwhile, the target field can also be understood as a necessary field.
Specifically, after analyzing each candidate field in the target data table, the server determines a field that can guarantee the integrity and accuracy of the backup data as the target field.
In this embodiment, by determining candidate fields satisfying the backup condition in the target data table as target fields, the backed-up fields can be reduced on the basis of ensuring the integrity of the backup data, thereby reducing the consumption of storage resources.
In one embodiment, the number of target time points in the same time period and a target field corresponding to the target time point number are encapsulated to the same json corpus according to json strings to obtain a plurality of json corpuses corresponding to a target data table, including:
and aiming at each time point, the time point and a target field corresponding to the time point are packaged according to a json string to obtain a plurality of json subsets. And taking the time period of the time points as the identifier of the json subset, and carrying out secondary packaging on the json subsets with the same identifier according to the json strings to obtain a plurality of json full sets corresponding to the target data table.
The json subsets are obtained by packaging a time point number and a corresponding target field in a json string mode, and a plurality of json subsets with the same identification can form a json full set.
Specifically, the server converts each time point record in the target data table and the corresponding target field into a json character string according to the form of the json string, encapsulates the json character string into a plurality of json subsets, and encapsulates the json subsets corresponding to the time points with the same period into the same json full set according to the time period of the time points encapsulated in each json subset, so as to obtain a plurality of json full sets corresponding to the target data table.
In this embodiment, data can be further compressed by encapsulating the json subsets having the same identifier into the same json full set, thereby reducing the consumption of storage resources.
In one embodiment, storing a plurality of json full sets corresponding to a target data table in the same backup table to obtain a backup table with a plurality of storage records includes:
and establishing a backup table corresponding to the target data table according to the table name of the target data table. And storing a plurality of json full sets to which the target data table belongs in the backup table.
Specifically, the server establishes a backup table corresponding to the table name of the target data table in the database based on the table name of the target data table, and stores a plurality of json full sets to which the target data table belongs to the corresponding backup table.
In a specific application, the table name of the target data table is a, and when data in the table a is backed up, a backup table with the table name of a is established in the database, so that a plurality of json full sets which need to be backed up in the target data table a are stored in the corresponding backup table a.
In this embodiment, by establishing the backup table corresponding to the target data table, the contents backed up in each target data table can be stored in a classified manner, so that the user can accurately and timely query the required data during the query.
In one embodiment, as shown in fig. 4, the data backup method further includes:
step 402, acquiring a data query instruction, and extracting a data table identifier and a time node carried in the data query instruction.
The data query instruction is an instruction sent to the system by a user during data query, and the data query instruction mainly comprises a data table identifier and a time node. The data table identification is a backup table used for determining the location of the query data, and the time node is used for determining the time period in which the data needing to be queried is located.
Specifically, after receiving the data query instruction, the server identifies the content carried in the instruction, and extracts information about the data table identifier and the time node in the instruction.
And step 404, performing time point query on the temporary table based on the data table identifier and the time node.
Specifically, after extracting the carried data table identifier and the time node from the data query instruction, the server queries the time point corresponding to the data query instruction in the temporary table based on the extracted content.
And 406, when the number of time points queried by the data query instruction does not exist in the temporary table currently, performing reservation query on the temporary table to obtain a query result corresponding to the data query instruction.
Specifically, when the server does not inquire the time point corresponding to the data query instruction in the temporary table, the server needs to decode the json corpus corresponding to the backup table first to obtain the query result corresponding to the data query instruction.
In this embodiment, the time points to be queried can be accurately queried through the data table identifier and the time node carried in the data query instruction, and the query time is also shortened.
In one embodiment, when the number of time points queried by the data query instruction does not exist in the temporary table at present, performing reservation query on the temporary table to obtain a query result corresponding to the data query instruction, including:
and acquiring a data query index established based on the time period and the identification of the target data table. And determining a target json corpus corresponding to the data query instruction by taking the data table identification and the time node as search terms and according to the data query index. And decoding the target json complete set, and storing the time point obtained by decoding into the temporary table to obtain an updated temporary table.
The index is a single and physical storage structure for sorting one or more columns of values in a database table, and is a collection of one or more columns of values in the table and a corresponding list of physical identification logical pointers in the direction table. The index is equivalent to the directory of the book, and can enable a user to quickly find the required content according to the page number in the directory. And inquiring the time points in the updated temporary table to obtain an inquiry result corresponding to the data inquiry instruction.
The search words are related words capable of summarizing searched contents, are basic units for expressing information requirements and searching subject contents, are also basic units for carrying out matching operation with related databases in the system, and are selected properly or not to directly influence the searching effect. For example, the data table identifier carried in the data query instruction is table a, the time node is 5 months and 20 days, and tables a and 5 months and 20 days are related words, that is, search terms, which can summarize the search content.
Specifically, the server establishes a data query index for each target data table in the system by using the time period of each time point and the identifier of the target data table as indexes. The server also uses a data table identifier and a time node which can summarize contents to be retrieved in the data query instruction as a retrieval word, and obtains a target json complete set corresponding to the data table identifier and the time node in the data query instruction according to the data query index, and calls a relevant module according to the packaging step to convert the json string into a character string, performs reverse analysis processing on the target json complete set, and stores the time point obtained by decoding into a temporary table to update the temporary table, thereby obtaining an updated temporary table. And finally, the server inquires the time point in the updated temporary table, so that an inquiry result corresponding to the data inquiry instruction is obtained.
In the embodiment, the query time can be reduced by determining the search terms and querying the target json corpus according to the data query index, so that the query efficiency is improved.
The application also provides an application scenario applying the data backup method. Specifically, the data backup method is applied to the application scenario as follows: the core system mainly comprises information of a customer's data sheet, the data sheet has elements such as loan balance, interest, penalty and the like, and the time points of the whole sheet need to be recorded in the end of each day of the data sheet based on business needs.
First, the target data table is determined to be loan _ info (loans table), and the loan _ bal (loan balance), int _ amt (interest), and pen _ amt (penalty) in the loans table are target fields. After running business data every day, precisely backing up the local _ info of the day, and counting the points when encapsulating a single piece of borrow data to obtain a json subset: { 'billno':2022091201, { 'loan _ bal':10000, 'int _ amt':100, 'pen _ amt':100} };
then, packaging a plurality of pieces of borrow information with the same time period to obtain a json corpus:
{
{‘billno’:2022091201,{‘loan_bal’:10000,’int_amt’:100,’pen_amt’:100}},
{‘billno’:2022091202,{‘loan_bal’:20000,’int_amt’:200,’pen_amt’:200}},
{‘billno’:2022091203,{‘loan_bal’:30000,’int_amt’:300,’pen_amt’:300}}
}
and finally, packaging the plurality of pieces of borrow data information to obtain a target json full set, storing the target json full set in a corresponding backup table in a database to obtain a record, and thus realizing the box sealing operation of the real points.
When a service person needs to use a certain time point in history, a date and a table name are selected on a page for reservation, after the reservation is initiated, a background is opened, and a corresponding target json corpus is accurately inquired from a backup table. And obtaining a corresponding target json complete set, reversely analyzing the target json complete set, obtaining the time point number required to be inquired, and storing the time point number in a temporary table of the mysql library. After the reservation is successful, the service personnel queries the data again to obtain a corresponding query result, and the backup and the use of the time point are shown in fig. 5.
It should be understood that, although the steps in the flowcharts related to the embodiments as described above are sequentially displayed as indicated by arrows, the steps are not necessarily performed sequentially as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least a part of the steps in the flowcharts related to the embodiments described above may include multiple steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, and the execution order of the steps or stages is not necessarily sequential, but may be performed alternately or alternately with other steps or at least a part of the steps or stages in other steps.
Based on the same inventive concept, the embodiment of the present application further provides a data backup device for implementing the above-mentioned data backup method. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme described in the above method, so specific limitations in one or more embodiments of the data backup device provided below may refer to the limitations in the above data backup method, and are not described herein again.
In one embodiment, as shown in fig. 6, there is provided a data backup apparatus including:
the data obtaining module 602 is configured to obtain a target data table and determine a target field in the target data table.
The time period determining module 604 is configured to determine, for each time point included in the target field, a time period of each time point.
And a data encapsulation module 606, configured to encapsulate the point number of the target in the same time period and the target field corresponding to the point number of the target to the same json corpus according to the json strings, so as to obtain multiple json corpuses corresponding to the target data table.
The data backup module 608 is configured to store a plurality of json full sets corresponding to the target data table in the same backup table, so as to obtain a backup table with a plurality of storage records.
In one embodiment, the data acquisition module comprises:
and the system type acquisition unit is used for acquiring the system type of the system generating the target data table.
And the target data table determining unit is used for determining the target data table based on the system type of the system.
And the candidate field determining unit is used for determining candidate fields in the target data table based on the content of the target data table.
And the target field determining unit is used for determining the field meeting the backup condition in the candidate fields as the target field.
In one embodiment, the data encapsulation module comprises:
and the json subset determining unit is used for packaging the time points and the target fields corresponding to the time points according to the json strings to obtain a plurality of json subsets.
And the json corpus determining unit is used for performing secondary packaging on the json subsets with the same identification according to the json string by taking the time period in which the point number is positioned as the identification of the json subset, so as to obtain a plurality of json corpuses corresponding to the target data table.
In one embodiment, the data backup module comprises:
and the backup table establishing unit is used for establishing a backup table corresponding to the target data table according to the table name of the target data table.
And the data storage unit is used for storing a plurality of json full sets to which the target data table belongs into the backup table.
In one embodiment, the data backup apparatus further includes:
and the instruction acquisition unit is used for acquiring the data query instruction and extracting the data table identifier and the time node carried in the data query instruction.
And the data query unit is used for carrying out time point number query on the temporary table based on the data table identification and the time node.
And the reservation query unit is used for performing reservation query on the temporary table to obtain a query result corresponding to the data query instruction when the number of time points queried by the data query instruction does not exist in the temporary table currently.
In one embodiment, the reservation inquiring unit further includes:
and the index constructing subunit is used for acquiring the data query index established on the basis of the time period and the identification of the target data table.
And the target json corpus determining subunit is used for determining a target json corpus corresponding to the data query instruction according to the data query index by taking the data table identifier and the time node as the search terms.
And the data decoding subunit is used for decoding the target json full set, storing the time point obtained by decoding into the temporary table and obtaining an updated temporary table.
And the query result acquisition subunit is used for querying the time points in the updated temporary table to obtain a query result corresponding to the data query instruction.
The modules in the data backup device can be implemented in whole or in part by software, hardware and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a server, the internal structure of which may be as shown in fig. 7. The computer device includes a processor, a memory, an Input/Output interface (I/O for short), and a communication interface. The processor, the memory and the input/output interface are connected through a system bus, and the communication interface is connected to the system bus through the input/output interface. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The database of the computer device is used for storing a target data table, a target field, each time point contained in the target field and the time period of each time point. The input/output interface of the computer device is used for exchanging information between the processor and an external device. The communication interface of the computer device is used for connecting and communicating with an external terminal through a network. The computer program is executed by a processor to implement a data backup method.
Those skilled in the art will appreciate that the architecture shown in fig. 7 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is provided, comprising a memory and a processor, the memory having a computer program stored therein, the processor implementing the following steps when executing the computer program:
acquiring a target data table, and determining a target field in the target data table; determining the time period of each time point contained in the target field according to each time point; packaging the number of target time points in the same time period and a target field corresponding to the target time point number to the same json corpus according to json strings to obtain a plurality of json corpuses corresponding to a target data table; and storing a plurality of json full sets corresponding to the target data table into the same backup table to obtain the backup table with a plurality of storage records.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
acquiring the system type of a system generating a target data table; determining a target data table based on the system type of the system; determining candidate fields in the target data table based on the content of the target data table; and determining the fields meeting the backup condition in the candidate fields as target fields.
In one embodiment, the processor when executing the computer program further performs the steps of:
aiming at each point number, performing encapsulation processing on the point number and a target field corresponding to the point number according to a json string to obtain a plurality of json subsets; and taking the time period of the time points as the identifier of the json subset, and carrying out secondary packaging on the json subsets with the same identifier according to the json strings to obtain a plurality of json full sets corresponding to the target data table.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
establishing a backup table corresponding to the target data table according to the table name of the target data table; and storing a plurality of json full sets to which the target data table belongs in the backup table.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
acquiring a data query instruction, and extracting a data table identifier and a time node carried in the data query instruction; performing time point number query on the temporary table based on the data table identifier and the time node; and when the number of time points inquired by the data inquiry command does not exist in the temporary table at present, carrying out reservation inquiry on the temporary table to obtain an inquiry result corresponding to the data inquiry command.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
acquiring a data query index established based on a time period and an identifier of a target data table; determining a target json corpus corresponding to the data query instruction by taking the data table identification and the time node as search terms and according to the data query index; decoding the target json complete set, and storing the time points obtained by decoding into a temporary table to obtain an updated temporary table; and inquiring the time points in the updated temporary table to obtain an inquiry result corresponding to the data inquiry instruction.
In one embodiment, a computer-readable storage medium is provided, having a computer program stored thereon, which when executed by a processor, performs the steps of:
acquiring a target data table, and determining a target field in the target data table; aiming at each time point contained in the target field, determining the time period of each time point; packaging the number of target time points in the same time period and a target field corresponding to the target time point number to the same json corpus according to json strings to obtain a plurality of json corpuses corresponding to a target data table; and storing a plurality of json full sets corresponding to the target data table into the same backup table to obtain the backup table with a plurality of storage records.
In one embodiment, the computer program when executed by the processor further performs the steps of:
acquiring the system type of a system generating a target data table; determining a target data table based on the system type of the system; determining candidate fields in the target data table based on the content of the target data table; and determining the fields meeting the backup condition in the candidate fields as target fields.
In one embodiment, the computer program when executed by the processor further performs the steps of:
aiming at each point number, performing encapsulation processing on the point number and a target field corresponding to the point number according to a json string to obtain a plurality of json subsets; and taking the time period of the time points as the identifier of the json subset, and carrying out secondary packaging on the json subsets with the same identifier according to the json strings to obtain a plurality of json full sets corresponding to the target data table.
In one embodiment, the computer program when executed by the processor further performs the steps of:
establishing a backup table corresponding to the target data table according to the table name of the target data table; and storing a plurality of json full sets to which the target data table belongs in the backup table.
In one embodiment, the computer program when executed by the processor further performs the steps of:
acquiring a data query instruction, and extracting a data table identifier and a time node carried in the data query instruction; performing time point number query on the temporary table based on the data table identifier and the time node; and when the number of time points inquired by the data inquiry command does not exist in the temporary table at present, carrying out reservation inquiry on the temporary table to obtain an inquiry result corresponding to the data inquiry command.
In one embodiment, the computer program when executed by the processor further performs the steps of:
acquiring a data query index established based on a time period and an identifier of a target data table; determining a target json corpus corresponding to the data query instruction by taking the data table identification and the time node as search terms and according to the data query index; decoding the target json complete set, and storing the time points obtained by decoding into a temporary table to obtain an updated temporary table; and inquiring the time points in the updated temporary table to obtain an inquiry result corresponding to the data inquiry instruction.
In one embodiment, a computer program product is provided, comprising a computer program which, when executed by a processor, performs the steps of:
acquiring a target data table, and determining a target field in the target data table; determining the time period of each time point contained in the target field according to each time point; the point number of the target in the same time period and a target field corresponding to the point number of the target are packaged to the same json corpus according to the json strings to obtain a plurality of json corpuses corresponding to a target data table; and storing a plurality of json full sets corresponding to the target data table into the same backup table to obtain the backup table with a plurality of storage records.
In one embodiment, the computer program when executed by the processor further performs the steps of:
acquiring the system type of a system generating a target data table; determining a target data table based on the system type of the system; determining candidate fields in the target data table based on the content of the target data table; and determining the fields meeting the backup condition in the candidate fields as target fields.
In one embodiment, the computer program when executed by the processor further performs the steps of:
aiming at each point number, performing encapsulation processing on the point number and a target field corresponding to the point number according to a json string to obtain a plurality of json subsets; and taking the time period of the time points as the identifier of the json subset, and carrying out secondary packaging on the json subsets with the same identifier according to the json strings to obtain a plurality of json full sets corresponding to the target data table.
In one embodiment, the computer program when executed by the processor further performs the steps of:
establishing a backup table corresponding to the target data table according to the table name of the target data table; and storing a plurality of json full sets to which the target data table belongs in the backup table.
In one embodiment, the computer program when executed by the processor further performs the steps of:
acquiring a data query instruction, and extracting a data table identifier and a time node carried in the data query instruction; performing time point number query on the temporary table based on the data table identifier and the time node; and when the number of time points inquired by the data inquiry command does not exist in the temporary table at present, carrying out reservation inquiry on the temporary table to obtain an inquiry result corresponding to the data inquiry command.
In one embodiment, the computer program when executed by the processor further performs the steps of:
acquiring a data query index established based on a time period and an identifier of a target data table; determining a target json corpus corresponding to the data query instruction by taking the data table identification and the time node as search terms and according to the data query index; decoding the target json complete set, and storing the time points obtained by decoding into a temporary table to obtain an updated temporary table; and inquiring the time points in the updated temporary table to obtain an inquiry result corresponding to the data inquiry instruction.
It should be noted that, the user information (including but not limited to user equipment information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) referred to in the present application are information and data authorized by the user or sufficiently authorized by each party, and the collection, use and processing of the related data need to comply with the relevant laws and regulations and standards of the relevant country and region.
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 instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, databases, or other media used in the embodiments provided herein can include at least one of non-volatile and volatile memory. The nonvolatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical Memory, high-density embedded nonvolatile Memory, resistive Random Access Memory (ReRAM), magnetic Random Access Memory (MRAM), ferroelectric Random Access Memory (FRAM), phase Change Memory (PCM), graphene Memory, and the like. Volatile Memory can include Random Access Memory (RAM), external cache Memory, and the like. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM), among others. The databases referred to in various embodiments provided herein may include at least one of relational and non-relational databases. The non-relational database may include, but is not limited to, a block chain based distributed database, and the like. The processors referred to in the embodiments provided herein may be general purpose processors, central processing units, graphics processors, digital signal processors, programmable logic devices, quantum computing based data processing logic devices, etc., without limitation.
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the present application. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, and these are all within the scope of protection of the present application. Therefore, the protection scope of the present application shall be subject to the appended claims.

Claims (10)

1. A method for data backup, the method comprising:
acquiring a target data table, and determining a target field in the target data table;
aiming at each time point contained in the target field, determining the time period of each time point;
packaging the target point number in the same time period and a target field corresponding to the target point number to the same json corpus according to json strings to obtain a plurality of json corpuses corresponding to the target data table;
and storing a plurality of json full sets corresponding to the target data table into the same backup table to obtain a backup table with a plurality of storage records.
2. The method of claim 1, wherein obtaining the target data table and determining the target field in the target data table comprises:
acquiring a system type to which a system for generating a target data table belongs;
determining a target data table based on the system type of the system;
determining candidate fields in the target data table based on the content of the target data table;
and determining the fields meeting the backup condition in the candidate fields as target fields.
3. The method according to claim 1, wherein the step of encapsulating the target point number in the same time period and the target field corresponding to the target point number to the same json corpus according to json strings to obtain a plurality of json corpuses corresponding to the target data table comprises:
aiming at each point, packaging the point and a target field corresponding to the point according to a json string to obtain a plurality of json subsets;
and taking the time period of the time point number as the identifier of the json subset, and carrying out secondary packaging on the json subsets with the same identifier according to the json strings to obtain a plurality of json full sets corresponding to the target data table.
4. The method of claim 1, wherein the storing the json corpora corresponding to the target data table into the same backup table to obtain a backup table having a plurality of storage records comprises:
establishing a backup table corresponding to the target data table according to the table name of the target data table;
and storing a plurality of json full sets to which the target data table belongs into the backup table.
5. The method of claim 1, further comprising:
acquiring a data query instruction, and extracting a data table identifier and a time node carried in the data query instruction;
performing time point number query on a temporary table based on the data table identifier and the time node;
and when the time point number inquired by the data inquiry command does not exist in the temporary table at present, carrying out reservation inquiry on the temporary table to obtain an inquiry result corresponding to the data inquiry command.
6. The method according to claim 5, wherein when the time count queried by the data query instruction does not exist in the temporary table currently, performing reservation query on the temporary table to obtain a query result corresponding to the data query instruction, includes:
acquiring a data query index established based on the time period and the identification of the target data table;
determining a target json corpus corresponding to the data query instruction by taking the data table identification and the time node as search terms according to the data query index;
decoding the target json complete set, and storing the time point obtained by decoding to the temporary table to obtain an updated temporary table;
and inquiring the time points in the updated temporary table to obtain an inquiry result corresponding to the data inquiry instruction.
7. A data backup apparatus, characterized in that the apparatus comprises:
the data acquisition module is used for acquiring a target data table and determining a target field in the target data table;
a time period determining module, configured to determine, for each time point included in the target field, a time period in which each time point is located;
the data encapsulation module is used for encapsulating the target point number in the same time period and the target field corresponding to the target point number to the same json corpus according to json strings to obtain a plurality of json corpuses corresponding to the target data table;
and the data backup module is used for storing a plurality of json full sets corresponding to the target data table into the same backup table to obtain the backup table with a plurality of storage records.
8. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor, when executing the computer program, implements the steps of the method of any of claims 1 to 6.
9. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 6.
10. A computer program product comprising a computer program, characterized in that the computer program realizes the steps of the method of any one of claims 1 to 6 when executed by a processor.
CN202211324667.8A 2022-10-27 2022-10-27 Data backup method and device, computer equipment and storage medium Pending CN115686939A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211324667.8A CN115686939A (en) 2022-10-27 2022-10-27 Data backup method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211324667.8A CN115686939A (en) 2022-10-27 2022-10-27 Data backup method and device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115686939A true CN115686939A (en) 2023-02-03

Family

ID=85098557

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211324667.8A Pending CN115686939A (en) 2022-10-27 2022-10-27 Data backup method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115686939A (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106156076A (en) * 2015-03-31 2016-11-23 阿里巴巴集团控股有限公司 The method and system that data process
CN106302920A (en) * 2016-08-15 2017-01-04 北京京东尚科信息技术有限公司 A kind of method and apparatus updating contact person in address list phone number
CN111367994A (en) * 2019-06-27 2020-07-03 北京关键科技股份有限公司 Method and system for synchronously backing up incremental data of database
CN111897818A (en) * 2020-07-31 2020-11-06 平安普惠企业管理有限公司 Data storage method and device, electronic equipment and storage medium
CN113094415A (en) * 2019-12-23 2021-07-09 北京懿医云科技有限公司 Data extraction method and device, computer readable medium and electronic equipment
CN113190381A (en) * 2021-04-28 2021-07-30 平安消费金融有限公司 Data backup method, system, device and storage medium
CN114064351A (en) * 2020-08-07 2022-02-18 伊姆西Ip控股有限责任公司 Optimized selection of storage device subsets for data backup
CN114528157A (en) * 2022-02-21 2022-05-24 中国工商银行股份有限公司 Database sensitive table backup method and device

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106156076A (en) * 2015-03-31 2016-11-23 阿里巴巴集团控股有限公司 The method and system that data process
CN106302920A (en) * 2016-08-15 2017-01-04 北京京东尚科信息技术有限公司 A kind of method and apparatus updating contact person in address list phone number
CN111367994A (en) * 2019-06-27 2020-07-03 北京关键科技股份有限公司 Method and system for synchronously backing up incremental data of database
CN113094415A (en) * 2019-12-23 2021-07-09 北京懿医云科技有限公司 Data extraction method and device, computer readable medium and electronic equipment
CN111897818A (en) * 2020-07-31 2020-11-06 平安普惠企业管理有限公司 Data storage method and device, electronic equipment and storage medium
CN114064351A (en) * 2020-08-07 2022-02-18 伊姆西Ip控股有限责任公司 Optimized selection of storage device subsets for data backup
CN113190381A (en) * 2021-04-28 2021-07-30 平安消费金融有限公司 Data backup method, system, device and storage medium
CN114528157A (en) * 2022-02-21 2022-05-24 中国工商银行股份有限公司 Database sensitive table backup method and device

Similar Documents

Publication Publication Date Title
Silva et al. SQL: From traditional databases to big data
US20050165817A1 (en) Data migration and analysis
CN104933112A (en) Distributed Internet transaction information storage and processing method
US11567999B2 (en) Using a B-tree to store graph information in a database
CN103455335A (en) Multilevel classification Web implementation method
CN113010542B (en) Service data processing method, device, computer equipment and storage medium
CN107729330A (en) The method and apparatus for obtaining data set
KR102153259B1 (en) Data domain recommendation method and method for constructing integrated data repository management system using recommended domain
CN109582476B (en) Data processing method, device and system
US8417594B2 (en) Dimension-based financial reporting using multiple combinations of dimensions
CN113515528B (en) Asset screening system and method based on big data and ORACLE mass data
CN115686939A (en) Data backup method and device, computer equipment and storage medium
CN111723129A (en) Report generation method, report generation device and electronic equipment
US10846064B1 (en) Software requirements creating and tracking system and method
US11886485B1 (en) Computer-implemented visual query matching methods, and systems for implementing thereof
CN114064935A (en) Information map construction method, device, equipment, storage medium and program product
CN114547066A (en) Nuclear power business data standardization method and device and computer equipment
CN117827902A (en) Service data processing method, device, computer equipment and storage medium
CN113961636A (en) Object relation query method and device, computer equipment and storage medium
CN113918634A (en) Data adaptation method, adapter and storage medium for data interaction
CN113934753A (en) Data development method and system
CN117273962A (en) Insurance security processing method, apparatus, equipment and medium
CN117495518A (en) Method, device, equipment and storage medium for managing articles of bank point system
CN117076476A (en) Object information processing method, device, computer equipment and storage medium
CN117350831A (en) Data processing method and device in cross-border scene, 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