Data storage method, device, electronic device and storage medium

By storing the valuable fields in the risk control data in the data set and establishing mapping relationships, the problem of excessive database resource usage is solved, efficient data storage and query are achieved, and system performance is improved.

CN111897818BActive Publication Date: 2024-08-23SHENZHEN YOULIAN CHUANGDA TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010760663.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-07-31
Publication Date
2024-08-23
Estimated Expiration
2040-07-31

AI Technical Summary

Technical Problem

When existing databases store and process risk control data, as fields increase, too many computing resources are occupied, resulting in reduced system performance and difficulty in meeting the needs of big data storage.

Method used

By storing the valuable fields in the risk control data in the data collection and establishing the mapping relationship between fields and records, we avoid storing non-valued fields and store them in the form of documents, which reduces the resource usage of the database.

Benefits of technology

It saves storage space, improves system performance, can quickly determine fields with empty values, and improves the efficiency of data query and update.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111897818B
    Figure CN111897818B
Patent Text Reader

Abstract

The present application relates to the field of big data technology and can be applied to scenarios such as smart logistics and smart medical care that require large amounts of data storage, thereby promoting the construction of smart cities. The present invention provides a data storage method, comprising: obtaining target risk control data, wherein the target risk control data is composed of multiple fields; from the multiple fields, determining the field whose value is not empty as the target field to be stored; storing the target field in a preset target data set in the form of a document, recording the write information of the target field and generating a target record; creating a mapping relationship between each of the target fields and the corresponding target record; storing the mapping relationship in a preset target data table. The present invention also provides a data storage device, an electronic device, and a storage medium. The present invention can reduce the computing resources occupied by the database.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of big data technology, and in particular to a data storage method, device, electronic device and storage medium. Background Art

[0002] At present, risk control-related data can be stored in the database and queried at any time for risk control analysis. However, in practice, it is found that a piece of risk control data has many fields. As the number of fields in the table increases, too many variables are bound when performing operations such as updating and inserting data, which causes the database to occupy too many computing resources and reduce system performance. With the demand for big data technology, the storage of large amounts of data further increases the requirements for the database.

[0003] Therefore, how to reduce the computing resources occupied by the database is a technical problem that needs to be solved urgently. Summary of the invention

[0004] In view of the above, it is necessary to provide a data storage method, device, electronic device and storage medium that can reduce the computing resources occupied by the database.

[0005] A first aspect of the present invention provides a data storage method, the data storage method comprising:

[0006] Obtaining target risk control data, wherein the target risk control data consists of multiple fields;

[0007] From the multiple fields, determine a field whose value is not empty as a target field to be stored;

[0008] The target field is stored in a preset target data set in the form of a document, the writing information of the target field is recorded and a target record is generated;

[0009] Creating a mapping relationship between each of the target fields and the corresponding target record;

[0010] The mapping relationship is stored in a preset target data table.

[0011] In a possible implementation, after storing the mapping relationship in a preset target data table, the data storage method further includes:

[0012] When receiving a data update instruction, querying in the target data set according to the first identifier carried by the data update instruction to obtain the data to be updated;

[0013] The data to be updated is updated according to the update field carried by the data update instruction.

[0014] In a possible implementation, after storing the mapping relationship in a preset target data table, the data storage method further includes:

[0015] When receiving a field query instruction, determining first query data from the target data set according to a second identifier carried by the field query instruction;

[0016] Determining whether the query field indicated by the field query instruction exists in the first query data;

[0017] If the query field indicated by the field query instruction exists in the first query data, data corresponding to the query field is output from the first query data.

[0018] In a possible implementation manner, after determining whether the first query data contains the query field indicated by the field query instruction, the data storage method further includes:

[0019] If the query field indicated by the field query instruction does not exist in the first query data, determining that the value of the query field is a null value;

[0020] Output the null value.

