Data file processing method, device, apparatus, and storage medium

By storing data files in the form of data links, the discrepancies in data file storage are resolved, thereby improving the efficiency of data reading, maintenance, and modification.

CN115495015BActive Publication Date: 2025-12-05BOOMING TECH (HANGZHOU) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211160132.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-22
Publication Date
2025-12-05
Estimated Expiration
2042-09-22

AI Technical Summary

Technical Problem

In software applications, different types of data files stored in a database require different parsing methods, resulting in low data file efficiency and low data reading efficiency.

Method used

By obtaining the file type of the data file, the corresponding parsing method is used to parse the data file, the efficiency of the root node is determined, a data link is generated, and the data in the data file is stored in the form of a data link.

Benefits of technology

This improves the processing efficiency of data reading, maintenance, and modification, eliminates the storage differences between different data files, and reduces the differences in data storage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115495015B_ABST
    Figure CN115495015B_ABST
Patent Text Reader

Abstract

The application discloses a data file processing method and device, equipment and a storage medium, and belongs to the technical field of computers and the Internet. The method comprises the following steps: acquiring a data file and a file type of the data file; analyzing the data file by using an analysis mode corresponding to the file type, determining at least one root node corresponding to the data file, at least one sub-node corresponding to each root node, and a node connection sequence corresponding to the data file; generating a data link corresponding to the data file according to the at least one root node, the at least one sub-node corresponding to each root node and the node connection sequence; and storing data in the data file in the form of the data link. In the application, the processing efficiency during data reading, maintenance and modification is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of computers, and in particular, to a data file processing method and device, equipment and a storage medium. BACKGROUND

[0002] At present, in software application development, configuration information which is not suitable for coding into code can be stored in a database.

[0003] In related technologies, for configuration information which is not suitable for coding into code, a data file for storing configuration information is generated. Since the complexity of function development in software applications, different types of data files can be used to store different configuration information. Then, in the running process of the software application, different data files can be read from the database to realize different functions of the software application.

[0004] However, in the above related technology, since the configuration information is stored in the database in different types of data files, different parsing methods need to be used to parse different types of data files to obtain data when data is read, and the data reading efficiency is low. SUMMARY

[0005] The embodiments of the present application provide a data file processing method, device, equipment and storage medium, which improves the processing efficiency when data is read, maintained and modified. The technical solution is as follows.

[0006] According to an aspect of an embodiment of the present application, a data file processing method is provided, which comprises the following steps:

[0007] Obtaining a data file and a file type of the data file, the data file comprising at least one data;

[0008] Parsing the data file by using a parsing method corresponding to the file type, determining at least one root node corresponding to the data file, at least one child node corresponding to each root node, and a node connection order corresponding to the data file;

[0009] Generating a data link corresponding to the data file according to the at least one root node, at least one child node corresponding to each root node and the node connection order;

[0010] Storing the data in the data file in the form of the data link.

[0011] According to an aspect of an embodiment of the present application, a data file processing device is provided, which comprises the following modules:

[0012] The file acquisition module is used to acquire data files and the file type of the data files, wherein the data files include at least one piece of data;

[0013] The file parsing module is used to parse the data file using the parsing method corresponding to the file type, determine at least one root node corresponding to the data file, at least one child node corresponding to each root node, and the node connection order corresponding to the data file.

[0014] The link generation module is used to generate a data link corresponding to the data file based on the at least one root node, at least one child node corresponding to each root node, and the connection order of the nodes.

[0015] A data storage module is used to store the data in the data file in the form of the data link.

[0016] According to one aspect of the embodiments of this application, the present application provides a computer device, the computer device including a processor and a memory, the memory storing at least one program, the at least one program being loaded and executed by the processor to implement the above-described data file processing method.

[0017] According to one aspect of the embodiments of this application, the embodiments of this application provide a computer-readable storage medium storing at least one program, which is loaded and executed by a processor to implement the above-described data file processing method.

[0018] According to one aspect of the embodiments of this application, a computer program product or computer program is provided, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the aforementioned data file processing method.

[0019] The technical solution provided in this application can bring the following beneficial effects:

[0020] By storing data in data files through data links, data files are converted into data links to eliminate storage differences caused by different file types. This ensures that data in all data files is stored in the form of data links, providing a unified storage format and avoiding inconvenience caused by file type differences during data reading, maintenance, and modification, thus improving processing efficiency. Furthermore, this application provides a file data normalization method, improving the scalability and reusability of the data storage module. In addition, by determining the corresponding parsing method based on the data file type and using the corresponding parsing method to parse the data file, the parsing efficiency of the data file is improved, thereby improving the subsequent data storage efficiency. Attached Figure Description

[0021] Figure 1 This is a schematic diagram of a data file processing system provided in one embodiment of this application;

[0022] Figure 2 An exemplary schematic diagram of a data file processing system is shown;

[0023] Figure 3 This is a flowchart of a data file processing method provided in one embodiment of this application;

[0024] Figures 4 to 6 An exemplary diagram illustrating how a data link is generated is provided.

[0025] Figure 7 This is a flowchart of a data file processing method provided in another embodiment of this application;

[0026] Figure 8 This is a block diagram of a data file processing apparatus provided in one embodiment of this application;

[0027] Figure 9 This is a block diagram of a data file processing apparatus provided in another embodiment of this application;

[0028] Figure 10 This is a structural block diagram of a computer device provided in one embodiment of this application. Detailed Implementation

[0029] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.

[0030] Please refer to Figure 1 This illustration shows a schematic diagram of a data file processing system provided in one embodiment of this application. The data file processing system may include a terminal device 10 and a server 20.

[0031] The terminal device 10 can be an electronic device such as a smartphone, tablet computer, game console, e-book reader, multimedia playback device, wearable device, or PC (Personal Computer), and this application embodiment does not limit this. In some embodiments, the terminal device 10 includes an application client. This application can be any application, such as a game application, music application, reading application, social application, etc. Exemplarily, the application can be an application that requires installation and download, or it can be an application that can be used instantly; this application embodiment does not limit this.

