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

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

Info

Publication number
CN114385643A
CN114385643A CN202210057500.3A CN202210057500A CN114385643A CN 114385643 A CN114385643 A CN 114385643A CN 202210057500 A CN202210057500 A CN 202210057500A CN 114385643 A CN114385643 A CN 114385643A
Authority
CN
China
Prior art keywords
service
data
field
information description
target service
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210057500.3A
Other languages
Chinese (zh)
Inventor
李夏
王聪
徐林
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN202210057500.3A priority Critical patent/CN114385643A/en
Publication of CN114385643A publication Critical patent/CN114385643A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2282Tablespace storage structures; Management thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution

Landscapes

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

Abstract

The application relates to the technical field of data processing, and provides a data storage method, a data storage device, computer equipment and a storage medium, wherein the method comprises the following steps: receiving a data storage request of a target service, wherein the data storage request comprises identification information of the target service and service data; searching a table information description table, a field information description table and a data storage table of the target service based on the identification information of the target service; determining field codes of the service data in the field information description table based on the table information description table; and storing the service data into the data storage table based on the field codes of the service data. By the method and the device, data storage efficiency can be improved, and stability of the database is improved.

Description

Data storage method and device, computer equipment and storage medium
Technical Field
The application relates to the technical field of data processing, and mainly relates to a data storage method and device, computer equipment and a storage medium.
Background
In the information-based construction, data circulation is performed based on a table in a database. Every time a service is added, a physical table needs to be added, and the database operation layer also adds codes of a series of actions such as adding, deleting, modifying, checking and the like of the table. With the increase of the complexity of business logic, the number of tables in the database is more and more created along with the development of business. From the perspective of an operating system, the more tables represent the more file descriptors, the data relationship of the tables in the database is very complex, the program logic is complex, and operation failure is easily caused.
Disclosure of Invention
The embodiment of the application provides a data storage method, a data storage device, computer equipment and a storage medium, which can improve the data storage efficiency and are beneficial to improving the stability of a database.
In a first aspect, an embodiment of the present application provides a data storage method, where:
receiving a data storage request of a target service, wherein the data storage request comprises identification information of the target service and service data;
searching a table information description table, a field information description table and a data storage table of the target service based on the identification information of the target service;
determining field codes of the service data in the field information description table based on the table information description table;
and storing the service data into the data storage table based on the field codes of the service data.
In a second aspect, embodiments of the present application provide a data storage device, wherein:
a receiving unit, configured to receive a data storage request of a target service, where the data storage request includes identification information of the target service and service data;
the searching unit is used for searching a table information description table, a field information description table and a data storage table of the target service based on the identification information of the target service;
a determining unit, configured to determine, based on the table information description table, a field code of the service data in the field information description table;
and the storage unit is used for storing the service data into the data storage table based on the field coding of the service data.
In a third aspect, an embodiment of the present application provides a computer device, including a processor, a memory, a communication interface, and a computer program, where the memory stores the computer program, 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.
In a fourth aspect, the present application provides a computer-readable storage medium, where the computer-readable storage medium stores a computer program, where the computer program makes a computer execute to implement part or all of the steps described in the first aspect.
The embodiment of the application has the following beneficial effects:
after the data storage method, the data storage device, the computer equipment and the storage medium are adopted, after a data storage request of a target service is received, a table information description table, a field information description table and a data storage table of the target service are searched based on identification information of the target service. And determining the field code of the service data in the field information description table based on the table information description table, and storing the service data into a data storage table based on the field code of the service data. Therefore, corresponding information is stored through the table information description table, the field information description and the data storage table respectively, so that the complexity of physical table storage logic is reduced, the data storage efficiency can be improved, and the stability of the database is improved.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Wherein:
fig. 1 is a schematic flowchart of a data storage method according to an embodiment of the present application;
fig. 2 is a schematic structural diagram of a data storage device according to an embodiment of the present application;
fig. 3 is a schematic structural diagram of a computer device according to an embodiment of the present application.
Detailed Description
In order to make the technical solutions of the present application better understood, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments obtained by a person of ordinary skill in the art without any inventive work according to the embodiments of the present application are within the scope of the present application.
The terms "first," "second," and the like in the description and claims of the present application and in the above-described drawings are used for distinguishing between different objects and not for describing a particular order. Furthermore, the terms "include" and "have," as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements listed, but may alternatively include other steps or elements not listed, or inherent to such process, method, article, or apparatus.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the application. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is explicitly and implicitly understood by one skilled in the art that the embodiments described herein can be combined with other embodiments.
The network architecture applied by the embodiment of the application comprises a server and electronic equipment. The number of the electronic devices and the number of the servers are not limited in the embodiment of the application, and the servers can provide services for the electronic devices at the same time. The server may be an independent server, or may be a cloud server that provides basic cloud computing services such as a cloud service, a cloud database, cloud computing, a cloud function, cloud storage, a network service, cloud communication, a middleware service, a domain name service, a security service, a Content Delivery Network (CDN), a big data and artificial intelligence platform, and the like. The server may alternatively be implemented as a server cluster consisting of a plurality of servers.
The electronic device may be a Personal Computer (PC), a notebook computer, or a smart phone, and may also be an all-in-one machine, a palm computer, a tablet computer (pad), a smart television playing terminal, a vehicle-mounted terminal, or a portable device. The operating system of the PC-side electronic device, such as a kiosk or the like, may include, but is not limited to, operating systems such as Linux system, Unix system, Windows series system (e.g., Windows xp, Windows 7, etc.), Mac OS X system (operating system of apple computer), and the like. The operating system of the electronic device at the mobile end, such as a smart phone, may include, but is not limited to, an operating system such as an android system, an IOS (operating system of an apple mobile phone), a Window system, and the like.
The electronic device may install and run the application program, and the server may be a server corresponding to the application program installed in the electronic device, and provide an application service for the application program. The application program may be a single integrated application software, or an applet embedded in another application, or a system on a web page, etc., which is not limited herein.
The embodiment of the application provides a data storage method which can be executed by a data storage device. The device can be realized by software and/or hardware, can be generally integrated in a server, can improve the efficiency of data storage, and is favorable for improving the stability of a database.
Referring to fig. 1, fig. 1 is a schematic flow chart of a data storage method provided in the present application. Taking the application of the method to a server as an example for illustration, the method includes the following steps S101 to S104, wherein:
s101, receiving a data storage request of a target service.
The service type of the target service is not limited in the application, and the service type can be any service, or the data type processed by the server is a service of intermediate data, or a new service not processed by the server, and the like. In the embodiment of the application, the data storage request includes identification information of the target service and service data, and is used for requesting to store the service data. The identification information of the target service may be a service name of the target service, or a number corresponding to the service name, or a content formed by a team name and the service name corresponding to the target service, which is responsible for processing, and the like, and is not limited herein. And the data type of the service data is not limited in the application. The service data may be any data involved in the target service, or may be intermediate data, etc.
S102, searching a table information description table, a field information description table and a data storage table of the target service based on the identification information of the target service.
In the embodiment of the present application, a table information description table, a field information description table, and a data storage table of each service may be stored in advance. The table information description table comprises table names of the field information description table and is used for describing service meanings of the field information description table. The field information description table records field codes corresponding to the data, and is used for describing attribute information such as the name, the type and the length of the field. The data storage table stores data corresponding to each field code.
The field coding method is not limited in the present application, and coding may be performed based on the field type and the preset sequence of the data. The field type may include a character type, a numerical value type, an extension type, and the like, which is not limited herein. For example, the field encoding of the character type may be described in a manner of "remap + number", such as remap 1 corresponding to name (name), remap 2 corresponding to email (email), and remap 3 corresponding to telephone (mobile). The field code of the value type can be described in a mode of "num + number", such as num1 corresponding to the amount of money and num2 corresponding to the time. The field encoding of the extension type may be described in the form of "ext + number", such as ext1, ext2, ext3, and the like.
The preset sequence of the data can be determined as the sequence of data storage, the size of the important value of the data to the target service, the size of the frequency of the data being used, and the like. Or all data related in the platform can be sequenced under the condition that the target service is not considered, so that after the target service is determined to include the data, the preset sequence of the data can be determined based on the data codes obtained by the sequencing, and therefore, the multiplexing rate of the codes can be improved by replacing the names of the fields through the reusable field codes.
It should be noted that the table information description table, the field description table, and the data storage table of the service are all logical tables, not physical tables with database operation functions. Therefore, different types of data are stored independently, complexity of program logic can be reduced, and processing efficiency of data and code reuse rate can be improved.
In the embodiment of the application, the auditing information table and the auditing record table of different services can be prestored. The audit information table is used for defining different audit information, and the audit record table is used for recording specific contents corresponding to different audit information. Illustratively, an audit information table ID, an audited table ID, an audit type, an audit status, an audit time, an audit opinion, and the like are defined in the audit information table. The audit record table comprises an audit record table ID and an audit information table ID, and can also comprise concrete contents corresponding to audit types, audit states, audit time and audit opinions.
It is understood that the data or part of the data in the business needs to be checked, for example, the business of opening an account of the merchant, the business license of the merchant, and so on. The audit information is respectively stored in the audit record table and the audit information table, so that the efficiency of checking the audit information can be improved, and the efficiency of processing abnormal data is improved.
In one possible example, after step S102, the following steps a1 to A3 may be further included, wherein:
and A1, if the table information description table, the field information description table and the data storage table of the target service are not found, determining whether the target service is a preset service.
If the target service is determined to be the preset service, step a2 is executed, and based on the identification information of the target service, the physical table of the target service is searched.
In this embodiment of the present application, the physical table of the target service refers to a table capable of implementing a database operation function of the target service, that is, the service data of the target service may be obtained through the physical table of the target service, and the service data may be processed based on the physical table.
The preset service is not limited, and the preset service can be an intermediate data service which does not need to be processed by the server. It can be understood that the service of the intermediate data that the server does not need to process indicates that the current server does not process the data of the service, and the data is used for data storage or cache.
A preset service or a service which can be processed by a server and is not influenced by security, etc. It can be understood that, the service that the data processed by the server is not affected by the security can improve the processing rate of the data under the condition of ensuring the security.
In one possible example, step A1 may include the following steps A11-A13, wherein:
a21, determining the data type related to the target service.
In the embodiment of the present application, the data type related to the target service specifically includes the data type of the data related to the target service. The data type may be determined based on the service type of the target service, input data and output data of the target service, and the like, and is not limited herein. It will be appreciated that the input data and output data of the target service relate to data involved in the target service, which also relates to the service type of the target service. Based on the method, the data type related to the target service is determined based on the service type of the target service and the input data and the output data of the target service, and the accuracy of determining the data type can be improved.
A12, determining the risk value and/or the processing complexity of the target business based on the data type.
In the embodiment of the application, the risk value of the target service is used for describing the size of a risk potential caused by data leakage in the target service. The risk value may be determined based on whether each data type is a privacy type, or a probability that data corresponding to the data type is used in other services. It can be understood that if the service data of the target service is of a privacy type, the risk of data leakage is high. The greater the probability that the data is used by other services, the greater the impact of the data leakage. In this way, the accuracy of determining the risk value of the target service can be improved.
The processing complexity of the target service refers to the complexity of the processing logic of the data in the target service. The processing complexity can be determined based on information such as the association between data corresponding to each data type, the association between input data and output data, and the like. It is understood that the data processing logic between the data can be determined based on the association relationship between the data corresponding to each data type. And determining the data processing logic of each data in the target service based on the incidence relation between the data corresponding to each data type and the input data and the output data. Therefore, the accuracy of determining the processing complexity of the target service can be improved.
And A13, if the risk value is smaller than a first threshold value or the processing complexity is larger than a second threshold value, determining that the target service is a preset service.
The first threshold value and the second threshold value are not limited, and can be determined based on the number of services, or can be determined based on a wind control rule, and the like. It is to be understood that in steps A11-A13, a risk value and/or processing complexity of the target business is determined based on the type of data the target business relates to. Thus, whether the target service is the preset service is determined based on the risk value of the target service and the processing complexity. If so, the physical table of the target service can be stored in the form of a table information description table, a field information description table and a data storage table, so that the data of the service with high safety performance requirement is protected, and the safety of data storage is improved. After the table information description table, the field information description table and the data storage table are stored in a single form, the physical table is prevented from being analyzed next time, and the data processing efficiency can be improved.
In one possible example, after step a2, if the physical table of the target service is not found, the table information description table, the field information description table and the data storage table of the target service are established based on the identification information of the target service.
The table information description table, the field information description table and the data storage table of the target service can be established by referring to the meanings of the tables. It can be understood that if the physical table of the target service is not found, it indicates that the service data of the target service is not stored before. When the target service is a preset service, a table information description table, a field information description table and a data storage table of the target service can be established. In this way, when data processing is performed on the target service next time, data processing can be performed based on the table information description table, the field information description table, and the data storage table of the target service.
And A3, analyzing the physical table of the target service to obtain a table information description table, a field information description table and a data storage table of the target service.
It can be understood that, in steps a 1-A3, if the table information description table, the field information description table, and the data storage table of the target service are not found, the service data indicating the target service is stored in the original manner, so that the physical table of the target service can be found based on the identification information of the target service. And under the condition that the target service is the preset service, the physical table of the target service can be analyzed to obtain a table information description table, a field information description table and a data storage table of the target service. Therefore, when the data of the target service is processed next time, the data can be processed based on the table information description table, the field information description table and the data storage table of the target service without analyzing a complex physical table, and the data processing efficiency is improved.
In a possible example, if it is determined that the target service is not the preset service, analyzing a physical table of the target service to obtain a data processing logic of service data of the target service; and storing the service data based on the data processing logic of the service data. Therefore, under the condition that the target service is not the preset service, the data storage can be carried out according to the original mode, so that the flexibility of the data storage methods of different services is improved.
S103, determining field codes of the service data in the field information description table based on the table information description table.
In one possible example, step S103 may include the following step B1 and step B2, wherein:
and B1, determining the field type of the service data based on the table information description table.
The field types may include character types, numeric types, extension types, and the like, as described above. The method for determining the field type is not limited in the present application, and in one possible example, the step B1 may include the following steps B11 to B13, wherein:
and B11, determining the service meaning of the target service based on the table information description table.
In the embodiment of the present application, the table information description table of the target service is used to describe the service meaning of the target service. The service meaning can be obtained by performing semantic analysis on the table information description table, the semantic analysis method is not limited in the application, word segmentation can be performed by adopting a word segmentation model consisting of one or more of a word segmenter, a Jieba segmenter, an Ansj segmenter or a HanLP segmenter, and then the service meaning of the target service is obtained based on the words obtained by word segmentation.
And B12, determining the data type of the business data based on the business meaning.
In the embodiment of the application, all data types included in the service data may be determined first, and then the data type of the service data of the target service may be selected from the data types based on the service meaning of the target service. Alternatively, the data type related to the target service may be determined based on the service meaning, and then the data type of the service data may be selected from the data types, which is not limited herein.
And B13, determining the field type of the service data based on the data type of the service data.
In the embodiment of the application, the field types corresponding to different data types and the characters corresponding to the field types can be stored in advance. For example, the field type corresponding to the data of the custom type is the custom type, and the character corresponding to the custom type may be a mark; the field type corresponding to the data of the numerical type is the numerical type, and the character corresponding to the numerical type can be num; the field type corresponding to the data of the extension type is the extension type, and the character corresponding to the extension type can be ext and the like. Therefore, after the data type of the service data is determined, based on the field type corresponding to the data type and the character corresponding to the field type, the efficiency of determining the field type can be improved, so that the efficiency of determining the field code can be improved, and the efficiency of storing the data is improved.
It is understood that the data types of different service data in different services may differ. Based on this, in steps B11 to B13, the business meaning of the target business is determined based on the table information description table. And then, the field type of the service data is determined based on the data type of the service data determined by the service meaning, so that the accuracy of determining the field type can be improved.
And B2, determining the field code of the service data in the field information description table based on the field type of the service data.
In the embodiment of the present application, a character corresponding to a field type of service data may be first searched from a field information description table, and then it is determined whether the service data corresponding to the character is service data to be stored. If the service data to be stored is not found, combining the characters corresponding to the field type of the service data and the size of the storage sequence of the service data to obtain the field code of the service data, or finding the field code of the service data from a preset field code library based on the field type of the service data, and the like, which is not limited herein.
It can be understood that, in step B1 and step B2, the field encoding of the service data in the field information description table is determined based on the field type of the service data determined by the table information description table, so that the accuracy of determining the field type can be improved, which is beneficial to improving the efficiency of data storage.
It should be noted that the target service may include 1 or more field information description tables, and the meaning of the sub-service of each field information description table is different. In a possible example, if the number of target services is greater than 1, before step S103, the following steps B14 to B16 may be further included, where:
and B14, determining the service range of the field information description table based on the field information description table.
In the embodiment of the present application, the service range of the field information description table refers to a service to which data corresponding to a field related in the field information description table belongs. The service scope may be determined based on the data type corresponding to each field in each field information description table, and specifically may include determining based on the data type corresponding to each field and an association relationship between data corresponding to each field and other data, which is not limited herein.
And B15, acquiring a matching value between the data type of the service data and the service range of the field information description table.
And B16, selecting a target field information description table from the field information description tables based on the maximum value of the matching value.
In the embodiment of the present application, the matching value between the data type of the service data and the service scope of the field information description table refers to the possibility that the service scope of the field information description table includes the service data. The determination may be performed based on a matching value between the data type related to the service scope and the data type of the service data, or may be performed based on a correlation between the data related to the service scope and the service data, which is not limited herein.
The field information description table corresponding to the maximum value of the matching value may be set as the target field information description table. As such, step S103 may include the steps of: and determining the field code of the service data in the target field information description table based on the field type of the service data. It is to be understood that, in the above example, in the case where a plurality of field information description tables exist for the target service, a matching value between the data type of the service data and the service range of the field information description table is obtained first. And then taking a field information description table corresponding to the maximum value of the matching value as a target field information description table. Therefore, the accuracy of determining the field type can be improved, and the accuracy of data storage is improved.
And S104, storing the service data into a data storage table based on the field coding of the service data.
In the method shown in fig. 1, after receiving a data storage request of a target service, a table information description table, a field information description table, and a data storage table of the target service are searched based on identification information of the target service. And determining the field code of the service data in the field information description table based on the table information description table, and storing the service data into a data storage table based on the field code of the service data. Therefore, corresponding information is stored through the table information description table, the field information description and the data storage table respectively, so that the complexity of physical table storage logic is reduced, the data storage efficiency can be improved, and the stability of the database is improved.
In one possible example, after step S104, the following steps may be further included: receiving a data processing request of service data; searching a table information description table, a field information description table and a data storage table of the target service based on the identification information of the target service; determining field codes of the service data in the field information description table based on the table information description table; determining associated data associated with the business data and processing logic between the business data and the associated data; searching the service data from the data storage table based on the field coding of the service data; and processing the service data based on the processing logic and the associated data.
The data processing request of the target service is used for requesting to process the service data of the target service. The data processing request at least comprises identification information of the target service and the processing type of the service data. The processing type of the service data is not limited, and the types can be added, deleted, changed, searched and the like. And may also include test type and collation type, etc. When the processing type is increased, the data processing request may further include increased data of the service data.
The table information description table, the field information description table, and the data storage table, and determining the field codes of the service data in the field information description table may refer to the foregoing description, and are not described herein again. The associated data of the service data may include data associated with the service data in previously stored data of the target service, or may include data associated with the service associated with the target service, and the like, which is not limited herein. If the associated data is data of the target service, the data can be obtained from a data storage table of the target service based on the field code of the associated data.
It can be understood that after the service data of the target service is stored in the data storage table of the target service, if a data processing request of the service data is received, the service data may be obtained from the data storage table first. Associated data associated with the business data and processing logic between the business data and the associated data are then determined. Therefore, the service data can be processed based on the processing logic and the associated data, and the data processing efficiency is improved.
The present application is not limited to the method for determining the associated data and the processing logic between the service data and the associated data, and in one possible example, the method may include the following steps: determining the service meaning of the target service based on the table information description table; determining a data type associated with the business data and an association relation between the business data and the associated data associated with the business data based on the business meaning of the target business; determining associated data based on the data type associated with the service data; processing logic between the business data and the associated data is determined based on the association relationship.
The method for determining the service meaning can refer to the foregoing description, and is not repeated herein. It is 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 may be determined based on the business meaning of the target business, so that the associated data may be determined based on the data type associated with the business data, and the processing logic between the business data and the associated data may be determined based on the association relationship between the business data and the associated data. Therefore, the associated data of the service data is determined based on the table information description table of the target service, and the processing logic between the service data and the associated data can improve the accuracy of determination.
The method of the embodiments of the present application is set forth above in detail and the apparatus of the embodiments of the present application is provided below.
Referring to fig. 2, fig. 2 is a schematic structural diagram of a data storage device according to the present disclosure, consistent with the embodiment shown in fig. 1. As shown in fig. 2, the data storage device 200 includes:
the receiving unit 201 is configured to receive a data storage request of a target service, where the data storage request includes identification information of the target service and service data;
the searching unit 202 is configured to search a table information description table, a field information description table, and a data storage table of the target service based on the identification information of the target service;
the determining unit 203 is configured to determine, based on the table information description table, a field code corresponding to the service data in the field information description table;
the storage unit 204 is configured to store the service data into the data storage table based on the field code.
In a possible example, the determining unit 203 is specifically configured to determine a field type of the service data based on the table information description table; and determining the field coding of the service data in the field information description table based on the field type of the service data.
In a possible example, the determining unit 203 is specifically configured to determine the service meaning of the target service based on the table information description table; determining a data type of the service data based on the service meaning of the target service; determining a field type of the service data based on a data type of the service data.
In a possible example, the number of the field information description tables is greater than 1, and the determining unit 203 is specifically configured to determine the service range of the field information description table based on the field codes in the field information description table; acquiring a matching value between the data type of the service data and the service range of the field information description table; selecting a target field information description table from the field information description table based on the maximum value of the matching value; and determining the field code of the service data in the target field information description table based on the field type of the service data.
In a possible example, the determining unit 203 is further configured to determine whether the target service is a preset service if the table information description table, the field information description table, and the data storage table of the target service are not found; the searching unit 202 is further configured to search a physical table of the target service based on the identification information of the target service if it is determined that the target service is the preset service; the data storage apparatus 200 further includes an analyzing unit 205, configured to analyze the physical table of the target service to obtain a table information description table, a field information description table, and a data storage table of the target service.
In a possible example, the determining unit 203 is specifically configured to determine a data type involved in the target service; determining a risk value and/or processing complexity of the target business based on the data type; and if the risk value is smaller than a first threshold value or the processing complexity is larger than a second threshold value, determining that the target service is a preset service.
In a possible example, the data storage apparatus 200 further includes a creating unit 206, configured to create a table information description table, a field information description table, and a data storage table of the target service based on the identification information of the target service if the physical table of the target service is not found.
For the detailed process executed by each unit in the data storage device 200, reference may be made to the execution steps in the foregoing method embodiments, which are not described herein again.
Referring to fig. 3, fig. 3 is a schematic structural diagram of a computer device according to an embodiment of the present disclosure. As shown in fig. 3, 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 interconnected via a bus 350. The related functions implemented by the receiving unit 201 shown in fig. 2 may be implemented by the communication interface 330, the related functions implemented by the searching unit 202, the determining unit 203, the parsing unit 205 and the establishing unit 206 shown in fig. 2 may be implemented by the processor 310, and the related functions implemented by the storing unit 204 shown in fig. 2 may be implemented by the memory 320.
The memory 320 has stored therein a computer program 340, the computer program 340 being configured to be executed by the processor 310, the computer program 340 comprising instructions for:
receiving a data storage request of a target service, wherein the data storage request comprises identification information of the target service and service data;
searching a table information description table, a field information description table and a data storage table of the target service based on the identification information of the target service;
determining field codes of the service data in the field information description table based on the table information description table;
and storing the service data into the data storage table based on the field codes of the service data.
In one possible example, in the aspect of determining the field encoding of the service data in the field information specification table based on the table information specification table, the computer program 340 specifically includes instructions for performing the following steps:
determining a field type of the service data based on the table information description table;
and determining the field coding of the service data in the field information description table based on the field type of the service data.
In one possible example, in said determining the field type of the service data based on the table information specification table, the computer program 340 specifically includes instructions for performing the steps of:
determining a service meaning of the target service based on the table information description table;
determining a data type of the service data based on the service meaning of the target service;
determining a field type of the service data based on a data type of the service data.
In one possible example, where the number of the field information description tables is greater than 1, the computer program 340 further includes instructions for, before the determining the field encoding of the traffic data in the field information description table based on the field type of the traffic data, performing the steps of:
determining the service range of the field information description table based on the field codes in the field information description table;
acquiring a matching value between the data type of the service data and the service range of the field information description table;
selecting a target field information description table from the field information description table based on the maximum value of the matching value;
in the aspect of determining the field encoding of the service data in the field information specification table based on the field type of the service data, the computer program 340 specifically includes instructions for performing the following steps:
and determining the field code of the service data in the target field information description table based on the field type of the service data.
In one possible example, after the searching for the table information description table, the field information description table, and the data storage table of the target service based on the identification information of the target service, the computer program 340 further includes instructions for performing the following steps:
if the table information description table, the field information description table and the data storage table of the target service are not found, determining whether the target service is a preset service;
if the target service is determined to be the preset service, searching a physical table of the target service based on the identification information of the target service;
and analyzing the physical table of the target service to obtain a table information description table, a field information description table and a data storage table of the target service.
In one possible example, in the aspect of determining whether the target service is a preset service, the computer program 340 specifically includes instructions for performing the following steps:
determining the data type related to the target service;
determining a risk value and/or processing complexity of the target business based on the data type;
and if the risk value is smaller than a first threshold value or the processing complexity is larger than a second threshold value, determining that the target service is a preset service.
In one possible example, after the looking up the physical table of the target service based on the identification information of the target service, the computer program 340 further comprises instructions for performing the steps of:
and if the physical table of the target service is not found, establishing a table information description table, a field information description table and a data storage table of the target service based on the identification information of the target service.
Embodiments of the present application also provide a computer-readable storage medium, where the computer-readable storage medium stores a computer program for causing a computer to execute to implement part or all of the steps of any one of the methods described in the method embodiments, and the computer includes an electronic device or a server.
Embodiments of the application also provide a computer program product comprising a non-transitory computer readable storage medium storing a computer program operable to cause a computer to perform to implement some or all of the steps of any of the methods recited in the method embodiments. The computer program product may be a software installation package and the computer comprises an electronic device or a server.
In the above-described embodiments, the computer-readable storage medium may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function, and the like; the storage data area may store data created according to the use of the blockchain node, and the like. For example, the block chain may store a table information description table, a field information description table, and a data storage table of the target service, and an audit information table and an audit record table, etc., which are not limited herein.
The block chain in the embodiment of the application is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, an encryption algorithm and the like. A block chain (blockchain), which is essentially a decentralized database, is a string of data blocks associated by using cryptography, and each data block contains information of a batch of network transactions, which is used to verify the validity (anti-counterfeiting) of the information and generate the next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, and the like.
It should be noted that, for simplicity of description, the above-mentioned method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present application is not limited by the order of acts described, as some steps may occur in other orders or concurrently depending on the application. Further, those skilled in the art will also appreciate that the embodiments described in this specification are presently preferred and that no particular act or mode of operation is required in the present application.
In the foregoing embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus may be implemented in other manners. For example, the above-described embodiments of the apparatus are merely illustrative, and for example, a division of a unit is merely a logical division, and an actual implementation may have another division, for example, at least one unit or component may be combined or integrated with another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of some interfaces, devices or units, and may be an electric or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may also be distributed on at least one network unit. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one storage unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a hardware mode or a software program mode.
The integrated unit, if implemented in the form of a software program module and sold or used as a stand-alone product, may be stored in a computer readable memory. With such an understanding, the technical solutions of the present application may be embodied in the form of a software product, which is stored in a memory and includes several instructions for causing a computer (which may be a personal computer, a server, a network device, or the like) to execute all or part of the steps of the methods according to the embodiments of the present application. And the aforementioned memory comprises: various media capable of storing program codes, such as a usb disk, a read-only memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and the like.
The foregoing detailed description of the embodiments of the present application has been presented to illustrate the principles and implementations of the present application, and the above description of the embodiments is only provided to help understand the method and the core concept of the present application; meanwhile, for a person skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.