[0021] In a possible implementation, after storing the mapping relationship in a preset target data table, the data storage method further includes:

[0022] When receiving the data query instruction, determining second query data from the target data set according to the third identifier carried by the data query instruction;

[0023] Determine a mapping record of a mapping relationship corresponding to the second query data from the target data table;

[0024] According to the mapping record, determining a target field whose value is empty;

[0025] The second query data and the target field are output.

[0026] In a possible implementation, after storing the mapping relationship in a preset target data table, the data storage method further includes:

[0027] Obtaining a unique identifier for the target risk control data;

[0028] A query index of the target record in the target data set is established according to the unique identifier.

[0029] In a possible implementation, the target risk control data is stored in the target data set in the form of a document, and one record of the target data table maps to one document of the target data set.

[0030] A second aspect of the present invention provides a data storage device, the data storage device comprising:

[0031] An acquisition module, used to acquire target risk control data, wherein the target risk control data consists of multiple fields;

[0032] A determination module, configured to determine, from the plurality of fields, a field whose value is not empty as a target field to be stored;

[0033] A storage module, used to store the target field in a preset target data set in the form of a document, record the writing information of the target field and generate a target record;

[0034] A creation module, used to create a mapping relationship between each of the target fields and the corresponding target record;

[0035] The storage module is further used to store the mapping relationship in a preset target data table.

[0036] A third aspect of the present invention provides an electronic device, comprising a processor and a memory, wherein the processor is configured to implement the data storage method when executing a computer program stored in the memory.

[0037] A fourth aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, and the computer program implements the data storage method when executed by a processor.

[0038] Based on the above technical solution, the present invention can store the fields with values ​​in the risk control data in the data set, and does not need to store the fields without values. Since it is not saved in the form of a data table, it does not need to bind multiple column elements, and the new fields do not need to expand the table, thus saving storage space. In addition, the database stores the mapping relationship between the risk control data and the fields, which can quickly determine the fields with empty values, thereby improving system performance. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] Figure 1 It is a flow chart of a preferred embodiment of a data storage method disclosed by the present invention.

[0040] Figure 2 It is a functional module diagram of a preferred embodiment of a data storage device disclosed in the present invention.

[0041] Figure 3It is a schematic diagram of the structure of an electronic device of a preferred embodiment of the data storage method of the present invention. DETAILED DESCRIPTION

[0042] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0043] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art of the present invention. The terms used in the specification of the present invention herein are only for the purpose of describing specific embodiments and are not intended to limit the present invention.

[0044] The data storage method of the embodiment of the present invention is applied in an electronic device, and can also be applied in a hardware environment consisting of an electronic device and a server connected to the electronic device via a network, and is jointly executed by the server and the electronic device. The network includes but is not limited to: a wide area network, a metropolitan area network or a local area network.

[0045] Among them, a server can refer to a computer system that can provide services to other devices (such as electronic devices) in the network. If a personal computer can provide File Transfer Protocol (FTP) services to the outside world, it can also be called a server. In a narrow sense, a server refers specifically to certain high-performance computers that can provide services to the outside world through the network. Compared with ordinary personal computers, it has higher requirements in terms of stability, security, and performance. Therefore, it is different from ordinary personal computers in terms of hardware such as CPU, chipset, memory, disk system, network, etc.

[0046] The electronic device is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application-specific integrated circuits (ASICs), field programmable gate arrays (FPGAs), digital processors (DSPs), embedded devices, etc. The electronic device may also include network devices and / or user devices. Among them, the network device includes but is not limited to a single network device, a server group composed of multiple network devices, or a cloud composed of a large number of hosts or network devices based on cloud computing (Cloud Computing), wherein cloud computing is a type of distributed computing, a super virtual computer composed of a group of loosely coupled computer sets. The user device includes but is not limited to any electronic product that can interact with the user through a keyboard, mouse, remote control, touchpad or voice control device, such as a personal computer, tablet computer, smart phone, personal digital assistant PDA, etc.