[0032] Server 20 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms.

[0033] The terminal device 10 and the server 20 communicate via a network. In some embodiments, the terminal device 10 includes a first terminal device 11 and a second terminal device 12. The first terminal device 11 refers to the terminal device used by the application developer, and the second terminal device 12 refers to the terminal device used by the application user. For example, as... Figure 2As shown, the developer uploads the application's data file through the first terminal device 11. This data file includes the application's configuration data. For example, the developer can upload the data file through a visual interface. Then, the first terminal device 11 sends the data file to the server 20. Further, after obtaining the data file, the server 20 determines the file type and the corresponding parsing method based on the file type. It then parses the data file using this parsing method to determine at least one root node, at least one child node corresponding to each root node, and the node connection order of the data file. Next, based on the at least one root node, the at least one child node corresponding to each root node, and the node connection order of the data file, a data link corresponding to the data file is generated, and the data in the data file is stored in the database in the form of a data link. Subsequently, when the user uses the application through the second terminal device 12, the second terminal device 12 sends a data retrieval request to the server 20. The server 20 then retrieves the corresponding data link from the database based on the data retrieval request, generates and sends data feedback information to the second terminal device 12 based on the data link. Then, the second terminal device 12 performs screen rendering and function implementation of the application based on the data feedback information.

[0034] It should be noted that the above description of the interaction between terminal device 10 and server 20 is merely exemplary and explanatory. In the exemplary embodiment, the interaction method between terminal device 10 and server 20 can be flexibly set and adjusted, and this application embodiment does not limit this. For example, if the load of the first terminal device 11 allows, the first terminal device 11 converts the data file into a data link, and then the server 20 stores the data link in the database.

[0035] Please refer to Figure 3 This document illustrates a flowchart of a data file processing method according to an embodiment of this application. The steps in this method can be performed by the aforementioned... Figure 1 The method is executed by the terminal device 10 and / or server 20 (hereinafter collectively referred to as "computer device"), whereby the executing entity of each step can be a client of an application in the terminal device 10. The method may include at least one of the following steps (301-304):

[0036] Step 301: Obtain the data file and its file type.

[0037] A data file refers to a file used to store data. This data file can be of any type, such as an Excel file, a JSON file, or an XML file; this application embodiment does not limit this. In some embodiments, different file types correspond to different data. For example, an appropriate file type can be selected based on the data, and then the aforementioned data file can be generated based on the selected file type.

[0038] In this embodiment, the computer device first acquires a data file, then determines the file type of the data file, and uses the parsing method corresponding to that file type to convert the data file so that different types of data files can be converted into a unified format for data storage. The data file includes at least one piece of data. For example, if the data file is a configuration file for an application, then the data included in the file is the application's configuration data.

[0039] In some embodiments, the data file may be manually generated by a user or automatically generated by a computer device; this application does not limit this. In one possible implementation, the data file is manually generated by a user. In some embodiments, the user determines a suitable file type based on the data and edits the data to generate a data file corresponding to that file type. In another possible implementation, the data file is automatically generated by a computer device. In some embodiments, the computer device determines a suitable file type based on the data and automatically edits the data to generate a data file corresponding to that file type.

[0040] In some embodiments, the file type of the data file is carried within the data file itself. For example, the file type is the file extension of the data file. Of course, in other possible implementations, the file type can also be directly written into the data of the data file, such as the first line of data in the data file recording the file type.

[0041] In some embodiments, the correspondence between file types and parsing methods is pre-stored in a parsing query file. In one possible implementation, the file type is directly stored in the data file. After acquiring the data file, the computer device determines the file type based on the file type indication information stored in the data file, and then queries the parsing query file to determine the parsing method corresponding to that file type. The file type indication information can be stored in any location within the data file, such as the title or filename; this embodiment does not limit this. In another possible implementation, the file type is not stored in the data file. After acquiring the data file, the computer device scans the data file to determine its corresponding file type, and then queries the parsing query file to determine the parsing method corresponding to that file type. It should be noted that the parsing query file can be of any type; this embodiment does not limit this.

[0042] In some embodiments, the data in the aforementioned data file is stored in the form of data groups, that is, the data file includes at least one data group, and each data group includes at least one piece of data. In some embodiments, after determining the above-mentioned parsing method, the computer device uses the parsing method to parse at least one data group from the data file; further, the parsing method is used to parse each data group separately. The data categories corresponding to different data groups may be the same or different. For example, in the data file, the data categories corresponding to the first data group include name, age, and email address, and the data categories corresponding to the second data group include first name, last name, and email address.

[0043] Step 302: Parse the data file using the parsing method corresponding to the file type to determine at least one root node corresponding to the data file, at least one child node corresponding to each root node, and the node connection order corresponding to the data file.

[0044] In some embodiments, since different file types correspond to different parsing methods, in order to improve the parsing efficiency of data files, the computer device first determines the parsing method corresponding to the file type of the data file when parsing the data file, and then uses that parsing method to parse the data file. In the embodiments of this application, after obtaining the data file and the file type of the data file, the computer device determines the corresponding parsing method based on the file type, and then uses that parsing method to parse the data file, determining at least one root node corresponding to the data file, at least one child node corresponding to each root node, and the node connection order corresponding to the data file.

[0045] In some embodiments, the above-described parsing method can be used to indicate parsing rules or parsing addresses. In one possible implementation, the above-described parsing method is used to indicate parsing rules, and after determining the parsing rules, the computer device parses the data file based on the parsing rules. In another possible implementation, the above-described parsing method is used to indicate a parsing address, and after determining the parsing address, the computer device calls the corresponding file parsing module to parse the data file based on the parsing address. The file parsing module may include a pre-packaged file parsing program.