Claims (10)

1. A method of storing data, comprising:
receiving a data storage request of a target service, wherein the data storage request comprises identification information of the target service and service data;
based on the identification information of the target service, searching a table information description table, a field information description table and a data storage table of the target service;
determining field codes of the service data in the field information description table based on the table information description table;
and storing the service data into the data storage table based on the field codes of the service data.
2. The method of claim 1, wherein the determining a field code of the service data in the field information description table based on the table information description table comprises:
determining the field type of the service data based on the table information description table;
and determining the field code of the service data in the field information description table based on the field type of the service data.
3. The method of claim 2, wherein determining the field type of the service data based on the table information specification table comprises:
determining the service meaning of the target service based on the table information description table;
determining the data type of the service data based on the service meaning of the target service;
and determining the field type of the service data based on the data type of the service data.
4. The method of claim 3, wherein the number of the field information description tables is greater than 1, and before the determining the field encoding of the service data in the field information description table based on the field type of the service data, the method further comprises:
determining the service range of the field information description table based on the field information description table;
acquiring a matching value between the data type of the service data and the service range of the field information description table;
selecting a target field information description table from the field information description table based on the maximum value of the matching value;
the determining the field coding of the service data in the field information description table based on the field type of the service data includes:
and determining the field code of the service data in the target field information description table based on the field type of the service data.
5. The method according to any of claims 1-4, wherein after said searching table information description table, field information description table and data storage table of said target service based on identification information of said target service, said method further comprises:
if the table information description table, the field information description table and the data storage table of the target service are not found, determining whether the target service is a preset service;
if the target service is determined to be the preset service, searching a physical table of the target service based on the identification information of the target service;
and analyzing the physical table of the target service to obtain a table information description table, a field information description table and a data storage table of the target service.
6. The method of claim 5, wherein the determining whether the target service is a preset service comprises:
determining the data type related to the target service;
determining a risk value and/or processing complexity of the target business based on the data type;
and if the risk value is smaller than a first threshold value or the processing complexity is larger than a second threshold value, determining that the target service is a preset service.
7. The method of claim 5, wherein after the searching for the physical table of the target service based on the identification information of the target service, the method further comprises:
and if the physical table of the target service is not found, establishing a table information description table, a field information description table and a data storage table of the target service based on the identification information of the target service.
8. A data storage device, comprising:
a receiving unit, configured to receive a data storage request of a target service, where the data storage request includes identification information of the target service and service data;
the searching unit is used for searching a table information description table, a field information description table and a data storage table of the target service based on the identification information of the target service;
a determining unit, configured to determine, based on the table information description table, a field code of the service data in the field information description table;
and the storage unit is used for storing the service data into the data storage table based on the field coding of the service data.
9. A computer device, characterized in that it comprises a processor, a memory and a communication interface, wherein the memory stores a computer program configured to be executed by the processor, the computer program comprising instructions for carrying out the steps of the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program, the computer program causing a computer to execute to implement the method of any one of claims 1-7.
CN202210057500.3A 2022-01-19 2022-01-19 Data storage method and device, computer equipment and storage medium Pending CN114385643A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210057500.3A CN114385643A (en) 2022-01-19 2022-01-19 Data storage method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210057500.3A CN114385643A (en) 2022-01-19 2022-01-19 Data storage method and device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114385643A true CN114385643A (en) 2022-04-22

