Data storage method, device, computer equipment and storage medium

By searching and using the field encoding of the table information description table, field information description table and data storage table in the database to store business data, the complexity problem caused by the increase in the number of tables in the database is solved, and data storage efficiency and database stability are improved.

CN114385643BActive Publication Date: 2025-02-28PING AN TECH (SHENZHEN) CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210057500.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-19
Publication Date
2025-02-28
Estimated Expiration
2042-01-19

AI Technical Summary

Technical Problem

With the increase in the complexity of business logic, the number of tables in the database continues to increase, resulting in many file descriptors, complex data relationships, and complex program logic, which easily leads to operation failure.

Method used

By receiving the data storage request of the target service, the target service finds the table information description table, the field information description table and the data storage table based on the identification information of the target service, determines the field encoding and stores the service data in the data storage table, thereby reducing the complexity of the physical table storage logic.

Benefits of technology

It improves the efficiency of data storage, reduces the complexity of database operations, and enhances the stability of database.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114385643B_ABST
    Figure CN114385643B_ABST
Patent Text Reader

Abstract

The present application relates to the field of data processing technology, and provides a data storage method, device, computer equipment and storage medium, wherein the method comprises: receiving a data storage request of a target business, the data storage request comprising identification information and business data of the target business; searching for a table information description table, a field information description table and a data storage table of the target business based on the identification information of the target business; determining the field coding of the business data in the field information description table based on the table information description table; storing the business data in the data storage table based on the field coding of the business data. The present application can improve the efficiency of data storage, which is conducive to improving the stability of the database.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and mainly to a data storage method, device, computer equipment and storage medium. Background Art

[0002] In the information construction, data is transferred based on the tables in the database. For each additional business, a new physical table needs to be added, and the database operation layer will also add a series of action codes such as adding, deleting, modifying, and checking this table. As the complexity of business logic increases, the number of tables in the database will increase with the development of business. From the perspective of the operating system, more tables mean more file descriptors, the data relationship between the tables in the database will be very complex, the program logic will be complex, and it is easy to cause operation failure. Summary of the invention

[0003] The embodiments of the present application provide a data storage method, apparatus, computer equipment, and storage medium, which can improve the efficiency of data storage and help improve the stability of the database.

[0004] In a first aspect, an embodiment of the present application provides a data storage method, wherein:

[0005] Receiving a data storage request of a target business, the data storage request including identification information and business data of the target business;

[0006] Searching for a table information description table, a field information description table, and a data storage table of the target business based on the identification information of the target business;

[0007] Determine the field code of the business data in the field information description table based on the table information description table;

[0008] The business data is stored in the data storage table based on the field code of the business data.

[0009] In a second aspect, an embodiment of the present application provides a data storage device, wherein:

[0010] A receiving unit, configured to receive a data storage request of a target service, wherein the data storage request includes identification information and service data of the target service;

[0011] A search unit, used to search the table information description table, the field information description table and the data storage table of the target business based on the identification information of the target business;

[0012] A determining unit, configured to determine the field code of the business data in the field information description table based on the table information description table;

[0013] A storage unit is used to store the business data in the data storage table based on the field coding of the business data.

[0014] In a third aspect, an embodiment of the present application provides a computer device, comprising a processor, a memory, a communication interface, and a computer program, wherein the computer program is stored in the memory, the computer program is configured to be executed by the processor, and the computer program includes instructions for some or all of the steps described in the first aspect.

[0015] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, wherein the computer program enables a computer to execute to implement some or all of the steps described in the first aspect.

[0016] Implementing the embodiments of the present application will have the following beneficial effects:

[0017] After adopting the above-mentioned data storage method, device, computer equipment and storage medium, when receiving a data storage request of a target business, first search the table information description table, field information description table and data storage table of the target business based on the identification information of the target business. Then determine the field code of the business data in the field information description table based on the table information description table, and then store the business data in the data storage table based on the field code of the business data. In this way, the corresponding information is stored in the table information description table, the field information description and the data storage table respectively, so as to reduce the complexity of the physical table storage logic, improve the efficiency of data storage, and help improve the stability of the database. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0019] in:

[0020] Figure 1 A schematic diagram of a data storage method provided in an embodiment of the present application;