[0046] In some embodiments, since different file types of data files correspond to different parsing methods, that is, different file types of data files have different data reading methods, different file types of data files correspond to different data link generation methods.

[0047] In one possible implementation, when the data file's file type is a first file type, after obtaining the data file and its file type, the computer device parses the data file using a parsing method corresponding to the file type. This process retrieves at least one piece of data stored in the data file and the corresponding data storage order. Further, based on the at least one piece of data and the data storage order, at least one root node corresponding to the data file, at least one child node corresponding to each root node, and the node connection order corresponding to the data file are determined to generate a data link corresponding to the data file. Here, the first file type refers to a file where the correspondence between data and data categories cannot be accurately read. For example, the first file type is an Excel file. Since an Excel file only stores data categories in the first row, it is impossible to accurately determine the data category corresponding to each piece of data in each row when reading data row by row. It should be noted that the aforementioned at least one piece of data refers to all data stored in the data file.

[0048] In another possible implementation, when the data file type is a second file type, after obtaining the data file and its file type, the computer device parses the data file using a parsing method corresponding to the file type. This process retrieves at least one piece of data stored in the data file, the correspondence between the data and data categories, and the data storage order. Further, based on the at least one piece of data, the correspondence between the data and data categories, and the data storage order, at least one root node, at least one child node corresponding to each root node, and the node connection order are determined to generate a data link corresponding to the data file. Here, the second file type refers to a file that accurately reads the correspondence between data and data categories. For example, the second file type is a JSON file or an XML file. Since data categories and data are stored in a nested manner in JSON and XML files, the data category corresponding to a particular piece of data can be accurately determined when reading the data. It should be noted that the at least one piece of data refers to all the data stored in the data file, and the data category refers to the classification of data during storage. For example, if data is distinguished by data format during storage, then the data category is used to indicate the data format, such as data categories including int, float, double, etc.; if data is distinguished by specific storage meaning during storage, then the data category is used to indicate the storage meaning of the data, such as data categories including name, age, email, etc.

[0049] Step 303: Generate the data link corresponding to the data file based on at least one root node, at least one child node corresponding to each root node, and the node connection order.

[0050] In this embodiment of the application, after obtaining the aforementioned at least one root node, at least one child node corresponding to each root node, and the node connection order, the computer device generates a data link corresponding to the data file based on the at least one root node, at least one child node corresponding to each root node, and the node connection order.

[0051] Step 304: Store the data in the data file as a data link.

[0052] In this embodiment, after obtaining the data link corresponding to the aforementioned data file, the computer device stores the data in the data file in the form of a data link. In some embodiments, the aforementioned data link is stored in a database, and the database includes data links corresponding to multiple data files.

[0053] In some embodiments, in order to improve the efficiency of reading data in the database, similar or related data are stored in adjacent locations to achieve data clustering and storage, which facilitates subsequent unified processing of the data.

[0054] In one possible implementation, the computer device stores the data link record based on the second root node. In an exemplary embodiment, step 304 above includes at least one of the following steps:

[0055] 1. Based on the second root node in the data link, determine the storage location of the data link in the database;

[0056] 2. Store the data in the data file in the storage location as a data link.

[0057] In some embodiments, the data link includes a second root node. The data file includes at least one data group, and each data group includes at least one piece of data. The second root node indicates the category of the data group within the at least one data group. In this embodiment, after acquiring the data link, the computer device determines its storage location in the database based on the second root node in the data link, and then stores the data from the data file in the form of a data link at that storage location.

[0058] In some embodiments, after acquiring the data link, the computer device retrieves the associated root node corresponding to the second root node in the database based on the second root node in the data link, and then determines the storage location of the data link in the database based on the location of the associated root node in the database. In one possible implementation, the associated root node and the second root node are the same root node. In some embodiments, the associated root node is determined by traversing the stored second root nodes in the database, using the second root node in the data link as a reference.

[0059] For example, the above method of storing data link records based on the second root node is applicable to data files belonging to the second file type.

[0060] In another possible implementation, the computer device stores the data link based on a data file identifier. In an exemplary embodiment, step 304 above includes at least one of the following steps:

[0061] 1. Determine the storage location of the data link in the database based on the data file identifier corresponding to the data link;

[0062] 2. Store the data in the data file in the storage location as a data link.

[0063] In some embodiments, a data link corresponds to a data file identifier, which is used to indicate the data file corresponding to the data link. In this embodiment, after acquiring the data link, the computer device determines the storage location of the data link in the database based on the data file identifier corresponding to the data link, and then stores the data in the data file in the form of a data link at that storage location.

[0064] In some embodiments, after acquiring the aforementioned data link, the computer device retrieves the associated file identifier corresponding to the data file identifier from the database based on the data file identifier corresponding to the data link, and then determines the storage location of the data link corresponding to the data file identifier in the database based on the location of the data link corresponding to the associated file identifier in the database. In one possible implementation, the aforementioned associated file identifier refers to the file identifier of an associated data file associated with the data file. Taking the application's configuration file as an example, the data file is a first configuration file for a target section of the application, and the associated data file is a second configuration file for the target section of the application.

[0065] For example, the above method of storing data links based on data file identifiers is applicable to data files belonging to the first file type.

[0066] In summary, the technical solution provided in this application stores data in data files via data links, converting data files into data links to eliminate storage differences caused by different file types. This ensures that data in each data file is stored in the form of data links, storing data in a unified manner. This avoids inconvenience caused by differences in file types during data reading, maintenance, and modification, and improves processing efficiency during data reading, maintenance, and modification. Furthermore, this application provides a file data normalization method, improving the scalability and reusability of the data storage module. In addition, by determining the corresponding parsing method based on the data file type and using the corresponding parsing method to parse the data file, the parsing efficiency of the data file is improved, thereby improving the subsequent data storage efficiency.

[0067] The generation method of the above data link will be described below.

[0068] In one possible implementation, the file type of the aforementioned data file is a first file type. In an exemplary embodiment, steps 302 and 303 include at least one of the following steps:

[0069] 1. Use the parsing method corresponding to the file type to parse the data file, determine the data stored in each data group in the data file, and the data storage order of each data group;

[0070] 2. For a target data group in at least one data group, according to the data storage order corresponding to the target data group, the data that is stored first in the order is taken as the first data;

[0071] 3. Set the first data as the first root node;

[0072] 4. Based on the storage order of the data in the target data group, determine the other data that are stored after the first data as the child nodes corresponding to the first root node;

[0073] 5. Determine the connection order of each child node based on the storage order of other data in the target data group;

[0074] 6. Generate the data sub-links corresponding to the target data group based on the first root node, the child nodes corresponding to the first root node, and the connection order of each child node;

[0075] 7. Concatenate the first node in the data sub-link corresponding to each data group to generate the data link corresponding to the data file.

[0076] In some embodiments, a data file includes at least one data group, and a data group includes at least one piece of data. In this embodiment, after acquiring the data file and determining its file type, the computer device parses the data file using a parsing method corresponding to the file type to determine the data stored in each data group and the data storage order of each data group. Then, the data stored first in the data group is designated as the first data, which is then identified as the first root node. The remaining data stored after the first data are identified as child nodes corresponding to the first root node. Furthermore, based on the storage order of the other data within the data group, the connection order of the other data as child nodes is determined. Then, based on the first root node, the child nodes corresponding to the first root node, and the connection order between the child nodes, a data sub-link corresponding to each data group is generated. Finally, based on the data sub-links corresponding to each data group, the first root nodes in the data sub-links corresponding to each data group are concatenated to generate the data link corresponding to the data file.

[0077] Taking a target data group as an example, after acquiring the data stored in the target data group and the corresponding data storage order, the computer device designates the data stored first as the first data and the first data as the first root node. Then, based on the data storage order of the target data group, the other data stored after the first data are identified as child nodes corresponding to the first root node. The connection order of each child node is determined based on the storage order of the other data in the target data group. Finally, based on the first root node, the child nodes corresponding to the first root node, and the connection order of the child nodes, a data sub-link corresponding to the target data group is generated. For example, after determining the first root node and its corresponding child nodes, the computer device sequentially connects the child nodes according to the storage order of the other data in the target data group, connecting the first child node to the first root node to generate the data sub-link corresponding to the target data group. Here, the target data group can be any data group within a data file.

[0078] In addition, combined Figure 4 This section introduces the methods for generating data links.

[0079] For example, such as Figure 4 As shown, data file 40 is an Excel file, which includes a first data group 41 and a second data group 42. The first data group 41 includes data (1), (90005), and (90007), with the data storage order being 1—90005—90007. Based on this, a first data sub-link 43 corresponding to the first data group 41 is generated. In the first data sub-link 43, data (1) is the first root node, and data (90005) and data (90007) are both child nodes corresponding to the first root node, with the child nodes connected in the order 90005—90007. The second data group 42 includes data (2), (90006), and (90008), with the data storage order being 2—90006—90008. Based on this, a second data sub-link 44 corresponding to the second data group 42 is generated. In the second data sub-link 44, data (2) is the first root node, and data (90006) and data (90008) are both child nodes corresponding to the first root node, with the connection order of the child nodes being 90006-90008. Then, the first root node (1) of the first data sub-link 43 and the second root node (2) of the second data sub-link 44 are concatenated to generate the data link 45 corresponding to the data file 40.

[0080] In another possible implementation, the file type of the aforementioned data file is a second file type. In an exemplary embodiment, steps 302 and 303 include at least one of the following steps:

[0081] 1. Use the file type-based parsing method to parse the data file, determine the correspondence between the data and data category of each data group in the data file, and the data storage order of each data group;

[0082] 2. For a target data group in at least one data group, based on the correspondence between the data and data categories in the target data group, determine the data category as the first root node and the data corresponding to the data category as the child node corresponding to the first root node;

[0083] 3. Determine the connection order between the first root nodes based on the data storage order corresponding to the target data group;

[0084] 4. Based on the first root node, the child nodes corresponding to the first root node, and the connection order between the first root nodes, determine the data sub-links corresponding to the target data group;

[0085] 5. Based on the data group category to which each data group belongs, the data sub-links corresponding to the data groups belonging to the same data group category are spliced ​​together to generate the data link corresponding to the data file.

[0086] In some embodiments, a data file includes at least one data group, and a data group includes at least one piece of data. In this embodiment, after acquiring the data file and determining its file type, the computer device parses the data file using a parsing method corresponding to the file type. This process determines the correspondence between the data and data categories corresponding to each data group, as well as the data storage order corresponding to each data group. Then, based on the correspondence between data and data categories, the connection relationship between the first root node and its child nodes is determined. Further, based on the data storage order corresponding to each data group, the connection relationship between each first root node is determined. Finally, based on the connection relationship between the first root node and its child nodes, and the connection relationship between each first root node, data sub-links corresponding to the data groups are generated. And based on the data sub-links corresponding to each data group, a data link corresponding to the data file is generated.

[0087] Taking a target data group as an example, after obtaining the correspondence between the data and data categories corresponding to the target data group and the data storage order corresponding to the target data group, the computer device determines the data category as the first root node and the data corresponding to the data category as the child nodes corresponding to the first root node based on the correspondence. Then, based on the data storage order corresponding to the target data group, the connection order between the first root nodes is determined. Next, based on the connection relationship between the first root node, the child nodes corresponding to the first root node, and the connection order between the first root nodes, a data sub-link corresponding to the target data group is generated. For example, after determining the connection relationship between the first root node and its child nodes, the computer device connects the corresponding first root node and its child nodes. Then, after determining the data storage order, the computer device connects the first root nodes sequentially based on the data storage order to generate the data sub-link corresponding to the target data group. Here, the target data group can be any data group in a data file.