Family

ID=81203671

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210057500.3A Pending CN114385643A (en) 2022-01-19 2022-01-19 Data storage method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114385643A (en)

Similar Documents

Publication Publication Date Title
CN113157315A (en) Method, device, equipment and medium for identifying difference information of different versions of software
CN108846292B (en) Desensitization rule generation method and device
CN112433705A (en) Script generation method and device, electronic equipment and storage medium
CN112181430A (en) Code change statistical method and device, electronic equipment and storage medium
CN115328759A (en) Form verification method and device
CN112363997B (en) Data version management method, device and storage medium
CN111914859A (en) Service multiplexing method, computing device and computer readable storage medium
CN112364022A (en) Information derivation management method and device, computer equipment and readable storage medium
CN111027065B (en) Leucavirus identification method and device, electronic equipment and storage medium
CN111124883A (en) Test case library introduction method, system and equipment based on tree form
CN114385643A (en) Data storage method and device, computer equipment and storage medium
CN113923190B (en) Equipment identification jump identification method and device, server and storage medium
CN114912003A (en) Document searching method and device, computer equipment and storage medium
CN106951225B (en) Data processing method and device based on service configuration template
CN112416875B (en) Log management method, device, computer equipment and storage medium
CN116127154A (en) Knowledge tag recommendation method and device, electronic equipment and storage medium
CN114861076A (en) Information processing method, information processing device, computer equipment and storage medium
CN114840872A (en) Secret text desensitization method and device, computer equipment and readable storage medium
CN112231232A (en) Method, device and equipment for determining test data model and generating test data
CN112015768A (en) Information matching method based on Rete algorithm and related products thereof
CN111901299A (en) Application authentication method and device, electronic equipment and storage medium
US9996691B1 (en) Using signals from developer clusters
CN115809466B (en) Security requirement generation method and device based on STRIDE model, electronic equipment and medium
CN115048533B (en) Knowledge graph construction method and device, electronic equipment and readable storage medium
CN113806372B (en) New data information construction method, device, computer equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination