Data processing method and device and electronic equipment
By generating and merging the path list of table files, multiple users can edit game configuration table data in parallel, solving the problem of low collaborative editing efficiency in existing technologies and improving collaborative editing efficiency and data processing automation.
Patent Information
- Application Number
- CN202510838519.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-20
- Publication Date
- 2025-11-18
AI Technical Summary
In game development, when multiple users collaboratively edit game configuration spreadsheet files, existing technologies suffer from low collaborative editing efficiency due to file-level exclusive locking mechanisms, requiring users to frequently switch spreadsheet files, which causes workflow blockage.
By determining the table names and path list of the shared spreadsheet file, the table names of the spreadsheet file to be shared are obtained, and the path list is generated or merged based on consistency, enabling multiple users to edit data in parallel and converting the data format into a format recognizable by the target program.
It effectively avoids workload bottlenecks during collaboration, significantly improves collaborative editing efficiency, reduces the cost of manual integration and format conversion, and enhances the automation and consistency of data processing.
Smart Images

Figure CN120973756A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer, and in particular, to a data processing method and device and electronic equipment. BACKGROUND
[0002] In the field of game development, a table-based configuration table management system is widely used, in which various game parameter configuration tables are stored in corresponding table files according to functions, such as a role file that centrally manages role-related data, including a role configuration table and a skill configuration table; and a prop file that focuses on a prop system, including a prop table and a prop effect table. These table files are centrally stored in a shared directory for use by developers for collaborative editing to meet the needs of multiple people processing business data.
[0003] However, the data involved in the business requirements is usually scattered in the worksheets of multiple table files, and the developers need to frequently switch between table files to complete their own requirements. After editing, the table files are converted into a format recognizable by the game engine through a table export operation. In related technologies, to avoid the data being overwritten or lost after table export due to multiple people modifying the same file at the same time, a file-level exclusive lock mechanism is often used to ensure that only one user can read and write the table file at the same time. This makes other users need to wait in line when processing business related to the same table file, which can easily cause serious blocking of the work flow and low efficiency of collaborative editing. SUMMARY
[0004] Therefore, the present application aims to provide a data processing method, device and electronic equipment to improve the efficiency of collaborative editing.
[0005] In a first aspect, the present application provides a data processing method, which comprises determining a first table name corresponding to a shared worksheet included in a shared table file; obtaining a first path list corresponding to the first table name; wherein the first path list includes a corresponding relationship between the first table name and a first file path of the shared table file; obtaining a to-be-shared table file and a second file path of the to-be-shared table file, and determining whether a second table name corresponding to a to-be-shared worksheet included in the to-be-shared table file belongs to the first table name; if the second table name belongs to the first table name, adding the second file path to the first path list; if the second table name does not belong to the first table name, generating a second path list corresponding to the second table name; wherein the second path list includes a corresponding relationship between the second table name and the second file path; for a target table name in the first path list or the second path list, obtaining a target file path corresponding to the target table name, determining a target table file based on the target file path, extracting target table data from the target table file, and converting a format of the target table data into a target format recognizable by a target program.
[0006] In a second aspect, an embodiment of the present application provides a data processing apparatus, comprising: a first obtaining module configured to determine a first table name corresponding to a shared worksheet contained in a shared table file; and obtain a first path list corresponding to the first table name; wherein the first path list comprises a corresponding relationship between the first table name and a first file path of the shared table file; a second obtaining module configured to obtain a to-be-shared table file and a second file path of the to-be-shared table file, and determine whether a second table name corresponding to a to-be-shared worksheet contained in the to-be-shared table file belongs to the first table name; a first determining module configured to, if the second table name belongs to the first table name, add the second file path to the first path list; and if the second table name does not belong to the first table name, generate a second path list corresponding to the second table name; wherein the second path list comprises a corresponding relationship between the second table name and the second file path; and a first converting module configured to, for a target table name in the first path list or the second path list, obtain a target file path corresponding to the target table name, determine a target table file based on the target file path, extract target table data from the target table file, and convert a format of the target table data into a target format recognizable by a target program.
[0007] In a third aspect, an embodiment of the present application provides an electronic device, comprising a processor and a memory, the memory stores machine executable instructions capable of being executed by the processor, and the processor executes the machine executable instructions to implement the data processing method.
[0008] In a fourth aspect, an embodiment of the present application provides a machine readable storage medium, the machine readable storage medium stores machine executable instructions, and the machine executable instructions, when invoked and executed by a processor, cause the processor to implement the data processing method.
[0009] An embodiment of the present application brings the following beneficial effects:
[0010] The data processing method, device and electronic equipment determine a first table name corresponding to a shared worksheet contained in a shared table file; a first path list corresponding to the first table name is obtained; the first path list includes a corresponding relationship between the first table name and a first file path of the shared table file; a table file to be shared and a second file path of the table file to be shared are obtained, and it is determined whether a second table name corresponding to a shared worksheet contained in the table file to be shared belongs to the first table name; if the second table name belongs to the first table name, the second file path is added to the first path list; if the second table name does not belong to the first table name, a second path list corresponding to the second table name is generated; the second path list includes a corresponding relationship between the second table name and the second file path; for a target table name in the first path list or the second path list, a target file path corresponding to the target table name is obtained, a target table file is determined based on the target file path, target table data is extracted from the target table file, and a format of the target table data is converted into a target format recognizable by a target program.
[0011] In this mode, a user can create an independent table file to be shared according to a business requirement, if the table name in the table file to be shared is consistent with the table name in the shared table file, the path of the table file to be shared is added to the path list corresponding to the same table name; if the names are inconsistent, an independent path list is generated according to the table name of the table file to be shared, finally, the corresponding table file is read from the path list corresponding to the table name according to the table name, target table data is extracted and format conversion is completed. In this mode, multiple users can simultaneously edit the same shared table file through their respective table files to be shared, then, the file paths corresponding to the tables with the same name are aggregated, and finally, the aggregation and target formatting output of the multiple-source data corresponding to the tables with the same name are realized, effectively avoiding the workload blockage during collaboration, and significantly improving the collaboration editing efficiency.
[0012] Other features and advantages of the present application will be set forth in the following description, and in part will become apparent to those skilled in the art from the description, or can be learned by practice of the present application. The objects and other advantages of the present application will be realized and achieved by the structure particularly pointed out in the description, claims and drawings.
[0013] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, the following preferred embodiments are specifically described below, and the accompanying drawings are described as follows. BRIEF DESCRIPTION OF DRAWINGS
[0014] In order to more clearly illustrate the technical solutions in the specific embodiments of the present application or the prior art, the following will briefly introduce the drawings needed to be used in the specific embodiments or prior art description. Obviously, the drawings described below are some embodiments of the present application, and other drawings can also be obtained by those skilled in the art without creative labor on the basis of these drawings.
[0015] Figure 1 A flow chart of a data processing method provided for an embodiment of the present application is shown in FIG. 1.
[0016] Figure 2 A schematic diagram of data table processing provided for an embodiment of the present application is shown in FIG. 2.
[0017] Figure 3 A schematic diagram of a data processing flow provided for an embodiment of the present application is shown in FIG. 3.
[0018] Figure 4 A structural schematic diagram of a data processing device provided for an embodiment of the present application is shown in FIG. 4.
[0019] Figure 5 A structural schematic diagram of an electronic device provided for an embodiment of the present application is shown in FIG. 5. DETAILED DESCRIPTION
[0020] In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions of the present application will be described clearly and completely below with reference to the drawings. Obviously, the described embodiments are some of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor fall within the scope of protection of the present application.
[0021] In the field of game development, a table-based configuration table management system is widely used in business data collaboration scenarios. In this system, various game parameter configuration tables are stored in corresponding table files according to functions, and multi-person collaborative editing is supported through a shared directory to meet the needs of multiple people processing business data together. The existing solutions generally use file-level exclusive lock mechanism to ensure data consistency, that is, only a single user is allowed to read and write the entire table file at the same time. However, the data involved in the business requirements are usually scattered in the worksheets of multiple table files, and the developers need to frequently switch between table files for cross-table editing to complete their own business requirements. The parallel modification of different users on the same table file leads to a linear increase in the probability of lock conflicts with the increase in the number of table files, resulting in low efficiency of collaborative editing.
[0022] Based on this, the embodiment of the present application provides a data processing method, device and electronic equipment, in order to facilitate the understanding of the embodiment, first of all, a kind of data processing method disclosed in the embodiment of the present application is introduced in detail, as shown in Figure Figure 1 The method comprises the following steps:
[0023] Step S102, determine the first table name corresponding to the shared worksheet contained in the shared table file;Obtain the first path list corresponding to the first table name;Wherein, the first path list includes: the corresponding relationship between the first table name and the first file path of the shared table file;
[0024] The above-mentioned shared table file is a table file that already exists in the shared directory for users to edit collaboratively. The above-mentioned first table name refers to the table name of the shared worksheet contained in the shared table file. The above-mentioned first file path refers to the file path of the shared table file, which can include the file name of the shared table file and the storage location of the file.
[0025] For example, the storage location of the shared table file is: D: / shared files / role configuration / ;The file name of the shared table file is: role attribute table.xlsx;The first file path is: D: / shared files / role configuration / role attribute table.xlsx.
[0026] The above-mentioned first path list includes: the corresponding relationship between the first table name corresponding to the shared worksheet contained in the shared table file and the first file path of the shared table file. For example, the first path list can indicate the corresponding relationship in the form of {first table name: [(first file path)]}.
[0027] Here, the shared table file can include multiple;When the shared table file is multiple, the table name corresponding to each shared worksheet contained in each shared table file can be obtained, and the file path of the shared table file is obtained, to obtain the corresponding relationship between the first table name in each shared table file and the shared table file.
[0028] Step S104, obtain the to-be-shared table file and the second file path of the to-be-shared table file, and determine whether the second table name corresponding to the to-be-shared worksheet contained in the to-be-shared table file belongs to the first table name;
[0029] The above-mentioned to-be-shared table file is a table file created by the user according to business requirements, and its core purpose is to obtain the data required by business requirements by merging the to-be-shared worksheet in the to-be-shared table file with the shared worksheet having the same table name in the shared table file.
[0030] The to-be-shared table files can be created by different users, and the to-be-shared table files can include multiple to-be-shared table files, and the table data included in different to-be-shared table files needs to have different data row identification information.
[0031] For example, the plurality of to-be-shared table files all include a "role configuration table", and the roles in each table are different, for example, the role IDs are different, and the role names are different. Through such differentiated identification, when merging multiple source data, merging errors caused by repetition or conflict can be avoided.
[0032] In this step, the to-be-shared table file and the second file path of the to-be-shared table file are obtained, and it is determined whether the second table name corresponding to the to-be-shared worksheet included in the to-be-shared table file belongs to the first table name.
[0033] In step S106, if the second table name belongs to the first table name, the second file path is added to the first path list; if the second table name does not belong to the first table name, a second path list corresponding to the second table name is generated; wherein the second path list includes the correspondence between the second table name and the second file path.
[0034] It can be understood that when the table name in the to-be-shared table file belongs to the first table name, the file path of the to-be-shared table file is directly added to the first path list, at this time, in the first path list, the file path corresponding to the first table name includes the first file path and the file path of the to-be-shared table file, realizing the aggregation of multiple file paths of the same table, so that subsequent extraction of table data corresponding to the first table name can automatically extract table data from the first file path and the file path of the to-be-shared table file according to the first path list, and complete the merging of multiple source data.
[0035] If the second table name does not belong to the first table name, a second path list corresponding to the second table name is generated; the second path list includes the correspondence between the second table name and the second file path.
[0036] In the prior art, when a new worksheet is added in a shared table file, an association relationship needs to be established between the new worksheet and the existing shared worksheet manually, and the table data of the worksheet can be recognized during subsequent data extraction.
[0037] In the present application, when a worksheet that is not included in the shared table file is added in the to-be-shared table file, a path list corresponding to the table name of the new worksheet can be automatically generated, and the new worksheet can be directly located based on the table name in the path list during the data extraction operation, and the data extraction of the new worksheet is realized, realizing the full-process automation of data extraction and improving the data processing efficiency.
[0038] Step S108, for the target table name in the first path list or the second path list, the target file path corresponding to the target table name is obtained, the target table file is determined based on the target file path, the target table data is extracted from the target table file, and the format of the target table data is converted into a target format recognizable by the target program.
[0039] The target table name can be any table name contained in the first path list or the second path list. The target file path, i.e. the file path corresponding to the target table name in the path list, can contain multiple target file paths. The target format can be a data format recognizable by a game program, for example, a py format that can be parsed by a Python program. The target tabular file refers to a table file under the target file path.
[0040] In this step, for each target table name in the first path list or the second path list, all target file paths corresponding to the target table name are traversed, the shared table file or the table file to be shared is determined according to each target file path, the table data of the worksheet consistent with the target table name is extracted from these table files, and the multi-source table data extracted is converted into a format recognizable by the target program.
[0041] For example, if the target format is a.py format that can be parsed by a Python program, the multi-source table data extracted by the target table name can be assembled into a dictionary list and written into a py format file corresponding to the target table name for direct calling by a Python script.
[0042] Further, all table data corresponding to the table names in the first path list and the second path list can also be extracted one by one, the data of the same table name is merged, the data format is converted into a target format recognizable by the target program, and thus the target format files corresponding to all table names in the shared data table and the shared data table are obtained.
[0043] For example, as shown in Figure 2 , the target table name in the first path list or the second path list is extracted, the target file path corresponding to the target table name is obtained, the target table file is determined based on the target file path, the target table data is extracted from the target table file, and the format of the target table data is converted into a target format recognizable by the target program. Figure 2The shared table includes a table name A corresponding to a worksheet sheetA, and a table name B corresponding to a worksheet sheetB; the to-be-shared table 1 includes a table name B corresponding to a worksheet sheetB1 and a table name C corresponding to a worksheet sheetC1; and the to-be-shared table 2 includes a table name C corresponding to a worksheet sheetC2 and a table name D corresponding to a worksheet sheetD2. The path list corresponding to the table name A, the table name B, the table name C and the table name D is obtained, the system merges the data of the same table name, and converts the data format into a target format (such as a py format) that can be recognized by a target program, so as to obtain a py format file corresponding to each target table name.
[0044] In the prior art, the shared table file supports multi-user shared editing, and multiple user operation records exist in the same file, so that it is necessary to filter other user information to find data submitted by a specific user, and the operation is complicated. The to-be-shared table file is edited by a single person and only includes personal operation records, so that personal business data can be quickly located, and version management and traceability efficiency is improved.
[0045] Since the to-be-shared table file has high data independence, the table data in the to-be-shared table file is not limited by the data requirements of the shared table file. Generally, the shared table file usually has fixed data specifications, such as specific field types, mandatory items or format requirements. The to-be-shared table file allows users to flexibly define data structures according to their own business needs, without the need to follow the data standards of the shared table file. Users can freely add, modify or delete fields in the to-be-shared table file, and flexibly adjust the data format. This flexibility effectively reduces the understanding cost in collaboration, and avoids the inconvenience of data processing caused by the fixed specification restrictions of the shared table.
[0046] In the present application, multiple users can perform parallel data editing on the same-named table in the shared file through their respective to-be-shared table files. After uploading the to-be-shared table file, the system can automatically complete the aggregation of multi-source data by aggregating the file paths corresponding to the same-named table, and convert it into a target format output. This process does not require manual intervention in data integration and format conversion, which greatly reduces the labor cost. In this way, exclusive lock mechanism can be avoided, effectively avoiding the workload blockage during collaboration, and significantly improving the collaboration editing efficiency.
[0047] The data processing method determines a first table name corresponding to a shared worksheet included in a shared table file, acquires a first path list corresponding to the first table name, wherein the first path list includes a corresponding relationship between the first table name and a first file path of the shared table file, acquires a to-be-shared table file and a second file path of the to-be-shared table file, determines whether a second table name corresponding to a to-be-shared worksheet included in the to-be-shared table file belongs to the first table name, adds the second file path to the first path list if the second table name belongs to the first table name, generates a second path list corresponding to the second table name if the second table name does not belong to the first table name, wherein the second path list includes a corresponding relationship between the second table name and the second file path, acquires a target file path corresponding to a target table name in the first path list or the second path list, determines a target table file based on the target file path, extracts target table data from the target table file, and converts a format of the target table data into a target format recognizable by a target program.
[0048] In this way, a user can create an independent to-be-shared table file according to a business requirement, if the table name in the to-be-shared table file is consistent with the table name in the shared table file, the path of the to-be-shared table file is added to the path list corresponding to the same table name, if the names are inconsistent, an independent path list is generated according to the table name of the to-be-shared table file, finally, the corresponding table file is read from the path list corresponding to the table name, target table data is extracted and format conversion is completed. In this way, multiple users can simultaneously edit the same shared table file through their respective to-be-shared table files, then, the file paths corresponding to the same-named tables are aggregated, and finally, the aggregation and target formatting output of the multi-source data corresponding to the same-named tables are realized, effectively avoiding the workload blockage during collaboration, and significantly improving the collaboration editing efficiency.
[0049] In one way, the to-be-shared table files include multiple to-be-shared table files.
[0050] The data row identification information is a field or field combination in the table data of the to-be-shared worksheet for uniquely identifying each data record, for example, a role ID in a role configuration table, a skill name in a skill configuration table, and the like.
[0051] The table data included in different to-be-shared table files needs to have different data row identification information.
[0052] For example, when multiple to-be-shared table files all include a role configuration table, the role IDs in the tables are different. Through such differentiated identification, when merging multi-source data, merging errors caused by repetition or conflict are avoided.
[0053] In one mode, after obtaining the correspondence between the table name and the file path, the shared table file and the table file to be shared can be serialized and stored, a more efficient data management link is constructed, efficient reading and writing in network transmission or local storage is facilitated, and file size and parsing time are reduced.
[0054] Specifically, the shared table file and the table file to be shared are serialized to obtain a first serialized file corresponding to the shared table file and a second serialized file corresponding to the table file to be shared; in the first serialized file, the first table name has a first mapping relationship with table data in the shared worksheet corresponding to the first table name; in the second serialized file, the second table name has a second mapping relationship with table data in the shared worksheet corresponding to the second table name; the first serialized file has a first association relationship with the first file path; and the second serialized file has a second association relationship with the second file path.
[0055] The above serialization processing can be converting the table file into a binary or JSON serialization format.
[0056] In this mode, the shared table file and the table file to be shared can be parsed by a parsing engine to extract table data therein, and then the extracted data can be serialized to obtain a first serialized file corresponding to the shared table file and a second serialized file corresponding to the table file to be shared; in the first serialized file, the first table name has a first mapping relationship with table data in the shared worksheet corresponding to the first table name; in the second serialized file, the second table name has a second mapping relationship with table data in the shared worksheet corresponding to the second table name.
[0057] In addition, the first serialized file has a first association relationship with the first file path; and the second serialized file has a second association relationship with the second file path; specifically, the association relationship can be established through the name of the serialized file and the file path of the table file, for example, the file path of the table file is calculated through a hash calculation or a path reduction algorithm to generate a unique serialized file name, so that each table file and its serialized file form a one-to-one association relationship, and the corresponding serialized file can be quickly located through the association relationship.
[0058] In the serialized file, table data in the worksheet corresponding to the table name can be quickly mapped according to the table name, without relying on original file format parsing, and when multiple table data scattered in different file paths are merged, the serialized file can be loaded in parallel through multiple threads to improve loading efficiency.
[0059] It should be noted that the table file can contain annotations, such as business rule instructions such as "role ID must be unique", if the table data is directly converted into a target format, such as a Py format file, the annotations cannot be parsed and read, resulting in a lack of key basis for subsequent data verification, making it difficult to find problems such as role ID duplication. The serialization processing process can ensure that each row and each field in the table file, including hidden annotation information, is completely converted into a serialized format through a full data verification mechanism, completely eliminating data loss or verification blind spots caused by parsing logic omissions. In addition, the annotation information retained in the serialized file can be directly embedded in the automated verification logic to achieve precise interception of data uniqueness and compliance, effectively avoiding manual omissions, and significantly improving data quality and business process reliability.
[0060] Further, after obtaining the first serialized file and the second serialized file, for a target table name in the first path list or the second path list, a target file path corresponding to the target table name is obtained, a first target serialized file associated with the target file path is determined, first target table data mapped by the target table name is extracted from the first target serialized file, and a format of the first target table data is converted into a target format recognizable by a target program.
[0061] The first target serialized file refers to a serialized file associated with the target file path based on the existing first association relationship or the existing second association relationship. The first target table data is table data mapped by the target table name extracted from the first target serialized file.
[0062] That is, for a target table name in the first path list or the second path list, a target file path corresponding to the target table name can be obtained, a first target serialized file associated with the target file path can be determined according to the association relationship, since the target file path can include multiple target file paths, the obtained first target serialized file can also include multiple first target serialized files, then, according to the target table name, first target table data mapped by the target table name is extracted from the first target serialized file, and a format of the first target table data is converted into a target format recognizable by a target program. By extracting table data mapped by the target table name from multiple first target serialized files, lossless merging of the to-be-shared table data and the shared table data can be achieved.
[0063] In one way, the first file path is subjected to a hash operation to obtain a first hash value, and the first hash value is determined as a file name of the first serialized file; the second file path is subjected to a hash operation to obtain a second hash value, and the second hash value is determined as a file name of the second serialized file.
[0064] For example, the hash operation can be an MD5 operation.
[0065] The first file path is hashed to obtain a unique first hash value, the first hash value is determined as the file name of the first serialized file, so that each shared table file and its corresponding first serialized file form a one-to-one corresponding association relationship, and then the corresponding serialized file of the shared table file can be quickly located through the association relationship.
[0066] The second file path is hashed to obtain a unique second hash value, the second hash value is determined as the file name of the second serialized file, so that each shared table file and its corresponding first serialized file form a one-to-one corresponding association relationship, and then the corresponding serialized file of the shared table file can be quickly located through the association relationship.
[0067] In one way, if the user needs to update the table data in the shared table file created by himself, the corresponding table data can be edited and saved directly in the shared table file. After editing, only the data of the updated file needs to be extracted, and the system will automatically perform serialization processing on the single file without touching other un-updated shared files, significantly reducing the redundant operation of data processing.
[0068] Specifically, an updated shared table file is obtained; the updated shared table file is a file generated after editing the table data in the shared table file; an updated shared table file is obtained; the updated shared table file is a file generated after editing the table data in the shared table file; the updated shared table file and the updated shared table file are serialized to obtain a first updated serialized file corresponding to the updated shared table file and a second updated serialized file corresponding to the updated shared table file; based on the first association relationship, a first file associated with the file path of the updated shared table file is determined; the first file in the first association relationship is replaced by the first updated serialized file; based on the second association relationship, a second file associated with the file path of the updated shared table file is determined; the second file in the second association relationship is replaced by the second updated serialized file.
[0069] It should be noted that the updated shared table file is saved by editing the corresponding table data in the shared table file, and the file path and the file name corresponding to the updated shared table file remain unchanged, that is, the file path corresponding to the updated shared table file is consistent with the file path corresponding to the shared table file before the update; the file name corresponding to the updated shared table file is consistent with the file name corresponding to the shared table file before the update. Similarly, the updated table file to be shared is saved by editing the corresponding table data in the table file to be shared, and the file path corresponding to the updated table file to be shared is consistent with the file path corresponding to the table file to be shared before the update; the file name corresponding to the updated table file to be shared is consistent with the file name corresponding to the table file to be shared before the update.
[0070] The first file is the file path associated with the serialization file of the updated shared table file. The second file is the file path associated with the serialization file of the updated table file to be shared.
[0071] Here, only the updated shared table file and the updated table file to be shared are serialized to obtain the first updated serialization file corresponding to the updated shared table file and the second updated serialization file corresponding to the updated table file to be shared,
[0072] Then, according to the first association relationship, the file path associated with the first file of the updated shared table file is determined, the first file in the first association relationship is replaced by the first updated serialization file; according to the second association relationship, the file path associated with the second file of the updated table file to be shared is determined; the second file in the second association relationship is replaced by the second updated serialization file.
[0073] Further, when extracting table data, for a target table name in the first path list or the second path list, a target file path corresponding to the target table name is obtained, a second target serialization file associated with the target file path is determined based on the target file path, second target table data mapped by the target table name is extracted from the second target serialization file, and the format of the second target table data is converted into a target format recognizable by a target program.
[0074] The second target serialization file refers to a serialization file associated with the target file path according to the current first association relationship or the current second association relationship. It should be noted that the association relationship corresponding to the serialization file other than the first file in the current first association relationship remains unchanged, and the association relationship corresponding to the serialization file other than the second file in the current second association relationship remains unchanged.
[0075] Here, the target file path corresponding to the target table name is obtained from the first path list or the second path list through the target table name, the second target serialized file associated with the target file path is determined according to the current first association relationship or the current second association relationship, the second target table data mapped by the target table name is extracted from the second target serialized file, the format of the second target table data is converted into a target format recognizable by the target program, and the update of the table data in the target format is realized.
[0076] In this way, only the shared table file that has changed and the table file to be shared are serialized, the old serialized file is directly located and replaced through the association relationship, and other un-updated table files to be shared do not need to be touched, that is, the other un-updated table files to be shared do not need to be repeatedly serialized, and the serialized file obtained through the last serialization conversion can be directly read. This way avoids full table file scanning and serialization processing, and greatly reduces the consumption of computing resources.
[0077] In one way, the updated shared table file can also be obtained in the following way:
[0078] The shared folder where the shared table file is located is traversed to obtain the modification time corresponding to the shared table file and the first file path corresponding to the shared table file; based on the first association relationship, a third file associated with the first file path is determined; the generation time of the third file is obtained, and based on the generation time of the third file and the modification time corresponding to the shared table file, the updated shared table file is determined.
[0079] The third file refers to a serialized file associated with the first file path.
[0080] That is, the shared folder where the shared table file is located can be traversed to obtain the modification time corresponding to the shared table file and the first file path corresponding to the shared table file; according to the first association relationship, a serialized file associated with the first file path is determined, the generation time of the serialized file corresponding to the shared table file is obtained, and according to the generation time and the modification time corresponding to the shared table file, it is determined whether the shared table file is updated.
[0081] Specifically, if the modification time corresponding to the shared table file is later than the generation time of the third file, it is determined that the shared table file is the updated shared table file; if the modification time corresponding to the shared table file is not later than the generation time of the third file, it is determined that the shared table file is not the updated shared table file.
[0082] That is, if a shared table file corresponds to a modification time later than the generation time of the corresponding third file, it is determined that the shared table file has updates. If a shared table file corresponds to a modification time not later than the generation time of the corresponding third file, it is determined that the shared table file has no updates.
[0083] Similarly, the shared folder where the shared table file is located is traversed to obtain the modification time corresponding to the shared table file and the second file path corresponding to the shared table file; based on the second association relationship, the fourth file associated with the second file path is determined; the generation time of the fourth file is obtained, and based on the generation time of the fourth file and the modification time corresponding to the shared table file, the updated shared table file is determined.
[0084] The fourth file mentioned above refers to a serialized file associated with the second file path.
[0085] That is, the shared folder where the shared table file is located can be traversed to obtain the modification time corresponding to the shared table file and the second file path corresponding to the shared table file; according to the second association relationship, the serialized file associated with the second file path is determined, the generation time of the serialized file corresponding to the shared table file is obtained, and according to the generation time and the modification time corresponding to the shared table file, it is determined whether the shared table file has updates.
[0086] Specifically, if the modification time corresponding to the shared table file is later than the generation time of the fourth file, it is determined that the shared table file is the updated shared table file; if the modification time corresponding to the shared table file is not later than the generation time of the fourth file, it is determined that the shared table file is not the updated shared table file.
[0087] That is, if a shared table file corresponds to a modification time later than the generation time of the corresponding third file, it is determined that the shared table file has updates. If a shared table file corresponds to a modification time not later than the generation time of the corresponding third file, it is determined that the shared table file has no updates.
[0088] In one way, the first path list and the second path list are stored in the relationship storage unit, a newly added table file to be shared is obtained, and a third file path of the newly added table file to be shared is obtained. The third table name corresponding to the shared worksheet contained in the newly added table file to be shared is determined. The relationship storage unit is updated based on the third table name and the third file path. The newly added table file to be shared is serialized to obtain a third serialized file corresponding to the newly added table file to be shared. The third serialized file has a third association relationship with the third file path. The third target table data mapped by the storage table name contained in the updated relationship storage unit is extracted, and the format of the third target table data is converted into a target format recognizable by a target program.
[0089] The third file path is the file path of the newly added table file to be shared. The storage table name refers to the table name stored in the relationship storage unit. The third target table data refers to the table data mapped by the storage table name obtained from the serialized file.
[0090] The first path list and the second path list are stored in the relationship storage unit. If a newly added table file to be shared appears, the third file path of the newly added table file to be shared is obtained, and the third table name corresponding to the shared worksheet contained in the newly added table file to be shared is determined. The relationship storage unit is updated according to the third table name and the third file path. For example, if the third table name is consistent with the first table name or the second table name, the third file path is added to the path list corresponding to the same table name. If they are inconsistent, an independent path list is generated in the relationship storage unit.
[0091] Then, the newly added table file to be shared is serialized to obtain a third serialized file. The third serialized file has a third association relationship with the third file path. For example, the third file path is calculated by a hash calculation or a path reduction algorithm to generate a unique serialized file name. The newly added table file to be shared and its serialized file form a one-to-one association relationship, and the corresponding third serialized file can be quickly located through the association relationship.
[0092] Further, for the table name stored in the updated relationship storage unit, the file path corresponding to the table name can be found according to the path list, the serialized file associated with the file path is obtained, the table data mapped by the table name is extracted from these serialized files to obtain the third target table data. The format of the third target table data is converted into a target format recognizable by a target program.
[0093] In one way, the relationship storage unit can be updated in the following way:
[0094] determining whether the third table name exists in the relational storage unit; if the third table name exists in the relational storage unit, adding the third file path to the first path list or the second path list; if the third table name does not exist in the relational storage unit, generating a third file path list corresponding to the third table name in the relational storage unit; wherein the third path list includes a corresponding relationship between the third table name and the third file path.
[0095] That is, if the third table name exists in the relational storage unit, that is, the third table name belongs to the first table name or the second table name, if the third table name belongs to the first table name, the third file path is added to the first path list, if the third table name belongs to the second table name, the third file path is added to the second path list, if the third table name does not belong to any one of the first table name and the second table name, it is a newly added worksheet, then generate a third file path list corresponding to the third table name in the relational storage unit; the third path list includes a corresponding relationship between the third table name and the third file path.
[0096] In one way, the third target table data storing the table name mapping can be extracted by the following way:
[0097] Obtaining a storage file path corresponding to a storage table name, determining a serialization file associated with the storage file path, and extracting third target table data storing the table name mapping from the serialization file associated with the storage file path.
[0098] The above storage file path is a file path in the path list corresponding to the storage table name in the updated relational storage unit. The storage file path can include multiple.
[0099] That is, for the table name stored in the updated relational storage unit, the file path corresponding to the table name is obtained, and then the serialization file associated with the file path is determined according to the file path, and the table data mapped by the table name is extracted from these serialization files as third target table data.
[0100] It can be understood that the serialization file stores intermediate data in the table file conversion process, rather than the final output result. The serialization file can be subjected to format conversion, verification, data updating and other operations, and finally a data format recognizable by a target program can be generated to realize efficient conversion of original table data to a target format.
[0101] In one mode, before extracting the first target table data, it can also be detected whether the same data row identification information exists in the table data mapped by the target table name in the first target serialized file; if the same data row identification information exists, an alarm information is generated to prompt the file name and file path of the table file to which the table data with the same identification information belongs.
[0102] That is, before extracting the first target table data from the first target serialized file, all table data mapped by the same table name in each first target serialized file can be scanned to check whether the repeated data row identification information exists. If the same data row identification information is found, an alarm information is generated to clearly prompt the file name and file path of the table file to which the table data containing the repeated data row identification information belongs. Through this mechanism, the data row identification conflict problem can be effectively intercepted to guarantee the data uniqueness.
[0103] In one specific embodiment, the data processing method of the application is described, wherein the shared table is stored in a shared folder, a to-be-shared folder is created for storing the to-be-shared table files uploaded by users, and a serialized folder is created for storing serialized files. Here, the file path of the table file can be used to generate a unique serialized file name through hash calculation, so that each table file and its serialized file form a one-to-one corresponding association relationship, and the corresponding serialized file can be quickly located through the association relationship. A data processing method comprises the following steps:
[0104] In step S32, the path list corresponding to each table name is obtained.
[0105] It can be understood that the table importing system is a multi-process execution process, and various competitions will occur when multiple processes write the same file. Therefore, the serialized folder and the relationship storage unit can be refreshed before the table is imported to obtain the latest path list.
[0106] Here, when the serialized folder saves the serialized file, the.temp_map_files folder under the serialized folder is written first.
[0107] For example, it is assumed that the prop table exists in the shared table file, the to-be-shared table file A and the to-be-shared table file B. When the serialized folder saves the serialized file, the following processing is performed:
[0108] 1) Create the temp_map_files folder
[0109] 2) Create the prop table ItemProto folder under the.temp_map_files folder
[0110] 3) Write the shared table file, the to-be-shared table file A and the to-be-shared table file B corresponding serialized files into the ItemProto folder. Assuming that the hash values corresponding to the file paths are (MD5_1, MD5_2, MD5_3), respectively, we will obtain three serialized files
[0111] a..temp_map_files / ItemProto / MD5_1
[0112] b..temp_map_files / ItemProto / MD5_2
[0113] c..temp_map_files / ItemProto / MD5_3
[0114] 4) Then, traverse the temp_map_files folder, and we will know the serialized files under ItemProto. Finally, the serialized files are sorted and written into the relational storage unit, and the path list in the following form is obtained: {ItemProto: [shared file path, MD5_1] [to-be-shared file path 1, MD5_2] [to-be-shared file path 2, MD5_3]}. The path list contains the correspondence between the table name and the file path, and can quickly locate the serialized file corresponding to the table name. The path list is stored in the relational storage unit.
[0115] Step S304, traverse the to-be-shared folder, obtain the file paths of all to-be-shared table files, calculate the hash value of each file path, find the serialized file with the same hash value in the serialized folder, and determine the to-be-shared table file that needs to be imported:
[0116] Traverse the to-be-shared folder, calculate the hash value of each to-be-shared table file, compare the serialized file with the same hash value in the serialized folder, and if the modification time is greater than the modification time of the serialized file, it means that the table file needs to be imported, and then the modified list is added.
[0117] Step S306, traverse the shared folder, obtain the file paths of all shared table files, calculate the hash value of each file path, find the serialized file with the same hash value in the serialized folder, and determine the shared table file that needs to be imported;
[0118] Traverse the to-be-shared folder, calculate the hash value of each to-be-shared table file, compare the serialized file with the same hash value in the serialized folder, and if the modification time is greater than the modification time of the serialized file, it means that the table file needs to be imported, and then the modified list is added.
[0119] Step S308, the shared table file that needs to be guided and the table file to be shared are serialized to obtain an updated serialized file, and the updated serialized file is added to the serialized folder to overwrite the serialized file with the same hash value in the serialized folder.
[0120] The shared table file that needs to be guided and the table file to be shared are serialized to obtain an updated serialized file, and the updated serialized file is added to the serialized folder to overwrite the serialized file with the same hash value in the serialized folder.
[0121] Step S310, for each table name in the relational storage unit, a target serialized file is determined from the serialized folder, target table data mapped by the table name is extracted from the target serialized file, and the format of the target table data is converted into a target format recognizable by a target program.
[0122] For the table name in the relational storage unit, a target serialized file corresponding to the table name is determined from the serialized folder, target table data mapped by the table name is extracted from the target serialized file, and the format of the target table data is converted into a target format recognizable by a target program, realizing lossless merging of data.
[0123] In this way, multiple users edit data in the same-named table in the shared file through the table file to be shared in parallel, and through the aggregation of the file paths corresponding to the same-named tables, the multi-source data corresponding to the same-named tables is ultimately aggregated and formatted and output, significantly improving the efficiency of collaborative editing.
[0124] By performing serialization only on the shared table file and the table file to be shared that have changed, the old serialized file is directly located and replaced through the hash value, without touching other un-updated table files to be shared, avoiding full scanning and processing, and greatly reducing the consumption of computing resources.
[0125] Corresponding to the method embodiment, referring to Figure 4 The device includes:
[0126] The first obtaining module 402 is configured to determine a first table name corresponding to a shared worksheet contained in a shared table file, and obtain a first path list corresponding to the first table name, wherein the first path list includes a corresponding relationship between the first table name and a first file path of the shared table file.
[0127] The second obtaining module 404 is configured to obtain a table file to be shared and a second file path of the table file to be shared, and determine whether a second table name corresponding to a shared worksheet contained in the table file to be shared belongs to the first table name.
[0128] The first determining module 406 is configured to add the second file path into the first path list if the second table name belongs to the first table name, and generate a second path list corresponding to the second table name if the second table name does not belong to the first table name, wherein the second path list includes a corresponding relationship between the second table name and the second file path.
[0129] The first converting module 408 is configured to, for a target table name in the first path list or the second path list, acquire a target file path corresponding to the target table name, determine a target table file based on the target file path, extract target table data from the target table file, and convert a format of the target table data into a target format recognizable by a target program.
[0130] In this way, a user can create an independent table file to be shared according to a business requirement. If the table name in the table file to be shared is consistent with the table name in a shared table file, the path of the table file to be shared is added to a path list corresponding to the same table name. If the table names are inconsistent, an independent path list is generated according to the table name of the table file to be shared. Finally, the corresponding table file is read from the path list corresponding to the table name, target table data is extracted, and format conversion is completed. In this way, multiple users can simultaneously edit the same shared table file through their respective table files to be shared. Then, the file paths corresponding to the tables with the same name are aggregated, and finally, the aggregation and target formatting output of the multiple-source data corresponding to the tables with the same name are realized, effectively avoiding the workload blockage during collaboration and significantly improving the collaboration editing efficiency.
[0131] The above-described table files to be shared include multiple table files to be shared. The table data in different table files to be shared includes data line identification information that is different.
[0132] The above-described apparatus further includes a serialization module configured to serialize the shared table file and the table files to be shared to obtain a first serialized file corresponding to the shared table file and a second serialized file corresponding to the table files to be shared. In the first serialized file, the first table name has a first mapping relationship with the table data in the shared worksheet corresponding to the first table name. In the second serialized file, the second table name has a second mapping relationship with the table data in the shared worksheet corresponding to the second table name. The first serialized file has a first association relationship with the first file path, and the second serialized file has a second association relationship with the second file path.
[0133] The device further includes a second conversion module configured to, for a target table name in the first path list or the second path list, acquire a target file path corresponding to the target table name, determine a first target serialization file associated with the target file path, extract first target table data mapped by the target table name from the first target serialization file, and convert a format of the first target table data into a target format recognizable by a target program.
[0134] The device further includes a second determination module configured to perform a hash operation on the first file path to obtain a first hash value, determine the first hash value as a file name of the first serialization file, perform a hash operation on the second file path to obtain a second hash value, and determine the second hash value as a file name of the second serialization file.
[0135] The device further includes a first update module configured to acquire an updated shared table file, wherein the updated shared table file is a file generated after performing an editing operation on table data in the shared table file; acquire an updated to-be-shared table file, wherein the updated to-be-shared table file is a file generated after performing an editing operation on table data in the to-be-shared table file; perform serialization processing on the updated shared table file and the updated to-be-shared table file to obtain a first updated serialization file corresponding to the updated shared table file and a second updated serialization file corresponding to the updated to-be-shared table file; determine a first file associated with a file path of the updated shared table file based on the first association relationship; replace the first file in the first association relationship with the first updated serialization file; determine a second file associated with a file path of the updated to-be-shared table file based on the second association relationship; and replace the second file in the second association relationship with the second updated serialization file.
[0136] The device further includes a third conversion module configured to, for a target table name in the first path list or the second path list, acquire a target file path corresponding to the target table name, determine a second target serialization file associated with the target file path based on the target file path, extract second target table data mapped by the target table name from the second target serialization file, and convert a format of the second target table data into a target format recognizable by a target program.
[0137] The device further includes a third determination module configured to traverse a shared folder in which the shared table file is located, acquire a modification time corresponding to the shared table file and a first file path corresponding to the shared table file, determine a third file associated with the first file path based on the first association relationship, acquire a generation time of the third file, and determine an updated shared table file based on the generation time of the third file and the modification time corresponding to the shared table file.
[0138] The device further includes a fourth determining module configured to determine that the shared table file is an updated shared table file if the modification time corresponding to the shared table file is later than the generation time of the third file; and determine that the shared table file is not an updated shared table file if the modification time corresponding to the shared table file is not later than the generation time of the third file.
[0139] The device further includes a fifth determining module configured to traverse a shared folder where the shared table file is located, to obtain a modification time corresponding to the shared table file and a second file path corresponding to the shared table file; determine a fourth file associated with the second file path based on the second association relationship; obtain a generation time of the fourth file; and determine an updated shared table file based on the generation time of the fourth file and the modification time corresponding to the shared table file.
[0140] The device further includes a sixth determining module configured to determine that the shared table file is an updated shared table file if the modification time corresponding to the shared table file is later than the generation time of the fourth file; and determine that the shared table file is not an updated shared table file if the modification time corresponding to the shared table file is not later than the generation time of the fourth file.
[0141] The first path list and the second path list are stored in the relationship storage unit; the device further includes a fourth converting module configured to obtain an added shared table file and a third file path of the added shared table file, determine a third table name corresponding to a shared worksheet included in the added shared table file; update the relationship storage unit based on the third table name and the third file path; serialize the added shared table file to obtain a third serialized file corresponding to the added shared table file, where the third serialized file has a third association relationship with the third file path; and extract third target table data mapped by a storage table name stored in the updated relationship storage unit, and convert a format of the third target table data into a target format recognizable by a target program.
[0142] The device further includes a second updating module configured to determine whether the third table name exists in the relationship storage unit; add the third file path to the first path list or the second path list if the third table name exists in the relationship storage unit; and generate a third file path list corresponding to the third table name in the relationship storage unit if the third table name does not exist in the relationship storage unit; where the third path list includes a corresponding relationship between the third table name and the third file path.
[0143] The device further includes a first extraction module configured to acquire a storage file path corresponding to the storage table name, determine a serialized file associated with the storage file path, and extract third target table data mapped by the storage table name from the serialized file associated with the storage file path.
[0144] The device further includes a first detection module configured to detect whether there is identical data row identifier information in table data mapped by the target table name in the first target serialized file, and generate an alarm information to prompt a file name and a file path of a table file to which the table data with the identical identifier information belongs if there is the identical data row identifier information.
[0145] The embodiment further provides an electronic device including a processor and a memory, the memory storing machine executable instructions capable of being executed by the processor, and the processor executes the machine executable instructions to implement the data processing method. The electronic device can be a server or a terminal device.
[0146] Referring to Figure 5 The electronic device includes a processor 100 and a memory 101, and the memory 101 stores machine executable instructions capable of being executed by the processor 100, and the processor 100 executes the machine executable instructions to implement the data processing method.
[0147] Further, Figure 5 The electronic device shown in the figure further includes a bus 102 and a communication interface 103, and the processor 100, the communication interface 103 and the memory 101 are connected through the bus 102.
[0148] The memory 101 can include a high-speed random access memory (RAM) and can also include a non-volatile memory such as at least one disk memory. The communication between the system network element and at least one other network element is realized through at least one communication interface 103 (which can be wired or wireless), and the Internet, a wide area network, a local area network, a metropolitan area network, etc. can be used. The bus 102 can be an ISA bus, a PCI bus or an EISA bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For the convenience of representation, Figure 5 Only one bidirectional arrow is used in the figure to represent the bus, but it does not mean that there is only one bus or only one type of bus.
[0149] The processor 100 can be an integrated circuit chip with processing capability. In implementation, the steps of the above method can be completed by integrated logic circuits or by instructions in the form of software in the processor 100. The processor 100 described above can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), and the like; or can be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware component. The disclosed methods, steps and logic block diagrams in the embodiments of the present application can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor. The steps of the method disclosed in combination with the embodiments of the present application can be directly embodied as a hardware code processor for execution, or a combination of hardware and software modules in the code processor for execution. The software module can be located in a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, and the like storage medium mature in the art. The storage medium is located in the memory 101, and the processor 100 reads the information in the memory 101, and combines the hardware to complete the steps of the method of the above-mentioned embodiments.
[0150] The processor in the above electronic device, by executing machine executable instructions, can realize the following operations of the above data processing method: determining a first table name corresponding to a shared worksheet contained in a shared table file; obtaining a first path list corresponding to the first table name; wherein the first path list includes: a corresponding relationship between the first table name and a first file path of the shared table file; obtaining a to-be-shared table file and a second file path of the to-be-shared table file, determining whether a second table name corresponding to a to-be-shared worksheet contained in the to-be-shared table file belongs to the first table name; if the second table name belongs to the first table name, adding the second file path to the first path list; if the second table name does not belong to the first table name, generating a second path list corresponding to the second table name; wherein the second path list includes: a corresponding relationship between the second table name and the second file path; for a target table name in the first path list or the second path list, obtaining a target file path corresponding to the target table name, determining a target table file based on the target file path, extracting target table data from the target table file, and converting a format of the target table data into a target format recognizable by a target program.
[0151] In this way, the user can create an independent table file to be shared according to the business requirement, if the table name in the table file to be shared is consistent with the table name in the shared table file, the path of the table file to be shared is added to the path list corresponding to the same table name, if the names are inconsistent, an independent path list is generated according to the table name of the table file to be shared, finally, the corresponding table file is read from the path list corresponding to the table name, the target table data is extracted and the format conversion is completed. In this way, multiple users can simultaneously edit the same shared table file through their respective table files to be shared, and then aggregate the file paths corresponding to the same name table to finally realize the aggregation of the multi-source data corresponding to the same name table and the target formatting output, effectively avoiding the workload blockage during collaboration, and significantly improving the collaboration editing efficiency.
[0152] The above-mentioned table file to be shared includes multiple; the data row identification information of the table data included in different table files to be shared is different.
[0153] The processor in the above-mentioned electronic device can realize the following operations of the above-mentioned data processing method by executing machine executable instructions: serializing the shared table file and the table file to be shared to obtain a first serialized file corresponding to the shared table file and a second serialized file corresponding to the table file to be shared; in the first serialized file, the first table name has a first mapping relationship with the table data in the shared worksheet corresponding to the first table name; in the second serialized file, the second table name has a second mapping relationship with the table data in the shared worksheet corresponding to the second table name; the first serialized file has a first association relationship with the first file path; the second serialized file has a second association relationship with the second file path;
[0154] The processor in the above-mentioned electronic device can realize the following operations of the above-mentioned data processing method by executing machine executable instructions: for the target table name in the first path list or the second path list, obtaining the target file path corresponding to the target table name, determining the first target serialized file associated with the target file path, extracting the first target table data mapped by the target table name from the first target serialized file, and converting the format of the first target table data into a target format recognizable by the target program.
[0155] The processor in the above-mentioned electronic device can realize the following operations of the above-mentioned data processing method by executing machine executable instructions: performing a hash operation on the first file path to obtain a first hash value, and determining the first hash value as the file name of the first serialized file; performing a hash operation on the second file path to obtain a second hash value, and determining the second hash value as the file name of the second serialized file.
[0156] The processor in the electronic device, by executing machine executable instructions, can implement the following operations of the data processing method: obtaining an updated shared table file; wherein the updated shared table file is a file generated after editing the table data in the shared table file; obtaining an updated to-be-shared table file; wherein the updated to-be-shared table file is a file generated after editing the table data in the to-be-shared table file; performing serialization processing on the updated shared table file and the updated to-be-shared table file to obtain a first updated serialization file corresponding to the updated shared table file and a second updated serialization file corresponding to the updated to-be-shared table file; determining a first file associated with the file path of the updated shared table file based on the first association relationship; replacing the first file in the first association relationship with the first updated serialization file; determining a second file associated with the file path of the updated to-be-shared table file based on the second association relationship; and replacing the second file in the second association relationship with the second updated serialization file.
[0157] The processor in the electronic device, by executing machine executable instructions, can implement the following operations of the data processing method: for a target table name in the first path list or the second path list, obtaining a target file path corresponding to the target table name, determining a second target serialization file associated with the target file path based on the target file path, extracting second target table data mapped by the target table name from the second target serialization file, and converting the format of the second target table data into a target format recognizable by the target program.
[0158] The processor in the electronic device, by executing machine executable instructions, can implement the following operations of the data processing method: traversing a shared folder where the shared table file is located, obtaining a modification time corresponding to the shared table file and a first file path corresponding to the shared table file; determining a third file associated with the first file path based on the first association relationship; obtaining a generation time of the third file, and determining the updated shared table file based on the generation time of the third file and the modification time corresponding to the shared table file.
[0159] The processor in the electronic device, by executing machine executable instructions, can implement the following operations of the data processing method: if the modification time corresponding to the shared table file is later than the generation time of the third file, determining that the shared table file is the updated shared table file; and if the modification time corresponding to the shared table file is not later than the generation time of the third file, determining that the shared table file is not the updated shared table file.
[0160] The processor in the electronic device, by executing machine executable instructions, can realize the following operations of the data processing method: traversing a to-be-shared folder where a to-be-shared table file is located, obtaining a modification time corresponding to the to-be-shared table file and a second file path corresponding to the to-be-shared table file; determining a fourth file associated with the second file path based on a second association relationship; obtaining a generation time of the fourth file, and determining an updated to-be-shared table file based on the generation time of the fourth file and the modification time corresponding to the to-be-shared table file.
[0161] The processor in the electronic device, by executing machine executable instructions, can realize the following operations of the data processing method: if the modification time corresponding to the to-be-shared table file is later than the generation time of the fourth file, determining that the to-be-shared table file is the updated to-be-shared table file; if the modification time corresponding to the to-be-shared table file is not later than the generation time of the fourth file, determining that the to-be-shared table file is not the updated to-be-shared table file.
[0162] The first path list and the second path list are stored in the relationship storage unit; the processor in the electronic device, by executing machine executable instructions, can realize the following operations of the data processing method: obtaining a newly added to-be-shared table file and a third file path of the newly added to-be-shared table file, and determining a third table name corresponding to a to-be-shared worksheet contained in the newly added to-be-shared table file; updating the relationship storage unit based on the third table name and the third file path; performing serialization processing on the newly added to-be-shared table file to obtain a third serialized file corresponding to the newly added to-be-shared table file, wherein the third serialized file has a third association relationship with the third file path; and extracting third target table data mapped by a storage table name stored in the updated relationship storage unit, and converting a format of the third target table data into a target format recognizable by a target program.
[0163] The processor in the electronic device, by executing machine executable instructions, can realize the following operations of the data processing method: determining whether the third table name exists in the relationship storage unit; if the third table name exists in the relationship storage unit, adding the third file path to the first path list or the second path list; if the third table name does not exist in the relationship storage unit, generating a third file path list corresponding to the third table name in the relationship storage unit; wherein the third path list includes a corresponding relationship between the third table name and the third file path.
[0164] The processor in the electronic device can implement the following operations of the data processing method by executing the machine executable instructions: obtaining a storage file path corresponding to a storage table name, determining a serialized file associated with the storage file path, extracting third target table data mapped by the storage table name from the serialized file associated with the storage file path.
[0165] The processor in the electronic device can implement the following operations of the data processing method by executing the machine executable instructions: detecting whether there is identical data row identifier information in table data mapped by a target table name in a first target serialized file; if there is identical data row identifier information, generating alarm information to prompt a file name and a file path of a table file to which the table data with the identical identifier information belongs.
[0166] The embodiment also provides a machine readable storage medium, which stores machine executable instructions. When the machine executable instructions are called and executed by a processor, the machine executable instructions cause the processor to implement the data processing method.
[0167] The machine executable instructions stored in the machine readable storage medium can implement the following operations of the data processing method by executing the machine executable instructions: determining a first table name corresponding to a shared worksheet included in a shared table file; obtaining a first path list corresponding to the first table name; the first path list includes a corresponding relationship between the first table name and a first file path of the shared table file; obtaining a to-be-shared table file and a second file path of the to-be-shared table file, and determining whether a second table name corresponding to a to-be-shared worksheet included in the to-be-shared table file belongs to the first table name; if the second table name belongs to the first table name, adding the second file path to the first path list; if the second table name does not belong to the first table name, generating a second path list corresponding to the second table name; the second path list includes a corresponding relationship between the second table name and the second file path; obtaining a target file path corresponding to a target table name in the first path list or the second path list, determining a target table file based on the target file path, extracting target table data from the target table file, and converting a format of the target table data into a target format recognizable by a target program.
[0168] In the mode, a user can create an independent table file to be shared according to a business requirement, if the table name in the table file to be shared is consistent with the table name in the shared table file, the path of the table file to be shared is added to the path list corresponding to the same table name, if the names are inconsistent, an independent path list is generated according to the table name of the table file to be shared, finally, the corresponding table file is read from the path list corresponding to the table name, the target table data is extracted and the format conversion is completed. In the mode, multiple users can simultaneously edit the same shared table file through the respective table file to be shared, then, the files corresponding to the same name table are aggregated, and finally, the aggregation and target formatting output of the multiple source data corresponding to the same name table are realized, effectively avoiding the workload blockage during collaboration, and significantly improving the collaboration editing efficiency.
[0169] The above-mentioned table file to be shared includes multiple; the data row identification information of the table data contained in different table files to be shared is different.
[0170] The machine executable instructions stored in the above-mentioned machine readable storage medium can realize the following operations in the above-mentioned data processing method by executing the machine executable instructions: the shared table file and the table file to be shared are serialized to obtain a first serialized file corresponding to the shared table file and a second serialized file corresponding to the table file to be shared; in the first serialized file, the first table name has a first mapping relationship with the table data in the shared worksheet corresponding to the first table name; in the second serialized file, the second table name has a second mapping relationship with the table data in the shared worksheet corresponding to the second table name; the first serialized file has a first association relationship with the first file path; the second serialized file has a second association relationship with the second file path;
[0171] The machine executable instructions stored in the above-mentioned machine readable storage medium can realize the following operations in the above-mentioned data processing method by executing the machine executable instructions: for a target table name in the first path list or the second path list, a target file path corresponding to the target table name is obtained, a first target serialized file associated with the target file path is determined, first target table data mapped by the target table name is extracted from the first target serialized file, and the format of the first target table data is converted into a target format recognizable by a target program.
[0172] The machine executable instructions stored in the above-mentioned machine readable storage medium can realize the following operations in the above-mentioned data processing method by executing the machine executable instructions: the first file path is subjected to a hash operation to obtain a first hash value, the first hash value is determined as the file name of the first serialized file; the second file path is subjected to a hash operation to obtain a second hash value, and the second hash value is determined as the file name of the second serialized file.
[0173] The machine executable instructions stored in the machine readable storage medium can realize the following operations in the data processing method: obtaining an updated shared table file; wherein the updated shared table file is a file generated after editing table data in the shared table file; obtaining an updated to-be-shared table file; wherein the updated to-be-shared table file is a file generated after editing table data in the to-be-shared table file; performing serialization processing on the updated shared table file and the updated to-be-shared table file to obtain a first updated serialization file corresponding to the updated shared table file and a second updated serialization file corresponding to the updated to-be-shared table file; determining a first file associated with the file path of the updated shared table file based on the first association relationship; replacing the first file in the first association relationship with the first updated serialization file; determining a second file associated with the file path of the updated to-be-shared table file based on the second association relationship; and replacing the second file in the second association relationship with the second updated serialization file.
[0174] The machine executable instructions stored in the machine readable storage medium can realize the following operations in the data processing method: obtaining a target file path corresponding to a target table name for the target table name in the first path list or the second path list, determining a second target serialization file associated with the target file path based on the target file path, extracting second target table data mapped by the target table name from the second target serialization file, and converting the format of the second target table data into a target format recognizable by a target program.
[0175] The machine executable instructions stored in the machine readable storage medium can realize the following operations in the data processing method: traversing a shared folder where the shared table file is located, obtaining a modification time corresponding to the shared table file and a first file path corresponding to the shared table file; determining a third file associated with the first file path based on the first association relationship; obtaining a generation time of the third file, and determining the updated shared table file based on the generation time of the third file and the modification time corresponding to the shared table file.
[0176] The machine executable instructions stored in the machine readable storage medium can realize the following operations in the data processing method: if the modification time corresponding to the shared table file is later than the generation time of the third file, determining that the shared table file is the updated shared table file; and if the modification time corresponding to the shared table file is not later than the generation time of the third file, determining that the shared table file is not the updated shared table file.
[0177] The machine executable instructions stored in the machine readable storage medium can realize the following operation in the data processing method: traversing the shared folder where the shared table file is located, obtaining the modification time corresponding to the shared table file and the second file path corresponding to the shared table file; determining the fourth file associated with the second file path based on the second association relationship; obtaining the generation time of the fourth file, and determining the updated shared table file based on the generation time of the fourth file and the modification time corresponding to the shared table file.
[0178] The machine executable instructions stored in the machine readable storage medium can realize the following operation in the data processing method: if the modification time corresponding to the shared table file is later than the generation time of the fourth file, determining that the shared table file is the updated shared table file; if the modification time corresponding to the shared table file is not later than the generation time of the fourth file, determining that the shared table file is not the updated shared table file.
[0179] The first path list and the second path list are stored in the relationship storage unit; the machine executable instructions stored in the machine readable storage medium can realize the following operation in the data processing method: obtaining the newly added shared table file and the third file path of the newly added shared table file, determining the third table name corresponding to the shared worksheet contained in the newly added shared table file; updating the relationship storage unit based on the third table name and the third file path; serializing the newly added shared table file to obtain the third serialized file corresponding to the newly added shared table file, wherein the third serialized file has a third association relationship with the third file path; extracting the third target table data mapped by the storage table name stored in the updated relationship storage unit, and converting the format of the third target table data into a target format recognizable by the target program.
[0180] The machine executable instructions stored in the machine readable storage medium can realize the following operation in the data processing method: determining whether the third table name exists in the relationship storage unit; if the third table name exists in the relationship storage unit, adding the third file path to the first path list or the second path list; if the third table name does not exist in the relationship storage unit, generating the third file path list corresponding to the third table name in the relationship storage unit; wherein the third path list includes the corresponding relationship between the third table name and the third file path.
[0181] The machine executable instructions stored in the machine readable storage medium can realize the following operation in the data processing method by executing the machine executable instructions: obtaining a storage file path corresponding to a storage table name, determining a serialized file associated with the storage file path, and extracting third target table data mapped by the storage table name from the serialized file associated with the storage file path.
[0182] The machine executable instructions stored in the machine readable storage medium can realize the following operation in the data processing method by executing the machine executable instructions: detecting whether there is same data row identifier information in table data mapped by a target table name in a first target serialized file; and if there is same data row identifier information, generating alarm information to prompt a file name and a file path of a table file to which the table data with the same identifier information belongs.
[0183] The data processing method, device and computer program product of the electronic equipment provided by the embodiment of the application include a computer readable storage medium storing program codes, instructions included in the program codes can be used to execute the method in the foregoing method embodiment, and specific implementation can be referred to the method embodiment, and will not be repeated here.
[0184] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the system and device described above can refer to the corresponding process in the foregoing method embodiment, and will not be repeated here.
[0185] In addition, in the description of the embodiment of the application, unless otherwise explicitly specified and limited, the terms "mounting", "connection" and "connection" should be understood in a broad sense, for example, can be fixedly connected, can also be detachably connected, or integrally connected; can be mechanically connected, can also be electrically connected; can be directly connected, can also be indirectly connected through an intermediate medium, can be the communication inside two elements. For those skilled in the art, the specific meaning of the above terms in the application can be understood according to the specific circumstances.
[0186] If the functions are implemented in the form of software function units and sold or used as independent products, they can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the present application essentially or the parts that contribute to the prior art or parts of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a number of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in various embodiments of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and various media that can store program codes.
[0187] In the description of the present application, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer" and the like indicate the orientation or positional relationship based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present application and simplifying the description, and do not indicate or imply that the devices or elements referred to must have a particular orientation, be constructed and operated in a particular orientation, and therefore cannot be understood as limiting the present application. In addition, the terms "first", "second", "third" are only for descriptive purposes and cannot be understood as indicating or implying relative importance.
[0188] Finally, it should be noted that: the above embodiments are only specific embodiments of the present application, used to illustrate the technical solutions of the present application, and are not limited thereto, the protection scope of the present application is not limited thereto, although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art within the technical scope disclosed by the present application can still modify or easily think of changes to the technical solutions recorded in the foregoing embodiments, or make equivalent replacements to part of the technical features; and these modifications, changes or replacements do not make the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A data processing method, characterized in that, The method includes: Determine the name of the first table corresponding to the shared worksheet contained in the shared spreadsheet file; obtain the first path list corresponding to the first table name; wherein, the first path list includes: the correspondence between the first table name and the first file path of the shared spreadsheet file; Obtain the table file to be shared and the second file path of the table file to be shared, and determine whether the second table name corresponding to the worksheet to be shared contained in the table file to be shared belongs to the first table name; If the second table name belongs to the first table name, add the second file path to the first path list; if the second table name does not belong to the first table name, generate a second path list corresponding to the second table name; wherein, the second path list includes: the correspondence between the second table name and the second file path; For the target table name in the first path list or the second path list, obtain the target file path corresponding to the target table name, determine the target table file based on the target file path, extract the target table data from the target table file, and convert the format of the target table data into a target format that the target program can recognize.
2. The method according to claim 1, characterized in that, The table files to be shared include multiple files; the data row identification information of the table data contained in different table files to be shared is different.
3. The method according to claim 1, characterized in that, After the step of generating the second path list corresponding to the second table name, the method further includes: The shared table file and the table file to be shared are serialized to obtain a first serialized file corresponding to the shared table file and a second serialized file corresponding to the table file to be shared; wherein, in the first serialized file, the first table name has a first mapping relationship with the table data in the shared worksheet corresponding to the first table name; in the second serialized file, the second table name has a second mapping relationship with the table data in the shared worksheet corresponding to the second table name; the first serialized file has a first association relationship with the first file path; and the second serialized file has a second association relationship with the second file path.
4. The method according to claim 3, characterized in that, After the steps of obtaining the first serialized file corresponding to the shared table file and the second serialized file corresponding to the table file to be shared, the method further includes: For a target table name in the first path list or the second path list, obtain the target file path corresponding to the target table name, determine the first target serialization file associated with the target file path, extract the first target table data mapped by the target table name from the first target serialization file, and convert the format of the first target table data into a target format that the target program can recognize.
5. The method according to claim 3, characterized in that, The method further includes: The first file path is hashed to obtain a first hash value, and the first hash value is determined as the file name of the first serialized file. The second file path is hashed to obtain a second hash value, which is then used as the filename of the second serialized file.
6. The method according to claim 4, characterized in that, After the step of converting the target table data into a target format recognizable by the target program, the method includes: Obtain the updated shared table file; wherein, the updated shared table file is a file generated after editing the table data in the shared table file; Obtain the updated table file to be shared; wherein, the updated table file to be shared is a file generated after editing the table data in the table file to be shared; The updated shared table file and the updated table file to be shared are serialized to obtain a first updated serialized file corresponding to the updated shared table file and a second updated serialized file corresponding to the updated table file to be shared. Based on the first association relationship, determine the first file associated with the file path of the updated shared table file; replace the first file in the first association relationship with the first updated serialization file; Based on the second association, determine the second file associated with the file path of the updated table file to be shared; replace the second file in the second association with the second updated serialization file.
7. The method according to claim 6, characterized in that, After the step of replacing the second file in the second association relationship with the second updated serialization file, the method further includes: For the target table name in the first path list or the second path list, obtain the target file path corresponding to the target table name, determine the second target serialization file associated with the target file path based on the target file path, extract the second target table data mapped by the target table name from the second target serialization file, and convert the format of the second target table data into a target format that the target program can recognize.
8. The method according to claim 6, characterized in that, The step of obtaining the updated shared table file includes: Traverse the shared folder where the shared table file is located, obtain the modification time corresponding to the shared table file, and the first file path corresponding to the shared table file; Based on the first association relationship, a third file associated with the first file path is determined; Obtain the generation time of the third file, and determine the updated shared table file based on the generation time of the third file and the modification time corresponding to the shared table file.
9. The method according to claim 8, characterized in that, The step of determining the updated shared table file based on the generation time of the third file and the modification time of the corresponding shared table file includes: If the modification time of the shared table file is later than the generation time of the third file, the shared table file is determined to be the updated shared table file. If the modification time of the shared table file is not later than the generation time of the third file, it is determined that the shared table file is not the updated shared table file.
10. The method according to claim 6, characterized in that, The step of obtaining the updated table file to be shared includes: Traverse the folder containing the table file to be shared, obtain the modification time of the table file to be shared, and the second file path of the table file to be shared; Based on the second association relationship, a fourth file associated with the second file path is determined; Obtain the generation time of the fourth file, and determine the updated table file to be shared based on the generation time of the fourth file and the modification time corresponding to the table file to be shared.
11. The method according to claim 10, characterized in that, The step of determining the updated table file to be shared based on the generation time of the fourth file and the modification time corresponding to the table file to be shared includes: If the modification time of the table file to be shared is later than the generation time of the fourth file, the table file to be shared is determined to be the updated table file to be shared. If the modification time of the table file to be shared is not later than the generation time of the fourth file, it is determined that the table file to be shared is not the updated table file to be shared.
12. The method according to claim 4, characterized in that, The first path list and the second path list are stored in a relational storage unit; After the step of converting the format of the target table data into a target format recognizable by the target program, the method further includes: Obtain the newly added table file to be shared, and the third file path of the newly added table file to be shared, and determine the name of the third table corresponding to the worksheet to be shared contained in the newly added table file to be shared; Update the relation storage unit based on the third table name and the third file path; The newly added table file to be shared is serialized to obtain a third serialized file corresponding to the newly added table file to be shared, wherein the third serialized file has a third association relationship with the third file path; For the storage table names stored in the updated relational storage unit, extract the third target table data mapped by the storage table names, and convert the format of the third target table data into a target format that the target program can recognize.
13. The method according to claim 12, characterized in that, The step of updating the relational storage unit based on the third table name and the third file path includes: Determine whether the name of the third table exists in the relational storage unit; If the third table name exists in the relational storage unit, add the third file path to the first path list or the second path list; If the third table name does not exist in the relational storage unit, a list of third file paths corresponding to the third table name is generated in the relational storage unit; wherein, the list of third paths includes: the correspondence between the third table name and the third file path.
14. The method according to claim 12, wherein the step of extracting the third target table data mapped to the stored table name includes: Obtain the storage file path corresponding to the storage table name, determine the serialization file associated with the storage file path, and extract the third target table data mapped by the storage table name from the serialization file associated with the storage file path.
15. The method according to claim 4, characterized in that, Before the step of extracting the first target table data mapped from the first target serialized file, the method includes: Detect whether there is the same data row identification information in the table data mapped to the target table name in the first target serialization file; If identical data row identifiers exist, an alarm message is generated to indicate the file name and file path of the table file to which the table data with the same identifiers belong.
16. A data processing apparatus, characterized in that, The device includes: The first acquisition module is used to determine the first table name corresponding to the shared worksheet contained in the shared table file; and to acquire a first path list corresponding to the first table name; wherein, the first path list includes: the correspondence between the first table name and the first file path of the shared table file; The second acquisition module is used to acquire the table file to be shared and the second file path of the table file to be shared, and to determine whether the second table name corresponding to the worksheet to be shared contained in the table file to be shared belongs to the first table name; The first determining module is used to add the second file path to the first path list if the second table name belongs to the first table name; and to generate a second path list corresponding to the second table name if the second table name does not belong to the first table name; wherein the second path list includes: the correspondence between the second table name and the second file path; The first conversion module is used to obtain the target file path corresponding to the target table name in the first path list or the second path list, determine the target table file based on the target file path, extract the target table data from the target table file, and convert the format of the target table data into a target format that the target program can recognize.
17. An electronic device, characterized in that, The method includes a processor and a memory, the memory storing machine-executable instructions that can be executed by the processor, the processor executing the machine-executable instructions to implement the data processing method according to any one of claims 1-15.
18. A machine-readable storage medium, characterized in that, The machine-readable storage medium stores machine-executable instructions, which, when invoked and executed by a processor, cause the processor to implement the data processing method according to any one of claims 1-15.
Citation Information
Patent Citations
Document editing method and device, computer storage medium and terminal
CN112395836A
Data sharing method and device between different databases, equipment and medium
CN116860851A
Data processing method and device, equipment, medium and product
CN117251449A
Disk data backup method, device and equipment
CN119557142A
Table processing method and device, equipment and storage medium
CN119807144A