[0088] In some embodiments, the data file further includes data group categories, where one data group category corresponds to one or more data groups. After obtaining the data sub-links corresponding to each data group, the computer device concatenates the data sub-links corresponding to data groups belonging to the same data group category based on the data group category to which each data group belongs, generating the data link corresponding to the data file. For example, during data sub-link concatenation, the computer uses the data group category as the second root node, connecting the first node of the data sub-links corresponding to data groups belonging to the same data group category to the second root node.

[0089] In addition, combined Figure 5 and 6 This section introduces the methods for generating data links.

[0090] For example, such as Figure 5As shown, data file 50 is a JSON file, which includes a first data group 51, a second data group 52, and a third data group 53. For the first data group 51, there is a correspondence between the first data category (first name) and the first data (Brett), a correspondence between the second data category (last name) and the second data (Lin), and a correspondence between the third data category (email) and the third data (Breet@xxxx.com). The data storage order is Brett—Lin—Breet@xxxx.com. Based on this, a first data sub-link 54 corresponding to the first data group 51 is generated. In the first data sub-link 54, the first root node (first name) is connected to the child node (Brett), the first root node (last name) is connected to the child node (Lin), and the first root node (email) is connected to the child node (Breet@xxxx.com). The connection order of the first root node is first name—last name—email. For the second data group 52, there is a correspondence between the first data category (first name) and the first data (Jason), a correspondence between the second data category (last name) and the second data (Li), and a correspondence between the third data category (email) and the third data (Jason@xxxx.com). The data storage order is Jason—Li—Jason@xxxx.com. Based on this, a second data sub-link 55 corresponding to the second data group 52 is generated. In the second data sub-link 55, the first root node (first name) is connected to the child node (Jason), the first root node (last name) is connected to the child node (Li), and the first root node (email) is connected to the child node (Jason@xxxx.com). The connection order of the first root node is first name—last name—email. For the third data group 53, there is a correspondence between the first data category (first name) and the first data (Elliotte), a correspondence between the second data category (last name) and the second data (Han), and a correspondence between the third data category (email) and the third data (Elliotte@xxxx.com). The data storage order is Elliotte—Han—Elliotte@xxxx.com. Based on this, the third data sub-link 56 corresponding to the third data group 53 is generated.In the third data sub-link 56, the first root node (first name) is connected to the child node (Elliotte), the first root node (last name) is connected to the child node (Han), and the first root node (email) is connected to the child node (Elliotte@xxxx.com), with the connection order of the first root node being first name—last name—email. Subsequently, since data file 50 includes a data group category (people), and the first data group 51, the second data group 52, and the third data group 53 all belong to this data group category, the first root node at the first position in the first data sub-link 54 can be connected to the second root node (people), the first root node at the first position in the second data sub-link 55 can be connected to the first root node at the first position in the first data sub-link 54, and the first root node at the first position in the third data sub-link 56 can be connected to the first root node at the first position in the second data sub-link 55, thus generating data link 57.

[0091] For example, such as Figure 6 As shown, data file 60 is an XML file, which includes a first data group 61. For the first data group 61, there is a correspondence between the first data category (first name) and the first data (Brett), a correspondence between the second data category (last name) and the second data (Lin), and a correspondence between the third data category (email) and the third data (Breet@xxxx.com). The data storage order is Brett—Lin—Breet@xxxx.com. Based on this, a first data sub-link 62 corresponding to the first data group 61 is generated. In the first data sub-link 62, the first root node (first name) is connected to the child node (Brett), the first root node (last name) is connected to the child node (Lin), and the first root node (email) is connected to the child node (Breet@xxxx.com). The connection order of the first root node is first name—last name—email. Subsequently, since the data file 60 includes a data group category (request), the first root node at the first position in the first data sub-link 62 can be connected to the second root node (request) to generate the data link 63.

[0092] Please refer to Figure 7 This illustrates a flowchart of a data file processing method provided in another embodiment of this application. The steps in this method can be performed by the methods described above. Figure 1The method is executed by the terminal device 10 and / or server 20 (hereinafter collectively referred to as "computer device"), whereby the executing entity of each step can be a client of an application in the terminal device 10. The method may include at least one of the following steps (701-706):

[0093] Step 701: Obtain the data file and its file type.

[0094] Step 702: Parse the data file using the parsing method corresponding to the file type to determine at least one root node corresponding to the data file, at least one child node corresponding to each root node, and the node connection order corresponding to the data file.

[0095] Step 703: Generate the data link corresponding to the data file based on at least one root node, at least one child node corresponding to each root node, and the node connection order.

[0096] Step 704: Store the data in the data file as a data link.

[0097] Steps 701-704 above and Figure 3 Steps 301-304 in the embodiment are the same; see details below. Figure 3 Examples are not described in detail here.

[0098] Step 705: Upon receiving a data acquisition request, retrieve the data link corresponding to the acquisition identification information from the database based on the acquisition identification information included in the data acquisition request.

[0099] A data retrieval request is used to request data. In some embodiments, after the data link is stored in the database, the corresponding data is read from the database via a data retrieval request. For example, if the data file is an application configuration file, the data retrieval request can be a request triggered during application runtime.

[0100] In this embodiment of the application, when a computer device receives the aforementioned data acquisition request, it retrieves the data link corresponding to the acquisition identification information from the database based on the acquisition identification information included in the data acquisition request.

[0101] In one possible implementation, the aforementioned acquisition of identification information includes a target second root node. In some embodiments, after acquiring the aforementioned data acquisition request, the computer device determines the target second root node from the data acquisition request, and then traverses the second root nodes contained in the database based on the target second root node to acquire the data link corresponding to the target second root node.

[0102] In another possible implementation, the aforementioned identification information includes a data file identifier. In some embodiments, after obtaining the aforementioned data acquisition request, the computer device determines the data file identifier from the data acquisition request, and then, based on the data file identifier, retrieves the data link corresponding to the data file identifier from the database.

