CN110555317A - Application file change processing method, device and system - Google Patents

Application file change processing method, device and system Download PDF

Info

Publication number
CN110555317A
CN110555317A CN201910847021.XA CN201910847021A CN110555317A CN 110555317 A CN110555317 A CN 110555317A CN 201910847021 A CN201910847021 A CN 201910847021A CN 110555317 A CN110555317 A CN 110555317A
Authority
CN
China
Prior art keywords
file
source code
client
project
application
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201910847021.XA
Other languages
Chinese (zh)
Other versions
CN110555317B (en
Inventor
纪鹏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Inspur General Software Co Ltd
Original Assignee
Shandong Inspur Genersoft Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shandong Inspur Genersoft Information Technology Co Ltd filed Critical Shandong Inspur Genersoft Information Technology Co Ltd
Priority to CN201910847021.XA priority Critical patent/CN110555317B/en
Publication of CN110555317A publication Critical patent/CN110555317A/en
Application granted granted Critical
Publication of CN110555317B publication Critical patent/CN110555317B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/20Software design

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Bioethics (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Hardware Design (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Databases & Information Systems (AREA)
  • Stored Programmes (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

the invention provides a method, a device and a system for processing change of an application file. When a client requests to develop a source code project of an application, if any client does not have writing permission to the project currently, an access token of the project is sent to the client, so that the client can write to the project and can read other projects of the application based on the access token; when the client requests file access, files of all projects of the application in the latest file set in the code base of the application are copied to a working area of the project, and the files in the working area are sent to the client; when the client requests to change the file, the file of the project in the working area is modified; when the client requests to submit changes, the latest file set of the code base is synchronized to the working area with the files of other projects, and the version control system is triggered to form the latest file set of the code base by the files in the working area. The scheme can avoid file change conflict.

Description

Application file change processing method, device and system
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method, an apparatus, and a system for processing an application file change.
Background
In the computer software engineering development process, there are usually application parallel development situations in which multiple persons participate in developing one application. When an application is developed, an integrated development environment running on a server provides services to share computing resources.
Currently, different developers can share a workspace, but when different developers work simultaneously on an application, file change conflicts can occur.
disclosure of Invention
the invention provides a method, a device and a system for processing application file change, which can avoid file change conflict.
In order to achieve the purpose, the invention is realized by the following technical scheme:
In a first aspect, the present invention provides an application file change processing module, including: the system comprises a permission service unit and an engineering resource management service unit;
The permission service unit is used for judging whether any client does not have the write permission of a first source code project currently or not when receiving a development request which is sent by a first client and aims at the first source code project of an application, and if so, sending an access token of the first source code project to the first client so that the first client has the write permission to the first source code project and the read permission to any other source code project of the application based on the access token;
the engineering resource management service unit is used for executing the following operations:
When a file access request which is sent by the first client and comprises the access token is received, copying each source code file which corresponds to each source code project of the application and is in the latest file set in the code library of the application to a working area of the first source code project according to the access token, and sending each source code file in the working area to the first client;
when a file change request which is sent by the first client and comprises the access token is received, modifying a source code file corresponding to the first source code project in the working area according to the access token;
And when a change submitting request which is sent by the first client and comprises the access token is received, synchronizing each source code file corresponding to each other source code project in the latest file set in the code library to the working area according to the access token, and triggering a version control system to form the latest file set in the code library by each source code file in the working area.
Further, the project resource management service unit is configured to, when receiving the file access request, query the permission service unit according to the access token to determine the application and the first source code project; and when the file change request or the change submitting request is received, inquiring the authority service unit according to the access token to determine the first source code project and the working area.
Further, the file change request further comprises a file identifier and file change content;
and the project resource management service unit is used for judging whether the first source code project corresponds to a first source code file with the file identifier or not according to the access token when the file change request is received, and if so, modifying the first source code file in the working area according to the file change content.
Furthermore, the application file change processing module is provided with two agents, namely a version control service corresponding to the version control system and a file service corresponding to a file server;
the engineering resource management service unit is used for executing the following operations:
When the file access request is received, requesting a first storage position of a latest file set in the code base from the version control system through the version control service; triggering the file server to copy each source code file corresponding to each source code project of the application in the latest file set in the code library to a working area of the first source code project according to the first storage position through the file service, and sending each source code file in the working area to the first client through the file service;
Modifying the source code file corresponding to the first source code project in the working area through the file service;
Requesting, by the versioning service, a second storage location of a latest file set in the code library from the versioning system upon receiving the submit change request; triggering the file server to synchronize each source code file corresponding to each other source code project in the latest file set in the code base to the working area according to the second storage position through the file service; and triggering the version control system to form a latest file set in the code base by each source code file in the working area through the version control service.
further, the permission service unit is configured to, when receiving the development request, verify the read-write permission of the first client to the first source code project according to the login information of the first client, and when the verification passes, determine whether the access token sent last time is invalid, and if so, generate the access token again and send the access token to the first client;
and the engineering resource management service unit is used for notifying the authority service unit that the access token is invalid when the version control system is triggered.
in a second aspect, the present invention provides an application file change processing system, including: the system comprises a version control system, at least one client and any one of the application file change processing modules;
Each client is used for executing the following operations through a browser based on external control: sending a development request of a first source code project for an application to the application file change processing module, and receiving an access token returned by the application file change processing module; sending a file access request including the access token to the application file change processing module; receiving each source code file sent by the application file change processing module; sending a file change request including the access token to the application file change processing module; and sending a change submitting request comprising the access token to the application file change processing module.
Further, the application file change processing system further includes: a file server;
the file server is used for storing a code library of the application, the code library comprises at least one file set, and the file set comprises source code files corresponding to source code projects of the application;
The application file change processing module is used for sending each source code file in the working area to the version control system;
and the version control system is used for forming a latest file set in the code base by using each received source code file, recording the storage position of the latest file set in the file server, and storing the latest file set to the file server based on the storage position.
In a third aspect, the present invention provides an application file change processing method, which is applied to any one of the above application file change processing modules, and includes:
When a development request which is sent by a first client and aims at a first source code project of an application is received, judging whether any client does not have the write permission of the first source code project at present, if so, sending an access token of the first source code project to the first client, so that the first client has the write permission to the first source code project and the read permission to any other source code project of the application based on the access token;
When a file access request which is sent by the first client and comprises the access token is received, copying each source code file which corresponds to each source code project of the application and is in the latest file set in the code library of the application to a working area of the first source code project according to the access token, and sending each source code file in the working area to the first client;
when a file change request which is sent by the first client and comprises the access token is received, modifying a source code file corresponding to the first source code project in the working area according to the access token;
And when a change submitting request which is sent by the first client and comprises the access token is received, synchronizing each source code file corresponding to each other source code project in the latest file set in the code library to the working area according to the access token, and triggering a version control system to form the latest file set in the code library by each source code file in the working area.
Further, the file change request further comprises a file identifier and file change content;
The modifying the source code file corresponding to the first source code project in the working area includes: and judging whether the first source code project corresponds to a first source code file with the file identifier, if so, modifying the first source code file in the working area according to the file modification content.
Further, the determining whether any client does not currently have the write permission of the first source code project, and if so, sending the access token of the first source code project to the first client includes: verifying the read-write permission of the first client to the first source code project according to the login information of the first client, judging whether the access token sent last time is invalid or not when the read-write permission passes the verification, and if so, generating the access token again and sending the access token to the first client;
And, after the triggering the version control system, further comprising: determining that the access token has failed.
the invention provides a method, a device and a system for processing change of an application file. When a client requests to develop a source code project of an application, if any client does not have writing permission to the project currently, an access token of the project is sent to the client, so that the client can write to the project and can read other projects of the application based on the access token; when the client requests file access, files of all projects of the application in the latest file set in the code base of the application are copied to a working area of the project, and the files in the working area are sent to the client; when the client requests to change the file, the file of the project in the working area is modified; when the client requests to submit changes, the latest file set of the code base is synchronized to the working area with the files of other projects, and the version control system is triggered to form the latest file set of the code base by the files in the working area. The invention can avoid file change conflict.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
FIG. 1 is a diagram of an application file change processing module according to an embodiment of the present invention;
FIG. 2 is a diagram illustrating an application architecture according to an embodiment of the present invention;
FIG. 3 is a diagram of an application file change processing system according to an embodiment of the present invention;
fig. 4 is a flowchart of an application file change processing method according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer and more complete, the technical solutions in the embodiments of the present invention will be described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention, and based on the embodiments of the present invention, all other embodiments obtained by a person of ordinary skill in the art without creative efforts belong to the scope of the present invention.
as shown in fig. 1, an embodiment of the present invention provides an application file change processing module, which may include: a permission service unit 101 and an engineering resource management service unit 102;
the permission service unit 101 is configured to, when receiving a development request for a first source code project of an application sent by a first client, determine whether any client does not currently have a write permission of the first source code project, and if so, send an access token of the first source code project to the first client, so that the first client has a write permission for the first source code project and a read permission for any other source code project of the application based on the access token;
The engineering resource management service unit 102 is configured to perform the following operations:
when a file access request which is sent by the first client and comprises the access token is received, copying each source code file which corresponds to each source code project of the application and is in the latest file set in the code library of the application to a working area of the first source code project according to the access token, and sending each source code file in the working area to the first client;
When a file change request which is sent by the first client and comprises the access token is received, modifying a source code file corresponding to the first source code project in the working area according to the access token;
And when a change submitting request which is sent by the first client and comprises the access token is received, synchronizing each source code file corresponding to each other source code project in the latest file set in the code library to the working area according to the access token, and triggering a version control system to form the latest file set in the code library by each source code file in the working area.
The embodiment of the invention provides an application file change processing module which comprises a permission service unit and an engineering resource management service unit. When a client requests to develop a source code project of an application, if any client does not have write permission to the project currently, the permission service unit sends an access token of the project to the client so that the client can write to the project and read to other projects of the application based on the access token; when the client requests file access, the project resource management service unit copies the files of each project of the application in the latest file set in the code base of the application to the working area of the project and sends the files in the working area to the client; when the client requests to change the file, the project resource management service unit modifies the file of the project in the working area; when the client requests to submit changes, the project resource management service unit synchronizes the latest file set of the code base with the files of other projects to the working area, and triggers the version control system to form the latest file set of the code base by the files in the working area. The embodiment of the invention can avoid file change conflict.
In detail, a permission service and an engineering resource management service can be arranged in the integrated development environment of the server, the permission service is mainly responsible for permission verification, access token distribution and the like, and the engineering resource management service is mainly responsible for processing of file access, file change, submission change and the like.
referring to fig. 2, fig. 2 shows an application structure of an application. Typically, the top layer of the application structure is the application declaration, and the bottom layer is the respective source code files. And based on all the source code files and combined with the concrete framework of the application structure, sequentially executing each task in the application structure, namely finally generating an application product of the application declaration.
the same source code file can have different versions, and the content of the source code file between different versions is different. In this way, when the application artifacts are generated based on different versions of the source code file, the application artifacts of different versions can be generated correspondingly. When the file content of the source code file is changed, the version update of the source code file can be initiated.
in the embodiment of the invention, because a plurality of clients are allowed to simultaneously carry out the application file changing operation, the source code engineering can be taken as a basic unit for facilitating the standardized management of the application file changing operation, namely, the clients can only request one source code engineering in one development request and only can change each source code file of the requested source code engineering.
for example, the application structure of application a is shown in fig. 2, and application a has 4 source code projects, which are project 1, project 2, project 3, and project 4.
it is assumed that a code library a of the application a is stored in the file server, and at least one file set may exist in the code library a respectively according to the creation sequence of the file sets. Any file set comprises 4 folders respectively corresponding to the 4 projects, and each folder comprises each source code file of the corresponding source code project.
certainly, when there is a file change, the corresponding file set is stored in the code library, so that at least one source code file in different file sets has different file contents, or called file versions.
assuming that no file change has been made to the application a, a file set 1 may generally exist in the code base a, and the file set 1 includes a folder 1 to a folder 4, and these 4 folders correspond to the project 1 to the project 4, respectively. As shown in table 1, each folder includes each source code file of the corresponding source code project.
TABLE 1
file 1 File 2 File 3 file 4
file set 1 A-1、B-1 C-1、D-1 E-1、F-1 G-1
As can be seen, the application A corresponds to the 7 source code files A-G. In table 1, the numbers after-are used to identify different versions of the corresponding source code file.
Assuming that the developer A needs to change the source code file A, the developer A can log in based on a browser on the client side of the developer A, and sends a development request aiming at the project 1 of the application A to the authority service unit based on a browser address after logging in.
in the embodiment of the invention, in order to ensure that the source code file of the same source code project cannot be changed by a plurality of clients simultaneously, namely, the developer of the plurality of clients cannot hold the write permission simultaneously, the access token of the source code project can be used for isolation. For example, if the permission service unit has issued the access token of the project 1 to a client and the access token is not invalid, even if the client is the client currently used by the developer a, the client still has write permission to the project 1 on behalf of the currently available client, so that the permission service unit does not issue the access token of the project 1 to any client when the client requests to develop the project 1 again during the validity period of the access token, so as to prevent multiple users from changing the same project at the same time.
Assuming that when a developer A requests to develop the project 1, the authority service unit does not yet distribute the access token of the project 1 at present, or when the access token of the project 1 distributed last time is invalid, that is, when it is ensured that any client does not have the write right of the project 1, the access token of the project 1 can be distributed to the client. Therefore, when the client requests to change the file subsequently, the access token can be repeatedly presented, so that the client has write permission for the project 1 and read permission for other source code projects of the application A.
It should be noted that, the developer a has previously sent a development request for the project 1, and when receiving the development request, the permission service unit may consider that the browser address corresponds to a client. In this way, after the developer a logs in, the developer a can also issue a development request for other source code projects, such as project 2, based on another browser address, and when receiving the development request, the authority service unit considers that the browser address corresponds to another client and can serve the access token of the project 2 for the client as required. Thus, a developer can make file changes to project 1 and project 2 on their own client side, respectively, under browser pages with different browser addresses. Although the same developer changes files for different projects on the same client, the two independent operation flows are actually not interfered with each other, so that the two independent operation flows do not conflict with the premise that multiple persons cannot change the same source code project at the same time.
after the client of the developer A receives the access token of the project 1, the client can send a file access request to the project resource management service unit under the control of the developer A. And the project resource management service unit can determine the application A and the project 1 according to the access token included in the file access request. Assuming that no file change has been made to the 4 projects, only one file set generally exists in the code library a of the application a, and assuming that the file set is the file set 1 shown in table 1, the file set 1 is the latest file set in the code library a, so that each source code file of the 4 projects in the file set 1 can be copied to the working area 1 of the project 1. I.e., A-1 to G-1 listed in Table 1 were copied to working area 1 of project 1.
In general, on a client display of a developer a, the project area 1 of the project 1 can be displayed so as to facilitate visual checking by a user, and source code files in the work area 1 can be sent to the client so as to facilitate file change by the user as required.
After the source code file A is changed by the developer A, the client can send a file change request to the engineering resource management service unit under the control of the developer A. And the project resource management service unit determines the project 1 and the working area 1 according to the access token included in the file change request, so that the source code file of the project 1 in the working area 1 is modified.
Typically, this file modification completion is viewable on the developer's first client display. After the file is modified, the client can send a change submitting request to the engineering resource management service unit under the control of the developer A. And the project resource management service unit determines a project 1 and a working area 1 according to the access token included in the change submitting request.
Considering that the file change lasts for a period of time, during the period, the file change of other client ends to other source code projects is synchronized into the code base A, so that in order to facilitate a developer to quickly and smoothly synchronize the file change of the project 1 into the code base A, before synchronizing the file content in the working area 1 into the code base A, the current latest files in the code base A can be concentrated, except for the project 1, the source code files of other source code projects are synchronized into the working area 1, and then the files in the working area 1 are synchronized into the code base A.
Considering that the engineering resource management service unit generally does not directly perform the operation of synchronizing the workspace file to the code library, but is performed by the version control system, after the synchronization of the workspace 1 is completed, the version control system can be triggered to form the latest file set in the code library a with each source code file in the workspace 1.
Based on the above, there may be at least the following case 1 or case 2:
Case 1:
During the period that the source code file A of the project 1 is changed by the developer A, other clients do not develop other source code projects in the application A, namely the latest file set is still the file set 1, so after the source code files of other source code projects except the project 1 in the file set 1 are synchronized to the working area 1, the working area 1 is before and after synchronization, and the file content in the working area 1 is not changed.
in case 1, there will be 2 filesets stored in codebase a. Since the developer A changed the source code file A, the 2 file sets stored in the code base A can be as shown in Table 2 below.
TABLE 2
file 1 File 2 File 3 File 4
File set 1 A-1、B-1 C-1、D-1 E-1、F-1 G-1
File set 2 A-2、B-1 C-1、D-1 E-1、F-1 G-1
In an embodiment of the present invention, a specific implementation manner of the work area synchronization operation for synchronizing each source code file corresponding to each of the other source code projects in the latest file set in the code library to the work area may further be: and aiming at each source code file corresponding to each other source code project in the latest file set in the code base, respectively executing: judging whether the source code file is the same as the file content of the corresponding source code file in the working area, if so, ending the current process, otherwise, synchronizing the source code file to the working area; and after the synchronous operation of the working area is completed, executing the operation of the trigger version control system.
in detail, the judgment basis for whether the file contents are the same may be a file version of the source code file.
Case 2:
during the process that a developer A changes a source code file A of a project 1, other clients develop other source code projects in an application A, namely, the latest file set is not the file set 1, so that the source code files of other source code projects except the project 1 in the latest file set need to be synchronized to a working area 1, and correspondingly, the file content in the working area 1 is changed before and after synchronization.
for example, assuming that during the change, other clients developed project 4 and changed source code file G, the latest file set is not file set 1 described above. It is assumed that the set of files stored in the code base a can be as shown in table 3 below.
TABLE 3
file 1 file 2 File 3 file 4
file set 1 A-1、B-1 C-1、D-1 E-1、F-1 G-1
File set 2' A-1、B-1 C-1、D-1 E-1、F-1 G-2
Therefore, the latest file set is file set 2 ', and after the working area 1 is synchronized according to the file set 2', the file sets stored in the code library a can be shown in table 4 below.
TABLE 4
file 1 File 2 file 3 file 4
File set 1 A-1、B-1 C-1、D-1 E-1、F-1 G-1
file set 2' A-1、B-1 C-1、D-1 E-1、F-1 G-2
file set 3 A-2、B-1 C-1、D-1 E-1、F-1 G-2
In an embodiment of the present invention, the engineering resource management service unit 102 is configured to, when receiving the file access request, query the permission service unit 101 according to the access token to determine the application and the first source code engineering; when receiving the file change request or the submit change request, querying the permission service unit 101 to determine the first source code project and the working area according to the access token.
in detail, when a client sends a request, the engineering resource management service unit needs to perform different processing. For example, for a file access request, an application and a first source code project need to be determined, and for a file change request and a change request submitted, a working area and a first source code project need to be determined before request processing can be performed.
The application, the source code project and the working area can be determined according to the access token, so that the client always carries the access token when sending a request.
considering that the engineering resource management service unit is mainly responsible for processing file access, file change, submission change and the like without identifying an access token, and the authority service unit is mainly responsible for authority verification, access token distribution and the like, the engineering resource management service unit can send the access token in a request to the authority service unit after receiving the request every time, the authority service unit determines an application, a source code engineering and a working area according to the access token, and feeds back a determination result to the engineering resource management service unit.
In one embodiment of the present invention, to illustrate one possible implementation of handling a file change request, the file change request further includes a file identifier and file change content;
The project resource management service unit 102 is configured to, when the file change request is received, determine whether the first source code project corresponds to a first source code file having the file identifier according to the access token, and if so, modify the first source code file in the working area according to the file change content.
For example, when the developer a changes the source code file a, the client may provide the file identifier, the file change content, and the access token of the source code file a to the engineering resource management service unit through the file change request. The project resource management service unit firstly determines a working area 1 and a project 1 according to the access token, then judges whether a source code file A identified by the file identifier corresponds to the project 1 or not according to the file identifier, and if so, updates and replaces the content of the file for the source code file A of the project 1 in the working area 1 according to the content of the file change. Based on this, the accuracy of the file change operation can be ensured.
normally, the source code files in each file set in the code library are stored in the file server, and the code library, the file set, the corresponding storage addresses of the source code files, the version information of each source code file in each file set, and the like are all recorded in the version control system. In addition, the workspace, which is a copy of the fileset, is typically also stored in the file server to facilitate the execution of the file copy.
Therefore, the application file change processing module can be provided with an agent service for information interaction with the version control system and an agent service for information interaction with the file server, and different requests are correspondingly processed by combining the version control system and the file server based on the existence of the agent.
Based on the above, in an embodiment of the present invention, the application file modification processing module is installed with two agents, namely, a version control service corresponding to the version control system and a file service corresponding to a file server;
the engineering resource management service unit 102 is configured to perform the following operations:
when the file access request is received, requesting a first storage position of a latest file set in the code base from the version control system through the version control service; triggering the file server to copy each source code file corresponding to each source code project of the application in the latest file set in the code library to a working area of the first source code project according to the first storage position through the file service, and sending each source code file in the working area to the first client through the file service;
modifying the source code file corresponding to the first source code project in the working area through the file service;
Requesting, by the versioning service, a second storage location of a latest file set in the code library from the versioning system upon receiving the submit change request; triggering the file server to synchronize each source code file corresponding to each other source code project in the latest file set in the code base to the working area according to the second storage position through the file service; and triggering the version control system to form a latest file set in the code base by each source code file in the working area through the version control service.
In detail, after receiving the trigger signal, the version control system may record a storage location of the latest file set, a version of the file set, a file version of each source code file in the latest file set, and the like, and may trigger the file server to construct the latest file set according to the recorded storage location, and transfer each source code file in the working area to the latest file set.
in an embodiment of the present invention, to illustrate a possible implementation manner for determining whether to allocate an access token, the permission service unit 101 is configured to, when receiving the development request, verify the read-write permission of the first client to the first source code project according to the login information of the first client, and when the verification passes, determine whether the access token sent last time is invalid, if so, generate the access token again and send the access token to the first client;
the engineering resource management service unit 102 is configured to notify the authority service unit 101 that the access token is invalid when the version control system is triggered.
in the embodiment of the invention, after a client submits the change request, the client can think that the development operation of the client on the requested source code project is finished, so the write permission of the client on the source code project can be recovered. In this way, the write right can be assigned again to the next client issuing the corresponding request.
Therefore, when the engineering resource management service unit triggers the version control system, the authority service unit can be informed to record that the corresponding access token is invalid.
In addition to the access token failure caused by the normal end of the application file change as described above, the access token failure may also be caused by long-time no-operation, active abandonment of the client, abnormal operation of the client, and the like. By timely determining that the access token is invalid, the write permission of each source code project is recovered, so that each client can conveniently and timely change the application file, and the overall efficiency of the application file change process is improved.
based on the above, in an embodiment of the present invention, if the client has no operation for a long time during holding the access token, the engineering resource management service unit may also notify the authority service unit so that the authority service unit records that the corresponding access token has failed. Therefore, resource occupation can be avoided, and other clients can change the application files as required. This determination of long-time no-operation can be handled with reference to a preset time threshold, such as 1 day.
Based on the above, in one embodiment of the present invention, the client may also request to give up on its own initiative during holding the access token. As such, the access token is invalidated when the client request is relinquished.
Based on the above, in an embodiment of the present invention, if the client is abnormally operated, for example, the client is down, it may be determined that the corresponding access token is invalid when the client is monitored to be abnormally operated. In detail, the judgment of the client operation abnormity can be realized based on the heartbeat signal.
In summary, the application file change processing module provided by the embodiment of the present invention can implement multi-user participation in developing an application, parallel development, providing services by an integrated development environment running on a server, sharing computing resources, and simultaneously isolating files according to an engineering directory, thereby avoiding conflict of editing files.
As shown in fig. 2, an embodiment of the present invention provides an application file change processing system, which may include: a version control system 301, at least one client 302, and any of the above-mentioned application file change processing modules 303;
Wherein, each of the clients 302 is configured to perform the following operations through a browser based on external control: sending a development request of a first source code project for an application to the application file change processing module 303, and receiving an access token returned by the application file change processing module; sending a file access request including the access token to the application file change processing module 303; receiving each source code file sent by the application file change processing module 303; sending a file change request including the access token to the application file change processing module 303; a change submission request including the access token is sent to the application file change processing module 303.
In an embodiment of the present invention, referring to fig. 3, the system for processing application file change further includes: a file server 304;
The file server 304 is configured to store a code library of the application, where the code library includes at least one file set, and the file set includes source code files corresponding to source code projects of the application;
The application file change processing module 303 is configured to send each source code file in the working area to the version control system 301;
The version control system 301 is configured to form a latest file set in the code library with the received source code files, record a storage location of the latest file set in the file server 304, and store the latest file set to the file server 304 based on the storage location.
In the embodiment of the invention, a developer can use the local browser to connect with the remote server to perform application file development work. As the number of online people increases, the computing resources consumed by the server do not increase significantly. When multiple persons develop the same application in parallel, the server system allows the modification of the code by the multiple persons to be combined, and file modification conflicts can be avoided.
The information interaction, execution process and other contents between the unit modules in the system are based on the same concept as the device embodiment of the present invention, and specific contents may refer to the description in the device embodiment of the present invention, and are not described herein again.
As shown in fig. 4, an embodiment of the present invention provides an application file change processing method, which is applied to any one of the application file change processing modules, and includes:
step 401: when a development request which is sent by a first client and aims at a first source code project of an application is received, whether any client does not have the write permission of the first source code project at present is judged, if yes, an access token of the first source code project is sent to the first client, and therefore the first client has the write permission of the first source code project and the read permission of any other source code project of the application based on the access token.
Step 402: when a file access request which is sent by the first client and comprises the access token is received, copying each source code file which corresponds to each source code project of the application and is in the latest file set in the code library of the application to a working area of the first source code project according to the access token, and sending each source code file in the working area to the first client.
Step 403: and when a file change request which is sent by the first client and comprises the access token is received, modifying the source code file corresponding to the first source code project in the working area according to the access token.
Step 404: and when a change submitting request which is sent by the first client and comprises the access token is received, synchronizing each source code file corresponding to each other source code project in the latest file set in the code library to the working area according to the access token, and triggering a version control system to form the latest file set in the code library by each source code file in the working area.
in one embodiment of the invention, the file change request further comprises a file identifier and file change content;
in step 403, the modifying the source code file corresponding to the first source code project in the workspace includes: and judging whether the first source code project corresponds to a first source code file with the file identifier, if so, modifying the first source code file in the working area according to the file modification content.
In an embodiment of the present invention, in step 401, the determining whether any client does not currently have the write permission of the first source code project, and if so, sending the access token of the first source code project to the first client includes: verifying the read-write permission of the first client to the first source code project according to the login information of the first client, judging whether the access token sent last time is invalid or not when the read-write permission passes the verification, and if so, generating the access token again and sending the access token to the first client;
And, after step 404, further comprising: determining that the access token has failed.
The information interaction, execution process and other contents between the unit modules in the method are based on the same concept as the device embodiment of the present invention, and specific contents can be referred to the description in the device embodiment of the present invention, and are not described herein again.
in summary, the embodiments of the present invention have at least the following advantages:
1. In the embodiment of the invention, the application file change processing module comprises a permission service unit and an engineering resource management service unit. When a client requests to develop a source code project of an application, if any client does not have write permission to the project currently, the permission service unit sends an access token of the project to the client so that the client can write to the project and read to other projects of the application based on the access token; when the client requests file access, the project resource management service unit copies the files of each project of the application in the latest file set in the code base of the application to the working area of the project and sends the files in the working area to the client; when the client requests to change the file, the project resource management service unit modifies the file of the project in the working area; when the client requests to submit changes, the project resource management service unit synchronizes the latest file set of the code base with the files of other projects to the working area, and triggers the version control system to form the latest file set of the code base by the files in the working area. The embodiment of the invention can avoid file change conflict.
2. the application file change processing module provided by the embodiment of the invention can realize that multiple persons participate in developing an application and develop the application in parallel, an integrated development environment running in a server provides services, computing resources are shared, files are isolated according to engineering catalogues, and the conflict of editing the files can be avoided.
3. In the embodiment of the invention, a developer can use the local browser to connect with the remote server to perform application file development work. As the number of online people increases, the computing resources consumed by the server do not increase significantly. When multiple persons develop the same application in parallel, the server system allows the modification of the code by the multiple persons to be combined, and file modification conflicts can be avoided.
it is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising a" does not exclude the presence of other similar elements in a process, method, article, or apparatus that comprises the element.
Those of ordinary skill in the art will understand that: all or part of the steps for realizing the method embodiments can be completed by hardware related to program instructions, the program can be stored in a computer readable storage medium, and the program executes the steps comprising the method embodiments when executed; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
finally, it is to be noted that: the above description is only a preferred embodiment of the present invention, and is only used to illustrate the technical solutions of the present invention, and not to limit the protection scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.

Claims (10)

1. An application file change processing module, comprising:
the system comprises a permission service unit and an engineering resource management service unit;
The permission service unit is used for judging whether any client does not have the write permission of a first source code project currently or not when receiving a development request which is sent by a first client and aims at the first source code project of an application, and if so, sending an access token of the first source code project to the first client so that the first client has the write permission to the first source code project and the read permission to any other source code project of the application based on the access token;
The engineering resource management service unit is used for executing the following operations:
When a file access request which is sent by the first client and comprises the access token is received, copying each source code file which corresponds to each source code project of the application and is in the latest file set in the code library of the application to a working area of the first source code project according to the access token, and sending each source code file in the working area to the first client;
when a file change request which is sent by the first client and comprises the access token is received, modifying a source code file corresponding to the first source code project in the working area according to the access token;
And when a change submitting request which is sent by the first client and comprises the access token is received, synchronizing each source code file corresponding to each other source code project in the latest file set in the code library to the working area according to the access token, and triggering a version control system to form the latest file set in the code library by each source code file in the working area.
2. the application file change processing module of claim 1,
the project resource management service unit is used for inquiring the authority service unit according to the access token to determine the application and the first source code project when receiving the file access request; and when the file change request or the change submitting request is received, inquiring the authority service unit according to the access token to determine the first source code project and the working area.
3. the application file change processing module of claim 1,
The file change request further comprises a file identifier and file change contents;
and the project resource management service unit is used for judging whether the first source code project corresponds to a first source code file with the file identifier or not according to the access token when the file change request is received, and if so, modifying the first source code file in the working area according to the file change content.
4. the application file change processing module of claim 1,
The application file change processing module is provided with two agents, namely a version control service corresponding to the version control system and a file service corresponding to the file server;
The engineering resource management service unit is used for executing the following operations:
When the file access request is received, requesting a first storage position of a latest file set in the code base from the version control system through the version control service; triggering the file server to copy each source code file corresponding to each source code project of the application in the latest file set in the code library to a working area of the first source code project according to the first storage position through the file service, and sending each source code file in the working area to the first client through the file service;
Modifying the source code file corresponding to the first source code project in the working area through the file service;
requesting, by the versioning service, a second storage location of a latest file set in the code library from the versioning system upon receiving the submit change request; triggering the file server to synchronize each source code file corresponding to each other source code project in the latest file set in the code base to the working area according to the second storage position through the file service; and triggering the version control system to form a latest file set in the code base by each source code file in the working area through the version control service.
5. The application file change processing module according to any one of claims 1 to 4,
The permission service unit is used for verifying the read-write permission of the first client to the first source code project according to the login information of the first client when the development request is received, judging whether the access token sent last time is invalid or not when the first client passes the verification, and if so, generating the access token again and sending the access token to the first client;
and the engineering resource management service unit is used for notifying the authority service unit that the access token is invalid when the version control system is triggered.
6. An application file change processing system, comprising:
a version control system, at least one client, and an application file change processing module as claimed in any one of claims 1 to 5;
Each client is used for executing the following operations through a browser based on external control: sending a development request of a first source code project for an application to the application file change processing module, and receiving an access token returned by the application file change processing module; sending a file access request including the access token to the application file change processing module; receiving each source code file sent by the application file change processing module; sending a file change request including the access token to the application file change processing module; and sending a change submitting request comprising the access token to the application file change processing module.
7. The application file change processing system according to claim 6,
Further comprising: a file server;
The file server is used for storing a code library of the application, the code library comprises at least one file set, and the file set comprises source code files corresponding to source code projects of the application;
The application file change processing module is used for sending each source code file in the working area to the version control system;
And the version control system is used for forming a latest file set in the code base by using each received source code file, recording the storage position of the latest file set in the file server, and storing the latest file set to the file server based on the storage position.
8. An application file change processing method applied to the application file change processing module according to any one of claims 1 to 5, comprising:
when a development request which is sent by a first client and aims at a first source code project of an application is received, judging whether any client does not have the write permission of the first source code project at present, if so, sending an access token of the first source code project to the first client, so that the first client has the write permission to the first source code project and the read permission to any other source code project of the application based on the access token;
When a file access request which is sent by the first client and comprises the access token is received, copying each source code file which corresponds to each source code project of the application and is in the latest file set in the code library of the application to a working area of the first source code project according to the access token, and sending each source code file in the working area to the first client;
When a file change request which is sent by the first client and comprises the access token is received, modifying a source code file corresponding to the first source code project in the working area according to the access token;
And when a change submitting request which is sent by the first client and comprises the access token is received, synchronizing each source code file corresponding to each other source code project in the latest file set in the code library to the working area according to the access token, and triggering a version control system to form the latest file set in the code library by each source code file in the working area.
9. The method of claim 8,
The file change request further comprises a file identifier and file change contents;
The modifying the source code file corresponding to the first source code project in the working area includes: and judging whether the first source code project corresponds to a first source code file with the file identifier, if so, modifying the first source code file in the working area according to the file modification content.
10. The method according to claim 8 or 9,
The judging whether any client does not have the write permission of the first source code project at present, and if so, sending the access token of the first source code project to the first client, including: verifying the read-write permission of the first client to the first source code project according to the login information of the first client, judging whether the access token sent last time is invalid or not when the read-write permission passes the verification, and if so, generating the access token again and sending the access token to the first client;
And, after the triggering the version control system, further comprising: determining that the access token has failed.
CN201910847021.XA 2019-09-09 2019-09-09 Application file change processing method, device and system Active CN110555317B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910847021.XA CN110555317B (en) 2019-09-09 2019-09-09 Application file change processing method, device and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910847021.XA CN110555317B (en) 2019-09-09 2019-09-09 Application file change processing method, device and system

Publications (2)

Publication Number Publication Date
CN110555317A true CN110555317A (en) 2019-12-10
CN110555317B CN110555317B (en) 2023-04-07

Family

ID=68739605

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910847021.XA Active CN110555317B (en) 2019-09-09 2019-09-09 Application file change processing method, device and system

Country Status (1)

Country Link
CN (1) CN110555317B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111737504A (en) * 2020-06-23 2020-10-02 网易(杭州)网络有限公司 Image resource detection method, device, equipment and storage medium
CN112650532A (en) * 2020-12-04 2021-04-13 苏州浪潮智能科技有限公司 Method, system and medium for modifying source code file under multi-person mode
CN113392383A (en) * 2021-06-09 2021-09-14 北京和信创天科技股份有限公司 Multi-user dynamic right-lifting method for Windows system

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102685086A (en) * 2011-04-14 2012-09-19 天脉聚源(北京)传媒科技有限公司 File access method and system
US20130159365A1 (en) * 2011-12-16 2013-06-20 Microsoft Corporation Using Distributed Source Control in a Centralized Source Control Environment
US20150180863A1 (en) * 2013-12-25 2015-06-25 Canon Kabushiki Kaisha Authority management server and authority management method
CN108156115A (en) * 2016-12-02 2018-06-12 航天星图科技(北京)有限公司 A kind of inter-sectional data sharing method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102685086A (en) * 2011-04-14 2012-09-19 天脉聚源(北京)传媒科技有限公司 File access method and system
US20130159365A1 (en) * 2011-12-16 2013-06-20 Microsoft Corporation Using Distributed Source Control in a Centralized Source Control Environment
US20150180863A1 (en) * 2013-12-25 2015-06-25 Canon Kabushiki Kaisha Authority management server and authority management method
CN108156115A (en) * 2016-12-02 2018-06-12 航天星图科技(北京)有限公司 A kind of inter-sectional data sharing method

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
M.ILYAS等: ""A simulation study of file transfers in token ring local area networks"", 《 PROCEEDINGS. IEEE ENERGY AND INFORMATION TECHNOLOGIES IN THE SOUTHEAST"》 *
张欣晨: ""云计算环境下文件管理与访问控制"", 《中国优秀硕士学位论文全文数据库 信息科技辑》 *

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111737504A (en) * 2020-06-23 2020-10-02 网易(杭州)网络有限公司 Image resource detection method, device, equipment and storage medium
CN111737504B (en) * 2020-06-23 2023-09-15 网易(杭州)网络有限公司 Image resource detection method, device, equipment and storage medium
CN112650532A (en) * 2020-12-04 2021-04-13 苏州浪潮智能科技有限公司 Method, system and medium for modifying source code file under multi-person mode
CN112650532B (en) * 2020-12-04 2022-07-12 苏州浪潮智能科技有限公司 Method, system and medium for modifying source code file under multi-person mode
CN113392383A (en) * 2021-06-09 2021-09-14 北京和信创天科技股份有限公司 Multi-user dynamic right-lifting method for Windows system

Also Published As

Publication number Publication date
CN110555317B (en) 2023-04-07

Similar Documents

Publication Publication Date Title
CN110555317B (en) Application file change processing method, device and system
JP4310354B2 (en) Replication facility
US7805420B2 (en) Versioning and concurrency control for multiple client access of data
CN104598459B (en) database processing, data access method and system
JP5178822B2 (en) Data replication method and system in database management system (DBMS)
JP2948496B2 (en) System and method for maintaining replicated data consistency in a data processing system
JP4806729B2 (en) Write request processing by servers with global knowledge
JP2019516171A (en) Service processing method, device and system
US20060190460A1 (en) Method and mechanism of handling reporting transactions in database systems
US20080005183A1 (en) Method And Apparatus for Propagating Tables While Preserving Cyclic Foreign Key Relationships
US10698767B1 (en) Decentralized management of multi-service workflows
JP2023541298A (en) Transaction processing methods, systems, devices, equipment, and programs
JP4159750B2 (en) Distributed computer system and maintenance data application method
US11042524B1 (en) Self-adaptive execution method of smart contract for realizing data trustworthiness
JP2011076572A (en) Storage system, storage device, method for duplicating data stored in the storage device, and program
CN113377763A (en) Database table switching method and device, electronic equipment and computer storage medium
CN105653566B (en) A kind of method and device for realizing database write access
JP2011522337A (en) Method of synchronizing software modules of computer system distributed to server cluster, application to synchronization system and data storage
WO2023103340A1 (en) Block data committing method and apparatus
EP3629178B1 (en) System and method for providing backup services to high availability applications
JP6172294B2 (en) Transaction distributed processing apparatus, method, system, and storage medium
TW201403362A (en) Managing large data sets through page based information tracking in multi-master environments
JP6398786B2 (en) Database system, database server, database server program, database client, and database client program
KR20130043823A (en) Distributed storage system for maintaining data consistency based on log, and method for the same
CN114861198B (en) Access page permission control method, equipment and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20230313

Address after: 250000 Langchao Road, Jinan, Shandong

Applicant after: Inspur Genersoft Co.,Ltd.

Address before: 250100 No. 2877 Kehang Road, Sun Village Town, Jinan High-tech District, Shandong Province

Applicant before: SHANDONG INSPUR GENESOFT INFORMATION TECHNOLOGY Co.,Ltd.

GR01 Patent grant
GR01 Patent grant