[0021] Figure 2 A schematic diagram of the structure of a data storage device provided in an embodiment of the present application;

[0022] Figure 3 A schematic diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0023] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. According to the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0024] The terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or devices.

[0025] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0026] The network architecture used in the embodiment of the present application includes a server and an electronic device. The embodiment of the present application does not limit the number of electronic devices and servers, and the server can provide services for multiple electronic devices at the same time. The server can be an independent server, or it can be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms. The server may be implemented by a server cluster consisting of multiple servers.

[0027] The electronic device may be a personal computer (PC), a laptop or a smart phone, or an all-in-one machine, a handheld computer, a tablet computer (pad), a smart TV player terminal, a vehicle-mounted terminal or a portable device. The operating system of the electronic device on the PC side, such as an all-in-one machine, may include but is not limited to Linux system, Unix system, Windows series system (such as Windows XP, Windows 7, etc.), Mac OS X system (Apple computer operating system) and other operating systems. The operating system of the electronic device on the mobile side, such as a smart phone, may include but is not limited to Android system, IOS (Apple mobile phone operating system), Window system and other operating systems.

[0028] The electronic device can install and run the application, and the server can be a server corresponding to the application installed in the electronic device, providing application services for the application. The application can be a separately integrated application software, or a small program embedded in other applications, or a system on a web page, etc., which is not limited here.

[0029] The embodiment of the present application provides a data storage method, which can be executed by a data storage device. The device can be implemented by software and / or hardware, and can generally be integrated in a server, which can improve the efficiency of data storage and help improve the stability of the database.

[0030] Please refer to Figure 1 , Figure 1 This is a flow chart of a data storage method provided by the present application. Taking the application of the method in a server as an example, the method includes the following steps S101 to S104, wherein:

[0031] S101: Receive a data storage request of a target business.

[0032] This application does not limit the business type of the target business, which can be any business, or a business whose data type processed by the server is intermediate data, or a new business that has not been processed by the server, etc. In an embodiment of the present application, the data storage request includes the identification information and business data of the target business, which is used to request the storage of business data. Among them, the identification information of the target business can be the business name of the target business, or the number corresponding to the business name, or the name of the team responsible for processing the target business and the content composed of the business name, etc., which are not limited here. And this application does not limit the data type of business data. The business data can be any data involved in the target business, or it can be intermediate data, etc.

[0033] S102: Searching for a table information description table, a field information description table, and a data storage table of the target business based on identification information of the target business.

[0034] In the embodiment of the present application, the table information description table, field information description table and data storage table of each business can be pre-stored. Among them, the table information description table includes the table name of the field information description table, which is used to explain the business meaning of the field information description table. The field information description table records the field code corresponding to each data, which is used to explain the attribute information such as the name, type and length of the field. The data storage table stores the data corresponding to each field code.

[0035] This application does not limit the encoding method of field encoding, and encoding can be performed based on the field type and preset order of the data. Among them, the field type may include character type, numerical type, and extended type, etc., which are not limited here. Exemplarily, the field encoding of the character type can be described in the form of "remark+number", such as remark1 corresponding to the name (name), remark2 corresponding to the email (email), and remark3 corresponding to the phone (mobile). The field encoding of the numerical type can be described in the form of "num+number", such as num1 corresponding to the amount and num2 corresponding to the time. The field encoding of the extended type can be described in the form of "ext+number", such as ext1, ext2, and ext3.

[0036] The preset order of data can be determined by the order of data storage, the importance of data to the target business, the frequency of data use, etc. Alternatively, all data involved in the platform can be sorted without considering the target business, so that after determining which data the target business includes, the preset order of the data can be determined based on the data encoding obtained by the previous sorting. In this way, replacing the field name with a reusable field code is conducive to improving the reuse rate of the code.

[0037] It should be noted that the business table information description table, field description table and data storage table are all logical tables, not physical tables with database operation functions. Therefore, storing different types of data separately can reduce the complexity of program logic, which is conducive to improving data processing efficiency and code reuse.