[0047] See also Figure 1 , Figure 1 The flowchart of a preferred embodiment of a data storage method disclosed in the present invention is shown in FIG. 1 , wherein the order of the steps in the flowchart can be changed and some steps can be omitted according to different requirements. The execution subject of the data storage method can be an electronic device.

[0048] S11. Obtain target risk control data, wherein the target risk control data consists of multiple fields.

[0049] In an embodiment of the present invention, a risk control data may be composed of multiple fields, such as name, phone number, number of overdue repayments, etc., such as {name: Zhang San; phone number: 33501; number of overdue repayments: 3}.

[0050] S12. From the multiple fields, determine a field whose value is not empty as a target field to be stored.

[0051] In an embodiment of the present invention, the target risk control data is composed of multiple fields, but the values ​​of some fields may be empty, such as {Name: Li Si; Phone: NULL; Number of overdue repayments: 3}, the value of the field "Phone" is empty, and from the multiple fields, the fields whose values ​​are not empty are determined as the target fields to be stored. The two fields "Name" and "Number of overdue repayments" whose values ​​are not empty can be determined as the target fields.

[0052] S13: storing the target field in a preset target data set in the form of a document, recording the writing information of the target field and generating a target record.

[0053] In the embodiment of the present invention, the target data set only needs to store fields with values, and other empty fields are not stored, which can save storage space.

[0054] The target risk control data is stored in the target data set in the form of documents, and one record of the target data table maps to one document of the target data set.

[0055] The target data set may be a storage document in mongodb (a database based on distributed file storage). The multiple fields are stored in mongodb in a document format, such as JSON format, to facilitate data transmission and use.

[0056] S14: Create a mapping relationship between each of the target fields and the corresponding target record.

[0057] In the embodiment of the present invention, the mapping relationship between each of the fields and the target record may be configured in MongoDB.

[0058] The target data table may be a configuration table in a database, which occupies little storage space.

[0059] S15: storing the mapping relationship in a preset target data table.

[0060] In the embodiment of the present invention, the mapping relationship may be stored in a preset target data table, that is, all fields corresponding to the target record may be queried and determined in the target data table through the mapping relationship.

[0061] As an optional implementation manner, after storing the mapping relationship in a preset target data table, the method further includes:

[0062] Obtaining a unique identifier for the target risk control data;

[0063] A query index of the target record in the target data set is established according to the unique identifier.

[0064] The index is a storage structure for accelerating the query of data.

[0065] In this optional implementation, a unique identifier of the target risk control data may be obtained, and a query index of the target record in the target data set may be established based on the unique identifier. By using the query index, the target record may be quickly queried in the target data set.

[0066] As an optional implementation manner, after storing the mapping relationship in a preset target data table, the method further includes:

[0067] When receiving a data update instruction, querying in the target data set according to the first identifier carried by the data update instruction to obtain the data to be updated;

[0068] The data to be updated is updated according to the update field carried by the data update instruction.

[0069] In this optional implementation, the corresponding multiple fields (i.e., the data to be updated) can be quickly queried in the target data set through the target identifier, and then the values ​​of the corresponding fields are updated according to the update fields carried by the data update instruction to complete the update of the data to be updated.

[0070] As an optional implementation manner, after storing the mapping relationship in a preset target data table, the method further includes:

[0071] When receiving a field query instruction, determining first query data from the target data set according to a second identifier carried by the field query instruction;

[0072] Determining whether the query field indicated by the field query instruction exists in the first query data;

[0073] If the query field indicated by the field query instruction exists in the first query data, data corresponding to the query field is output from the first query data.

[0074] The field query instruction may be an instruction for querying a specified field in a certain risk control data.

[0075] In this optional implementation, when a field query instruction is received, first query data is determined from the target data set according to the risk control identifier carried by the field query instruction, and the first query data may be the values ​​of all fields corresponding to the risk control identifier. If the query field indicated by the field query instruction exists in the first query data, data corresponding to the query field is output from the first query data.

