Data reading method and device, computer equipment and computer readable storage medium
By introducing a two-factor verification mechanism and database file information analysis technology in the database, the problem of low security in data reading of existing databases is solved, and higher security and convenience in data reading are achieved.
Patent Information
- Application Number
- CN202411616975.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-12
- Publication Date
- 2025-03-11
AI Technical Summary
The data reading method of existing databases has low security problems, and when users access the database through structured query statements, the security of the data is difficult to guarantee.
By detecting the user's data reading request, the first verification information, the second verification information and the data information of the target data are obtained. When the first verification information matches the pre-stored first reference information, the database file information of the target database is obtained and parsed to obtain a plurality of data table information. The position information of the target data is determined based on these information, and when the second verification information matches the pre-stored second reference information, the target data is read from the target database based on the target position information.
By performing two-factor verification during data reading, the security of data reading in the database is improved, and by analyzing database file information and determining data location information, it is possible to read database data without creating a database connection instance.
Smart Images

Figure CN119597799A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of data reading and writing, and in particular to a data reading method, device, computer equipment and computer-readable storage medium. Background Art
[0002] At present, with the rapid development of the Internet, a large amount of data is generated every day in various industries, such as finance, medical care, education, etc. Using databases to store data has become a common way of data storage. The data reading method of existing databases is usually: users use structured query statements of the database to access the database. After the database receives the user's data reading request, it pushes the data that the user needs to read to the user. However, the existing data reading method can read the data in the database as long as the user accesses the database through structured query statements, and the data in the database has the problem of low security. Summary of the invention
[0003] The embodiments of the present application provide a data reading method, apparatus, computer device and computer-readable storage medium, which can improve the security and convenience of data reading in a database.
[0004] In one aspect, the present application provides a data reading method, the data reading method comprising:
[0005] When a data reading request from a user is detected, first verification information, second verification information and data information of target data in the data reading request are obtained;
[0006] When the first verification information matches the pre-stored first reference information, obtaining database file information of a target database; wherein the target database is a database where the target data is located;
[0007] Parse the database file information to obtain multiple data table information of the target database;
[0008] Determine target location information of target data based on multiple data table information and data information;
[0009] When the second verification information matches the pre-stored second reference information, the target data is read from the target database based on the target location information.
[0010] In some embodiments of the present application, based on multiple data table information and data information, determining the target location information where the target data is located includes:
[0011] Determine matching information between each piece of data table information and the data information in the plurality of data table information, the matching information being used to characterize the matching degree between each piece of data table information and the data information;
[0012] Determine target data table information from the multiple data table information based on the matching information, where the target data table information is the information with the highest matching degree with the data information among the multiple data table information;
[0013] Based on the target data table information, the target location information of the target data is determined.
[0014] In some embodiments of the present application, each data table information includes data table attribute information and data table field information, and determining the matching information between each data table information and the data information in the plurality of data table information includes:
[0015] Inputting the data table attribute information and the data information in each data table information into a pre-trained first matching model, and outputting a first matching parameter between each data table information and the data information through the first matching model;
[0016] Inputting the data table field information and the data information in each data table information into a pre-trained second matching model, and outputting the second matching parameters of each data table information and the data information through the second matching model;
[0017] Obtaining first weight information corresponding to a preset first matching parameter and second weight information corresponding to a preset second matching parameter;
[0018] The first matching parameter and the second matching parameter are fused based on the first weight information and the second weight information to obtain matching information between each data table information and the data information.
[0019] In some embodiments of the present application, reading target data from a target database based on target location information includes:
[0020] Based on the target location information, determining a plurality of target data blocks of the target data in the target database;
[0021] Obtaining data block information of each target data block among the multiple target data blocks;
[0022] Based on the data block information, determine the data reading order of the plurality of target data blocks;
[0023] The target data is read from the plurality of target data blocks based on a data reading order.
[0024] In some embodiments of the present application, the data block information includes type information and keyword information. Based on the data block information, determining the data reading order of the plurality of target data blocks includes:
[0025] Inputting the type information and the keyword information into a pre-trained first prediction model, and outputting a first parameter of each target data block through the first prediction model, where the first parameter is used to characterize the importance of the data in each target data block;
[0026] Inputting the type information and the keyword information into a pre-trained second prediction model, outputting an association matrix of multiple target data blocks through the second prediction model, wherein the association matrix includes data association parameters of each target data block and other target data blocks, and the data association parameters are used to characterize the degree of association between each target data block and other target data blocks;
[0027] Based on the association matrix, determine a second parameter of each target data block, where the second parameter is the sum of data association parameters of each target data block and other target data blocks;
[0028] Determining a target parameter for each target data block based on the first parameter and the second parameter;
[0029] Based on the target parameters, a data reading order of the plurality of target data blocks is determined.
[0030] In some embodiments of the present application, when the second verification information matches the pre-stored second reference information, before reading the target data from the target database based on the target location information, the method includes:
[0031] Acquire user information of the user, and acquire pre-stored second reference information from a pre-set information database based on the user information;
[0032] Based on the first verification information and the second verification information, generating third verification information;
[0033] When the third verification information is consistent with the second reference information, it is determined that the second verification information matches the second reference information.
[0034] In some embodiments of the present application, the database file information is parsed to obtain multiple data table information of the target database, including:
[0035] Parsing the database file information to obtain a first data file;
[0036] Scanning the first data file to obtain first position information;
[0037] Based on the first location information, determining a first data block;
[0038] Reading data from the first data block to obtain second position information;
[0039] Based on the second position information, determining a second data block;
[0040] The second data block is read to obtain information of multiple data tables of the target database.
[0041] On the other hand, the present application provides a data reading device, the data reading device comprising:
[0042] A first acquisition unit, configured to acquire the first verification information, the second verification information and the data information of the target data in the data read request when a data read request from the user is detected;
[0043] A second acquisition unit is used to acquire database file information of a target database when the first verification information matches the pre-stored first reference information; wherein the target database is a database where the target data is located;
[0044] A file parsing unit, used for parsing database file information to obtain multiple data table information of the target database;
[0045] An information determination unit, used for determining target location information where target data is located based on a plurality of data table information and data information;
[0046] The data reading unit is used to read the target data from the target database based on the target position information when the second verification information matches the pre-stored second reference information.
[0047] On the other hand, the present application also provides a computer device, the computer device comprising:
[0048] one or more processors;
[0049] Memory; and
[0050] One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the processor to implement any one of the data reading methods in the first aspect.
[0051] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, and the computer program is loaded by a processor to execute the steps in any one of the data reading methods of the first aspect.
[0052] In the present application, when the first verification information matches the pre-stored first reference information, the database file information of the target database is obtained, and when the second verification information matches the pre-stored second reference information, the target data is read from the target database based on the target location information. The data security verification is performed during the data reading process by using the first verification information and the second verification information, thereby improving the security of data reading. The database file information is parsed to obtain multiple data table information of the target database, and the target location information of the target data is determined based on the multiple data table information and the data information. The data is read based on the target location information. The data in the database can be read without creating a database connection instance, thereby improving the convenience of data reading in the database. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0054] Figure 1 is a schematic diagram of a scenario of a data reading system provided in an embodiment of the present application;
[0055] Figure 2 It is a schematic diagram of an embodiment of a data reading method provided in an embodiment of the present application;
[0056] Figure 3 This is a schematic diagram of an embodiment of the database file information analysis provided in the embodiments of the present application;
[0057] Figure 4 It is a schematic diagram of a specific embodiment of determining target location information provided in an embodiment of the present application;
[0058] Figure 5 It is a schematic diagram of a specific embodiment of determining matching information provided in an embodiment of the present application;
[0059] Figure 6 This is a schematic diagram of a specific embodiment of target data reading provided in the embodiments of the present application;
[0060] Figure 7 It is a schematic diagram of a specific embodiment of determining the data reading order provided in the embodiments of the present application;
[0061] Figure 8 It is a schematic diagram of a specific embodiment of the second verification information verification provided in the embodiment of the present application;
[0062] Fig. 9 is a schematic diagram of the structure of an embodiment of a data reading device provided in an embodiment of the present application;
[0063] Fig.10 It is a schematic diagram of the structure of an embodiment of a computer device provided in the embodiments of the present application. DETAILED DESCRIPTION
[0064] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions 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. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of this application.
[0065] In the description of the present application, it should be understood that the terms "center", "longitudinal", "lateral", "length", "width", "thickness", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside" and the like indicate positions or positional relationships based on the positions or positional relationships shown in the drawings, which are only for the convenience of describing the present application and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present application. In addition, the terms "first", "second", "third", and "fourth" are only used for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first", "second", "third", and "fourth" may explicitly or implicitly include one or more of the features. In the description of the present application, the meaning of "multiple" is two or more, unless otherwise clearly and specifically defined.
[0066] In this application, the word "exemplary" is used to mean "used as an example, illustration, or description." Any embodiment described in this application as "exemplary" is not necessarily to be construed as being preferred or advantageous over other embodiments. The following description is given to enable any technician in the field to implement and use the present application. In the following description, details are listed for the purpose of explanation. It should be understood that a person of ordinary skill in the art can recognize that the present application can be implemented without using these specific details. In other instances, well-known structures and processes will not be elaborated in detail to avoid obscuring the description of the present application with unnecessary details. Therefore, the present application is not intended to be limited to the embodiments shown, but is consistent with the widest scope consistent with the principles and features disclosed in the present application.
[0067] It should be noted that since the method of the embodiment of the present application is executed in a computer device, the processing objects of each computer device exist in the form of data or information. For example, time is actually time information. It can be understood that if size, quantity, position, etc. are mentioned in subsequent embodiments, they are all corresponding data for processing by the computer device. The details will not be repeated here.
[0068] The embodiments of the present application provide a data reading method, apparatus, computer device, and computer-readable storage medium, which are described in detail below.
[0069] See also Figure 1 , Figure 1 Schematic diagram of a data reading system provided in an embodiment of the present application. The data reading system may include a computer device 100, in which a data reading device is integrated. Figure 1Computer equipment in.
[0070] In the embodiment of the present application, the computer device 100 is mainly used to obtain the first verification information, the second verification information and the data information of the target data in the data reading request when a data reading request of the user is detected; when the first verification information matches the pre-stored first reference information, obtain the database file information of the target database; wherein the target database is the database where the target data is located; parse the database file information to obtain multiple data table information of the target database; based on the multiple data table information and data information, determine the target location information where the target data is located; when the second verification information matches the pre-stored second reference information, read the target data from the target database based on the target location information. By reading the data through the first verification information and the second verification information, the security of data reading in the database can be improved. By determining the target location information through multiple data table information and data information, and reading the data based on the target location information, the data reading in the database can be realized without creating a database connection instance, which can improve the convenience of data reading in the database.
[0071] In the embodiment of the present application, the computer device 100 may be an independent server, or a server network or server cluster composed of servers. For example, the computer device 100 described in the embodiment of the present application includes but is not limited to a computer, a network host, a single network server, a plurality of network server sets or a cloud server composed of a plurality of servers. The cloud server is composed of a large number of computers or network servers based on cloud computing.
[0072] It is understandable that the computer device 100 used in the embodiments of the present application may be a device including both receiving and transmitting hardware, that is, a device having receiving and transmitting hardware capable of performing two-way communication on a two-way communication link. Such a device may include: a cellular or other communication device having a single-line display or a multi-line display or a cellular or other communication device without a multi-line display. The specific computer device 100 may be a desktop terminal or a mobile terminal, and the computer device 100 may also be one of a mobile phone, a tablet computer, a laptop computer, etc.
[0073] Those skilled in the art will understand that Figure 1 The application environment shown in the figure is only one application scenario of the present application solution and does not constitute a limitation on the application scenario of the present application solution. Other application environments may also include Figure 1 More or less computer equipment as shown in Figure 1 Only one computer device is shown. It can be understood that the data reading system can also include one or more other services, which are not specifically limited here.
[0074] In addition, if Figure 1 As shown, the data reading system may further include a memory 200 for storing data, such as reference information, for example, first reference information, second reference information, and the like.
[0075] It should be noted that Figure 1 The scenario diagram of the data reading system shown is only an example. The data reading system and scenario described in the embodiment of the present application are intended to more clearly illustrate the technical solution of the embodiment of the present application, and do not constitute a limitation on the technical solution provided in the embodiment of the present application. Ordinary technicians in this field can know that with the evolution of the data reading system and the emergence of new business scenarios, the technical solution provided in the embodiment of the present application is also applicable to similar technical problems.
[0076] First, a data reading method is provided in an embodiment of the present application, and the executor of the data reading method is a data reading device, and the data reading device is applied to a computer device. The data reading method includes: when a user's data reading request is detected, obtaining first verification information, second verification information and data information of target data in the data reading request; when the first verification information matches the pre-stored first reference information, obtaining database file information of the target database; wherein the target database is the database where the target data is located; parsing the database file information to obtain multiple data table information of the target database; based on the multiple data table information and data information, determining the target location information where the target data is located; when the second verification information matches the pre-stored second reference information, reading the target data from the target database based on the target location information.
[0077] It should be noted that in the prior art solution, a database is connected by creating a database connection instance, and then the database is accessed through the database connection instance to read data. The data reading method in the prior art solution requires that both the database and the database connection instance are in an open state. Compared with the prior art, the data reading method provided in the embodiment of the present application does not depend on the database connection instance. Therefore, the database reading method can be applied to application scenarios such as the database is closed, the database connection instance is closed, and the database connection instance is not created.
[0078] like Figure 2 FIG. 1 is a flow chart of an embodiment of a data reading method in an embodiment of the present application. The data reading method may include the following steps 301 to 305, which are as follows:
[0079] 301. When a data reading request from a user is detected, first verification information, second verification information, and data information of target data in the data reading request are obtained.
[0080] The target data is the data that the user needs to read, and the data reading request is the data reading instruction issued by the user to the computer device for the target data. The data reading request includes but is not limited to touch instructions, mouse instructions, remote control instructions, voice instructions, etc. For example, when the user wants to read data A in database A, he directly clicks the icon of data A in database A on the touch screen, or the user clicks the icon of data A in database A on the touch screen with a mouse, or the user issues a voice instruction of "read data A in database A".
[0081] The data reading request includes first verification information, second verification information and data information of the target data. The first verification information and the second verification information are used to perform security verification during the data reading process. The data information is information of the target data, including but not limited to the data identifier of the target data, the data name of the target data, etc.
[0082] The computer device will detect in real time or periodically whether it has received a user's data reading request. When the computer device detects the user's data reading request, it obtains the first verification information, the second verification information and the data information of the target data in the data reading request, and reads the data based on the first verification information and the second verification information, which can improve the security of data reading in the database.
[0083] 302. When the first verification information matches the pre-stored first reference information, obtain database file information of a target database; wherein the target database is a database where the target data is located.
[0084] The target database is the database where the target data is located. For example, target data A exists in target database A. When a user needs to read target data A, the target database is target database A. Database file information is control file information related to the target database. Based on the database file information, multiple data table information of the target database can be determined.
[0085] The first verification information is used to verify whether the database file information of the target database can be obtained. After obtaining the first verification information from the data reading request, this embodiment matches the first verification information with the pre-stored first reference information. When the first verification information matches the first reference information, the database file information of the target database is obtained; conversely, when the first verification information does not match the first reference information, it is determined that the database file information of the target database cannot be obtained and the data reading fails.
[0086] 303. Parse the database file information to obtain information of multiple data tables of the target database.
[0087] There are multiple data tables in the target database, and the multiple data table information is the data table information of the multiple data tables in the target database. After acquiring the database file information of the target database, this embodiment parses the database file information to acquire the multiple data table information of the target database, and the target location information where the target data is located can be determined based on the multiple data table information of the target database. For example, the target database includes data table A, data table B, and data table C. By parsing the database file information, the data table information of data table A, the data table information of data table B, and the data table information of data table C can be acquired.
[0088] In a specific embodiment, Figure 3 As shown, in step 303, the database file information is parsed to obtain multiple data table information of the target database, which may include the following steps 401 to 406, which are as follows:
[0089] 401. Parse the database file information to obtain a first data file;
[0090] 402. Scan the first data file to obtain first location information;
[0091] 403. Determine a first data block based on the first location information;
[0092] 404. Read data from the first data block to obtain second position information;
[0093] 405. Determine a second data block based on the second location information;
[0094] 406. Read data from the second data block to obtain information of multiple data tables of the target database.
[0095] The first data file is a data file obtained by parsing the database file information. The first position information can be determined from the first data file. The first position information is the position information corresponding to the first data block. That is to say, after obtaining the first position information from the first data file, the first data block can be located based on the first position information.
[0096] The second location information can be obtained by reading data from the first data block, and the second location information is the location information corresponding to the second data block, that is, after obtaining the second location information from the first data block, the second data block can be located based on the second location information. Multiple data table information of the target database exists in the second data block, so after locating the second data block based on the second location information, the second data block can be read to obtain multiple data table information of the target database.
[0097] 304. Determine target location information of target data based on the multiple data table information and data information.
[0098] The target location information is the location information of the target data in the target database. After acquiring multiple data table information of the target database, this embodiment determines the target location information where the target data is located based on the multiple data table information and data information, and can read the target data from the target database based on the target location information. By determining the target location information where the target data is located based on multiple data table information, and then reading the data based on the target location information, compared with the existing solution of reading data by creating a database connection instance, the embodiment of the present application can realize the reading of data in the database in scenarios such as the database is closed, the database connection instance is closed, and the database connection instance is not created, thereby improving the convenience of reading data in the database.
[0099] In a specific implementation, Figure 4 As shown, in step 304, based on the multiple data table information and data information, determining the target location information where the target data is located may include the following steps 407 to 409, which are specifically as follows:
[0100] 407. Determine matching information between each piece of data table information and the data information in the plurality of data table information, where the matching information is used to represent a matching degree between each piece of data table information and the data information;
[0101] 408. Determine target data table information from the multiple data table information based on the matching information, where the target data table information is the information with the highest matching degree with the data information among the multiple data table information;
[0102] 409. Determine target location information of the target data based on the target data table information.
[0103] The matching information is used to characterize the matching degree between each data table information and the data information. The target data table information is the data table information with the highest matching degree with the data information among multiple data table information. For example, the matching information between data table information A, data table information B, and data table information C and the data information are 0.98, 0.20, and 0.35 respectively, then the target data table information is data table information A.
[0104] When determining the target location information of the target data, this embodiment first determines the matching information between each data table information and the data information in multiple data table information, and then determines the target data table information with the highest degree of matching with the data information from the multiple data table information based on the matching information, and finally determines the target location information of the target data based on the target data table information.
[0105] The target data table information includes data block location information of the data table, and the target location information is the data block location information of the data table in the target data table information.
[0106] In a specific implementation, Figure 5 As shown, each data table information includes data table attribute information and data table field information. Step 407 determines the matching information between each data table information and the data information in the plurality of data table information, which may include the following steps 501 to 504, which are as follows:
[0107] 501. Input data table attribute information and data information in each data table information into a pre-trained first matching model, and output a first matching parameter between each data table information and the data information through the first matching model;
[0108] 502. Inputting data table field information and data information in each data table information into a pre-trained second matching model, and outputting second matching parameters of each data table information and data information through the second matching model;
[0109] 503. Obtain first weight information corresponding to a preset first matching parameter and second weight information corresponding to a preset second matching parameter;
[0110] 504. The first matching parameter and the second matching parameter are merged based on the first weight information and the second weight information to obtain matching information between each data table information and the data information.
[0111] The first matching model is a pre-trained network model for predicting the first matching parameters of each data table information and the data information. The first matching model is obtained by training a preset first network model based on a preset first training sample set. The preset first network model can adopt a deep learning model or a machine learning model, for example, convolutional neural networks (CNN), deconvolutional neural networks (DN), etc.
[0112] In a specific implementation, the preset first training sample set includes multiple first sample information and the first real matching parameters of each first sample information and multiple data information. The step of training the preset first network model based on the preset first training sample set specifically includes: inputting multiple first sample information and multiple data information into the preset first network model, outputting the first predicted matching parameters of each first sample information and each data information through the preset first network model, determining the first loss value based on the first predicted matching parameters, the first real matching parameters and the first loss function of the preset first network model, when the first loss value does not meet the preset first condition, correcting the model parameters of the preset first network model based on the preset first parameter learning rate, and continuing to execute the step of outputting the first predicted matching parameters of each first sample information and each data information through the preset first network model until the first loss value meets the preset first condition, so as to obtain the pre-trained first matching model.
[0113] The second matching model is a pre-trained network model for predicting the second matching parameters of each data table information and the data information. The second matching model is obtained by training a preset second network model based on a preset second training sample set. The preset second network model can adopt a deep learning model or a machine learning model, for example, convolutional neural networks (CNN), deconvolutional neural networks (DN), etc.
[0114] In a specific implementation, the preset second training sample set includes multiple second sample information and second real matching parameters of each second sample information and multiple data information. The step of training the preset second network model based on the preset second training sample set specifically includes: inputting multiple second sample information and multiple data information into the preset second network model, outputting the second predicted matching parameters of each second sample information and each data information through the preset second network model, determining the second loss value based on the second predicted matching parameters, the second real matching parameters and the second loss function of the preset second network model, when the second loss value does not meet the preset second condition, correcting the model parameters of the preset second network model based on the preset second parameter learning rate, and continuing to execute the step of outputting the second predicted matching parameters of each second sample information and each data information through the preset second network model until the second loss value meets the preset second condition to obtain the pre-trained second matching model.
[0115] When determining the matching information of each data table information and data information in this embodiment, firstly, the data table attribute information and data information in each data table information are input into a pre-trained first matching model, and the first matching parameter of each data table information and data information is output through the first matching model, and at the same time, the data table field information and data information in each data table information are input into a pre-trained second matching model, and the second matching parameter of each data table information and data information is output through the second matching model, and then the first weight information corresponding to the pre-set first matching parameter and the second weight information corresponding to the second matching parameter are obtained, and finally, the first matching parameter and the second matching parameter are fused based on the first weight information and the second weight information to obtain the matching information of each data table information and data information. Wherein, the determination formula of the matching information is: P = λ1*P1+λ2*P2, P represents the matching information, λ1 represents the first weight information, λ2 represents the second weight information, P1 represents the first matching parameter, and P2 represents the second matching parameter.
[0116] 305. When the second verification information matches the pre-stored second reference information, read the target data from the target database based on the target location information.
[0117] The second verification information is used to verify whether the target data can be read. After determining the target location information where the target data is located, this embodiment further matches the second verification information with the pre-stored second reference information. When it is determined that the second verification information matches the second reference information, the target data is read from the target database based on the target location information. Security verification is performed during the data reading process using the first verification information and the second verification information, thereby improving the security of data reading in the database.
[0118] In a specific implementation, Figure 6 As shown, in step 305, the target data is read from the target database based on the target location information, which may include the following steps 410 to 413, which are specifically as follows:
[0119] 410. Determine multiple target data blocks of the target data in the target database based on the target location information;
[0120] 411. Obtain data block information of each target data block among multiple target data blocks;
[0121] 412. Determine a data reading order of the plurality of target data blocks based on the data block information;
[0122] 413. Read target data from multiple target data blocks based on a data reading order.
[0123] The target data block is the data block where the target data is located in the target database, and the data block information is the information of the target data block. The data block information includes but is not limited to type information and keyword information. The type information is the type information of the data in the target data block, and the keyword information is the keyword information of the data in the target data block. The data reading order is the data reading order of multiple target data blocks, for example, first read the target data block A, then read the target data block B, and finally read the target data block C.
[0124] When the present embodiment reads the target data from the target database based on the target position information, the present embodiment first determines the multiple target data blocks of the target data in the target database based on the target position information, then obtains the data block information of each target data block in the multiple target data blocks, then determines the data reading order of the multiple target data blocks based on the data block information, and finally reads the target data from the multiple target data blocks based on the data reading order.
[0125] In a specific implementation, Figure 7 As shown, the data block information includes type information and keyword information. In step 412, based on the data block information, determining the data reading order of the plurality of target data blocks may include the following steps 505 to 509, which are specifically as follows:
[0126] 505. Input the type information and the keyword information into a pre-trained first prediction model, and output a first parameter of each target data block through the first prediction model, where the first parameter is used to characterize the importance of data in each target data block;
[0127] 506. Input the type information and the keyword information into a pre-trained second prediction model, and output a correlation matrix of the plurality of target data blocks through the second prediction model, wherein the correlation matrix includes data correlation parameters between each target data block and other target data blocks, and the data correlation parameters are used to characterize the correlation degree between each target data block and other target data blocks;
[0128] 507. Determine a second parameter of each target data block based on the association matrix, where the second parameter is the sum of data association parameters of each target data block and other target data blocks;
[0129] 508. Determine a target parameter of each target data block based on the first parameter and the second parameter;
[0130] 509. Determine a data reading order of multiple target data blocks based on the target parameters.
[0131] The first parameter is used to characterize the importance of each target data block. The first prediction model is used to predict the first parameter of each target data block based on type information and keyword information. The first prediction model is obtained by training a preset third network model based on a preset third training sample set. The preset third network model can adopt a deep learning model or a machine learning model, for example, convolutional neural networks (CNN), deconvolutional neural networks (DN), etc.
[0132] In a specific implementation, the preset third training sample set includes type information of multiple first sample data blocks, keyword information of multiple first sample data blocks and the first real parameter of each first sample data block. The step of training the preset third network model based on the preset third training sample set specifically includes: inputting the type information of multiple first sample data blocks and the keyword information of multiple first sample data blocks into the preset third network model, outputting the first prediction parameter of each first sample data block through the preset third network model, determining the third loss value based on the first prediction parameter, the first real parameter and the third loss function of the preset third network model, when the third loss value does not meet the preset third condition, correcting the model parameters of the preset third network model based on the preset third parameter learning rate, and continuing to execute the step of outputting the first prediction parameter of each first sample data block through the preset third network model until the third loss value meets the preset third condition, so as to obtain the pre-trained first prediction model.
[0133] The association matrix includes data association parameters between each target data block and other target data blocks, and the data association parameters are used to characterize the degree of association between each target data block and other target data blocks. The second prediction model is used to predict the association matrix of multiple target data blocks based on type information and keyword information. The second prediction model is obtained by training a preset fourth network model based on a preset fourth training sample set. The preset fourth network model can adopt a deep learning model or a machine learning model, for example, convolutional neural networks (CNN), deconvolutional neural networks (DN), etc.
[0134] In a specific implementation, the preset fourth training sample set includes type information of multiple second sample data blocks, keyword information of multiple second sample data blocks and real association matrices of multiple second sample data blocks. The step of training the preset fourth network model based on the preset fourth training sample set specifically includes: inputting the type information of multiple second sample data blocks and the keyword information of multiple second sample data blocks into the preset fourth network model, outputting the predicted association matrix of each second sample data block through the preset fourth network model, determining the fourth loss value based on the real association matrix, the predicted association matrix and the fourth loss function of the preset fourth network model, when the fourth loss value does not meet the preset fourth condition, correcting the model parameters of the preset fourth network model based on the preset fourth parameter learning rate, and continuing to execute the step of outputting the predicted association matrix of each second sample data block through the preset fourth network model until the fourth loss value meets the preset fourth condition, so as to obtain the pre-trained second prediction model.
[0135] The second parameter is the sum of the data association parameters of each target data block and other target data blocks. Since the association matrix includes the data association parameters of each target data block and other target data blocks, the data association parameters of each target data block and other target data blocks can be determined based on the association matrix, and then the data association parameters of each target data block and other target data blocks are added to obtain the target association parameters of each target data block. The calculation formula of the target association parameter is: Ω represents the set of target data blocks, R i represents the target association parameter of target data block i, R ij Indicates the data association parameter between target data block i and target data block j.
[0136] After determining the second parameter of each target data block, the target parameter of each target data block can be determined based on the first parameter and the second parameter, wherein the calculation formula of the target parameter is: i =λ3*S i +λ4*R i , M i represents the target parameter of target data block i, S i The first parameter representing the target data block i, R i represents the second parameter of the target data block i, λ3 represents the third weight information corresponding to the preset first parameter, and λ4 represents the fourth weight information corresponding to the preset second parameter.
[0137] After determining the target parameters of each target data block, the data reading order of multiple target data blocks can be determined based on the target parameters. For example, the target parameters of target data block A, target data block B and target data block C are 0.95, 0.64 and 0.85 respectively, then the data reading order is target data block A, target data block C and target data block B.
[0138] In a specific implementation, Figure 8 As shown, in step 305, when the second verification information matches the pre-stored second reference information, before reading the target data from the target database based on the target location information, the following steps 306 to 308 may be included, as follows:
[0139] 306. Obtain user information of the user, and obtain pre-stored second reference information from a pre-set information database based on the user information;
[0140] 307. Generate third verification information based on the first verification information and the second verification information;
[0141] 308. When the third verification information is consistent with the second reference information, determine that the second verification information matches the second reference information.
[0142] The computer device is pre-set with an information base, in which a plurality of reference information is stored, and the second reference information is the reference information that matches the user information among the plurality of reference information. When determining whether the second verification information matches the pre-stored second reference information in this embodiment, the user information of the user is first obtained, and the pre-stored second reference information is obtained from the pre-set information base based on the user information, and then the third verification information is generated based on the first verification information and the second verification information, and the third verification information and the second reference information are compared, and when the third verification information is consistent with the second reference information, it is determined that the second verification information matches the second reference information.
[0143] In order to better implement the data reading method in the embodiment of the present application, based on the data reading method, the embodiment of the present application also provides a data reading device, such as Fig. 9 As shown, the data reading device 700 includes:
[0144] The first acquisition unit 701 is used to acquire the first verification information, the second verification information and the data information of the target data in the data reading request when a data reading request of the user is detected;
[0145] The second acquisition unit 702 is used to acquire database file information of a target database when the first verification information matches the pre-stored first reference information; wherein the target database is a database where the target data is located;
[0146] The file parsing unit 703 is used to parse the database file information to obtain multiple data table information of the target database;
[0147] An information determination unit 704, configured to determine target location information of target data based on the plurality of data table information and data information;
[0148] The data reading unit 705 is configured to read the target data from the target database based on the target position information when the second verification information matches the pre-stored second reference information.
[0149] In an embodiment of the present application, when the first verification information matches the pre-stored first reference information, the database file information of the target database is obtained, and when the second verification information matches the pre-stored second reference information, the target data is read from the target database based on the target location information. Data security verification is performed during the data reading process using the first verification information and the second verification information, thereby improving the security of data reading. The database file information is parsed to obtain multiple data table information of the target database, and the target location information of the target data is determined based on the multiple data table information and the data information. Data is read based on the target location information, and the reading of data in the database can be achieved without creating a database connection instance, thereby improving the convenience of data reading in the database.
[0150] In some embodiments of the present application, the information determination unit 704 is specifically used to:
[0151] Determine matching information between each piece of data table information and the data information in the plurality of data table information, the matching information being used to characterize the matching degree between each piece of data table information and the data information;
[0152] Determine target data table information from the multiple data table information based on the matching information, where the target data table information is the information with the highest matching degree with the data information among the multiple data table information;
[0153] Based on the target data table information, the target location information of the target data is determined.
[0154] In some implementation schemes of the present application, each data table information includes data table attribute information and data table field information, and the information determination unit 704 is specifically used to:
[0155] Inputting the data table attribute information and the data information in each data table information into a pre-trained first matching model, and outputting a first matching parameter between each data table information and the data information through the first matching model;
[0156] Inputting the data table field information and the data information in each data table information into a pre-trained second matching model, and outputting the second matching parameters of each data table information and the data information through the second matching model;
[0157] Obtaining first weight information corresponding to a preset first matching parameter and second weight information corresponding to a preset second matching parameter;
[0158] The first matching parameter and the second matching parameter are fused based on the first weight information and the second weight information to obtain matching information between each data table information and the data information.
[0159] In some embodiments of the present application, the data reading unit 705 is specifically used for:
[0160] Based on the target location information, determining a plurality of target data blocks of the target data in the target database;
[0161] Obtaining data block information of each target data block among the multiple target data blocks;
[0162] Based on the data block information, determine the data reading order of the plurality of target data blocks;
[0163] The target data is read from the plurality of target data blocks based on a data reading order.
[0164] In some implementation schemes of the present application, the data block information includes type information and keyword information, and the data reading unit 705 is specifically further used to:
[0165] Inputting the type information and the keyword information into a pre-trained first prediction model, and outputting a first parameter of each target data block through the first prediction model, where the first parameter is used to characterize the importance of the data in each target data block;
[0166] Inputting the type information and the keyword information into a pre-trained second prediction model, outputting an association matrix of multiple target data blocks through the second prediction model, wherein the association matrix includes data association parameters of each target data block and other target data blocks, and the data association parameters are used to characterize the degree of association between each target data block and other target data blocks;
[0167] Based on the association matrix, determine a second parameter of each target data block, where the second parameter is the sum of data association parameters of each target data block and other target data blocks;
[0168] Determining a target parameter for each target data block based on the first parameter and the second parameter;
[0169] Based on the target parameters, a data reading order of the plurality of target data blocks is determined.
[0170] In some embodiments of the present application, the file parsing unit 703 is specifically used to:
[0171] Parsing the database file information to obtain a first data file;
[0172] Scanning the first data file to obtain first position information;
[0173] Based on the first location information, determining a first data block;
[0174] Reading data from the first data block to obtain second position information;
[0175] Based on the second position information, determining a second data block;
[0176] The second data block is read to obtain information of multiple data tables of the target database.
[0177] In some embodiments of the present application, the data reading device further includes:
[0178] A third acquisition unit is used to acquire user information of the user, and acquire pre-stored second reference information from a pre-set information database based on the user information;
[0179] An information generating unit, configured to generate third verification information based on the first verification information and the second verification information;
[0180] The information matching unit is used to determine that the second verification information matches the second reference information when the third verification information is consistent with the second reference information.
[0181] The embodiment of the present application further provides a computer device, which integrates any one of the data reading devices provided in the embodiment of the present application, and the computer device includes:
[0182] one or more processors;
[0183] Memory; and
[0184] One or more applications, wherein the one or more applications are stored in the memory and are configured to execute, by the processor, the steps of the data reading method in any of the above data reading method embodiments.
[0185] The present application also provides a computer device that integrates any data reading device provided in the present application. Fig.10 As shown, it shows a schematic diagram of the structure of the computer device involved in the embodiment of the present application, specifically:
[0186] The computer device may include one or more processing core processors 801, one or more computer-readable storage media memories 802, a power supply 803, an input unit 804 and other components. Those skilled in the art will appreciate that Fig.10 The computer device structure shown in the figure does not constitute a limitation on the computer device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently. Among them:
[0187] The processor 801 is the control center of the computer device. It uses various interfaces and lines to connect various parts of the entire computer device. By running or executing software programs and / or modules stored in the memory 802 and calling data stored in the memory 802, it executes various functions of the computer device and processes data, thereby monitoring the computer device as a whole. Optionally, the processor 801 may include one or more processing cores; preferably, the processor 801 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 801.
[0188] The memory 802 can be used to store software programs and modules. The processor 801 executes various functional applications and data processing by running the software programs and modules stored in the memory 802. The memory 802 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 (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 802 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory 802 may also include a memory controller to provide the processor 801 with access to the memory 802.
[0189] The computer device also includes a power supply 803 for supplying power to each component. Preferably, the power supply 803 can be logically connected to the processor 801 through a power management system, so that the power management system can manage charging, discharging, power consumption and other functions. The power supply 803 can also include one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, power status indicators and other arbitrary components.
[0190] The computer device may further include an input unit 804, which may be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.
[0191] Although not shown, the computer device may further include a display unit, etc., which will not be described in detail herein. Specifically in this embodiment, the processor 801 in the computer device will load the executable files corresponding to the processes of one or more application programs into the memory 802 according to the following instructions, and the processor 801 will run the application programs stored in the memory 802, thereby realizing various functions, as follows:
[0192] When a data reading request from a user is detected, first verification information, second verification information and data information of target data in the data reading request are obtained;
[0193] When the first verification information matches the pre-stored first reference information, obtaining database file information of a target database; wherein the target database is a database where the target data is located;
[0194] Parse the database file information to obtain multiple data table information of the target database;
[0195] Determine target location information of target data based on multiple data table information and data information;
[0196] When the second verification information matches the pre-stored second reference information, the target data is read from the target database based on the target location information.
[0197] A person of ordinary skill in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by instructions, or by controlling related hardware through instructions. The instructions may be stored in a computer-readable storage medium and loaded and executed by a processor.
[0198] To this end, an embodiment of the present application provides a computer-readable storage medium, which may include: a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc. A computer program is stored thereon, and the computer program is loaded by a processor to execute the steps in any data reading method provided in the embodiment of the present application. For example, the computer program is loaded by a processor to execute the following steps:
[0199] When a data reading request from a user is detected, first verification information, second verification information and data information of target data in the data reading request are obtained;
[0200] When the first verification information matches the pre-stored first reference information, obtaining database file information of a target database; wherein the target database is a database where the target data is located;
[0201] Parse the database file information to obtain multiple data table information of the target database;
[0202] Determine target location information of target data based on multiple data table information and data information;
[0203] When the second verification information matches the pre-stored second reference information, the target data is read from the target database based on the target location information.
[0204] 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, please refer to the detailed description of other embodiments above, and will not be repeated here.
[0205] In specific implementation, the above units or structures can be implemented as independent entities, or can be arbitrarily combined to be implemented as the same or several entities. The specific implementation of the above units or structures can refer to the previous method embodiments, which will not be repeated here.
[0206] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.
[0207] The above is a detailed introduction to a data reading method, device, computer equipment and computer-readable storage medium provided in the embodiments of the present application. 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 technical personnel in this field, according to the ideas of the present application, there will be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A data reading method, characterized in that: The data reading method comprises: When a data reading request from a user is detected, obtaining first verification information, second verification information, and data information of target data in the data reading request; When the first verification information matches the pre-stored first reference information, obtaining database file information of a target database; wherein the target database is a database where the target data is located; Parsing the database file information to obtain multiple data table information of the target database; Determine target location information of the target data based on the plurality of data table information and the data information; When the second verification information matches the pre-stored second reference information, the target data is read from the target database based on the target location information.
2. The data reading method according to claim 1, characterized in that: The determining the target location information of the target data based on the plurality of data table information and the data information includes: Determine matching information between each piece of data table information and the data information, wherein the matching information is used to characterize the matching degree between each piece of data table information and the data information; Determine target data table information from the plurality of data table information based on the matching information, the target data table information being the information with the highest matching degree with the data information among the plurality of data table information; Based on the target data table information, target location information of the target data is determined.
3. The data reading method according to claim 2, characterized in that: Each of the data table information includes data table attribute information and data table field information, and the determining of matching information between each of the plurality of data table information and the data information includes: Inputting the data table attribute information in each piece of the data table information and the data information into a pre-trained first matching model, and outputting a first matching parameter between each piece of the data table information and the data information through the first matching model; Inputting the data table field information in each of the data table information and the data information into a pre-trained second matching model, and outputting a second matching parameter between each of the data table information and the data information through the second matching model; Acquire preset first weight information corresponding to the first matching parameter and second weight information corresponding to the second matching parameter; The first matching parameter and the second matching parameter are merged based on the first weight information and the second weight information to obtain matching information between each data table information and the data information.
4. The data reading method according to claim 1, characterized in that: The reading the target data from the target database based on the target location information includes: Based on the target location information, determining a plurality of target data blocks of the target data in the target database; Acquire data block information of each target data block among the plurality of target data blocks; Based on the data block information, determining a data reading order of the plurality of target data blocks; The target data is read from a plurality of the target data blocks based on the data reading order.
5. The data reading method according to claim 4, characterized in that: The data block information includes type information and keyword information, and determining the data reading order of the plurality of target data blocks based on the data block information includes: Inputting the type information and the keyword information into a pre-trained first prediction model, and outputting a first parameter of each target data block through the first prediction model, wherein the first parameter is used to characterize the importance of data in each target data block; Inputting the type information and the keyword information into a pre-trained second prediction model, and outputting an association matrix of the plurality of target data blocks through the second prediction model, wherein the association matrix includes data association parameters of each target data block and other target data blocks, and the data association parameters are used to characterize the degree of association between each target data block and other target data blocks; Based on the association matrix, determining a second parameter of each target data block, where the second parameter is the sum of data association parameters of each target data block and other target data blocks; Determining a target parameter of each of the target data blocks based on the first parameter and the second parameter; Based on the target parameter, a data reading order of the plurality of target data blocks is determined.
6. The data reading method according to claim 1, characterized in that: When the second verification information matches the pre-stored second reference information, before reading the target data from the target database based on the target location information, the method includes: Acquire user information of the user, and acquire pre-stored second reference information from a pre-set information database based on the user information; Generate third verification information based on the first verification information and the second verification information; When the third verification information is consistent with the second reference information, it is determined that the second verification information matches the second reference information.
7. The data reading method according to claim 1, characterized in that: The parsing of the database file information to obtain multiple data table information of the target database includes: Parsing the database file information to obtain a first data file; Scanning the first data file to obtain first location information; Determine a first data block based on the first location information; Reading data from the first data block to obtain second position information; Determine a second data block based on the second location information; The second data block is read to obtain information of multiple data tables of the target database.
8. A data reading device, characterized in that: The data reading device comprises: A first acquisition unit, configured to acquire the first verification information, the second verification information and the data information of the target data in the data read request when a data read request of the user is detected; A second acquisition unit is used to acquire database file information of a target database when the first verification information matches the pre-stored first reference information; wherein the target database is a database where the target data is located; A file parsing unit, used for parsing the database file information to obtain multiple data table information of the target database; An information determining unit, configured to determine target location information of the target data based on the plurality of data table information and the data information; A data reading unit is configured to read the target data from the target database based on the target position information when the second verification information matches the pre-stored second reference information.
9. A computer device, characterized in that: The computer device comprises: one or more processors; Memory; and One or more application programs, wherein the one or more application programs are stored in the memory and configured to be executed by the processor to implement the data reading method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and the computer program is loaded by a processor to execute the steps in the data reading method according to any one of claims 1 to 7.