[0038] In an embodiment of the present application, audit information tables and audit record tables for different businesses may also be pre-stored. Among them, the audit information table is used to define different audit information, and the audit record table is used to record the specific content corresponding to different audit information. Exemplarily, the audit information table defines the audit information table ID, the audit table ID, the audit type, the audit status, the audit time, the audit opinion, etc. The audit record table includes the audit record table ID and the audit information table ID, and may also include the specific content corresponding to the audit type, the audit status, the audit time, and the audit opinion.

[0039] It is understandable that data or part of the data in the business needs to be reviewed. For example, the merchant's account opening business needs to review the merchant's business license and other information. Storing audit information separately in the audit record table and the audit information table can improve the efficiency of audit information search and help improve the efficiency of handling abnormal data.

[0040] In a possible example, after step S102, the following steps A1 to A3 may be further included, wherein:

[0041] A1. If the table information description table, field information description table and data storage table of the target business are not found, it is determined whether the target business is a preset business.

[0042] If it is determined that the target service is a preset service, step A2 is performed to search for a physical table of the target service based on the identification information of the target service.

[0043] In the embodiment of the present application, the physical table of the target business refers to a table that can implement the database operation function of the target business, that is, the business data of the target business can be obtained through the physical table of the target business, and the business data can be processed based on the physical table.

[0044] The present application does not limit the preset business, and the preset business can be a business of intermediate data that the server does not need to process. It can be understood that the business of intermediate data that the server does not need to process means that the current server does not process the data of the business, and for data storage or caching, the data storage method proposed in the present application can be used for storage to reduce the number of physical library tables created, thereby reducing the code workload of the database operation layer, which is conducive to improving the stability of the database.

[0045] Preset services or services that can be processed by the server and are not affected by security, etc. It can be understood that services where data processed by the server is not affected by security can increase the data processing rate while ensuring security.

[0046] In a possible example, step A1 may include the following steps A11 to A13, wherein:

[0047] A21. Determine the type of data involved in the target business.

[0048] In an embodiment of the present application, the data type involved in the target business specifically includes the data type of the data involved in the target business. The data type can be determined based on the business type of the target business and the input data and output data of the target business, etc., and is not limited here. It can be understood that the input data and output data of the target business are related to the data involved in the target business, and the data involved in the target business is also related to the business type of the target business. Based on this, the data type involved in the target business is determined based on the business type of the target business and the input data and output data of the target business, which can improve the accuracy of determining the data type.

[0049] A12. Determine the risk value and / or processing complexity of the target business based on the data type.

[0050] In an embodiment of the present application, the risk value of the target business is used to describe the size of the risk caused by data leakage in the target business. The risk value can be determined based on whether each data type is a privacy type, or the probability that the data corresponding to the data type is used in other businesses. It can be understood that if the business data of the target business is a privacy type, the risk of data leakage is high. The greater the probability that the data is used by other businesses, the greater the impact of the data leakage. In this way, the accuracy of determining the risk value of the target business can be improved.

[0051] The processing complexity of the target business refers to the complexity of the processing logic of the data in the target business. The processing complexity can be determined based on the association relationship between the data corresponding to each data type, and the association relationship between the input data and the output data. It can be understood that based on the association relationship between the data corresponding to each data type, the data processing logic between the data can be determined. Based on the association relationship between the data corresponding to each data type and the input data and the output data, the data processing logic of each data in the target business can be determined. In this way, the accuracy of determining the processing complexity of the target business can be improved.

[0052] A13. If the risk value is less than the first threshold, or the processing complexity is greater than the second threshold, the target business is determined to be a preset business.

[0053] The present application does not limit the first threshold and the second threshold, which can be determined based on the number of businesses, or can be determined based on risk control rules, etc. It can be understood that in steps A11 to A13, the risk value and / or processing complexity of the target business is determined based on the data type involved in the target business. In this way, whether the target business is a preset business is determined based on the size of the risk value of the target business and the size of the processing complexity. If so, the physical table of the target business can be stored in the form of a table information description table, a field information description table, and a data storage table, so as to protect the data of businesses with high security requirements, which is conducive to improving the security of data storage. After storing the table information description table, the field information description table, and the data storage table in a separate form, it can be avoided that the physical table needs to be parsed next time, which can improve the data processing efficiency.