[0076] As an optional implementation manner, after determining whether the query field indicated by the field query instruction exists in the first query data, the method further includes:

[0077] If the query field indicated by the field query instruction does not exist in the first query data, determining that the value of the query field is a null value;

[0078] Output the null value.

[0079] In this optional implementation, because the target data set only stores fields with existing values, if the query field indicated by the field query instruction does not exist in the query data, it can be determined that the value of the query field is a null value and the null value is output.

[0080] As an optional implementation manner, after storing the mapping relationship in a preset target data table, the method further includes:

[0081] When receiving the data query instruction, determining second query data from the target data set according to the third identifier carried by the data query instruction;

[0082] Determine a mapping record of a mapping relationship corresponding to the second query data from the target data table;

[0083] According to the mapping record, determining a target field whose value is empty;

[0084] The second query data and the target field are output.

[0085] The data query instruction may be a query instruction for a certain risk control data, and the corresponding query result may be the value of all fields of the risk control data.

[0086] In this optional implementation, when a data query instruction is received, the second query data (i.e., a field with an existing value) is determined from the target data set according to the third identifier carried by the data query instruction; a mapping record corresponding to the second query data is determined from the target data table (the mapping record records all fields of the risk control data corresponding to the third identifier); and a target field whose value is empty can be determined based on the mapping record.

[0087] exist Figure 1 In the described method flow, the fields with values ​​in the risk control data can be stored in the data set, and there is no need to store fields without values. Since it is not saved in the form of a data table, it is not necessary to bind multiple column elements, and the table does not need to be expanded when adding new fields, thus saving storage space. In addition, the database stores the mapping relationship between risk control data and fields, which can quickly determine the fields with empty values, thereby improving system performance.

[0088] Figure 2 It is a functional module diagram of a preferred embodiment of a data storage device disclosed in the present invention.

[0089] See also Figure 2The data storage device 20 may be operated in an electronic device. The data storage device 20 may include a plurality of functional modules composed of program code segments. The program code of each program segment in the data storage device 20 may be stored in a memory and executed by at least one processor to execute Figure 1 Part or all of the steps in the described data storage method.

[0090] In this embodiment, the data storage device 20 can be divided into multiple functional modules according to the functions it performs. The functional modules may include: an acquisition module 201, a determination module 202, a storage module 203 and a creation module 204. The module referred to in the present invention refers to a series of computer program segments that can be executed by at least one processor and can complete fixed functions, which are stored in a memory.

[0091] The acquisition module 201 is used to acquire target risk control data, wherein the target risk control data consists of multiple fields.

[0092] In an embodiment of the present invention, a risk control data may be composed of multiple fields, such as name, phone number, number of overdue repayments, etc., such as {name: Zhang San; phone number: 33501; number of overdue repayments: 3}.

[0093] The determination module 202 is used to determine, from the multiple fields, a field whose value is not empty as a target field to be stored.

[0094] In an embodiment of the present invention, the target risk control data is composed of multiple fields, but the values ​​of some fields may be empty, such as {Name: Li Si; Phone: NULL; Number of overdue repayments: 3}, the value of the field "Phone" is empty, and from the multiple fields, the fields whose values ​​are not empty are determined as the target fields to be stored. The two fields "Name" and "Number of overdue repayments" whose values ​​are not empty can be determined as the target fields.

[0095] The storage module 203 is used to store the target field in a preset target data set in the form of a document, record the writing information of the target field and generate a target record.

[0096] In the embodiment of the present invention, the target data set only needs to store fields with values, and other empty fields are not stored, which can save storage space.

[0097] The target risk control data is stored in the target data set in the form of documents, and one record of the target data table maps to one document of the target data set.

