File processing method and apparatus, computer-readable storage medium, and electronic device
Automatically importing file branches and data branch information in game development through the configuration file table solves the problem of low file processing efficiency in traditional game development, achieves efficient file processing and reduces manual errors.
Patent Information
- Application Number
- CN202310838163.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-07
- Publication Date
- 2025-10-10
- Estimated Expiration
- 2043-07-07
AI Technical Summary
In traditional game development, file processing efficiency is low, and the table import process requires manual processing of differences, which is prone to accidental deletion and omission, wasting manpower.
The file branch information and data branch information are read through the configuration file table, and the data is automatically imported into the corresponding code branch, reducing manual intervention.
It improves the efficiency of file processing, reduces the number of files retained on the import table server, and reduces the error rate of manual processing.
Smart Images

Figure CN116910059B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computers, and in particular, to a file processing method and device, a computer-readable storage medium, and an electronic device. Background Art
[0002] Currently, during the game development phase, game planners typically fill out content such as gameplay and numerical values into files like Excel and JSON. These data is then imported into the game code using tools. This process is called importing tables. Game development typically involves parallel development of multiple code branches. Before the game is released, these branches are merged back into the main trunk. Files in different branches contain different content, and the differences between the branches are processed and merged into a single file. This process is called merging tables.
[0003] Traditional table import methods require creating a file for each code branch. Modifying data in a particular code branch requires modifying the file for that code branch, resulting in low file processing efficiency and a large number of files on the import server. Traditional table merging methods also require manual processing of differences between imported files, which can easily lead to accidental deletions and omissions, wasting significant manpower.
[0004] To address the above-mentioned problems, no effective solutions have been proposed so far. Summary of the Invention
[0005] At least some embodiments of the present disclosure provide a file processing method and device, a computer-readable storage medium, and an electronic device to at least solve the technical problem of low efficiency in importing files in related technologies.
[0006] According to one embodiment of the present disclosure, a file processing method is provided, comprising: in response to a change in first data in a first file, reading first configuration information corresponding to the first file from a configuration file table, wherein the configuration file table is used to store configuration information of different files; in response to the first configuration information containing first file branch information, determining first data branch information corresponding to the first data, wherein the first file branch information is used to represent a first code branch to be imported into a first file among multiple code branches, and the first data branch information is used to represent a second code branch to be imported into a first data among multiple code branches; and based on the first data branch information, importing the first data in the first file into the second code branch.
[0007] According to one of the embodiments of the present disclosure, a file processing apparatus is also provided, comprising: a reading module configured to read first configuration information corresponding to a first file from a configuration file table in response to a change in first data in the first file, wherein the configuration file table is configured to store configuration information of different files; a determining module configured to determine first data branch information corresponding to the first data in response to the first configuration information containing first file branch information, wherein the first file branch information is configured to represent a first code branch to which the first file is to be imported among a plurality of code branches, and the first data branch information is configured to represent a second code branch to which the first data is to be imported among the plurality of code branches; and an importing module configured to import the first data in the first file to the second code branch based on the first data branch information.
[0008] According to one of the embodiments of the present disclosure, a computer readable storage medium is also provided, wherein the computer readable storage medium stores a computer program, and the computer program is configured to execute the file processing method in any of the above embodiments when running.
[0009] According to one of the embodiments of the present disclosure, an electronic device is also provided, comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the computer program to perform the file processing method in any of the above embodiments.
[0010] In at least some embodiments of the present disclosure, first configuration information corresponding to a first file is read from a configuration file table in response to a change in first data in the first file; first data branch information corresponding to the first data is determined in response to the first configuration information containing first file branch information; and the first data of the first file is imported to a second code branch based on the first data branch information. It should be noted that, through the first file branch information and the first data branch information, the data imported to different code branches in a file is modified, and the data imported to different code branches is respectively imported to different code branches, so that the technical effects of improving the processing efficiency of the table importing file and reducing the number of files retained on the table importing server are achieved, and thus the technical problem of low efficiency of table importing of files in the related art is solved. BRIEF DESCRIPTION OF DRAWINGS
[0011] The accompanying drawings, which are included to provide a further understanding of the present disclosure and constitute a part of this application, illustrate certain illustrative embodiments of the present disclosure and are used to explain the present disclosure, but should not be construed as limiting the present disclosure. In the drawings:
[0012] Figure 1 is a hardware structure block diagram of a mobile terminal of a file processing method according to an embodiment of the present disclosure;
[0013] Figure 2is a flow chart of a file processing method according to one of the embodiments of the present disclosure;
[0014] Figure 3 is a flow chart of an optional file table guiding according to the embodiments of the present disclosure;
[0015] Figure 4 is a flow chart of an optional file table combining according to the embodiments of the present disclosure
[0016] Figure 5 is a structural block diagram of a file processing device according to one of the embodiments of the present disclosure;
[0017] Figure 6 is a schematic diagram of an electronic device according to one of the embodiments of the present disclosure. DETAILED DESCRIPTION
[0018] In order to make the personnel in the art better understand the present disclosure scheme, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only a part of the embodiments of the present disclosure, not all the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by those skilled in the art without creative labor should belong to the scope of protection of the present disclosure.
[0019] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily describe a specific order or sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device including a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to these processes, methods, products or devices.
[0020] In a possible embodiment, for the commonly used background in the computer field, after practice and careful research, the inventor still found that there is a technical problem of low file processing efficiency. Based on this, the application scenario of the embodiment of the present disclosure can be a scenario in which the machine runs a guide table service process, and the application game scenario can be a scenario in which game data is planned and edited or modified. The game type targeted is generally a game that requires modification of game parameters. A file processing method is proposed, and the technical concept adopted is that in response to a change in the first data in the first file, the first configuration information corresponding to the first file is read from the configuration file table; in response to the first configuration information containing the first file branch information, the first data branch information corresponding to the first data is determined; based on the first data branch information, the first data of the first file is imported into the second code branch. It should be noted that the first configuration information corresponding to the first file can be quickly found according to the configuration file table, and the first data branch information can be further determined according to the first configuration information, so that the first data can be quickly imported into the corresponding second code branch, thereby achieving the purpose of improving file processing efficiency and thus realizing the technical effect of efficient file processing.
[0021] The above method embodiments involved in the present disclosure can be executed in a mobile terminal, a computer terminal, or a similar computing device. Taking running on a mobile terminal as an example, the mobile terminal can be a smart phone, a tablet computer, a PDA, a mobile Internet device, a PAD, a game console, or other terminal device. Figure 1 FIG is a hardware structure block diagram of a mobile terminal of a file processing method according to an embodiment of the present disclosure. Figure 1 As shown, the mobile terminal may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a central processing unit (CPU), a graphics processing unit (GPU), a digital signal processing (DSP) chip, a microprocessor (MCU), a field-programmable logic device (FPGA), a neural network processor (NPU), a tensor processing unit (TPU), an artificial intelligence (AI) type processor, etc.) and a memory 104 for storing data. In one embodiment of the present disclosure, it may also include: an input and output device 108 and a display device 110.
[0022] In some optional embodiments mainly based on gaming scenarios, the above-mentioned device can also provide a human-computer interaction interface with a touch-sensitive surface, which can sense finger contact and / or gestures to perform human-computer interaction with a graphical user interface (GUI). The human-computer interaction functions may include the following interactions: creating web pages, drawing, word processing, making electronic documents, games, video conferencing, instant messaging, sending and receiving emails, call interface, playing digital videos, playing digital music and / or web browsing, etc. The executable instructions for executing the above-mentioned human-computer interaction functions are configured / stored in a computer program product or readable storage medium executable by one or more processors.
[0023] Those skilled in the art will understand that Figure 1 The structure shown is only for illustration and does not limit the structure of the mobile terminal. Figure 1 More or fewer components than shown, or with Figure 1 Different configurations shown.
[0024] According to one embodiment of the present disclosure, an embodiment of a file processing method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0025] In a possible implementation, an embodiment of the present disclosure provides a file processing method, which is applied to the aforementioned mobile terminal, computer terminal, or similar computing device. Figure 2 is a flowchart of a file processing method according to one embodiment of the present disclosure. Figure 2 As shown, the method includes the following steps:
[0026] Step S202 : in response to a change in first data in the first file, reading first configuration information corresponding to the first file from a configuration file table, wherein the configuration file table is used to store configuration information of different files.
[0027] The first file mentioned above can be a file that a user fills out during code development to modify the code. This file contains the data that needs to be modified and needs to be imported into the code via table import. For example, during the game development phase, the first file can be an Excel, JSON, or other file filled out by the game planner, but is not limited to this.
[0028] The first data may be data added or modified by the user in the first file, for example, data entered in an Excel file by a game planner to modify gameplay or values. The first data may be stored in a data table contained in the first file, in rows.
[0029] The above-mentioned configuration file table can be a data table used to store configuration information of different files during the import process. The configuration information can be the file name, category, storage path and other information. If a file needs to be imported into a certain code branch, it is necessary to add a file branch information to the configuration information. For example, a "branch number" column can be added to the configuration file table to mark the code branch by recording the code branch number; if the file can be imported into all code branches and code trunks, there is no need to add file branch information, for example, there is no need to fill in the "branch number" column in the configuration file table.
[0030] In an optional embodiment, when a game planner needs to adjust gameplay, values, and other content, a first file can be created and specific data can be filled in the first file. At this time, it can be determined that the first data in the first file has changed. In order to achieve the purpose of importing the first file, the first configuration information corresponding to the first file can be read from the configuration file table through a pre-set interface to determine whether there is file branch information in the first configuration information.
[0031] Step S204, in response to the first configuration information containing the first file branch information, determine the first data branch information corresponding to the first data, wherein the first file branch information is used to represent the first code branch to which the first file is to be imported among multiple code branches, and the first data branch information is used to represent the second code branch to which the first data is to be imported among multiple code branches.
[0032] The first file branch information may be information used to mark the first code branch, and may be, but is not limited to, the branch number of the first code branch. The first data branch information may be information used to mark the second code branch, and may be, but is not limited to, the branch number of the second code branch. It should be noted that since the first data is stored in the data table of the first file, a "branch number" column may be added to the data table to record the data branch information.
[0033] The aforementioned multiple code branches may be code branches developed in parallel during the code development process, for example, may be all game code branches during the game development process.
[0034] In an optional embodiment, after reading the first configuration information corresponding to the first file, it is first determined whether the first configuration information contains the first file branch information, that is, whether the "branch number" column stores the branch number. If the first configuration information contains the first file branch information, that is, the "branch number" column stores the branch number, it means that the first file needs to be imported into the first code branch. Since the first file can store the first data imported into different code branches, it is necessary to further read the first data branch information corresponding to the first data from the first file, that is, in the data table storing the first data in the first file, determine whether the "branch number" column stores the branch number. If the "branch number" column stores the branch number, the branch number can be used as the first data branch information. Furthermore, since the first file may contain multiple data tables, different data tables can also be imported into different code branches. On this basis, it is necessary to determine the code branch imported by each data table. First, the branch number of the code branch to be imported into the data table can be read from the table name of the data table, and then the branch number of the code branch to be imported into the first data can be further read from the data table.
[0035] Step S206: Based on the first data branch information, import the first data in the first file into the second code branch.
[0036] In an optional embodiment, after reading out the first data branch information, the first data can be imported into the second code branch through the import table code according to the first data branch information, that is, based on the branch number of the second code branch. It should be noted that if there are multiple first data that need to be imported in the first file, each first data can be imported into the corresponding code branch in sequence based on the data branch information in the storage order. On this basis, since different data in the first file can also be imported into the same code branch, in order to improve the efficiency of importing, the data imported into the same code branch can be summarized each time according to the order of multiple code branches, and then imported at one time. Optionally, a data table can be established in advance to store the data that needs to be imported, and different data can be distinguished by different identification numbers (IdentityDocument).
[0037] For example, the first file stores a data copy to be imported into code branch No. 2, a data copy to be imported into code branch No. 6, and some data copies without data branch information added. In the process of importing the table, the data copy to be imported into code branch No. 2 can be imported into code branch No. 2, and the data copy to be imported into code branch No. 6 can be imported into code branch No. 6, and then imported into each code branch together with the data copy.
[0038] In an embodiment of the present invention, in response to a change in the first data in the first file, the first configuration information corresponding to the first file is read from the configuration file table; in response to the first configuration information containing the first file branch information, the first data branch information corresponding to the first data is determined; based on the first data branch information, the first data of the first file is imported into the second code branch. It should be noted that, through the first file branch information and the first data branch information, it is possible to modify the data imported into different code branches in one file, and import the data imported into different code branches into different code branches respectively, thereby achieving the technical effect of improving the processing efficiency of the import table file and reducing the number of files retained on the import table server, thereby solving the technical problem of low efficiency in importing files in the related art.
[0039] Optionally, determining the first data branch information corresponding to the first data includes: in response to the first file branch information being the same as the first preset branch information, determining the first data table storing the first data in the first file, wherein the first preset branch information is used to represent the preset code branch of the data currently to be imported among multiple code branches; and reading the first data branch information from the first data table.
[0040] The first preset branch information mentioned above may be information about the preset code branch for which data is currently to be imported, and may be, but is not limited to, the branch number of the preset code branch. It should be noted that, since multiple code branches are included during the code development phase, data for each code branch may be imported separately through multiple table imports. The preset code branch may be a code branch determined from the multiple code branches during each table import process.
[0041] In an optional embodiment, after reading the first file branch information from the first configuration information, it can be determined whether the first file branch information is the same as the first preset branch information. If they are the same, it indicates that the first file needs to be imported into the preset code branch, and further, all first data imported into the preset code branch needs to be read from the first file. If they are different, it indicates that the first file needs to be imported into other code branches, and the first file can be skipped. The first data in the first file will not be imported during this import process. Since the first file is usually composed of multiple data tables, the first data branch information can be read from the first data table.
[0042] Optionally, reading the first data branch information from the first data table includes: parsing the table name of the first data table to determine whether the first table branch information corresponding to the first data table exists in the table name, wherein the first table branch information is used to represent the third code branch to be imported from the first data table among multiple code branches; in response to the first table branch information not existing in the table name, or the first table branch information is the same as the first preset branch information, reading the first data branch information from the first data table.
[0043] Since the first file can be composed of multiple data tables, each of which can contain multiple rows of data, in order to indicate the code branches that need to be imported into different data tables, suffix information can be added to the table name to mark the table branch information. The above-mentioned first table branch information can be information used to mark the third code branch, which can be, but is not limited to: the branch number of the third code branch. It should be noted that the file branch information, table branch information, and data branch information can be different or completely the same.
[0044] In an optional embodiment, after determining that the first data table of the first data exists in the first file, the table name of the first data table can be read, and the table name of the first data table can be traversed using the quick search provided in the Excel file, or the table name of the first data table can be directly searched using a pre-written script. Based on whether there is suffix information in the table name, it is determined whether there is first table branch information in the table name. If the first table branch information does not exist in the table name, it indicates that the first data table needs to be imported into each code branch. Therefore, the first data table must be imported into the preset code branch, and the first data table can be read from the row in the first data table where the first data is stored. Get the first data branch information, and then import the first data according to the first data branch information; if the first table branch information is the same as the first preset branch information, it indicates that the first data table needs to be imported into the preset code branch, and the first data branch information can be read from the row where the first data is stored in the first data table, and then the first data is imported according to the first data branch information; if the table name has the first table branch information, and the first table branch information is different from the first preset branch information, it indicates that the first data table needs to be imported into other code branches, and not imported into the preset code branch, and the first data table can be skipped and not imported.
[0045] It should be noted that the requirements for different first data stored in the first data table are often different, and there are usually multiple copies of the data for code branches. However, in each code branch, the first data is unique. If the same data is exported to different code branches, the consistency between the first branch information and the first preset branch information shall prevail. Therefore, before resolving the table name, a read operation can be performed on all table names, that is, all table names are scanned. If the first table branch information exists in the first data table and the first table branch information is the same as the first preset branch information, the table name is recorded. Then, when resolving the table name, the current table can be skipped directly when it is determined that the first table branch information exists in the first data table and the first table branch information is the same as the first preset branch.
[0046] Optionally, based on the first data branch information, the data in the first file is imported into the second code branch, including: in response to the first data branch information being the same as the first preset branch information, the first data is stored in the preset table; and at least one data stored in the preset table is imported into the preset code branch corresponding to the first preset branch information.
[0047] The above-mentioned preset table may be a data table that uses a key-value pair structure to store data, where the key in the data table may be a data identifier and the value may be the content of the data.
[0048] In an optional embodiment, if the first data branch information is the same as the first preset branch information, it indicates that the first data needs to be exported to the preset code branch, and the first data can be temporarily stored in the preset table; if the first data branch information is different from the first preset branch information, it indicates that the first data needs to be exported to other code branches, and the first data table can be skipped. After all data tables in the first file are scanned, all data stored in the preset table can be imported into the preset code branch at once through the import code, so that the data stored in the preset table that needs to be imported can be imported together, thereby improving the efficiency of importing.
[0049] Optionally, storing the first data in a preset table includes: reading first identification information corresponding to the first data from the first data table, wherein the first identification information is used to identify the first data; determining whether second data corresponding to the first identification information exists in the preset table; in response to the existence of second data corresponding to the first identification information in the preset table, updating the second data based on the first data; in response to the absence of the second data corresponding to the first identification information in the preset table, storing the first identification information and the first data in the preset table.
[0050] The first identification information may be information for uniquely identifying the first data, for example, the ID of the first data, but is not limited thereto. The second data may be data stored in a preset table, and the identification information of the second data may be the same as the first identification information. However, the second data may be the same as or different from the first data.
[0051] In an optional embodiment, there may be multiple rows of first data in the first data table, and duplicate data may exist in the multiple rows of first data. In this case, each time before storing the first data in the preset table, the first identification information corresponding to the first data is first read from the first data table, and the preset table is checked to see whether the second data corresponding to the first identification information exists. If the second data exists in the preset table, it indicates that duplicate data has occurred. The first data can be used to overwrite the already stored second data, thereby updating the data corresponding to the first identification information in the preset table and ensuring that duplicate data does not exist in the preset table. If the second data does not exist in the preset table, it indicates that duplicate data has not occurred, and the first data and the first identification information can be directly saved in the preset table.
[0052] Optionally, the method further includes: in response to failure to successfully obtain the first data branch information, determining whether there is second data corresponding to the first identification information in the preset table; in response to the second data not existing in the preset table, importing the first data into the second code branch.
[0053] In an optional embodiment, if the first data branch information is not stored in the first data table, it indicates that the first data is to be imported into each code branch, that is, the first data needs to be substituted into the second code branch. Therefore, it can be determined whether the second data corresponding to the first identification information exists in the preset table. If the second data corresponding to the first identification information does not exist in the preset table, the first data is imported into the second code branch; if the second data corresponding to the first identification information exists in the preset table, the first data is skipped.
[0054] Optionally, the method further includes: in response to failure to successfully obtain the first file branch information, importing the first data into multiple code branches.
[0055] In an optional embodiment, if the first file branch information corresponding to the first file is not obtained in the configuration file table, that is, there is no first file branch information in the first configuration information corresponding to the first file in the configuration file table, indicating that the first file is to be imported into each code branch, the first data in the first file can be imported into multiple code branches.
[0056] Optionally, after the data in the first file is imported into the second code branch based on the first data branch information, the method further comprises: obtaining first file information of the first file and code branch information corresponding to the second code branch; and storing the first file information and the code branch information into a preset file.
[0057] The first file information described above can be attribute information of the first file, including but not limited to: branch number, file name, file number. The code branch information can be attribute information of the second code branch, including but not limited to: code branch number, code branch name.
[0058] The preset file described above can be a file preset for storing the first file information and the code branch information, for example, can be a branch table information file recording branch table information in a table service.
[0059] In an optional embodiment, after the first data in the first file is imported into the second code branch, the first file information of the first file and the code branch information corresponding to the second code branch can be stored in the preset file in the format of branch number as key and the rest information as value, so as to reduce the number of scanning in the subsequent table service, reduce the table service time, and improve the table service efficiency.
[0060] It should be noted that the preset file can be uploaded to a version management library for storage. After the table service is successful, the game code can be generated according to the first data and uploaded to the version management library for storage.
[0061] Figure 3 is a flowchart of an optional file table service according to an embodiment of the present disclosure, as shown in Figure 3 The specific implementation method comprises the following steps:
[0062] Step S301, reading first configuration information corresponding to a first file from a configuration file table.
[0063] Step S302, determining whether the first configuration information contains first file branch information; if not, executing step S303; if yes, executing step S304.
[0064] Step S303, importing the first data into a plurality of code branches according to a table service template file or a table service processing program, recording the table service branch and table number information, and writing into a branch table information file.
[0065] Step S304, determining whether the first file branch information is same as the first preset branch information; if not, executing step S305; if yes, executing step S306.
[0066] Step S305, skipping.
[0067] Step S306, parse the table name of the first data table to determine whether the table name contains first table branch information corresponding to the first data table, and whether the first table branch information is the same as the first preset branch information; if not, execute step S305; if so, execute step S307.
[0068] Step S307 , reading the first data branch information from the first data table; if the first data branch is read, executing step S308 ; if the first data branch is not read, executing step S313 .
[0069] Step S308, determining whether the first data branch information is the same as the first preset branch information; if not, executing step S305; if so, executing step S309.
[0070] Step S309 , determining whether the second data corresponding to the first identification information exists in the preset table; if so, executing step S310 ; if not, executing step S311 .
[0071] Step S310: Overwrite the second data with the first data.
[0072] Step S311: store the first data in a preset table.
[0073] Step S312: import at least one data stored in the preset table into the preset code branch corresponding to the first preset branch information.
[0074] Step S313, determining whether the second data corresponding to the first identification information exists in the preset table; if so, executing step S305; if not, executing step S311.
[0075] Optionally, the method also includes: obtaining a second file to be imported into the code trunk, wherein the second file is a file imported into any one of the multiple code branches; in response to the existence of second file branch information corresponding to the second file in the configuration file table, deleting the second file branch information, and importing the second data stored in the second file into the code trunk; in response to the absence of the second file branch information in the configuration file table and the existence of second data branch information in the second file, deleting the second data branch information to obtain a third file, and importing the third data stored in the third file into the code trunk, wherein the second data branch information is used to represent the data branch information corresponding to the second data.
[0076] The aforementioned code trunk can be the trunk during code development. Multiple code branches need to be merged back into the trunk before release. The aforementioned second file can contain files for all code branches to be imported into the code trunk. The second file branch information and second data branch information are similar to the first file branch information and first data branch information described above and are not further described here.
[0077] In order to solve the problems of low efficiency in merging files, waste of human resources, and high merging error rate in related technologies, in an optional embodiment, before merging, the preset file, configuration file table, and corresponding branch information can be updated from the version library, and the file information stored in the preset file can be compared, and the file with the same file information is determined as the second file. The table is merged in units of books, and the second file branch information stored in the configuration file table is read. If the second file branch information is read, the second file branch information is deleted, and the second data stored in the second file is directly imported into the code trunk; if the second file branch information is not read, the second data branch information is further read from the second file. If the second data branch information is read, the second data branch information in the second file is deleted to obtain a third file, and then the third data stored in the third file is imported into the code trunk; if the second data branch information does not exist in the second file, it is skipped.
[0078] Through the above steps, you can scan the table and delete the branch information in the table according to the configuration file content, complete the file merging function between branches, and automate the table merging and importing process, reducing the manpower waste and merging errors caused by manual table merging, thereby improving development efficiency.
[0079] Optionally, deleting the second file branch information includes: in response to the second file branch information being the same as the second preset branch information, deleting the second file branch information and marking the second file as a preset mark, wherein the second preset branch information is used to represent the code branch of the current code trunk to be imported into multiple code branches; deleting the second data branch information to obtain a third file includes: in response to the second data branch information being the same as the second preset branch information, deleting the second data branch information to obtain a third file, and marking the third file as a preset mark.
[0080] The second preset branch information mentioned above may be file branch information pre-set as needed, or may be information of a code branch currently to be imported into a code trunk.
[0081] The aforementioned preset mark may be a pre-set mark used to determine whether the file needs to be merged.
[0082] In an optional embodiment, in order to further improve efficiency, files can be merged according to code branches, that is, it can be determined whether the second file branch information is the same as the second preset branch information. If they are the same, the second file branch information is deleted and the second file is marked with a preset mark, for example, the file modification flag of the second file is set to true; if they are different, the second file branch information is retained.
[0083] Similarly, it can be determined whether the second data branch information corresponding to the second data is the same as the second preset branch information. If they are the same, the second data branch information is deleted and the second file is marked as a preset mark, for example, the file modification flag of the second file is set to true; if they are different, the second data branch information is retained to achieve table merging.
[0084] It should be noted that after deleting the same branch information, the branch information on the trunk will be different. During the table merging process, the modified files can be recorded, the files can be unlocked, and the table import service can be notified to perform table import processing. The corresponding planning and production data will be modified.
[0085] Optionally, before obtaining the second file to be imported into the code trunk, the method further includes: determining the second file based on file information stored in a preset file; and locking the second file and the configuration file table.
[0086] The above-mentioned file information may be attribute information of the second file, for example, may be the file path of the second file, but is not limited thereto.
[0087] During the table merge process, if someone else modifies the import file, a conflict will occur when submitting. In an optional embodiment, the second file and configuration file table can be locked based on the branch import record information before the table merge. This ensures that the table is not modified during the merge, avoiding conflicts and preventing the import of unlocked tables.
[0088] Optionally, the method further includes: performing a data check on the second data stored in the second file to obtain a data check result; in response to the data check result being a failure, or the locking process failing, rolling back and unlocking the second file and configuration file.
[0089] The above-mentioned data checks may include but are not limited to: data uniqueness check and format correctness check.
[0090] In an optional embodiment, during the table merging process, the second data stored in the second file can be checked for data uniqueness and format correctness to avoid erroneous second data being merged into the code trunk. If the data check result is successful, the second data can be merged into the code trunk. If the data check result is a failure, or the locking process fails, an exception can be thrown to uniformly handle the error in the outermost system, and the error information can be sent back to the initiator of the receipt table, and the error information can be recorded in the log. The second file and configuration file are rolled back and unlocked to avoid file errors and omissions in the next table merging.
[0091] Figure 4 This is a flowchart of an optional file merging table according to an embodiment of the present disclosure. Figure 4As shown, the specific implementation method includes the following steps:
[0092] Step S401, start merging tables.
[0093] Step S402: Update configuration files, import table information, and all tables.
[0094] Step S403: configure the file and perform table merging processing.
[0095] Step S404, determine whether any file branch information is deleted; if so, execute step S405; if not, execute step S406.
[0096] Step S405: record the table in the list of tables that need to be imported.
[0097] Step S406: read the records in the branch guide table information file and generate a list of files whose records need to be merged.
[0098] Step S407 , scan the table, merge the tables and rows, and record the modified tables.
[0099] Step S408, check to determine whether an error occurs; if not, execute step S409; if so, execute step S410.
[0100] Step S409: Submit the modified file, unlock the file and send the modification record to the system, and notify the system to import the table.
[0101] Step S410: record the error, roll back and unlock the file, and notify the table assembler to handle it.
[0102] Step S411, the table merging ends.
[0103] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus the necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present disclosure is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), including a number of instructions for enabling a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present disclosure.
[0104] In this embodiment, a device is also provided for implementing the above-mentioned embodiments and preferred embodiments. Details already described are omitted for brevity. As used below, the terms "unit" and "module" may refer to a combination of software and / or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementation using hardware, or a combination of software and hardware, is also possible and contemplated.
[0105] Figure 5 is a structural block diagram of a file processing device according to one embodiment of the present disclosure, such as Figure 5 As shown, the device includes: a reading module 50, which is used to read the first configuration information corresponding to the first file from the configuration file table in response to a change in the first data in the first file, wherein the configuration file table is used to store configuration information of different files; a determination module 52, which is used to determine the first data branch information corresponding to the first data in response to the first configuration information containing the first file branch information, wherein the first file branch information is used to represent the first code branch to be imported into the first file in multiple code branches, and the first data branch information is used to represent the second code branch to be imported into the first data in multiple code branches; an import module 54, which is used to import the first data in the first file into the second code branch based on the first data branch information.
[0106] Optionally, the determination module includes: a first determination unit, used to determine the first data table storing the first data in the first file in response to the first file branch information being the same as the first preset branch information, wherein the first preset branch information is used to represent the preset code branch of the data currently to be imported among multiple code branches; and a first reading unit, used to read the first data branch information from the first data table.
[0107] Optionally, the first reading unit includes: a parsing sub-unit, used to parse the table name of the first data table, and determine whether the table name contains first table branch information corresponding to the first data table, wherein the first table branch information is used to represent the third code branch to be imported from the first data table among multiple code branches; a first reading sub-unit, used to read the first data branch information from the first data table in response to the absence of the first table branch information in the table name, or the first table branch information is the same as the first preset branch information.
[0108] Optionally, the import module includes a first storage unit for storing the first data in a preset table in response to the first data branch information being the same as the first preset branch information; and a first import unit for importing at least one data stored in the preset table into the preset code branch corresponding to the first preset branch information.
[0109] Optionally, the first storage unit includes a second reading subunit for reading first identification information corresponding to the first data from the first data table, wherein the first identification information is used to identify the first data; a first determination subunit for determining whether second data corresponding to the first identification information exists in the preset table; a first update subunit for updating the second data based on the first data in response to the existence of second data corresponding to the first identification information in the preset table; and a first storage subunit for storing the first identification information and the first data in the preset table in response to the absence of the second data corresponding to the first identification information in the preset table.
[0110] Optionally, the first storage unit also includes: a second determination subunit, used to determine whether there is second data corresponding to the first identification information in the preset table in response to the failure to successfully obtain the first data branch information; a first import subunit, used to import the first data into the second code branch in response to the absence of the second data in the preset table.
[0111] Optionally, the import module further includes: a second import unit, configured to import the first data into the plurality of code branches in response to failure to successfully obtain the first file branch information.
[0112] Optionally, after importing the data in the first file into the second code branch based on the first data branch information, the device also includes: a first acquisition module, used to obtain the first file information of the first file and the code branch information corresponding to the second code branch; a storage module, used to store the first file information and the code branch information in a preset file.
[0113] Optionally, the device also includes: a second acquisition module, used to acquire a second file to be imported into the code trunk, wherein the second file is a file imported into any one of the multiple code branches; a first deletion module, used to delete the second file branch information in response to the existence of second file branch information corresponding to the second file in the configuration file table, and import the second data stored in the second file into the code trunk; a second deletion module, in response to the absence of second file branch information in the configuration file table and the existence of second data branch information in the second file, delete the second data branch information to obtain a third file, and import the third data stored in the third file into the code trunk, wherein the second data branch information is used to represent the data branch information corresponding to the second data.
[0114] Optionally, the first deleting module comprises: a first deleting unit, configured to delete the second file branch information and mark the second file as a preset mark in response to the second file branch information being identical to second preset branch information, wherein the second preset branch information is used to represent a code branch in the plurality of code branches that is currently to be imported into the code trunk; and the second deleting module comprises: a second deleting unit, configured to delete the second data branch information in response to the second data branch information being identical to the second preset branch information, to obtain a third file, and mark the third file as a preset mark.
[0115] Optionally, before the second file to be imported into the code trunk is obtained, the second obtaining module further comprises: a second determining unit, configured to determine the second file based on file information stored in the preset file; and a locking unit, configured to perform locking processing on the second file and the configuration file table.
[0116] Optionally, the second obtaining module further comprises: a data checking unit, configured to perform data checking on second data stored in the second file to obtain a data checking result; and an unlocking unit, configured to perform rollback and unlocking processing on the second file and the configuration file in response to the data checking result being a failure or the locking processing failing.
[0117] It should be noted that the above units and modules can be implemented by software or hardware, and for the latter, the following implementation manners can be used, but are not limited thereto: the above units and modules are located in the same processor; or the above units and modules are located in different processors in any combination.
[0118] Embodiments of the present disclosure further provide a computer readable storage medium, which stores a computer program, and the computer program is configured to execute the steps in any of the above method embodiments when running.
[0119] Optionally, in the present embodiment, the above computer readable storage medium can include, but is not limited to: a U disk, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and various media that can store computer programs.
[0120] Optionally, in the present embodiment, the above computer readable storage medium can be located in any one of computer terminals in a computer terminal group in a computer network, or in any one of mobile terminals in a mobile terminal group.
[0121] Optionally, in the present embodiment, the above computer readable storage medium can be configured to store a computer program for executing the following steps:
[0122] In step S1, first configuration information corresponding to the first file is read from a configuration file table in response to a change in the first data in the first file, wherein the configuration file table is configured to store configuration information of different files.
[0123] In step S2, first data branch information corresponding to the first data is determined in response to the first configuration information containing first file branch information, wherein the first file branch information is configured to represent a first code branch in the plurality of code branches to which the first file is to be imported, and the first data branch information is configured to represent a second code branch in the plurality of code branches to which the first data is to be imported.
[0124] In step S3, the first data in the first file is imported into the second code branch based on the first data branch information.
[0125] Optionally, the computer readable storage medium is further configured to store program code for performing the following steps: determining a first data table storing the first data in the first file in response to the first file branch information being identical to first preset branch information, wherein the first preset branch information is configured to represent a preset code branch in the plurality of code branches to which data is to be currently imported; and reading the first data branch information from the first data table.
[0126] Optionally, the computer readable storage medium is further configured to store program code for performing the following steps: parsing a table name of the first data table to determine whether first table branch information corresponding to the first data table exists in the table name, wherein the first table branch information is configured to represent a third code branch in the plurality of code branches to which the first data table is to be imported; and reading the first data branch information from the first data table in response to the first table branch information not existing in the table name or the first table branch information being identical to the first preset branch information.
[0127] Optionally, the computer readable storage medium is further configured to store program code for performing the following steps: storing the first data in a preset table in response to the first data branch information being identical to the first preset branch information; and importing at least one data stored in the preset table into a preset code branch corresponding to the first preset branch information.
[0128] Optionally, the computer readable storage medium is further configured to store program code for performing the following steps: reading first identification information corresponding to the first data from the first data table, wherein the first identification information is configured to identify the first data; determining whether second data corresponding to the first identification information exists in the preset table; updating the second data based on the first data in response to the second data corresponding to the first identification information existing in the preset table; and storing the first identification information and the first data into the preset table in response to the second data corresponding to the first identification information not existing in the preset table.
[0129] Optionally, the above-mentioned computer-readable storage medium is also configured to store program code for performing the following steps: in response to unsuccessful acquisition of the first data branch information, determining whether there is second data corresponding to the first identification information in the preset table; in response to the absence of the second data in the preset table, importing the first data into the second code branch.
[0130] Optionally, the computer-readable storage medium is further configured to store program code for executing the following steps: in response to failure to successfully obtain the first file branch information, importing the first data into multiple code branches.
[0131] Optionally, the computer-readable storage medium is further configured to store program code for executing the following steps: obtaining first file information of the first file and code branch information corresponding to the second code branch; and storing the first file information and code branch information in a preset file.
[0132] Optionally, the above-mentioned computer-readable storage medium is also configured to store program code for executing the following steps: obtaining a second file to be imported into the code trunk, wherein the second file is a file imported into any one of multiple code branches; in response to the existence of second file branch information corresponding to the second file in the configuration file table, deleting the second file branch information, and importing the second data stored in the second file into the code trunk; in response to the absence of second file branch information in the configuration file table and the existence of second data branch information in the second file, deleting the second data branch information to obtain a third file, and importing the third data stored in the third file into the code trunk, wherein the second data branch information is used to represent the data branch information corresponding to the second data.
[0133] Optionally, the above-mentioned computer-readable storage medium is also configured to store program code for performing the following steps: deleting the second file branch information includes: in response to the second file branch information being the same as the second preset branch information, deleting the second file branch information and marking the second file as a preset mark, wherein the second preset branch information is used to represent the code branch currently to be imported into the code trunk among multiple code branches; deleting the second data branch information to obtain a third file includes: in response to the second data branch information being the same as the second preset branch information, deleting the second data branch information to obtain a third file, and marking the third file as a preset mark.
[0134] Optionally, the computer-readable storage medium is further configured to store program codes for executing the following steps: determining a second file based on file information stored in a preset file; and locking the second file and the configuration file table.
[0135] Optionally, the above-mentioned computer-readable storage medium is also configured to store program code for executing the following steps: performing a data check on the second data stored in the second file to obtain a data check result; in response to the data check result being a failure, or the locking process failing, rolling back and unlocking the second file and configuration file.
[0136] In the computer-readable storage medium of this embodiment, a technical solution for a file processing method is provided. In response to a change in the first data in the first file, the first configuration information corresponding to the first file is read from the configuration file table; in response to the first configuration information containing the first file branch information, the first data branch information corresponding to the first data is determined; based on the first data branch information, the first data of the first file is imported into the second code branch. It should be noted that, through the first file branch information and the first data branch information, it is possible to modify the data imported into different code branches in one file, and import the data imported into different code branches into different code branches respectively, thereby achieving the technical effect of improving the processing efficiency of the import table file and reducing the number of files retained on the import table server, thereby solving the technical problem of low efficiency in importing files in the related technology.
[0137] Through the description of the above embodiments, it is easy for those skilled in the art to understand that the example embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the embodiments of the present disclosure can be embodied in the form of a software product, which can be stored in a computer-readable storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the embodiments of the present disclosure.
[0138] In an exemplary embodiment of the present application, a computer-readable storage medium stores a program product capable of implementing the above-described method of this embodiment. In some possible implementations, various aspects of the embodiments of the present disclosure may also be implemented in the form of a program product, which includes program code. When the program product is executed on a terminal device, the program code is used to cause the terminal device to execute the steps described in the "Exemplary Method" section of this embodiment according to various exemplary embodiments of the present disclosure.
[0139] According to an embodiment of the present disclosure, a program product for implementing the above-mentioned method can be a portable compact disc read-only memory (CD-ROM) and include program code, and can be run on a terminal device, such as a personal computer. However, the program product of the embodiment of the present disclosure is not limited thereto. In the embodiment of the present disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0140] The program product may be implemented in any combination of one or more computer-readable media. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any combination thereof. More specific examples (non-exhaustive) of computer-readable storage media include: an electrical connection having one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof.
[0141] It should be noted that the program code contained in the computer-readable storage medium can be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any appropriate combination of the above.
[0142] An embodiment of the present disclosure further provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to perform the steps in any of the above method embodiments.
[0143] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0144] Optionally, in this embodiment, the processor may be configured to execute the following steps through a computer program:
[0145] Step S1, in response to a change in first data in a first file, reading first configuration information corresponding to the first file from a configuration file table, wherein the configuration file table is used to store configuration information of different files;
[0146] Step S2: In response to the first configuration information including first file branch information, determining first data branch information corresponding to the first data, wherein the first file branch information is used to represent a first code branch to be imported into the first file among the multiple code branches, and the first data branch information is used to represent a second code branch to be imported into the first data among the multiple code branches;
[0147] Step S3: Based on the first data branch information, import the first data in the first file into the second code branch.
[0148] Optionally, the above-mentioned processor can also be configured to perform the following steps through a computer program: in response to the first file branch information being the same as the first preset branch information, determining the first data table storing the first data in the first file, wherein the first preset branch information is used to represent the preset code branch of the data currently to be imported in multiple code branches; and reading the first data branch information from the first data table.
[0149] Optionally, the above-mentioned processor can also be configured to perform the following steps through a computer program: parsing the table name of the first data table to determine whether the table name contains first table branch information corresponding to the first data table, wherein the first table branch information is used to represent the third code branch to be imported from the first data table among multiple code branches; in response to the absence of the first table branch information in the table name, or the first table branch information is the same as the first preset branch information, reading the first data branch information from the first data table.
[0150] Optionally, the above-mentioned processor can also be configured to perform the following steps through a computer program: in response to the first data branch information being the same as the first preset branch information, storing the first data in a preset table; importing at least one data stored in the preset table into the preset code branch corresponding to the first preset branch information.
[0151] Optionally, the above-mentioned processor can also be configured to perform the following steps through a computer program: reading first identification information corresponding to the first data from the first data table, wherein the first identification information is used to identify the first data; determining whether second data corresponding to the first identification information exists in the preset table; in response to the existence of second data corresponding to the first identification information in the preset table, updating the second data based on the first data; in response to the absence of second data corresponding to the first identification information in the preset table, storing the first identification information and the first data in the preset table.
[0152] Optionally, the above-mentioned processor can also be configured to perform the following steps through a computer program: in response to unsuccessful acquisition of the first data branch information, determining whether there is second data corresponding to the first identification information in the preset table; in response to the absence of the second data in the preset table, importing the first data into the second code branch.
[0153] Optionally, the processor may be further configured to execute the following steps through a computer program: in response to failure to successfully obtain the first file branch information, import the first data into multiple code branches.
[0154] Optionally, the processor can be further configured to execute the following steps by using a computer program: obtaining first file information of the first file and code branch information corresponding to the second code branch; and storing the first file information and the code branch information into the preset file.
[0155] Optionally, the processor can be further configured to execute the following steps by using a computer program: obtaining a second file to be imported into the code trunk, wherein the second file is a file to be imported into any one of the plurality of code branches; in response to the second file branch information corresponding to the second file existing in the configuration file table, deleting the second file branch information and importing second data stored in the second file into the code trunk; and in response to the second file branch information not existing in the configuration file table and second data branch information existing in the second file, deleting the second data branch information, obtaining a third file, and importing third data stored in the third file into the code trunk, wherein the second data branch information represents data branch information corresponding to the second data.
[0156] Optionally, the processor can be further configured to execute the following steps by using a computer program: deleting the second file branch information comprises: in response to the second file branch information being the same as second preset branch information, deleting the second file branch information and marking the second file as a preset mark, wherein the second preset branch information represents a code branch of the plurality of code branches that is currently to be imported into the code trunk; and deleting the second data branch information to obtain the third file comprises: in response to the second data branch information being the same as the second preset branch information, deleting the second data branch information to obtain the third file and marking the third file as the preset mark.
[0157] Optionally, the processor can be further configured to execute the following steps by using a computer program: determining the second file based on file information stored in the preset file; and performing lock processing on the second file and the configuration file table.
[0158] Optionally, the processor can be further configured to execute the following steps by using a computer program: performing data checking on second data stored in the second file to obtain a data checking result; and in response to the data checking result being failed or the lock processing being failed, performing rollback and unlock processing on the second file and the configuration file.
[0159] In the electronic device of this embodiment, a technical solution for a file processing method is provided. In response to a change in the first data in the first file, the first configuration information corresponding to the first file is read from the configuration file table; in response to the first configuration information containing the first file branch information, the first data branch information corresponding to the first data is determined; based on the first data branch information, the first data of the first file is imported into the second code branch. It should be noted that, through the first file branch information and the first data branch information, it is possible to modify the data imported into different code branches in one file, and import the data imported into different code branches into different code branches respectively, thereby achieving the technical effect of improving the processing efficiency of the import table file and reducing the number of files retained on the import table server, thereby solving the technical problem of low efficiency in importing files in the related technology.
[0160] Figure 6 Schematic diagram of an electronic device according to an embodiment of the present disclosure. Figure 6 As shown, the electronic device 600 is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0161] like Figure 6 As shown, electronic device 600 is implemented as a general-purpose computing device. Components of electronic device 600 may include, but are not limited to, at least one processor 610, at least one memory 620, a bus 630 connecting various system components (including memory 620 and processor 610), and a display 640.
[0162] The memory 620 stores program codes, which can be executed by the processor 610 so that the processor 610 executes the steps described in the method section of the embodiment of the present application according to various exemplary embodiments of the present disclosure.
[0163] The memory 620 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 6201 and / or a cache memory unit 6202, and may further include a read-only memory unit (ROM) 6203, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory.
[0164] In some examples, the memory 620 may also include a program / utility 6204 having a set (at least one) of program modules 6205. Such program modules 6205 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include an implementation of a network environment. The memory 620 may further include a memory remotely located relative to the processor 610. These remote memories may be connected to the electronic device 600 via a network. Examples of the aforementioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0165] Bus 630 may represent one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a local bus to processor 610, or a bus using any of a variety of bus architectures.
[0166] The display 640 may be, for example, a touch screen liquid crystal display (LCD) that enables a user to interact with a user interface of the electronic device 600 .
[0167] Optionally, the electronic device 600 may also communicate with one or more external devices 700 (e.g., a keyboard, a pointing device, a Bluetooth device, etc.), one or more devices that enable a user to interact with the electronic device 600, and / or any device that enables the electronic device 600 to communicate with one or more other computing devices (e.g., a router, a modem, etc.). Such communication may be performed through an input / output (I / O) interface 650. Furthermore, the electronic device 600 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) through a network adapter 660. Figure 6 As shown, the network adapter 660 communicates with other modules of the electronic device 1300 via the bus 630. Figure 6 Not shown, other hardware and / or software modules may be used in conjunction with electronic device 600, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0168] The electronic device 600 may further include: a keyboard, a cursor control device (such as a mouse), an input / output interface (I / O interface), a network interface, a power supply and / or a camera.
[0169] It can be understood by those skilled in the art that Figure 6 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 6 more or less components than shown, or configured differently from that shown in the drawings. The memory 620 can be used to store computer programs and corresponding data, such as the computer program and corresponding data of the file processing method in the embodiments of the present disclosure. The processor 610 performs various functional applications and data processing by running the computer program stored in the memory 620, that is, implements the file processing method described above. Figure 1
[0170] The serial numbers of the embodiments of the present disclosure described above are only for description, and do not represent the advantages and disadvantages of the embodiments.
[0171] In the above-described embodiments of the present disclosure, the description of each embodiment has its own focus, and the parts not described in detail in a certain embodiment can be referred to the related description of other embodiments.
[0172] In several embodiments provided in the present application, it should be understood that the disclosed technical contents can be implemented by other means. Among them, the above-described device embodiments are only schematic, for example, the division of the units can be a logical function division, and actual implementation can have another division manner, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the units or modules shown or discussed can be indirect coupling or communication connection through some interfaces, units or modules, which can be electrical or other forms.
[0173] The units described as separate components can or can not be physically separated, and the components shown as units can or can not be physical units, that is, they can be located in one place, or can be distributed to multiple units. Part or all of the units can be selected according to actual needs to achieve the purpose of the present embodiment scheme.
[0174] In addition, each functional unit in each embodiment of the present disclosure can be integrated in one processing unit, or each unit can exist physically, or two or more units can be integrated in one unit. The above integrated unit can be realized in the form of hardware or in the form of software functional unit.
[0175] The integrated unit, if implemented in the form of a software function unit and sold or used as an independent product, can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present disclosure, essentially or in other words, the part that contributes to the prior art or the whole or part 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 several 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 methods described in the various embodiments of the present disclosure. The aforementioned storage medium includes various media that can store program codes, such as a U disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a mobile hard disk, a magnetic disk or an optical disk, etc.
[0176] The above description is only the preferred embodiments of the present disclosure, and it should be pointed out that, for those skilled in the art, without departing from the principles of the present disclosure, a number of improvements and refinements can be made, and these improvements and refinements should also be considered as the protection scope of the present disclosure.
Claims
1. A file processing method, characterized in that: include: In response to a change in first data in a first file, reading first configuration information corresponding to the first file from a configuration file table, wherein the first file is used to represent a file filled in by a user to modify code during code development, the first data is used to represent data added or modified by the user in the first file, and the first data is not code, and the configuration file table is used to store configuration information of different files; In response to the first configuration information including first file branch information, determining first data branch information corresponding to the first data, wherein the first file branch information is used to represent a first code branch to be imported into the first file among multiple code branches, and the first data branch information is used to represent a second code branch to be imported into the first data among the multiple code branches; Based on the first data branch information, the first data in the first file is imported into the second code branch.
2. The method according to claim 1, characterized in that Determining first data branch information corresponding to the first data includes: In response to the first file branch information being identical to the first preset branch information, determining a first data table storing the first data in the first file, wherein the first preset branch information is used to represent a preset code branch of data to be currently imported among the multiple code branches; The first data branch information is read from the first data table.
3. The method according to claim 2, characterized in that Reading the first data branch information from the first data table includes: Parsing the table name of the first data table to determine whether first table branch information corresponding to the first data table exists in the table name, wherein the first table branch information is used to represent a third code branch to be imported into the first data table among the multiple code branches; In response to the first table branch information not existing in the table name, or the first table branch information being the same as the first preset branch information, the first data branch information is read from the first data table.
4. The method according to claim 1, wherein Importing the data in the first file into the second code branch based on the first data branch information includes: In response to the first data branch information being identical to the first preset branch information, storing the first data in a preset table; Importing at least one data stored in the preset table into the preset code branch corresponding to the first preset branch information.
5. The method according to claim 4, characterized in that Storing the first data in a preset table includes: Reading first identification information corresponding to the first data from a first data table, wherein the first identification information is used to identify the first data; Determine whether second data corresponding to the first identification information exists in the preset table; In response to the presence of second data corresponding to the first identification information in the preset table, updating the second data based on the first data; In response to the second data corresponding to the first identification information not existing in the preset table, the first identification information and the first data are stored in the preset table.
6. The method according to claim 5, characterized in that The method further comprises: In response to failure to successfully obtain the first data branch information, determining whether second data corresponding to the first identification information exists in the preset table; In response to the second data not existing in the preset table, the first data is imported into the second code branch.
7. The method according to claim 1, characterized in that The method further comprises: In response to failure to successfully obtain the first file branch information, the first data is imported into the multiple code branches.
8. The method according to claim 1, characterized in that After importing the data in the first file into the second code branch based on the first data branch information, the method further includes: Obtaining first file information of the first file and code branch information corresponding to the second code branch; The first file information and the code branch information are stored in a preset file.
9. The method according to claim 1, characterized in that The method further comprises: Obtain a second file to be imported into the code trunk, wherein the second file is a file imported into any one of the multiple code branches; In response to the presence of second file branch information corresponding to the second file in the configuration file table, deleting the second file branch information, and importing the second data stored in the second file into the code trunk; In response to the fact that the second file branch information does not exist in the configuration file table and the second data branch information exists in the second file, the second data branch information is deleted to obtain a third file, and the third data stored in the third file is imported into the code trunk, wherein the second data branch information is used to represent the data branch information corresponding to the second data.
10. The method according to claim 9, characterized in that Deleting the second file branch information includes: in response to the second file branch information being identical to second preset branch information, deleting the second file branch information and marking the second file with a preset mark, wherein the second preset branch information is used to represent a code branch among the multiple code branches that is currently to be imported into the code trunk; The second data branch information is deleted to obtain a third file, including: in response to the second data branch information being the same as the second preset branch information, the second data branch information is deleted to obtain the third file, and the third file is marked as a preset mark.
11. The method according to claim 9, characterized in that Before obtaining the second file to be imported into the code trunk, the method further includes: Determining the second file based on file information stored in a preset file; The second file and the configuration file table are locked.
12. The method according to claim 11, characterized in that The method further comprises: Performing a data check on the second data stored in the second file to obtain a data check result; In response to a failure in the data check result or a failure in the locking process, the second file and the configuration file are rolled back and unlocked.
13. A file processing device, characterized in that: include: a reading module, configured to read, in response to a change in first data in a first file, first configuration information corresponding to the first file from a configuration file table, wherein the first file is used to represent a file filled in by a user to modify code during code development, the first data is used to represent data added or modified by the user in the first file, and the first data is not code; and the configuration file table is used to store configuration information of different files; a determination module, configured to determine, in response to the first configuration information including first file branch information, first data branch information corresponding to the first data, wherein the first file branch information is used to represent a first code branch among multiple code branches to which the first file is to be imported, and the first data branch information is used to represent a second code branch among the multiple code branches to which the first data is to be imported; An import module is used to import the first data in the first file into the second code branch based on the first data branch information.
14. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, wherein the computer program is configured to execute the method according to any one of claims 1 to 12 when executed by a processor.
15. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to perform the method according to any one of claims 1 to 12.
Citation Information
Patent Citations
Resource display method, resource packaging method, device and equipment
CN114510281A
Game table processing method and device, computer equipment and storage medium
CN115364487A