Engineering file conflict processing method and device based on mobile communication equipment
Through the method of finding and processing engineering file conflict content in mobile communication devices, the problem of manually modifying engineering file conflicts in the existing technology is solved, automated processing is realized, time-consuming is shortened, and accuracy is improved.
Patent Information
- Application Number
- CN202111037427.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-06
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2041-09-06
AI Technical Summary
In the existing technology, project file conflicts in mobile communication devices require manual modification, which makes the processing difficult and time-consuming. There is also a lack of automated solutions and it is prone to errors.
Provides a method of handling project file conflicts based on mobile communication devices, by searching for the conflict content of multiple project files in the project files whose conflicts need to be resolved, storing them in arrays, and handling conflicts based on the arrays, including determining compilable files and file references. and group file contents, finding conflicting content and merging the conflicting content if the elements are different.
It solves the disadvantages of manually modifying project file conflicts, shortens the time-consuming process of processing project file conflicts, and improves the efficiency and accuracy of automated processing.
Smart Images

Figure CN113703778B_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the technical field of application development of mobile communication equipment, and specifically relates to a method and device for processing engineering file conflicts based on mobile communication equipment. Background Art
[0002] In the prior art, files in mobile phone applications mainly include three categories: files that need to be compiled, such as: .h / .m / .mm / .swift, etc.; resource files, including pictures, videos, text files, etc.; project files, including: .xcodeproj, .xcworkspace, etc.
[0003] For the first two types of files, developers can manually resolve conflicts based on business needs. As for project files, because they record changes in directories, references, and configurations, their complexity is positively correlated with the complexity of the project. For example: Developer A adds file am to directory F, and developer B adds file bm to directory F, which will cause three conflicts in .xcodeproj. It is extremely difficult to manually resolve such conflicts, and if an error occurs, the project file will not be able to open. Existing technologies do not provide corresponding solutions, and the open source community does not have a mature and reliable solution. Programmers can only manually resolve such conflicts. Manual conflict resolution is not only time-consuming, but also prone to errors. Summary of the invention
[0004] The present invention can be used in the technical field of the application of application development technology of mobile communication equipment in finance, and can also be used in any field other than the financial field. The project file conflict processing method and device based on mobile communication equipment provided by the present invention can solve the disadvantage that the project file conflict can only be modified manually in the prior art, and shorten the time spent on processing the project file conflict.
[0005] In order to solve the above technical problems, the present invention provides the following technical solutions:
[0006] In a first aspect, the present invention provides a method for processing engineering file conflicts based on a mobile communication device, comprising:
[0007] Find conflicting contents of multiple project files in the project files where conflicts need to be resolved;
[0008] Store the conflicting content of each project file into an array;
[0009] Handle project file conflicts based on multiple arrays.
[0010] In one embodiment, searching for conflicting contents of multiple project files in the project files whose conflicts need to be resolved includes:
[0011] Determine the compilable file content, file reference content, and group file content in the project file whose conflicts need to be resolved;
[0012] Search for conflicting contents of multiple project files in the compilable file contents, file reference contents, and group file contents.
[0013] In one embodiment, the determining of the compilable file content, file reference content, and group file content in the project file whose conflicts are to be resolved includes:
[0014] Scanning the engineering file whose conflict needs to be resolved line by line to determine the content of the engineering file;
[0015] In the project file content, the compilable file content is determined according to the compilable file start mark and the compilable file end mark;
[0016] In the project file content, the file reference content is determined according to the file reference start mark and the file reference end mark;
[0017] In the project file content, the group file content is determined according to a group start mark and a group end mark.
[0018] In one embodiment, searching for multiple project file conflict contents in the compilable file contents, file reference contents, and group file contents includes:
[0019] According to the conflict start symbol of the project file conflict and the separator symbol between multiple conflicts, multiple project file conflict contents are searched in the compilable file content, the file reference content and the group file content.
[0020] In one embodiment, processing the engineering file conflicts according to the multiple arrays includes:
[0021] When the elements in the multiple arrays are not the same, the conflicting contents of the multiple project files are merged.
[0022] In a second aspect, the present invention provides an engineering file conflict processing device based on a mobile communication device, the device comprising:
[0023] A conflict content search module is used to search for conflicting contents of multiple project files in the project files whose conflicts need to be resolved;
[0024] A conflict content storage module, used for storing the conflict content of each project file into an array;
[0025] The project file conflict handling module is used to handle project file conflicts based on multiple arrays.
[0026] In one embodiment, the conflict content search module includes:
[0027] A file content determination unit, used to determine the compilable file content, file reference content and group file content in the project file whose conflict is to be resolved;
[0028] A conflict content search unit, used for searching for conflicting contents of multiple project files in the compilable file contents, file reference contents and group file contents;
[0029] In one embodiment, the file content determination unit includes:
[0030] A project file scanning unit, used for scanning the project file with the conflict to be resolved line by line to determine the content of the project file;
[0031] A compilable content determination unit, used to determine the compilable file content in the project file content according to the compilable file start mark and the compilable file end mark;
[0032] A file reference content determination unit, used to determine the file reference content in the project file content according to a file reference start mark and a file reference end mark;
[0033] The group file content determination unit is used to determine the group file content according to the group start mark and the group end mark in the project file content.
[0034] In one embodiment, the conflict content search unit includes:
[0035] A multiple conflict content search unit, used for searching for multiple project file conflict contents in the compilable file content, the file reference content and the group file content according to the conflict start symbol of the project file conflict and the separator symbol between multiple conflicts;
[0036] In one embodiment, the project file conflict handling module includes:
[0037] The conflict content merging unit is used to merge the conflicting contents of the multiple project files when the elements in the multiple arrays are different.
[0038] In a third aspect, the present invention provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of a method for handling engineering file conflicts based on a mobile communication device are implemented.
[0039] In a fourth aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of a method for handling engineering file conflicts based on a mobile communication device.
[0040] From the above description, it can be seen that the embodiment of the present invention provides a method and device for processing engineering file conflicts based on a mobile communication device. First, multiple engineering file conflict contents are searched in the engineering file whose conflict is to be resolved; then, each engineering file conflict content is stored in an array; finally, the engineering file conflict is processed according to the multiple arrays. The method and device for processing engineering file conflicts based on a mobile communication device provided by the present invention can solve the disadvantage that engineering file conflicts can only be modified manually in the prior art, and shorten the time spent on processing engineering file conflicts. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0042] Figure 1 It is a flowchart of a method for handling engineering file conflicts based on a mobile communication device in an embodiment of the present invention;
[0043] Figure 2 is a flow chart of step 100 in an embodiment of the present invention;
[0044] Figure 3 This is a flow chart of step 101 in an embodiment of the present invention;
[0045] Figure 4 This is a flow chart of step 102 in an embodiment of the present invention;
[0046] Figure 5 is a flow chart of step 300 in an embodiment of the present invention;
[0047] Figure 6 It is a flowchart of a method for handling engineering file conflicts based on a mobile communication device in a specific implementation manner of the present invention;
[0048] Figure 7 The block diagram of the engineering file conflict handling device based on the mobile communication device in the embodiment of the present invention is Figure 1 ;
[0049] Figure 8 is a block diagram of a conflict content search module 10 in an embodiment of the present invention;
[0050] Fig. 9 is a block diagram of the file content determination unit 101 in an embodiment of the present invention;
[0051] Fig.10is a block diagram of the conflict content search unit 102 in an embodiment of the present invention;
[0052] Fig.11 is a block diagram of the project file conflict processing module 30 in an embodiment of the present invention;
[0053] Fig.12 It is a schematic diagram of the structure of an electronic device in an embodiment of the present invention. DETAILED DESCRIPTION
[0054] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0055] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0056] It should be noted that the terms "including" and "having" and any variations thereof in the specification and claims of the present application and the above-mentioned drawings are intended to cover non-exclusive inclusions. For example, a process, method, system, product or apparatus comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or apparatuses.
[0057] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0058] The embodiment of the present invention provides a specific implementation method of a project file conflict handling method based on a mobile communication device, see Figure 1 , the method specifically includes the following contents:
[0059] Step 100: searching for conflicting contents of multiple project files in the project files whose conflicts need to be resolved;
[0060] It can be understood that the engineering file based on the mobile communication device is generated through the following steps. First, the batch processing script and the compilation engine are set up. The processing script transmits the read compilation configuration information to the compilation engine. After the compilation engine receives the compilation configuration information, it controls the execution of the entire compilation work and then generates the engineering file.
[0061] Step 200: storing the conflicting content of each project file into an array;
[0062] It can be understood that the elements in the array are the contents of each engineering file (the contents of the engineering file triggered by a single technician).
[0063] Step 300: Processing project file conflicts according to multiple arrays.
[0064] The existing technology for integrating the engineering file content of mobile communication devices is based on the Git platform, which is a free, open source distributed version control system. It can effectively and quickly handle the version management of projects from very small to very large. The Git platform cannot automatically and intelligently resolve engineering file conflicts. The principle of the Git platform is to intelligently determine unambiguous merge solutions, but if there is a conflict, it will not try to intelligently and automatically resolve it. Therefore, if two forked engineering file branches are merged after a long time, there will be many conflicts. That is, if multiple people modify the same location of a file, conflicts will occur when performing operations such as committing and merging.
[0065] From the above description, it can be seen that the embodiment of the present invention provides a method for processing engineering file conflicts based on a mobile communication device. First, multiple engineering file conflict contents are searched in the engineering file whose conflict is to be resolved; then, each engineering file conflict content is stored in an array; finally, the engineering file conflict is processed according to the multiple arrays. The method and device for processing engineering file conflicts based on a mobile communication device provided by the present invention can solve the disadvantage that engineering file conflicts can only be modified manually in the prior art, and shorten the time spent on processing engineering file conflicts.
[0066] In one embodiment, see Figure 2 , step 100 further comprises:
[0067] Step 101: Determine the compilable file content, file reference content, and group file content in the project file whose conflicts need to be resolved.
[0068] Step 102: searching for conflicting contents of multiple project files in the compilable file contents, file reference contents, and group file contents.
[0069] In one embodiment, see Figure 3 , step 101 further comprises:
[0070] Step 1011: Scanning the project file with the conflict to be resolved line by line to determine the content of the project file;
[0071] Specifically, open the project file with conflicts to be resolved, and use the readline() function to read the content of each line in the file.
[0072] Step 1012: Determine the content of the compilable file in the project file content according to the compilable file start mark and the compilable file end mark;
[0073] In the project file content, search for the PBXBuildFile section that starts with / *Begin PBXBuildFile section* / (the beginning mark of the compilable file) and ends with / *End PBXBuildFile section* / (the end mark of the compilable file). This is the compilable file content.
[0074] Step 1013: Determine the file reference content in the project file content according to the file reference start mark and the file reference end mark;
[0075] In the project file content, search for the PBXFileReference section that starts with / *Begin PBXFileReference section* / (file reference start mark) and ends with / *End PBXFileReference section* / (file reference end mark). This is the file reference content.
[0076] Step 1014: Determine the group file content according to the group start mark and the group end mark in the project file content.
[0077] In the project file content, search for the PBXGroup section that starts with / *Begin PBXGroup section* / (group start mark) and ends with / *End PBXGroup section* / (group end mark). This is the file reference content.
[0078] In one embodiment, see Figure 4 , step 102 comprises:
[0079] Step 1021: searching for multiple project file conflict contents in the compilable file content, the file reference content, and the group file content according to the conflict start symbol of the project file conflict and the separator symbol between multiple conflicts.
[0080] Specifically, in the project file, the conflict start symbol and the division symbol between multiple conflicts are recorded as the first project file conflict content. Similarly, the next conflict start symbol and the division symbol between the next multiple conflicts are searched for as the second project file conflict content, and so on.
[0081] In one embodiment, see Figure 5 , step 300 comprises:
[0082] Step 301: When the elements in the multiple arrays are not the same, merging the conflicting contents of the multiple project files.
[0083] Specifically, if the content of a line starts with a conflicting start symbol, a first array is created; if the content of a line is a plurality of conflicting decomposition symbols, a second array is created;
[0084] Next, if the content of a line starts with a conflict resolution symbol, compare the elements in the first array and the second array. If there are no identical elements, merge them directly; if there are identical elements, do nothing (manual processing by the developer is required). And destroy the first array and the second data.
[0085] It should be noted that if the content of a line is not the case, the content of this line is parsed to obtain the file name. If the second data array has been created, the file name is inserted into the end of the second array; if the first array has been created, the file name is inserted into the end of the first array; if neither the first array nor the second array has been created, exit.
[0086] In a specific implementation, the present invention also takes the engineering file of a mobile phone as an example to provide a specific implementation of an engineering file conflict handling method based on a mobile communication device, see Figure 6 , specifically including the following contents.
[0087] The problem to be solved by the specific embodiment of the present invention is: to solve the problem of conflicts in the .xcodeproj project file caused by multiple people adding different files to a directory at the same time during the development of mobile phone applications.
[0088] S1: Determine whether the newly added project file needs to be compiled.
[0089] S2: If yes, add the first file ID in PBXBuildFile and jump to step S4.
[0090] S3: If not, add the second ID of the file reference in PBXFileReference.
[0091] S4: Add the second ID to children in PBXGroup.
[0092] S5: Add the id to the compiled files in PBXSource.
[0093] The following processing is performed for the above-mentioned changes:
[0094] S6: Open the specified .xcodeproj file and use the readline() method to read the content of each line in the file.
[0095] S7: Process the PBXBuildFile section starting with / *Begin PBXBuildFile section* / and ending with / *End PBXBuildFilesection* / . The processing procedure is similar to step S10.
[0096] S8: Process the line between the "file reference start mark" and the "file reference end mark". For the processing of each line, refer to step S10.
[0097] S9: Process the line between the "group start mark" and the "group end mark". For the processing of each line, refer to step S10.
[0098] S10: It is divided into the following three cases:
[0099] (1) If the content of a line starts with the string “<<<<<<<” (conflict start symbol), create array A;
[0100] (2) If the content of a line is "========" (multiple conflicting decomposition symbols), create array B;
[0101] (3) If the content of a line begins with ">>>>>>>" (conflict resolution symbol), compare the elements in array A and array B. If there are no identical elements, merge them directly; if there are identical elements, do nothing (manual processing by the developer is required). Destroy the array A and array B objects.
[0102] (4) If the content of a line is not one of the above three situations, parse the content of this line to get the file name. If array B has been created, insert the file name to the end of array B; if array A has been created, insert the file name to the end of array A; if arrays A and B have not been created, exit the process.
[0103] From the above description, it can be seen that the embodiment of the present invention provides a method for handling project file conflicts based on a mobile communication device. First, multiple project file conflict contents are searched in the project file whose conflict is to be resolved; then, each project file conflict content is stored in an array; finally, the project file conflict is handled according to the multiple arrays. The method and device for handling project file conflicts based on a mobile communication device provided by the present invention can solve the drawback that the project file conflicts can only be manually modified in the prior art, and shorten the time spent on handling project file (.xcodeproj file) conflicts.
[0104] Based on the same inventive concept, the embodiments of the present application also provide an engineering file conflict processing device based on a mobile communication device, which can be used to implement the method described in the above embodiments, such as the following embodiments. Since the principle of solving the problem by the engineering file conflict processing device based on a mobile communication device is similar to the engineering file conflict processing method based on a mobile communication device, the implementation of the engineering file conflict processing device based on a mobile communication device can refer to the implementation of the engineering file conflict processing method based on a mobile communication device, and the repeated parts will not be repeated. As used below, the term "unit" or "module" can be a combination of software and / or hardware that implements a predetermined function. Although the system described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceived.
[0105] The embodiment of the present invention provides a specific implementation of a project file conflict processing device based on a mobile communication device that can implement a project file conflict processing method based on a mobile communication device, see Figure 7 The engineering file conflict handling device based on the mobile communication device specifically includes the following contents:
[0106] A conflict content search module 10 is used to search for conflicting contents of multiple project files in the project files whose conflicts are to be resolved;
[0107] The conflict content storage module 20 is used to store the conflict content of each project file into an array;
[0108] The project file conflict processing module 30 is used to process the project file conflicts according to the multiple arrays.
[0109] In one embodiment, see Figure 8 , the conflict content search module 10 includes:
[0110] A file content determination unit 101, used to determine the compilable file content, file reference content and group file content in the project file whose conflict is to be resolved;
[0111] A conflict content search unit 102, used to search for conflicting contents of multiple project files in the compilable file content, file reference content and group file content;
[0112] In one embodiment, see Fig. 9 , the file content determination unit 101 includes:
[0113] The project file scanning unit 1011 is used to scan the project file with the conflict to be resolved line by line to determine the content of the project file;
[0114] The compilable content determining unit 1012 is used to determine the compilable file content in the project file content according to the compilable file start mark and the compilable file end mark;
[0115] A file reference content determination unit 1013, configured to determine the file reference content in the project file content according to a file reference start mark and a file reference end mark;
[0116] The group file content determination unit 1014 is used to determine the group file content according to the group start mark and the group end mark in the project file content.
[0117] In one embodiment, see Fig.10 , the conflict content searching unit 102 comprises:
[0118] A multiple conflict content search unit 1021 is used to search for multiple project file conflict contents in the compilable file content, the file reference content and the group file content according to the conflict start symbol of the project file conflict and the separator symbol between multiple conflicts;
[0119] In one embodiment, see Fig.11 , the engineering file conflict processing module 30 includes:
[0120] The conflicting content merging unit 301 is used to merge the conflicting contents of the multiple project files when the elements in the multiple arrays are different.
[0121] From the above description, it can be seen that the embodiment of the present invention provides a project file conflict processing device based on a mobile communication device, which first searches for multiple project file conflict contents in the project file whose conflict is to be resolved; then, stores each project file conflict content in an array; and finally processes the project file conflict according to the multiple arrays. The project file conflict processing method and device based on a mobile communication device provided by the present invention can solve the disadvantage that the project file conflict can only be manually modified in the prior art, and shorten the time spent on processing the project file conflict.
[0122] The embodiment of the present application also provides a specific implementation of an electronic device that can implement all steps in the engineering file conflict handling method based on a mobile communication device in the above embodiment, see Fig.12 , electronic equipment specifically includes the following:
[0123] Processor (processor) 1201, memory (memory) 1202, communication interface (CommunicationsInterface) 1203 and bus 1204;
[0124] The processor 1201, the memory 1202, and the communication interface 1203 communicate with each other through the bus 1204; the communication interface 1203 is used to realize information transmission between the server device and the client device and other related devices;
[0125] The processor 1201 is used to call the computer program in the memory 1202. When the processor executes the computer program, all steps in the engineering file conflict handling method based on the mobile communication device in the above embodiment are implemented. For example, when the processor executes the computer program, the following steps are implemented:
[0126] Step 100: searching for conflicting contents of multiple project files in the project files whose conflicts need to be resolved;
[0127] Step 200: storing the conflicting content of each project file into an array;
[0128] Step 300: Processing project file conflicts according to multiple arrays.
[0129] The embodiments of the present application also provide a computer-readable storage medium capable of implementing all the steps of the method for handling engineering file conflicts based on a mobile communication device in the above embodiments. The computer-readable storage medium stores a computer program. When the computer program is executed by a processor, all the steps of the method for handling engineering file conflicts based on a mobile communication device in the above embodiments are implemented. For example, when the processor executes the computer program, the following steps are implemented:
[0130] Step 100: searching for conflicting contents of multiple project files in the project files whose conflicts need to be resolved;
[0131] Step 200: storing the conflicting content of each project file into an array;
[0132] Step 300: Processing project file conflicts according to multiple arrays.
[0133] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the hardware + program embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0134] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0135] Although the present application provides method operation steps such as embodiments or flow charts, more or fewer operation steps may be included based on conventional or non-creative labor. The order of steps listed in the embodiments is only one way of executing the order of many steps and does not represent the only execution order. When the actual device or client product is executed, it can be executed in the order of the method shown in the embodiments or the drawings or in parallel (for example, in a parallel processor or multi-threaded processing environment).
[0136] For the convenience of description, the above devices are described in various modules according to their functions. Of course, when implementing the embodiments of this specification, the functions of each module can be implemented in the same or more software and / or hardware, or the module implementing the same function can be implemented by a combination of multiple sub-modules or sub-units. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0137] Those skilled in the art also know that, in addition to implementing the controller in a purely computer-readable program code, the controller can be made to implement the same function in the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers by logically programming the method steps. Therefore, such a controller can be considered as a hardware component, and the devices for implementing various functions included therein can also be considered as structures within the hardware component. Or even, the devices for implementing various functions can be considered as both software modules for implementing the method and structures within the hardware component.
[0138] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0139] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0140] The present specification embodiments may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present specification embodiments may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.
[0141] Each embodiment in this specification is described in a progressive manner, and the same and similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment. In the description of this specification, the description of the reference terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the embodiment of this specification. In this specification, the schematic representation of the above terms does not necessarily target the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner. In addition, in the absence of contradiction, a person skilled in the art can combine and combine the different embodiments or examples described in this specification and the features of different embodiments or examples.
[0142] The above is only an example of the embodiment of the present specification and is not intended to limit the embodiment of the present specification. For those skilled in the art, the embodiment of the present specification may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the embodiment of the present specification shall be included in the scope of the claims of the embodiment of the present specification.
Claims
1. A method for processing engineering file conflicts based on a mobile communication device, characterized in that: include: Find conflicting contents of multiple project files in the project files where conflicts need to be resolved; Store the conflicting content of each project file into an array; Handle project file conflicts based on multiple arrays; The elements in the array are the contents of each project file; The step of searching for conflicting contents of multiple project files in the project files to be resolved includes: Determine the compilable file content, file reference content, and group file content in the project file whose conflicts need to be resolved; Searching for conflicting contents of multiple project files in the compilable file contents, file reference contents, and group file contents; The searching for conflicting contents of multiple project files in the compilable file contents, file reference contents, and group file contents includes: According to the conflict start symbol of the project file conflict and the separator symbol between multiple conflicts, searching for multiple project file conflict contents in the compilable file content, the file reference content and the group file content; The processing of project file conflicts according to multiple arrays includes: When the elements in multiple arrays are not the same, the conflicting contents of the multiple project files are merged; specifically, if the content of a certain line starts with a conflict resolution symbol, the elements in the first array and the second array are compared; if there are no identical elements, a merge process is performed.
2. The method for handling project file conflicts according to claim 1, characterized in that: The determination of the compilable file content, file reference content, and group file content in the project file whose conflicts are to be resolved includes: Scanning the engineering file whose conflict needs to be resolved line by line to determine the content of the engineering file; In the project file content, the compilable file content is determined according to the compilable file start mark and the compilable file end mark; In the project file content, the file reference content is determined according to the file reference start mark and the file reference end mark; In the project file content, the group file content is determined according to a group start mark and a group end mark.
3. A project file conflict handling device based on a mobile communication device, characterized in that: include: A conflict content search module is used to search for conflicting contents of multiple project files in the project files whose conflicts need to be resolved; A conflict content storage module, used for storing the conflict content of each project file into an array; The project file conflict handling module is used to handle project file conflicts based on multiple arrays; The elements in the array are the contents of each project file; The conflict content search module includes: A file content determination unit, used to determine the compilable file content, file reference content and group file content in the project file whose conflict is to be resolved; A conflict content search unit, used for searching for conflicting contents of multiple project files in the compilable file contents, file reference contents and group file contents; The conflict content searching unit comprises: A multiple conflict content search unit, used for searching for multiple project file conflict contents in the compilable file content, the file reference content and the group file content according to the conflict start symbol of the project file conflict and the separator symbol between multiple conflicts; The engineering file conflict processing module includes: The conflict content merging unit is used to merge the conflicting contents of the multiple project files when the elements in the multiple arrays are different. Specifically, if the content of a certain line starts with a conflict resolution symbol, the elements in the first array and the second array are compared; if there are no identical elements, a merge process is performed.
4. The project file conflict handling device according to claim 3, characterized in that: The file content determination unit comprises: A project file scanning unit, used for scanning the project file with the conflict to be resolved line by line to determine the content of the project file; A compilable content determination unit, used to determine the compilable file content in the project file content according to the compilable file start mark and the compilable file end mark; A file reference content determination unit, used to determine the file reference content in the project file content according to a file reference start mark and a file reference end mark; The group file content determination unit is used to determine the group file content according to the group start mark and the group end mark in the project file content.
5. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of the project file conflict handling method based on a mobile communication device according to any one of claims 1 to 2 are implemented.
6. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method for handling engineering file conflicts based on a mobile communication device as described in any one of claims 1 to 2 are implemented.
Citation Information
Patent Citations
Method and device for generating merge conflict record list
CN104123126A
Program file processing method and device
CN107329765A