[0054] In a possible example, after step A2, if the physical table of the target business is not found, a table information description table, a field information description table and a data storage table of the target business are established based on the identification information of the target business.

[0055] Among them, the method of establishing the table information description table, field information description table and data storage table of the target business can refer to the meaning of the aforementioned tables. It can be understood that if the physical table of the target business is not found, it means that the business data of the target business has not been stored before. In the case where the target business is a preset business, the table information description table, field information description table and data storage table of the target business can be established. In this way, when the target business is processed next time, data processing can be performed based on the table information description table, field information description table and data storage table of the target business.

[0056] A3. Analyze the physical table of the target business to obtain the table information description table, field information description table and data storage table of the target business.

[0057] It can be understood that in steps A1 to A3, if the table information description table, field information description table, and data storage table of the target business are not found, it means that the business data of the target business is stored in the original way, so that the physical table of the target business can be found based on the identification information of the target business. And in the case where the target business is a preset business, the physical table of the target business can be parsed to obtain the table information description table, field information description table, and data storage table of the target business. In this way, when processing the data of the target business next time, it can be processed based on the table information description table, field information description table, and data storage table of the target business without parsing complex physical tables, thereby improving data processing efficiency.

[0058] In a possible example, if it is determined that the target business is not a preset business, the physical table of the target business is parsed to obtain the data processing logic of the business data of the target business; based on the data processing logic of the business data, the business data is stored. In this way, when the target business is not a preset business, the data can be stored in the original way to improve the flexibility of the data storage method for different businesses.

[0059] S103: Determine the field code of the business data in the field information description table based on the table information description table.

[0060] In a possible example, step S103 may include the following steps B1 and B2, wherein:

[0061] B1. Determine the field type of business data based on the table information description table.

[0062] The field type may include character type, numeric type, and extended type as described above. The present application does not limit the method for determining the field type. In a possible example, step B1 may include the following steps B11 to B13, wherein:

[0063] B11. Determine the business meaning of the target business based on the table information description table.

[0064] In the embodiment of the present application, the table information description table of the target business is used to explain the business meaning of the target business. The business meaning can be obtained by semantically parsing the table information description table. The present application does not limit the method of semantic parsing. The word segmentation model composed of one or more word segmenters, Jieba segmenters, Ansj segmenters or HanLP segmenters can be used for word segmentation, and then the business meaning of the target business is obtained based on the vocabulary obtained by word segmentation.

[0065] B12. Determine the data type of business data based on business meaning.

[0066] In the embodiment of the present application, all data types included in the business data can be determined first, and then the data type of the business data of the target business can be selected from the data types based on the business meaning of the target business. Alternatively, the data type involved in the target business can be determined based on the business meaning, and then the data type of the business data can be selected from the data types, etc., which is not limited here.

[0067] B13. Determine the field type of the business data based on the data type of the business data.

[0068] In an embodiment of the present application, field types corresponding to different data types and characters corresponding to field types may be pre-stored. For example, the field type corresponding to data of a custom type is a custom type, and the character corresponding to the custom type may be remark; the field type corresponding to data of a numerical type is a numerical type, and the character corresponding to the numerical type may be num; the field type corresponding to data of an extended type is an extended type, and the character corresponding to the extended type may be ext, etc. In this way, after determining the data type of the business data, the efficiency of determining the field type can be improved based on the field type corresponding to the data type and the character corresponding to the field type, thereby improving the efficiency of determining the field encoding, which is conducive to improving the efficiency of data storage.

[0069] It is understandable that different business data may have different data types in different businesses. Based on this, in steps B11 to B13, the business meaning of the target business is first determined based on the table information description table. Then, the field type of the business data is determined based on the data type of the business data determined by the business meaning, which can improve the accuracy of determining the field type.

[0070] B2. Determine the field code of the business data in the field information description table based on the field type of the business data.

[0071] In the embodiment of the present application, the character corresponding to the field type of the business data can be first searched from the field information description table, and then it is determined whether the business data corresponding to the character is the business data to be stored. If the business data to be stored is not found, the field code of the business data is obtained by combining the character corresponding to the field type of the business data and the size of the storage order of the business data, or the field code of the business data can be searched from a pre-set field code library based on the field type of the business data, etc., which is not limited here.