[0103] Step 706: Generate data feedback information corresponding to the data acquisition request based on the data link corresponding to the acquired identification information.

[0104] In this embodiment of the application, after the computer device obtains the data link corresponding to the above-mentioned acquisition identification information, it generates data feedback information corresponding to the data acquisition request based on the data link corresponding to the acquisition identification information, and sends the data feedback information.

[0105] In some embodiments, after the data link is stored in the database, the data is modified from the database through a data modification request. Data modification includes data replacement, data addition, data deletion, etc., which are not limited in this embodiment. Exemplarily, when a computer device receives a data modification request, it retrieves the data link corresponding to the modification identifier information from the database based on the modification identifier information included in the data modification request, and then modifies the data link corresponding to the modification identifier information according to the data modification request.

[0106] In one possible implementation, the aforementioned data modification request includes a data modification file, and the computer device modifies the data links in the database based on the data modification file. It should be noted that since the database stores data in the form of data links, the file types of the data modification file and the original data file can be the same or different during data modification; this embodiment does not limit this. Of course, in another possible implementation, since the data in the database is stored in the form of data links, during data modification, the modified data can be directly uploaded using a unified data interface.

[0107] In summary, the technical solution provided in this application stores data from different file types via a data link, offering a data file normalization approach. This eliminates the need for data files of different file types in the database, improving data retrieval efficiency. Furthermore, the data file normalization process allows for data modification using a unified interface, reducing development costs.

[0108] The following are embodiments of the apparatus described in this application, which can be used to execute the embodiments of the method described in this application. For details not disclosed in the apparatus embodiments of this application, please refer to the embodiments of the method described in this application.

[0109] Please refer to Figure 8 This diagram illustrates a block diagram of a data file processing apparatus according to an embodiment of this application. The apparatus has the function of implementing the aforementioned data file processing method; this function can be implemented in hardware or by hardware executing corresponding software. The apparatus can be a computer device or can be installed within a computer device. The apparatus 800 may include: a file acquisition module 810, a file parsing module 820, a link generation module 830, and a data storage module 840.

[0110] The file acquisition module 810 is used to acquire a data file and the file type of the data file, wherein the data file includes at least one piece of data.

[0111] The file parsing module 820 is used to parse the data file using the parsing method corresponding to the file type, determine at least one root node corresponding to the data file, at least one child node corresponding to each root node, and the node connection order corresponding to the data file.

[0112] The link generation module 830 is used to generate a data link corresponding to the data file based on the at least one root node, at least one child node corresponding to each root node, and the node connection order.

[0113] The data storage module 840 is used to store the data in the data file in the form of the data link.

[0114] In an exemplary embodiment, the data file includes at least one data group, and a data group includes at least one piece of data; the file parsing module 820 is further configured to:

[0115] The data file is parsed using the parsing method corresponding to the file type to determine the data stored in each data group in the data file, and the data storage order corresponding to each data group.

[0116] For a target data group in the at least one data group, the data that is stored first is taken as the first data according to the data storage order corresponding to the target data group;

[0117] Use the first data as the first root node;

[0118] Based on the data storage order corresponding to the target data group, other data whose storage order is after the first data are determined as child nodes corresponding to the first root node;

[0119] The connection order of each child node is determined based on the storage order of the other data in the target data group.

[0120] In an exemplary embodiment, the link generation module 830 is further configured to:

[0121] Based on the first root node, the child nodes corresponding to the first root node, and the connection order of each child node, a data sub-link corresponding to the target data group is generated.

[0122] The first node in each of the data sub-links corresponding to the data groups is concatenated to generate the data link corresponding to the data file.

[0123] In an exemplary embodiment, the data file includes at least one data group, and a data group includes at least one piece of data; the file parsing module 820 is further configured to:

[0124] The data file is parsed using the parsing method corresponding to the file type to determine the correspondence between the data and data category of each data group in the data file, as well as the data storage order of each data group.

[0125] For a target data group in the at least one data group, based on the correspondence between the data and the data category corresponding to the target data group, the data category is determined as the first root node, and the data corresponding to the data category is determined as the child node corresponding to the first root node;

[0126] The connection order between the first root nodes is determined based on the data storage order corresponding to the target data group.

[0127] In an exemplary embodiment, the link generation module 830 is further configured to:

[0128] Based on the first root node, the child nodes corresponding to the first root node, and the connection order between the first root nodes, determine the data sub-links corresponding to the target data group;

[0129] Based on the data group category to which each of the data groups belongs, the data sub-links corresponding to the data groups belonging to the same data group category are spliced ​​together to generate the data link corresponding to the data file.

[0130] In an exemplary embodiment, the link generation module 830 is further configured to:

[0131] Using the data group category as the second root node, connect the first root node in the data sub-link corresponding to the data group belonging to the same data group category to the second root node.

[0132] In an exemplary embodiment, the data storage module 840 is further configured to:

[0133] Based on the second root node in the data link, the storage location of the data link in the database is determined; wherein, the data file includes at least one data group, and a data group includes at least one piece of data, and the second root node is used to indicate the data group category in the at least one data group;

[0134] The data in the data file is stored in the storage location in the form of the data link.

[0135] In an exemplary embodiment, the data storage module 840 is further configured to:

[0136] Based on the data file identifier corresponding to the data link, determine the storage location of the data link in the database;

[0137] The data in the data file is stored in the storage location in the form of the data link.

[0138] In an exemplary embodiment, the data storage module 840 is further configured to:

[0139] Retrieve the associated root node corresponding to the second root node from the database;

[0140] Based on the location of the associated root node in the database, the storage location of the data link in the database is determined.

[0141] In an exemplary embodiment, the data storage module 840 is further configured to:

[0142] Retrieve the associated file identifier corresponding to the data file identifier from the database;

[0143] Based on the location of the data link corresponding to the associated file identifier in the database, the storage location of the data link corresponding to the data file identifier in the database is determined.