[0098] The target data set may be a storage document in mongodb (a database based on distributed file storage). The multiple fields are stored in mongodb in a document format, such as JSON format, to facilitate data transmission and use.

[0099] The creation module 204 is used to create a mapping relationship between each of the target fields and the corresponding target record.

[0100] In the embodiment of the present invention, the mapping relationship between each of the fields and the target record may be configured in MongoDB.

[0101] The target data table may be a configuration table in a database, which occupies little storage space.

[0102] The storage module 203 is further configured to store the mapping relationship in a preset target data table.

[0103] In the embodiment of the present invention, the mapping relationship may be stored in a preset target data table, that is, all fields corresponding to the target record may be queried and determined in the target data table through the mapping relationship.

[0104] As an optional implementation, the data storage device 20 further includes:

[0105] A query module, which is used for querying the target data set to obtain the data to be updated according to the first identifier carried by the data update instruction when receiving the data update instruction after the storage module 203 stores the mapping relationship in the preset target data table;

[0106] An updating module is used to update the data to be updated according to the updating field carried by the data updating instruction.

[0107] In this optional implementation, the corresponding multiple fields (i.e., the data to be updated) can be quickly queried in the target data set through the target identifier, and then the values ​​of the corresponding fields are updated according to the update fields carried by the data update instruction to complete the update of the data to be updated.

[0108] As an optional implementation, the determination module 202 is further configured to determine the first query data from the target data set according to the second identifier carried by the field query instruction when receiving a field query instruction after the storage module 203 stores the mapping relationship in a preset target data table;

[0109] The data storage device 20 further includes:

[0110] A determination module, used for determining whether the first query data contains a query field indicated by the field query instruction;

[0111] The first output module is configured to output data corresponding to the query field from the first query data if the query field indicated by the field query instruction exists in the first query data.

[0112] The field query instruction may be an instruction for querying a specified field in a certain risk control data.

[0113] In this optional implementation, when a field query instruction is received, first query data is determined from the target data set according to the risk control identifier carried by the field query instruction, and the first query data may be the values ​​of all fields corresponding to the risk control identifier. If the query field indicated by the field query instruction exists in the first query data, data corresponding to the query field is output from the first query data.

[0114] As an optional implementation, the determination module 202 is further configured to, after the determination module determines whether the query field indicated by the field query instruction exists in the first query data, determine that the value of the query field is a null value if the query field indicated by the field query instruction does not exist in the first query data;

[0115] The first output module is further used to output the null value.

[0116] In this optional implementation, because the target data set only stores fields with existing values, if the query field indicated by the field query instruction does not exist in the query data, it can be determined that the value of the query field is a null value and the null value is output.

[0117] As an optional implementation manner, the determination module 202 is further configured to, after storing the mapping relationship in the preset target data table, determine the second query data from the target data set according to the third identifier carried by the data query instruction when receiving a data query instruction;

[0118] The determination module 202 is further configured to determine a mapping record of a mapping relationship corresponding to the second query data from the target data table;

[0119] The determination module 202 is further configured to determine, according to the mapping record, a target field whose value is empty;

[0120] The data storage device 20 further includes:

[0121] The second output module is used to output the second query data and the target field.

[0122] The data query instruction may be a query instruction for a certain risk control data, and the corresponding query result may be the value of all fields of the risk control data.

[0123] In this optional implementation, when a data query instruction is received, the second query data (i.e., a field with an existing value) is determined from the target data set according to the third identifier carried by the data query instruction; a mapping record corresponding to the second query data is determined from the target data table (the mapping record records all fields of the risk control data corresponding to the third identifier); and a target field whose value is empty can be determined based on the mapping record.

[0124] As an optional implementation, the acquisition module 201 is further configured to acquire a unique identifier of the target risk control data after the storage module 203 stores the mapping relationship in a preset target data table;

[0125] The data storage device 20 further includes:

[0126] An establishing module is used to establish a query index of the target record in the target data set according to the unique identifier.