[0072] It can be understood that in step B1 and step B2, the field type of the business data determined in the table information description table is used to determine the field code of the business data in the field information description table, thereby improving the accuracy of determining the field type and facilitating improving the efficiency of data storage.

[0073] It should be noted that the target business may include one or more field information description tables, and the sub-business meanings of each field information description table are different. In a possible example, if the number of target businesses is greater than 1, the following steps B14 to B16 may be further included before step S103, wherein:

[0074] B14. Determine the business scope of the field information description table based on the field information description table.

[0075] In the embodiment of the present application, the business scope of the field information description table refers to the business to which the data corresponding to the fields involved in the field information description table belongs. The business scope can be determined based on the data type corresponding to each field in each field information description table, and specifically can be determined based on the data type corresponding to each field, and the association relationship between the data corresponding to each field and other data, etc., which is not limited here.

[0076] B15. Obtain the matching value between the data type of the business data and the business scope of the field information description table.

[0077] B16. Select the target field information description table from the field information description table based on the maximum value of the matching value.

[0078] In the embodiment of the present application, the matching value between the data type of the business data and the business scope of the field information description table refers to the possibility that the business scope of the field information description table includes the business data. It can be determined based on the matching value between the data type involved in the business scope and the data type of the business data, or based on the correlation between the data involved in the business scope and the business data, etc., which is not limited here.

[0079] The field information description table corresponding to the maximum value of the matching value can be used as the target field information description table. In this way, step S103 may include the following steps: determining the field code of the business data in the target field information description table based on the field type of the business data. It can be understood that in the above example, when there are multiple field information description tables for the target business, the matching value between the data type of the business data and the business scope of the field information description table is first obtained. Then the field information description table corresponding to the maximum value of the matching value is used as the target field information description table. In this way, the accuracy of determining the field type can be improved, which is conducive to improving the accuracy of data storage.

[0080] S104. Store the business data in a data storage table based on the field code of the business data.

[0081] exist Figure 1 In the method shown, after receiving a data storage request of a target business, the table information description table, field information description table and data storage table of the target business are first searched based on the identification information of the target business. The field code of the business data in the field information description table is then determined based on the table information description table, and then the business data is stored in the data storage table based on the field code of the business data. In this way, the corresponding information is stored in the table information description table, the field information description and the data storage table respectively, so as to reduce the complexity of the physical table storage logic, improve the efficiency of data storage, and help improve the stability of the database.

[0082] In a possible example, after step S104, the following steps may also be included: receiving a data processing request for business data; searching the table information description table, field information description table and data storage table of the target business based on the identification information of the target business; determining the field coding of the business data in the field information description table based on the table information description table; determining the associated data associated with the business data, and the processing logic between the business data and the associated data; searching for the business data from the data storage table based on the field coding of the business data; and processing the business data based on the processing logic and the associated data.

[0083] The data processing request of the target business is used to request the processing of the business data of the target business. The data processing request includes at least the identification information of the target business and the processing type of the business data. The present application does not limit the processing type of the business data, and may include an add type, a delete type, a change type, a search type, etc. It may also include a test type and a check type, etc. When the processing type is an add type, the data processing request may also include the added data of the business data.

[0084] The table information description table, field information description table and data storage table, as well as the field coding of the business data in the field information description table can be referred to above, and will not be repeated here. The associated data of the business data may include data associated with the business data in the previously stored data of the target business, or may include data of associated businesses associated with the target business, etc., which are not limited here. If the associated data is the data of the target business, it can be obtained from the data storage table of the target business based on the field coding of the associated data.

[0085] It can be understood that after the business data of the target business is stored in the data storage table of the target business, if a data processing request for the business data is received, the business data can be first obtained from the data storage table. Then, the associated data associated with the business data and the processing logic between the business data and the associated data are determined. In this way, the business data can be processed based on the processing logic and the associated data, thereby improving the data processing efficiency.

[0086] The present application does not limit the method for determining the associated data and the processing logic between the business data and the associated data. In a possible example, the following steps may be included: determining the business meaning of the target business based on the table information description table; determining the data type associated with the business data and the association relationship between the business data and the associated data associated with the business data based on the business meaning of the target business; determining the associated data based on the data type associated with the business data; and determining the processing logic between the business data and the associated data based on the association relationship.