[0144] In an exemplary embodiment, such as Figure 9 As shown, the device 800 further includes: a data reading module 850, an information generation module 860, and an information sending module 870.

[0145] The data reading module 850 is used to, upon receiving a data acquisition request, retrieve the data link corresponding to the acquisition identification information from the database based on the acquisition identification information included in the data acquisition request.

[0146] The information generation module 860 is used to generate data feedback information corresponding to the data acquisition request based on the data link corresponding to the acquisition identification information.

[0147] The information sending module 870 is used to send the data feedback information.

[0148] In an exemplary embodiment, the data reading module 850 is further configured to:

[0149] The acquisition of identification information includes the target second root node. Based on the target second root node, the second nodes contained in the database are traversed to obtain the data link corresponding to the target second root node.

[0150] or,

[0151] The identification information obtained includes a data file identifier, and based on the data file identifier, the data link corresponding to the data file identifier is obtained from the database.

[0152] In an exemplary embodiment, such as Figure 9 As shown, the device 800 further includes a data modification module 880.

[0153] The data modification module 880 is used to, upon receiving a data modification request, retrieve the data link corresponding to the modification identifier information from the database based on the modification identifier information included in the data modification request; and modify the data link corresponding to the modification identifier information according to the data modification request.

[0154] In summary, the technical solution provided in this application stores data in data files via data links, converting data files into data links to eliminate storage differences caused by different file types. This ensures that data in each data file is stored in the form of data links, storing data in a unified manner. This avoids inconvenience caused by differences in file types during data reading, maintenance, and modification, and improves processing efficiency during data reading, maintenance, and modification. Furthermore, this application provides a file data normalization method, improving the scalability and reusability of the data storage module. In addition, by determining the corresponding parsing method based on the data file type and using the corresponding parsing method to parse the data file, the parsing efficiency of the data file is improved, thereby improving the subsequent data storage efficiency.

[0155] It should be noted that the apparatus provided in the above embodiments is only illustrated by the division of the above functional modules when implementing its functions. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the apparatus and method embodiments provided in the above embodiments belong to the same concept, and the specific implementation process can be found in the method embodiments, which will not be repeated here.

[0156] Please refer to Figure 10This diagram illustrates the structural block diagram of a computer device according to an embodiment of this application. This computer device can be used to implement the functions of the data file processing method described above. Specifically:

[0157] Computer device 1000 includes a central processing unit (CPU) 1001, a system memory 1004 including random access memory (RAM) 1002 and read-only memory (ROM) 1003, and a system bus 1005 connecting the system memory 1004 and the CPU 1001. Computer device 1000 also includes a basic input / output system (I / O system) 1006 that facilitates information transfer between various devices within the computer, and a mass storage device 1007 for storing the operating system 1013, application programs 1014, and other program modules 1015.

[0158] The basic input / output system 1006 includes a display 1008 for displaying information and an input device 1009 for user input, such as a mouse or keyboard. Both the display 1008 and the input device 1009 are connected to the central processing unit 1001 via an input / output controller 1010 connected to the system bus 1005. The basic input / output system 1006 may also include the input / output controller 1010 for receiving and processing input from multiple other devices such as a keyboard, mouse, or electronic stylus. Similarly, the input / output controller 1010 also provides output to a display screen, printer, or other types of output devices.

[0159] Mass storage device 1007 is connected to central processing unit 1001 via a mass storage controller (not shown) connected to system bus 1005. Mass storage device 1007 and its associated computer-readable media provide non-volatile storage for computer device 1000. That is, mass storage device 1007 may include computer-readable media (not shown) such as hard disk or CD-ROM (Compact Disc Read-Only Memory) drive.

[0160] Without loss of generality, computer-readable media can include computer storage media and communication media. Computer storage media includes volatile and non-volatile, removable and non-removable media implemented using any method or technology for storing information such as computer-readable instructions, data structures, program modules, or other data. Computer storage media includes RAM, ROM, EPROM (Erasable Programmable Read Only Memory), EEPROM (Electrically Erasable Programmable Read Only Memory), flash memory or other solid-state storage devices, CD-ROM, DVD (Digital Video Disc) or other optical storage, magnetic tape cassettes, magnetic tape, disk storage, or other magnetic storage devices. Of course, those skilled in the art will recognize that computer storage media are not limited to the above-mentioned types. The system memory 1004 and mass storage device 1007 described above can be collectively referred to as memory.

[0161] According to various embodiments of this application, the computer device 1000 can also be connected to a remote computer on a network, such as the Internet. That is, the computer device 1000 can be connected to the network 1012 via the network interface unit 1011 connected to the system bus 1005, or the network interface unit 1011 can be used to connect to other types of networks or remote computer systems (not shown).

[0162] The memory also includes a computer program stored in the memory and configured to be executed by one or more processors to implement the above-described data file processing method.

[0163] In an exemplary embodiment, a computer-readable storage medium is also provided, the storage medium storing at least one instruction, at least one program, code set, or instruction set, wherein the at least one instruction, the at least one program, the code set, or the instruction set, when executed by a processor, implements the above-described data file processing method.

[0164] Optionally, the computer-readable storage medium may include: ROM (Read Only Memory), RAM (Random Access Memory), SSD (Solid State Drives), or optical disc, etc. The random access memory may include ReRAM (Resistance Random Access Memory) and DRAM (Dynamic Random Access Memory).

[0165] In an exemplary embodiment, a computer program product or computer program is also provided, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the aforementioned data file processing method.

[0166] It should be understood that "multiple" as used herein refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. Furthermore, the step numbers described herein are merely illustrative of one possible execution order. In some other embodiments, the steps may not be executed in numerical order, such as two steps with different numbers being executed simultaneously, or two steps with different numbers being executed in the reverse order of the illustration. This application does not limit this.

[0167] The above description is merely an exemplary embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.

Claims