[0127] The index is a storage structure for accelerating the query of data.

[0128] In this optional implementation, a unique identifier of the target risk control data may be obtained, and a query index of the target record in the target data set may be established based on the unique identifier. By using the query index, the target record may be quickly queried in the target data set.

[0129] exist Figure 2 In the described data storage device, the fields with values ​​in the risk control data can be stored in the data set, and there is no need to store the fields without values. Since it is not saved in the form of a data table, it is not necessary to bind multiple column elements, and the table does not need to be expanded when adding new fields, thus saving storage space. In addition, the database stores the mapping relationship between the risk control data and the fields, which can quickly determine the fields with empty values, thereby improving system performance.

[0130] like Figure 3 As shown, Figure 3 The electronic device 3 includes a memory 31, at least one processor 32, a computer program 33 stored in the memory 31 and executable on the at least one processor 32, and at least one communication bus 34.

[0131] Those skilled in the art will understand that Figure 3 The schematic diagram shown is merely an example of the electronic device 3 and does not constitute a limitation on the electronic device 3. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the electronic device 3 may also include input and output devices, network access devices, etc.

[0132] The electronic device 3 also includes but is not limited to any electronic product that can interact with the user through a keyboard, mouse, remote control, touch pad or voice control device, such as a personal computer, tablet computer, smart phone, personal digital assistant (PDA), game console, interactive network television (IPTV), smart wearable device, etc. The network where the electronic device 3 is located includes but is not limited to the Internet, wide area network, metropolitan area network, local area network, virtual private network (VPN), etc.

[0133] The at least one processor 32 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, transistor logic devices, discrete hardware components, etc. The processor 32 may be a microprocessor or any conventional processor, etc. The processor 32 is the control center of the electronic device 3, and uses various interfaces and lines to connect various parts of the entire electronic device 3.

[0134] The memory 31 can be used to store the computer program 33 and / or modules / units. The processor 32 implements various functions of the electronic device 3 by running or executing the computer program and / or modules / units stored in the memory 31 and calling the data stored in the memory 31. The memory 31 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the electronic device 3, etc. In addition, the memory 31 can include volatile and non-volatile memories, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, etc.

[0135] Combination Figure 1 , the memory 31 in the electronic device 3 stores a plurality of instructions to implement a data storage method, and the processor 32 can execute the plurality of instructions to implement:

[0136] Obtaining target risk control data, wherein the target risk control data consists of multiple fields;

[0137] From the multiple fields, determine a field whose value is not empty as a target field to be stored;

[0138] Determine the target data set and target data table;

[0139] The target field is stored in a preset target data set in the form of a document, the writing information of the target field is recorded and a target record is generated;

[0140] Creating a mapping relationship between each of the target fields and the corresponding target record;

[0141] The mapping relationship is stored in a preset target data table.

[0142] Specifically, the specific implementation method of the processor 32 for the above instructions can refer to Figure 1 The description of the relevant steps in the corresponding embodiments will not be repeated here.

[0143] exist Figure 3In the described electronic device 3, the fields with values ​​in the risk control data can be stored in the data set, and there is no need to store fields without values. Since it is not saved in the form of a data table, it is not necessary to bind multiple column elements, and the table does not need to be expanded when adding new fields, thus saving storage space. In addition, the database stores the mapping relationship between the risk control data and the fields, which can quickly determine the fields with empty values, thereby improving system performance.

[0144] If the module / unit integrated in the electronic device 3 is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention implements all or part of the process in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program code can be in the form of source code, object code, executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), etc.

[0145] In the several embodiments provided by the present invention, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only illustrative, for example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation.

[0146] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0147] In addition, each functional module in each embodiment of the present invention may be integrated into one processing unit, each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional modules.