[0087] Among them, the method for determining the business meaning can refer to the above, and will not be repeated here. It can be understood that after determining the business meaning of the target business, the data type of the business data, the data type associated with the business data, and the association relationship between the business data and the associated data associated with the business data can be determined based on the business meaning of the target business, so that the associated data can be determined based on the data type associated with the business data, and the processing logic between the business data and the associated data can be determined based on the association relationship between the business data and the associated data. In this way, the associated data of the business data and the processing logic between the business data and the associated data are determined based on the table information description table of the target business, which can improve the accuracy of the determination.

[0088] The method of the embodiment of the present application is described in detail above, and the device of the embodiment of the present application is provided below.

[0089] and Figure 1 The embodiment shown is consistent with that shown in FIG. Figure 2 , Figure 2 Schematic diagram of a data storage device proposed in this application. Figure 2 As shown, the data storage device 200 comprises:

[0090] The receiving unit 201 is used to receive a data storage request of a target service, wherein the data storage request includes identification information and service data of the target service;

[0091] The search unit 202 is used to search the table information description table, the field information description table and the data storage table of the target business based on the identification information of the target business;

[0092] The determination unit 203 is used to determine the field code corresponding to the business data in the field information description table based on the table information description table;

[0093] The storage unit 204 is used to store the business data in the data storage table based on the field code.

[0094] In a possible example, the determining unit 203 is specifically configured to determine a field type of the business data based on the table information description table; and determine a field code of the business data in the field information description table based on the field type of the business data.

[0095] In a possible example, the determination unit 203 is specifically used to determine the business meaning of the target business based on the table information description table; determine the data type of the business data based on the business meaning of the target business; and determine the field type of the business data based on the data type of the business data.

[0096] In a possible example, the number of field information description tables is greater than 1, and the determination unit 203 is specifically used to determine the business scope of the field information description table based on the field code in the field information description table; obtain the matching value between the data type of the business data and the business scope of the field information description table; select the target field information description table from the field information description table based on the maximum value of the matching value; and determine the field code of the business data in the target field information description table based on the field type of the business data.

[0097] In a possible example, the determination unit 203 is also used to determine whether the target business is a preset business if the table information description table, field information description table and data storage table of the target business are not found; the search unit 202 is also used to search for the physical table of the target business based on the identification information of the target business if it is determined that the target business is the preset business; the data storage device 200 also includes a parsing unit 205, which is used to parse the physical table of the target business to obtain the table information description table, field information description table and data storage table of the target business.

[0098] In a possible example, the determination unit 203 is specifically used to determine the data type involved in the target business; determine the risk value and / or processing complexity of the target business based on the data type; if the risk value is less than a first threshold, or the processing complexity is greater than a second threshold, the target business is determined to be a preset business.

[0099] In a possible example, the data storage device 200 further includes an establishing unit 206 for establishing a table information description table, a field information description table and a data storage table of the target business based on the identification information of the target business if the physical table of the target business is not found.

[0100] The detailed execution process of each unit in the above data storage device 200 can refer to the execution steps in the above method embodiment, which will not be repeated here.

[0101] and Figure 1 For details, please refer to Figure 3 , Figure 3 Schematic diagram of the structure of a computer device provided in an embodiment of the present application. Figure 3 As shown, the computer device 300 includes a processor 310, a memory 320 and a communication interface 330. The processor 310, the memory 320 and the communication interface 330 are connected to each other via a bus 350. Figure 2 The related functions implemented by the receiving unit 201 shown can be implemented through the communication interface 330. Figure 2The related functions implemented by the searching unit 202, the determining unit 203, the parsing unit 205 and the establishing unit 206 can be implemented by the processor 310. Figure 2 The related functions implemented by the storage unit 204 shown can be implemented by the memory 320 .

[0102] The memory 320 stores a computer program 340, which is configured to be executed by the processor 310. The computer program 340 includes instructions for executing the following steps:

[0103] Receiving a data storage request of a target business, the data storage request including identification information and business data of the target business;

[0104] Searching for a table information description table, a field information description table, and a data storage table of the target business based on the identification information of the target business;