1. A method of processing a data file, characterized by, The method comprises: acquiring a data file and a file type of the data file; wherein the data file comprises at least one data group, and each data group comprises at least one data; parsing the data file by using a parsing mode corresponding to the file type, determining at least one root node corresponding to the data file, at least one sub-node corresponding to each root node, and a node connection sequence corresponding to the data file; generating a data link corresponding to the data file according to the at least one root node, the at least one sub-node corresponding to each root node, and the node connection sequence; determining a storage position of the data link in a database based on a second root node in the data link, wherein the second root node is used to indicate a data group category in the at least one data group; or determining the storage position of the data link in the database based on a data file identifier corresponding to the data link; storing data in the data file in the form of the data link at the storage position.

2. The method of claim 1, wherein, The parsing of the data file by using the parsing mode corresponding to the file type, the determination of the at least one root node corresponding to the data file, the at least one sub-node corresponding to each root node, and the node connection sequence corresponding to the data file comprise: parsing the data file by using the parsing mode corresponding to the file type, determining data stored in each data group in the data file, and determining a data storage sequence corresponding to each data group; for a target data group in the at least one data group, determining a first data in a front storage sequence as a first data according to the data storage sequence corresponding to the target data group; determining the first data as a first root node; determining other data after the first data in the storage sequence as sub-nodes corresponding to the first root node according to the data storage sequence corresponding to the target data group; determining a connection sequence of each sub-node according to a storage sequence of the other data in the target data group.

3. The method of claim 2, wherein, The generation of the data link corresponding to the data file according to the at least one root node, the at least one sub-node corresponding to each root node, and the node connection sequence comprises: generating a data sub-link corresponding to the target data group according to the first root node, the sub-nodes corresponding to the first root node, and the connection sequence of each sub-node; splicing first root nodes in data sub-links corresponding to each data group to generate the data link corresponding to the data file.

4. The method of claim 1, wherein the parsing of the data file by using the parsing mode corresponding to the file type, the determination of the at least one root node corresponding to the data file, the at least one sub-node corresponding to each root node, and the node connection sequence corresponding to the data file comprise: The data file is parsed by using the parsing mode corresponding to the file type, to determine the correspondence between data and data categories corresponding to each data group in the data file, and the data storage order corresponding to each data group; For a target data group in the at least one data group, the data category is determined as a first root node according to the correspondence between the data corresponding to the target data group and the data category, and the data corresponding to the data category is determined as a child node corresponding to the first root node; The connection order between the first root nodes is determined according to the data storage order corresponding to the target data group.

5. The method of claim 4, wherein, The data link corresponding to the data file is generated according to the at least one root node, the at least one child node corresponding to each root node, and the node connection order, including: The data sub-link corresponding to the target data group is determined according to the first root node, the child node corresponding to the first root node, and the connection order between the first root nodes; The data sub-links corresponding to the data groups belonging to the same data group category are spliced based on the data group category to which each data group belongs, to generate the data link corresponding to the data file.

6. The method of claim 5, wherein, The data link corresponding to the data file is generated based on the data group category, including: The first root node in the data sub-link corresponding to the data group belonging to the same data group category is connected to the second root node as the data group category.

7. The method of claim 1, wherein, The storage location of the data link in the database is determined based on the second root node in the data link, including: An associated root node corresponding to the second root node is obtained in the database; The storage location of the data link in the database is determined based on the location of the associated root node in the database; The storage location of the data link in the database is determined based on the data file identifier corresponding to the data link, including: An associated file identifier corresponding to the data file identifier is obtained in the database; The storage location of the data link corresponding to the data file identifier in the database is determined based on the location of the data link corresponding to the associated file identifier in the database.

8. The method according to any one of claims 1 to 7, characterized in that, The method further includes: In the case of receiving a data acquisition request, the data link corresponding to the acquisition identifier information included in the data acquisition request is obtained from the database based on the acquisition identifier information; The data feedback information corresponding to the data acquisition request is generated according to the data link corresponding to the acquisition identifier information; The data feedback information is sent; The data link corresponding to the acquisition identifier information is obtained from the database based on the acquisition identifier information included in the data acquisition request, including: The acquisition identifier information includes a target second root node, and the second root nodes contained in the database are traversed based on the target second root node to obtain the data link corresponding to the target second root node; Or, The acquisition of the identification information includes a data file identification, and the data link corresponding to the data file identification is acquired from the database based on the data file identification.

9. An apparatus for processing a data file, characterized by The device includes: a file acquisition module, configured to acquire a data file and a file type of the data file, wherein the data file includes at least one data group, and one data group includes at least one data; a file analysis module, configured to analyze the data file by using an analysis method corresponding to the file type, to determine at least one root node corresponding to the data file, at least one child node corresponding to each root node, and a node connection order corresponding to the data file; a link generation module, configured to generate a data link corresponding to the data file according to the at least one root node, the at least one child node corresponding to each root node, and the node connection order; a data storage module, configured to determine a storage location of the data link in a database based on a second root node in the data link, the second root node being used to indicate a data group category in the at least one data group, or to determine the storage location of the data link in the database based on a data file identification corresponding to the data link, and to store data in the data file in the form of the data link in the storage location.

10. A computer device, comprising: The computer device includes a processor and a memory, and the memory stores at least one program, which is loaded and executed by the processor to implement the data file processing method of any one of claims 1 to 8.

11. A computer readable storage medium, characterized in that, The storage medium stores at least one program, which is loaded and executed by a processor to implement the data file processing method of any one of claims 1 to 8.

12. A computer program product, characterised in that, The computer program product includes computer instructions stored in a computer readable storage medium, which are read by a processor of a computer device from the computer readable storage medium and executed by the processor to implement the data file processing method of any one of claims 1 to 8.

Citation Information

Patent Citations

  • Data processing method and device, electronic equipment and storage medium

    CN113051333A

  • File processing method and device, electronic equipment and storage medium

    CN113590554A