[0148] It is obvious to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the present invention can be implemented in other specific forms without departing from the spirit or essential features of the present invention. Therefore, from any point of view, the embodiments should be regarded as exemplary and non-restrictive, and the scope of the present invention is defined by the appended claims rather than the above description, and it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims are included in the present invention. Any accompanying figure mark in the claims should not be regarded as limiting the claims involved. In addition, it is obvious that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices stated in the system claim may also be implemented by one unit or device through software or hardware. The second and other words are used to indicate names, and do not indicate any particular order.

[0149] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of the present invention.

Claims

1. A data storage method, It is characterized in that The data storage method comprises: Obtaining target risk control data, wherein the target risk control data consists of multiple fields; From the multiple fields, determine a field whose value is not empty as a target field to be stored; The target field is stored in a preset target data set in the form of a document, the writing information of the target field is recorded and a target record is generated; Creating a mapping relationship between each of the target fields and the corresponding target record; The mapping relationship is stored in a preset target data table, wherein one record of the target data table maps to one document of the target data set; When receiving a field query instruction, determining first query data from the target data set according to a second identifier carried by the field query instruction; Determining whether the query field indicated by the field query instruction exists in the first query data; If the query field indicated by the field query instruction exists in the first query data, outputting data corresponding to the query field from the first query data; If the query field indicated by the field query instruction does not exist in the first query data, determining that the value of the query field is a null value; Output the null value; When receiving the data query instruction, determining second query data from the target data set according to the third identifier carried by the data query instruction; Determine a mapping record of a mapping relationship corresponding to the second query data from the target data table; According to the mapping record, determining an empty field whose value is empty; The second query data and the empty field are output.

2. The data storage method according to claim 1, It is characterized in that After storing the mapping relationship in a preset target data table, the data storage method further includes: When receiving a data update instruction, querying in the target data set according to the first identifier carried by the data update instruction to obtain the data to be updated; The data to be updated is updated according to the update field carried by the data update instruction.

3. The data storage method according to any one of claims 1 to 2, It is characterized in that After storing the mapping relationship in a preset target data table, the data storage method further includes: Obtaining a unique identifier for the target risk control data; A query index of the target record in the target data set is established according to the unique identifier.

4. The data storage method according to any one of claims 1 to 2, It is characterized in that The target risk control data is stored in the target data set in the form of documents.

5. A data storage device, It is characterized in that The data storage device comprises: An acquisition module, used to acquire target risk control data, wherein the target risk control data consists of multiple fields; A determination module, configured to determine, from the plurality of fields, a field whose value is not empty as a target field to be stored; A storage module, used to store the target field in a preset target data set in the form of a document, record the writing information of the target field and generate a target record; A creation module, used to create a mapping relationship between each of the target fields and the corresponding target record; The storage module is further used to store the mapping relationship in a preset target data table, wherein one record of the target data table maps to one document of the target data set; The determination module is further configured to determine the first query data from the target data set according to the second identifier carried by the field query instruction when receiving the field query instruction; A determination module, used for determining whether the first query data contains a query field indicated by the field query instruction; A first output module, configured to output data corresponding to the query field from the first query data if the query field indicated by the field query instruction exists in the first query data; The determining module is further configured to determine that the value of the query field is a null value if the query field indicated by the field query instruction does not exist in the first query data; The first output module is further used to output the null value; The determination module is further configured to determine second query data from the target data set according to a third identifier carried by the data query instruction when receiving the data query instruction; The determination module is further used to determine a mapping record of a mapping relationship corresponding to the second query data from the target data table; The determination module is further used to determine an empty field whose value is empty according to the mapping record; The second output module is used to output the second query data and the empty field.

6. An electronic device, It is characterized in that The electronic device comprises a processor and a memory, wherein the processor is configured to execute a computer program stored in the memory to implement the data storage method according to any one of claims 1 to 4.

7. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores at least one instruction, and when the at least one instruction is executed by a processor, the data storage method according to any one of claims 1 to 4 is implemented.