[0105] Determine the field code of the business data in the field information description table based on the table information description table;

[0106] The business data is stored in the data storage table based on the field code of the business data.

[0107] In a possible example, in determining the field coding of the business data in the field information description table based on the table information description table, the computer program 340 specifically includes instructions for performing the following steps:

[0108] Determine the field type of the business data based on the table information description table;

[0109] The field code of the business data in the field information description table is determined based on the field type of the business data.

[0110] In a possible example, in determining the field type of the business data based on the table information description table, the computer program 340 specifically includes instructions for performing the following steps:

[0111] Determine the business meaning of the target business based on the table information description table;

[0112] Determining the data type of the business data based on the business meaning of the target business;

[0113] The field type of the business data is determined based on the data type of the business data.

[0114] In a possible example, the number of the field information description tables is greater than 1, and before determining the field code of the business data in the field information description table based on the field type of the business data, the computer program 340 further includes instructions for performing the following steps:

[0115] Determine the business scope of the field information description table based on the field code in the field information description table;

[0116] Acquire a matching value between the data type of the business data and the business scope of the field information description table;

[0117] Selecting a target field information description table from the field information description table based on the maximum value of the matching value;

[0118] In terms of determining the field code of the business data in the field information description table based on the field type of the business data, the computer program 340 specifically includes instructions for executing the following steps:

[0119] The field code of the business data in the target field information description table is determined based on the field type of the business data.

[0120] In a possible example, after searching the table information description table, the field information description table, and the data storage table of the target business based on the identification information of the target business, the computer program 340 further includes instructions for executing the following steps:

[0121] If the table information description table, field information description table and data storage table of the target business are not found, determining whether the target business is a preset business;

[0122] If it is determined that the target service is the preset service, searching for a physical table of the target service based on the identification information of the target service;

[0123] The physical table of the target business is parsed to obtain a table information description table, a field information description table and a data storage table of the target business.

[0124] In a possible example, in determining whether the target service is a preset service, the computer program 340 specifically includes instructions for executing the following steps:

[0125] Determining the type of data involved in the target business;

[0126] Determine the risk value and / or processing complexity of the target business based on the data type;

[0127] If the risk value is less than a first threshold, or the processing complexity is greater than a second threshold, the target business is determined to be a preset business.

[0128] In a possible example, after searching the physical table of the target service based on the identification information of the target service, the computer program 340 further includes instructions for executing the following steps:

[0129] If the physical table of the target business is not found, a table information description table, a field information description table and a data storage table of the target business are established based on the identification information of the target business.

[0130] An embodiment of the present application also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, which enables a computer to execute part or all of the steps of any method recorded in the method embodiment, and the computer includes an electronic device or a server.

[0131] The present application also provides a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to cause a computer to execute to implement some or all steps of any method described in the method embodiment. The computer program product can be a software installation package, and the computer includes an electronic device or a server.

[0132] In the above embodiment, the computer-readable storage medium may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function, etc.; the data storage area may store data created according to the use of the blockchain node, etc. For example, the blockchain may store a table information description table, a field information description table, and a data storage table of the target business, as well as an audit information table and an audit record table, etc., which are not limited here.

[0133] The blockchain referred to in the embodiments of the present application is a new application model of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods, each of which contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, platform product service layer, and application service layer.

[0134] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modes involved are not necessarily required by the present application.

[0135] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0136] In the several embodiments provided in the present application, it should be understood that the disclosed device can be implemented in other ways. For example, the device embodiments described above are only schematic, such as the division of units, which is only a logical function division. There may be other division methods in actual implementation, such as at least one unit or component can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, and the indirect coupling or communication connection of devices or units can be electrical or other forms.

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

[0138] In addition, each functional unit in each embodiment of the present application can be integrated into a storage unit, each unit can exist physically separately, or two or more units can be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of software program mode.

[0139] If the integrated unit is implemented in the form of a software program model and sold or used as an independent product, it can be stored in a computer-readable memory. According to this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a memory and includes several instructions for a computer (which can be a personal computer, server or network device, etc.) to execute all or part of the steps of the various embodiments of the present application. The aforementioned memory includes: U disk, read-only memory (ROM), random access memory (RAM), mobile hard disk, magnetic disk or optical disk, etc., and other media that can store program codes.

