Data processing method and device, electronic equipment, storage medium and computer program
By obtaining remote log data and converting it into git commands to process local tags, the dirty data problem caused by the desynchronization of remote tags in gitlab is solved, and efficient data processing and retaining unsubmitted tags are achieved.
Patent Information
- Application Number
- CN202411065477.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-05
- Publication Date
- 2024-11-12
AI Technical Summary
When using gitlab software, tags deleted by remote users will not be deleted when synchronized locally, resulting in dirty data generation, and the forced synchronization command deletes local unpushed tags, resulting in data loss.
By obtaining the log data generated when remotely operating the version control system tag tag, converting the log data into a target git command, and executing the command locally to create, delete or retain local tags to avoid dirty data Generation and data loss.
It realizes the retention of uncommitted tags while deleting local dirty data, which improves data processing efficiency and avoids the problem of data loss in large multi-branch and multi-version projects.
Smart Images

Figure CN118939623A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a data processing method, device, electronic device, storage medium, and computer program. Background Art
[0002] When users actually use the gitlab software, they can synchronize tags created by remote users to local users through tag synchronization. However, when the remote user deletes the tag, the locally synchronized tag will not be deleted. When the local user pushes the tag again, the tag that has been deleted remotely will be pushed to the server, resulting in dirty data.
[0003] In the related art, the generated dirty data can be deleted through a forced synchronization command, but at the same time, the local tags that have not been pushed will also be deleted, resulting in data loss. Summary of the invention
[0004] The present disclosure provides a data processing method, device, electronic device, storage medium and computer program.
[0005] According to a first aspect of the present disclosure, a data processing method is provided, the method comprising:
[0006] Get the log data generated when the remote end operates the tag of the version control system;
[0007] Convert the log data into target git commands;
[0008] The target git command is executed locally to perform target processing on the local tag; wherein the target processing includes creation, deletion or retention.
[0009] According to a second aspect of the present disclosure, a data processing device is provided, the device comprising:
[0010] The core scheduler is used to obtain the log data generated when the remote end operates the tag of the version control system;
[0011] A log parser, used to convert the log data into target git commands;
[0012] The local tag controller is used to execute the target git command locally and perform target processing on the local tag; wherein the target processing includes creation, deletion or retention processing.
[0013] According to a third aspect of the present disclosure, an electronic device is provided, which includes a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the program, the method described above is implemented.
[0014] According to a fourth aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored, and when the program is executed by a processor, the above method of the present disclosure is implemented.
[0015] According to a fifth aspect of the present disclosure, a computer program product is provided, including a computer program, wherein the computer program implements the above method of the present disclosure when executed by a processor.
[0016] The data processing method, device, electronic device, storage medium and computer program provided by the embodiments of the present disclosure obtain log data generated when a remote end operates a tag, convert the log data into a target git command, and execute the target git command locally to achieve target processing of local tags. Since the target processing can include the creation, deletion or retention of local tags, it is possible to retain the tags that have been created but not submitted locally and not deleted while deleting local dirty data, which can greatly improve the data processing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Further details, features and advantages of the present disclosure are disclosed in the following description of exemplary embodiments in conjunction with the accompanying drawings, in which:
[0018] Figure 1 A schematic diagram of a data processing system provided for an exemplary embodiment of the present disclosure;
[0019] Figure 2 A schematic diagram of tag synchronization provided by an exemplary embodiment of the present disclosure;
[0020] Figure 3 A schematic diagram of converting a log into a git command provided by an exemplary embodiment of the present disclosure;
[0021] Figure 4 A schematic diagram of converting batch logs into git commands provided by an exemplary embodiment of the present disclosure;
[0022] Figure 5 A flowchart of a data processing method provided for an exemplary embodiment of the present disclosure;
[0023] Figure 6 A structural block diagram of an electronic device provided for an exemplary embodiment of the present disclosure;
[0024] Figure 7 A structural block diagram of a computer system provided for an exemplary embodiment of the present disclosure. DETAILED DESCRIPTION
[0025] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.
[0026] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.
[0027] The term "including" and its variations used in this document are open inclusions, that is, "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one other embodiment"; the term "some embodiments" means "at least some embodiments". Relevant definitions of other terms will be given in the description below. It should be noted that the concepts of "first", "second", etc. mentioned in this disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0028] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".
[0029] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0030] It is understandable that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, scope of use, usage scenarios, etc. of the personal information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.
[0031] For example, in response to receiving an active request from a user, a prompt message is sent to the user to clearly prompt the user that the operation requested to be performed will require obtaining and using the user's personal information. Thus, the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, application, server, or storage medium that performs the operation of the technical solution of the present disclosure according to the prompt message.
[0032] As an optional but non-limiting implementation, in response to receiving an active request from the user, the method of sending a prompt message to the user may be, for example, a pop-up window, in which the prompt message may be presented in text. In addition, the pop-up window may also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device. It is understandable that the above notification and the process of obtaining user authorization are only illustrative and do not constitute a limitation on the implementation of the present disclosure. Other methods that meet relevant laws and regulations may also be applied to the implementation of the present disclosure.
[0033] Currently, the creation and uploading of software version tags (version control system labels) based on gitlab (version control system project warehouse application) usually uses the git in the IDE (Integrated Development Environment) development manager for visual plug-in operations. At the same time, commands that the plug-in does not have can be operated through the git command line. For example, when synchronizing tags on a remote server, you can use the git fetch--prune--prune-tags origin command to delete redundant local tags and synchronize newly added tags on the remote server to the local server.
[0034] The relevant technology can meet the requirements in some simple small projects, but for some large multi-branch and multi-version projects developed simultaneously, the following problems will occur in actual application:
[0035] First, the synchronization mechanism using git tags is relatively simple, but it is also prone to dirty data. When using the git function in the IDE integrated development tool, you will generally use (1) to create tags locally, (2) push the local full / specified branch tags to the remote, and (3) pull the remote branch to the local. At this time, if A and B are operating locally at the same time, A first creates tag1 and pushes it to the remote server, then B pulls the server tag1 to the local, and then A deletes the server and A's local tag1. When B pulls all the remote tags again, according to the git strategy, B's local tag1 will not be deleted. When B pushes other tags to the remote at this time, the tag1 is pushed to the server again, resulting in dirty data. As long as one person still has the tag1 locally, it is possible to push dirty data to the remote.
[0036] Secondly, using the forced synchronization command before each push will cause the tags that have been typed but not pushed locally to be forcibly deleted. For the above problems, simple projects can use the command line git fetch--prune--prune-tagsorigin to force the synchronization of all remote tags to the local, and delete the local uncommitted tags. However, for large projects with multiple branches and multiple versions being developed simultaneously, forcing the synchronization to delete tags that are available locally but not remotely before each submission and push will cause the local tags that have been typed to be deleted when the test is completed (because there are usually multiple intermediate repair tag versions during testing, they will not be pushed to the remote to form the official version tag before the test is completed), resulting in the loss of version information. Large projects often have many branches, many and complex tag versions, and the method of forcibly deleting local tags is not reasonable.
[0037] Based on the above problems, the present disclosure aims to implement a large-scale multi-branch multi-tag parallel development project, which can avoid the generation of dirty data locally by using simple plug-in operations while not deleting local uncommitted tags.
[0038] like Figure 1 As shown, Figure 1 This is a schematic diagram of a data processing system provided by the present disclosure, which may specifically include: a label control device, an IDE integrated development tool, a gitlab server, and a local git bash. The label control device may specifically include:
[0039] Core scheduler: responsible for receiving operation interface requests, calling other component function operations and returning the interface return values uniformly.
[0040] Operation interface: receives IDE development tool commands and calls the core scheduler to perform related operations.
[0041] Local tag controller: calls local git related commands to perform operations such as submission or pull.
[0042] Log parser: responsible for parsing the messages requested by the network connector.
[0043] Local storage: stores data such as the time point of the last synchronization in the form of files.
[0044] Network connector: Use httpclient to call gitlab's API to obtain logs and other operations.
[0045] Specifically, during each synchronization from remote to local, all logs from the remote between the last synchronization time and the current time can be synchronized to the local, and the logs can be converted into git commands to simulate other users' operations on the remote to operate the local tag, so as to keep the local and remote states incrementally synchronized, instead of using the forced overwrite synchronization method such as git fetch--prune--prune-tags origin, which can ensure that dirty data can be deleted while local uncommitted data will not be deleted. Among them, this synchronization operation can be performed before each tag push.
[0046] like Figure 2 As shown, Figure 2 The schematic diagram of tag synchronization provided by the present disclosure. For example, user A normally creates tag1 at commit point commit1 locally, creates tag2 at commit3 and pushes it to the server, the server records user A's operation behavior to form a log, user B synchronizes tag1 and tag2 locally (first time), and user A deletes tag1 remotely at this time, the server records the log, user B creates local tag3 but does not submit it, and performs the synchronization command of this device (second time) to the local, after synchronization, user A's deleted tag1 (dirty data) is also deleted locally by user B, and user B's local unsubmitted tag3 is not deleted.
[0047] Specifically, the sync command provided by this device will first read the last synchronization time point stored locally by the current user B, call the gitlab api (application program interface) through the network connector, obtain all pushed tag log messages, parse the events of type tag in order of events after being parsed by the log parser, and select all logs from the last synchronization time point (if no time point is recorded, the time of cloning the project is selected) to the current time point ( Figure 2 The logs in the figure are all the logs between the first sync and the second sync, which is log 3). The logs are converted into git commands and compressed. The local tag controller calls the local git program to execute them in sequence. After completion, the local storage synchronization time is updated.
[0048] like Figure 3 As shown, Figure 3The schematic diagram of converting logs to git commands is provided for the implementation of the present disclosure. The principle process of converting logs to git commands in the above process is as follows: in the range of the last synchronization time and the current time interval, the log of the tag operation can be obtained by requesting the gitlab server, and the log of the tag operation is converted into a git command, and the action_name, push_data.ref_type in the git server standard message are read, and the push_data.action field is determined to be a new tag action, and commit_to is read to obtain the hash point to generate the tag, and the first 8 hash values 2ff16021 are taken, and push_data.ref is obtained as the tag content v1.0.0.1. After the above process, the git command git tag "v1.0.0.1" 2ff16021 is generated and handed over to the subsequent logic for execution, and the deletion logic is the same.
[0049] like Figure 4 As shown, Figure 4 A schematic diagram of converting batch logs into git commands provided by an embodiment of the present disclosure. Operations for the same tag at the same commit point are arranged together, and then the incremental results of multiple operations on the same tag are retained without change, such as Figure 4 In the command, git tag "Tag1" commit1 and git tag-d "Tag1" (commit1), two actions for commit1 (commit1 here is actually a hash value) cancel each other out and can be deleted. The remaining commands are left for subsequent execution. This is mainly used to optimize the log when there is a lot of historical operation data, reduce compression commands and optimize synchronization speed. This operation is mainly used to simulate the operations that occurred on the server during the first and second synchronizations and reproduce the operations incrementally locally.
[0050] Based on the above system, the specific implementation process implemented by the present disclosure may include the following steps:
[0051] Step 1, initiate a synchronization command: the developer may click the plug-in operation sync tag button in the IDE, and the application program operation interface device of the device is called.
[0052] Step 2, log synchronization: After the application operation interface is called, the information is passed to the core scheduler, and the local storage is called to obtain the time when the local storage file is read. This time is the last synchronization completion time T1. If the file or time does not exist, the device obtains the project creation time T1 when the project is cloned locally. The current time is obtained as T2. The core scheduler calls the network connector, and the network connector initiates an http network request to the gitlab server to call the remote log interface, using the T1 to T2 time period as a parameter, and filters all tag operations with a time between the last synchronization and the current period, and obtains the return message log in json format, such as Figure 3 In the format example, the network connector returns the JSON message to the core scheduler.
[0053] Step 3, sort out git commands: pass the message log in step 2 to the log parser of the device. The log parser determines the operation type commit_to, commit_from, push_data.ref according to the fields action_name, push_data.ref_type, push_data.action in the log, and determines the operation object, and generates a set of git local commands, such as Figure 3 The conversion method in the example simulates all other users' remote operations, sorts out the git commands, rearranges the operation commands of the same object, determines the commands that cancel each other out, deletes the commands that cancel each other out, and compresses the commands to form a new command group, such as Figure 4 The process in .
[0054] Step 4, execute the converted command group: the core scheduler sends the commands organized in step 4 to the local label controller, and the local label controller calls the local git bash commands in sequence to execute the command group, and returns the execution completion information to the core scheduler.
[0055] Step 5, record the synchronization time: After the core scheduler receives the information returned in step 4, it calls the local storage device. The local storage device records the T2 time, which is the current operation time node, and records the value into a local file for persistent storage. This time point will be the T1 time point in step 2 when it is used next time.
[0056] Therefore, based on the above embodiments, the present disclosure also provides a data processing method, such as Figure 5 As shown, the method may include the following steps:
[0057] In step S510, log data generated when the remote end operates on the tag is obtained.
[0058] In the embodiment, multiple users can interact with the server through multiple terminals respectively. The remote terminal can be a terminal interacting with the server, and the local terminal can be another terminal interacting with the server. The remote terminal can create tags and synchronize the created tags to the server, and the local terminal can synchronize the tags created by the remote terminal through the server. The server in the embodiment can be a gitlab server.
[0059] Since the remote end may perform a deletion operation on the created tag, dirty data is likely to be generated locally after the tag created by the remote end is synchronized. However, if a forced synchronization operation is performed, the tags that have been created but not submitted locally will be deleted, resulting in data loss. Therefore, the log data generated when the remote end operates on the tag can be obtained. Specifically, all the log data of the remote end can be obtained first, and then the log data related to the tag operation can be determined from the log data, or the log data related to the tag operation can be directly obtained, and the implementation example is not limited to this.
[0060] Specifically, the log synchronization time of the previous cycle can be obtained, and the current time can be obtained; wherein the current time is the log synchronization time of this cycle. The log data generated when the remote end operates the tag between the log synchronization time of the previous cycle and the current time is obtained. For example, in the above embodiment, the last synchronization completion time T1 is the log synchronization time of the previous cycle, and the current time is the synchronization time T2 of this time.
[0061] In step S520, the log data is converted into a target git command.
[0062] In an embodiment, the log data of the operation performed on the tag by the remote end can be converted into a target git command, and the target git command can specifically be an operation of creating or deleting the tag.
[0063] Specifically, the log data can be converted into multiple git commands, and the multiple git commands are divided into multiple categories; wherein different categories of git commands represent git commands for different tags. A merge operation is performed on the git commands in each category to obtain a target git command; wherein the merge operation is used to delete git commands that cancel each other out. Since the log data can be converted into multiple git commands, which may include repeated or mutually cancelling commands, the multiple git commands can be compressed. For example, for the same tag, it may include a create command for the tag and a delete command for deleting the tag. The create command and the delete command for the same tag can cancel each other out, so the create command and the delete command can be deleted. The obtained target git command can process local tags more effectively.
[0064] In step S530, the target git command is executed locally to perform target processing on the local tag; wherein the target processing includes creation, deletion or retention processing.
[0065] In the embodiment, after obtaining the target git command, the target git command may include multiple target git commands, and the execution time corresponding to each target git command can be obtained. The execution time can be determined based on the generation time of the corresponding log data, and the generation time of the log indicates the execution order of the git command, so that the execution order of each target git command can be accurately determined, which is convenient for simulating the execution order of the git command actually executed by the remote end.
[0066] In the embodiment, when the target git command is executed locally and the local tags are processed by the target, the multiple tags stored locally can be deleted, retained or created.
[0067] Specifically, multiple tags stored locally can be obtained, and when the target git command includes a delete tag command, the corresponding tag among the multiple tags is deleted. When the target git command includes a create tag command, the corresponding tag is created locally. When there is a target tag among multiple tags that is not related to the target git command, the target tag is retained. In this way, according to the target git command, the tags in the local storage can be deleted or retained, or new tags can be created. In this way, while deleting dirty data, the tags that have been created but not submitted locally can be kept from being deleted. In addition, by executing the target git command, the synchronization of local and remote tags can be achieved.
[0068] The data processing method provided by the embodiment of the present disclosure obtains the log data generated when the remote end operates on the tag, converts the log data into a target git command, and executes the target git command locally to achieve target processing of the local tag. Since the target processing can include the creation, deletion or retention of the local tag, the tags that have been created but not submitted locally can be retained from being deleted while deleting the local dirty data, which can greatly improve the data processing efficiency.
[0069] Based on the above embodiment, in another embodiment provided by the present disclosure, the method can also retain the tag to be processed when the target git command includes multiple operations on the same tag to be processed in multiple tags and there is no incremental change in the tag to be processed.
[0070] Specifically, Figure 4As shown in the figure, by arranging the operations for the same tag at the same commit point together, the incremental results of multiple operations on the same tag are retained without change, and the remaining commands are executed later. This is mainly used to optimize the logs when there is a lot of historical operation data, which can reduce compression commands and optimize synchronization speed.
[0071] Based on the above embodiment, in another embodiment provided by the present disclosure, before S510, the method can also obtain the tags created by the remote end in the server and save the tags created by the remote end in the server to the local. In this way, the purpose of synchronizing the tags created by the remote end to the local can be achieved, and the purpose of deleting the dirty data in the local tags can be further achieved through the method in the above embodiment, and the tags created but not submitted locally can be retained and not deleted.
[0072] In the case of dividing each functional module according to each function, the embodiment of the present disclosure provides a data processing device, which can be specifically the tag control device in the above embodiment. The data processing device includes:
[0073] The core scheduler is used to obtain the log data generated when the remote end operates the tag of the version control system;
[0074] A log parser, used to convert the log data into target git commands;
[0075] The local tag controller is used to execute the target git command locally and perform target processing on the local tag; wherein the target processing includes creation, deletion or retention processing.
[0076] In another embodiment provided by the present disclosure, the core scheduler is specifically used to:
[0077] Get the log synchronization time of the previous cycle and the current time; the current time is the log synchronization time of this cycle;
[0078] Obtain log data generated when the remote end operates on the tag between the log synchronization time of the previous cycle and the current time.
[0079] In another embodiment provided by the present disclosure, the log parser is specifically used to:
[0080] Converting the log data into a plurality of git commands;
[0081] Divide the multiple git commands into multiple categories; wherein different categories of git commands represent git commands for different tags;
[0082] A merge operation is performed on the git commands in each category to obtain a target git command; wherein the merge operation is used to delete the git commands that cancel each other out.
[0083] In another embodiment provided by the present disclosure, the local tag controller is specifically used to:
[0084] Obtaining the execution time of each git command in the target git command; the execution time of the git command is determined based on the generation time of the log data corresponding to the git command;
[0085] The target git commands are executed sequentially according to the execution time.
[0086] In another embodiment provided by the present disclosure, the local tag controller is further configured to:
[0087] Get multiple tags stored locally;
[0088] When the target git command includes a tag deletion command, deleting a corresponding tag from the multiple tags;
[0089] When the target git command includes a create tag command, create a corresponding tag locally;
[0090] When there is a target tag that is not related to the target git command among the multiple tags, the target tag is retained.
[0091] In another embodiment provided by the present disclosure, the device further includes:
[0092] The tag deletion module is used to retain the tag to be processed when the target git command includes multiple operations on the same tag to be processed among the multiple tags and the tag to be processed has no incremental change.
[0093] In another embodiment provided by the present disclosure, the device further includes: a tag synchronization module, specifically configured to:
[0094] Get the tag created remotely in the server;
[0095] The tag created remotely in the server is saved locally.
[0096] The data processing device provided by the embodiment of the present disclosure obtains the log data generated when the remote end operates on the tag, converts the log data into a target git command, and executes the target git command locally to achieve target processing of the local tag. Since the target processing can include the creation, deletion or retention of the local tag, the tags that have been created but not submitted locally can be retained from being deleted while deleting the local dirty data, which can greatly improve the data processing efficiency.
[0097] An embodiment of the present disclosure also provides an electronic device, comprising: at least one processor; and a memory for storing instructions executable by the at least one processor; wherein the at least one processor is configured to execute the instructions to implement the above method disclosed in the embodiment of the present disclosure.
[0098] Figure 6 The structure diagram of an electronic device provided by an exemplary embodiment of the present disclosure is shown in FIG. Figure 6 As shown, the electronic device 1800 includes at least one processor 1801 and a memory 1802 coupled to the processor 1801 , and the processor 1801 can execute corresponding steps in the above method disclosed in the embodiment of the present disclosure.
[0099] The processor 1801 may also be referred to as a central processing unit (CPU), which may be an integrated circuit chip having signal processing capabilities. Each step in the method disclosed in the embodiment of the present disclosure may be completed by an integrated logic circuit of hardware in the processor 1801 or by instructions in the form of software. The processor 1801 may be a general-purpose processor, a digital signal processor (DSP), an ASIC (Application Specific Integrated Circuit), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. A general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. The steps of the method disclosed in the embodiment of the present disclosure may be directly embodied as being executed by a hardware decoding processor, or may be executed by a combination of hardware and software modules in a decoding processor. The software module may be located in a memory 1802, such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, or other mature storage media in the art. The processor 1801 reads the information in the memory 1802 and completes the steps of the method in combination with its hardware.
[0100] In addition, when various operations / processes according to the present disclosure are implemented by software and / or firmware, they can be transmitted from a storage medium or a network to a computer system having a dedicated hardware structure, such as Figure 7 The computer system 1900 shown is installed with the programs constituting the software. When the various programs are installed, the computer system can perform various functions, including the functions described above. Figure 7 A structural block diagram of a computer system provided for an exemplary embodiment of the present disclosure.
[0101] Computer system 1900 is intended to represent various forms of digital electronic computer devices, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. Electronic devices can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0102] like Figure 7 As shown, the computer system 1900 includes a computing unit 1901, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 1902 or a computer program loaded from a storage unit 1908 to a random access memory (RAM) 1903. In the RAM 1903, various programs and data required for the operation of the computer system 1900 can also be stored. The computing unit 1901, the ROM 1902, and the RAM 1903 are connected to each other via a bus 1904. An input / output (I / O) interface 1905 is also connected to the bus 1904.
[0103] A plurality of components in the computer system 1900 are connected to the I / O interface 1905, including: an input unit 1906, an output unit 1907, a storage unit 1908, and a communication unit 1909. The input unit 1906 may be any type of device capable of inputting information to the computer system 1900, and the input unit 1906 may receive input digital or character information, and generate key signal inputs related to user settings and / or function control of the electronic device. The output unit 1907 may be any type of device capable of presenting information, and may include, but is not limited to, a display, a speaker, a video / audio output terminal, a vibrator, and / or a printer. The storage unit 1908 may include, but is not limited to, a disk, an optical disk. The communication unit 1909 allows the computer system 1900 to exchange information / data with other devices over a network such as the Internet, and may include, but is not limited to, a modem, a network card, an infrared communication device, a wireless communication transceiver, and / or a chipset, such as a Bluetooth™ device, a WiFi device, a WiMax device, a cellular communication device, and / or the like.
[0104] The computing unit 1901 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 1901 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 1901 performs the various methods and processes described above. For example, in some embodiments, the above methods disclosed in the embodiments of the present disclosure may be implemented as a computer software program, which is tangibly included in a machine-readable medium, such as a storage unit 1908. In some embodiments, part or all of the computer program may be loaded and / or installed on an electronic device via ROM 1902 and / or communication unit 1909. In some embodiments, the computing unit 1901 may be configured to perform the above methods disclosed in the embodiments of the present disclosure in any other appropriate manner (e.g., by means of firmware).
[0105] The embodiment of the present disclosure further provides a computer-readable storage medium, wherein when instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the above method disclosed in the embodiment of the present disclosure.
[0106] The computer-readable storage medium in the disclosed embodiments may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. The computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or equipment, or any suitable combination of the foregoing. More specifically, the computer-readable storage medium may include an electrical connection based on one or more lines, a portable computer 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 of the foregoing.
[0107] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0108] The embodiments of the present disclosure further provide a computer program product, including a computer program, wherein when the computer program is executed by a processor, the above method disclosed in the embodiments of the present disclosure is implemented.
[0109] In embodiments of the present disclosure, computer program codes for performing the operations of the present disclosure may be written in one or more programming languages or combinations thereof, including but not limited to object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" language or similar programming languages. The program code may be executed entirely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer, partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer.
[0110] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0111] The modules, components or units involved in the embodiments described in the present disclosure may be implemented by software or hardware, wherein the names of the modules, components or units do not, in some cases, limit the modules, components or units themselves.
[0112] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chip (SOCs), complex programmable logic devices (CPLDs), and the like.
[0113] The above descriptions are only some embodiments of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, a technical solution formed by replacing the above features with the technical features with similar functions disclosed in the present disclosure (but not limited to).
[0114] Although some specific embodiments of the present disclosure have been described in detail by way of example, it should be understood by those skilled in the art that the above examples are for illustration only and are not intended to limit the scope of the present disclosure. It should be understood by those skilled in the art that the above embodiments may be modified without departing from the scope and spirit of the present disclosure. The scope of the present disclosure is defined by the appended claims.
Claims
1. A data processing method, characterized in that: The method comprises: Get the log data generated when the remote end operates the tag of the version control system; Convert the log data into target git commands; The target git command is executed locally to perform target processing on the local tag; wherein the target processing includes creation, deletion or retention.
2. The method according to claim 1, characterized in that The step of obtaining log data generated when a remote end operates a tag of a version control system includes: Get the log synchronization time of the previous cycle and the current time; the current time is the log synchronization time of this cycle; Obtain log data generated when the remote end operates on the tag between the log synchronization time of the previous cycle and the current time.
3. The method according to claim 1, characterized in that The converting the log data into a target git command comprises: Converting the log data into a plurality of git commands; Divide the multiple git commands into multiple categories; wherein different categories of git commands represent git commands for different tags; A merge operation is performed on the git commands in each category to obtain a target git command; wherein the merge operation is used to delete the git commands that cancel each other out.
4. The method according to claim 1, characterized in that: The locally executing the target git command includes: Obtaining the execution time of each git command in the target git command; the execution time of the git command is determined based on the generation time of the log data corresponding to the git command; The target git commands are executed sequentially according to the execution time.
5. The method according to claim 1, characterized in that Delete or retain local tags, including: Get multiple tags stored locally; Alternatively, when the target git command includes a delete tag command, delete a corresponding tag from the multiple tags; Alternatively, when the target git command includes a create tag command, a corresponding tag is created locally; Alternatively, when there is a target tag that is not related to the target git command among the multiple tags, the target tag is retained.
6. The method according to claim 5, characterized in that The method further comprises: When the target git command includes multiple operations on the same tag to be processed among the multiple tags, and the tag to be processed has no incremental change, the tag to be processed is retained.
7. The method according to claim 1, characterized in that Before obtaining the log data generated when the remote end operates the tag tag of the version control system, the method further includes: Get the tag created remotely in the server; The tag created remotely in the server is saved locally.
8. A data processing device, characterized in that: The device comprises: The core scheduler is used to obtain the log data generated when the remote end operates the tag of the version control system; A log parser, used to convert the log data into target git commands; The local tag controller is used to execute the target git command locally and perform target processing on the local tag; wherein the target processing includes creation, deletion or retention processing.
9. An electronic device, characterized in that: include: at least one processor; a memory for storing the at least one processor-executable instruction; The at least one processor is configured to execute the instructions to implement the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: When the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform the method as claimed in any one of claims 1 to 7.
11. A computer program product, characterized in that The invention comprises a computer program, which implements the method according to any one of claims 1 to 7 when being executed by a processor.