[0140] The embodiments of the present application are introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for those skilled in the art, according to the idea of ​​the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A data storage method, characterized in that: include: Receiving a data storage request of a target business, the data storage request including identification information of the target business and business data requested to be stored; Based on the identification information of the target business, the table information description table, the field information description table and the data storage table of the target business are searched, the table information description table includes the table name of the field information description table, the table name is used to describe the business meaning of the field information description table, the field information description table records the field codes corresponding to each data, the field codes are used to describe the name, type and length of the field, and the data storage table stores the data corresponding to each field code; the encoding method of the field code is based on the field type and preset order of the data, the field type includes character type, numeric type and extended type, and the preset order is determined based on the order of data storage, the size of the important value of the data for the target business, and the size of the frequency of data use; the table information description table, the field information description table and the data storage table are all logical tables, rather than physical tables with database operation functions; Based on the table information description table, determining the field code of the business data in the field information description table; Based on the field coding of the business data, storing the business data in the data storage table; If the table information description table, field information description table and data storage table of the target business are not found, determine the data type involved in the target business, and determine the risk value and / or processing complexity of the target business based on the data type. The risk value of the target business is used to describe the risk potential caused by data leakage in the target business. The processing complexity of the target business refers to the complexity of the processing logic of the data in the target business. The risk value is determined based on whether each data type is a privacy type, or the probability that the data corresponding to the data type is used in other businesses; If the risk value is less than a first threshold, or the processing complexity is greater than a second threshold, determining that the target business is a preset business, where the preset business is a business of intermediate data that the server does not need to process; If it is determined that the target business is a preset business, a physical table of the target business is searched based on the identification information of the target business, and the physical table of the target business is parsed to obtain a table information description table, a field information description table, and a data storage table of the target business, wherein the physical table of the target business means that the business data of the target business can be obtained through the physical table of the target business, and the business data is processed based on the physical table; If the physical table of the target business is not found, create a table information description table, a field information description table and a data storage table of the target business; If it is determined that the target business is not a preset business, the physical table of the target business is parsed to obtain the data processing logic of the business data of the target business; based on the data processing logic of the business data, the business data is stored.

2. The method according to claim 1, characterized in that The determining, based on the table information description table, the field code of the business data in the field information description table comprises: Determine the field type of the business data based on the table information description table; Based on the field type of the business data, the field code of the business data in the field information description table is determined.

3. The method according to claim 2, characterized in that The determining the field type of the business data based on the table information description table includes: Determining the business meaning of the target business based on the table information description table; Determining the data type of the business data based on the business meaning of the target business; Based on the data type of the business data, the field type of the business data is determined.

4. The method according to claim 3, characterized in that The number of the field information description tables is greater than 1, and before determining the field code of the business data in the field information description table based on the field type of the business data, the method further includes: Based on the field information description table, determining the business scope of the field information description table; Acquire a matching value between the data type of the business data and the business scope of the field information description table; Based on the maximum value of the matching values, selecting a target field information description table from the field information description table; The determining, based on the field type of the business data, the field code of the business data in the field information description table comprises: Based on the field type of the business data, the field code of the business data in the target field information description table is determined.

5. A data storage device, characterized in that: The device comprises a unit for executing the method according to any one of claims 1 to 4, the device comprising: A receiving unit, configured to receive a data storage request of a target service, wherein the data storage request includes identification information and service data of the target service; A search unit, used to search the table information description table, the field information description table and the data storage table of the target business based on the identification information of the target business; A determining unit, configured to determine the field code of the business data in the field information description table based on the table information description table; A storage unit is used to store the business data in the data storage table based on the field coding of the business data.

6. A computer device, characterized in that: The method comprises a processor, a memory and a communication interface, wherein the memory stores a computer program, the computer program is configured to be executed by the processor, and the computer program comprises instructions for executing the steps in any one of the methods of claims 1 to 4.

7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which enables a computer to execute to implement the method according to any one of claims 1 to 4.

Citation Information

Patent Citations

  • Dynamic form implementation method based on MYSQL and MONGODB

    CN112286999A