CN114281786A - File processing method and device, electronic equipment and storage medium - Google Patents

File processing method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN114281786A
CN114281786A CN202111599667.4A CN202111599667A CN114281786A CN 114281786 A CN114281786 A CN 114281786A CN 202111599667 A CN202111599667 A CN 202111599667A CN 114281786 A CN114281786 A CN 114281786A
Authority
CN
China
Prior art keywords
file
version information
detected
client
platform
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.)
Pending
Application number
CN202111599667.4A
Other languages
Chinese (zh)
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.)
CCB Finetech Co Ltd
Original Assignee
CCB Finetech 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 CCB Finetech Co Ltd filed Critical CCB Finetech Co Ltd
Priority to CN202111599667.4A priority Critical patent/CN114281786A/en
Publication of CN114281786A publication Critical patent/CN114281786A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a file processing method, a file processing device, electronic equipment and a storage medium, and relates to the technical field of data storage. One embodiment of the method comprises: responding to a platform replacement instruction, and sending a file acquisition request to a replaced platform to acquire a file identifier and first version information of a file to be processed in the replaced platform; inquiring second version information of the file to be processed based on the file identification, and acquiring a modification record with the maximum time corresponding to the second version information so as to judge whether the first version information comprises the modification record; if so, storing the file to be processed, and updating the first version information into second version information; if not, inquiring and deleting the file corresponding to the second version information, storing the file to be processed, and updating the first version information into the second version information. The implementation mode can solve the problems that the platform replacement mode in the prior art is complex in operation and low in efficiency.

Description

File processing method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of data storage technologies, and in particular, to a file processing method and apparatus, an electronic device, and a storage medium.
Background
Currently, mainframe platforms (mainframes) are used for daily testing and commissioning to publish files of related products, typically generated and stored by BuildForge platforms. With the advancement of the localization and distributed systems, the buildford platform cannot be docked with an upper-layer updated platform, so that the buildford platform needs to be replaced. In the prior art, after a new platform is constructed, a developer manually imports a file in an original platform into a replaced file to realize the replacement of the platform, but the method is not only complex in operation, but also low in efficiency.
Disclosure of Invention
In view of this, embodiments of the present invention provide a file processing method and apparatus, an electronic device, and a storage medium, which can solve the problems in the prior art that a platform replacement method is not only complex in operation but also low in efficiency.
To achieve the above object, according to an aspect of an embodiment of the present invention, there is provided a file processing method.
The file processing method of the embodiment of the invention comprises the following steps: responding to a platform replacement instruction, and sending a file acquisition request to a replaced platform to acquire a file identifier and first version information of a file to be processed in the replaced platform; based on the file identification, inquiring second version information of the file to be processed from data synchronous with a target platform, and acquiring a modification record with the maximum time corresponding to the second version information so as to judge whether the first version information comprises the modification record; if not, storing the file to be processed, and updating the first version information into the second version information; if yes, inquiring and deleting the file corresponding to the second version information, storing the file to be processed, and updating the first version information into the second version information.
In one embodiment, further comprising:
receiving a file check-in request sent by a client, and acquiring a file identifier and third version information of a check-in file in the check-in request;
inquiring fourth version information of the checked-in file based on the file identifier of the checked-in file, and acquiring a modification record with the maximum time corresponding to the fourth version information so as to judge whether the third version information comprises the modification record;
if so, storing the check-in file, and updating the third version information into the fourth version information; if not, inquiring and deleting the file corresponding to the fourth version information, storing the detected file, and updating the third version information into the fourth version information.
In another embodiment, before receiving the file check-in request sent by the client, the method further includes:
receiving a file detection request sent by the client, and acquiring a file identifier in the file detection request to query a corresponding detected file;
determining whether the detected file is locked;
if so, sending a prompt message which cannot be detected to the client; and if not, sending the detected file and the fifth version information to the client.
In yet another embodiment, determining whether the detected file is locked includes:
inquiring the current state label of the detected file to judge whether the current state label of the detected file is in a detected state;
if yes, determining that the detected file is locked; if not, determining that the detected file is not locked.
In another embodiment, querying and deleting the file corresponding to the fourth version information includes:
sending a file conflict prompt message to the client;
and receiving a file storage instruction sent by the client, and inquiring and deleting the file corresponding to the fourth version information in response to the file storage instruction.
In another embodiment, after querying the file corresponding to the fourth version information, the method further includes:
acquiring a check-in client identifier of a file corresponding to the fourth version information to inquire corresponding client address information;
and sending file deletion prompt information based on the client address information.
In yet another embodiment, further comprising:
acquiring a stored file to generate a corresponding program file;
and sending the program file to a corresponding cluster host to enable the cluster host to operate the program file.
In yet another embodiment, further comprising:
and responding to a file synchronization instruction triggered by a target platform, acquiring files stored in a preset period to call a preset API (application program interface) interface, and synchronizing the files stored in the preset period to the target platform. .
To achieve the above object, according to another aspect of the embodiments of the present invention, there is provided a document processing apparatus.
A file processing apparatus of an embodiment of the present invention includes: the system comprises an acquisition unit, a storage unit and a processing unit, wherein the acquisition unit is used for responding to a platform replacement instruction and sending a file acquisition request to a replaced platform so as to acquire a file identifier and first version information of a file to be processed in the replaced platform; a determining unit, configured to query, based on the file identifier, second version information of the file to be processed from data synchronized with a target platform, and obtain a modified record with the maximum time corresponding to the second version information, so as to determine whether the modified record is included in the first version information; the storage unit is used for storing the file to be processed and updating the first version information into the second version information if the file to be processed is not stored; if yes, inquiring and deleting the file corresponding to the second version information, storing the file to be processed, and updating the first version information into the second version information.
To achieve the above object, according to still another aspect of an embodiment of the present invention, there is provided an electronic apparatus.
An electronic device of an embodiment of the present invention includes: one or more processors; the storage device is used for storing one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors realize the file processing method provided by the embodiment of the invention.
To achieve the above object, according to still another aspect of an embodiment of the present invention, there is provided a computer-readable medium.
A computer-readable medium of an embodiment of the present invention stores thereon a computer program, which, when executed by a processor, implements a file processing method provided by an embodiment of the present invention.
To achieve the above object, according to still another aspect of an embodiment of the present invention, there is provided a computer program product.
A computer program product according to an embodiment of the present invention includes a computer program, and when the computer program is executed by a processor, the computer program implements the file processing method according to an embodiment of the present invention.
One embodiment of the above invention has the following advantages or benefits: in the embodiment of the present invention, after a platform replacement instruction is triggered, a file acquisition request may be sent to a replaced platform to acquire a file identifier and first version information of a file to be processed in the replaced platform, and then second version information corresponding to the file to be processed in a target platform is acquired to determine whether a version conflict exists through the first version information and the second version information, that is, the second version information of the file to be processed is queried, and a modification record with the maximum time corresponding to the second version information is acquired to determine whether the first version information includes a modification record; if the first version information comprises the acquired modification record, which indicates that the file to be processed is modified on the basis of the version stored in the target platform, the file to be processed can be directly stored, and the first version information is updated to the second version information; if the first version information does not include the acquired modification record, which indicates that the file to be processed is not modified based on the version stored in the target platform, and a version conflict is generated, the file corresponding to the second version information can be inquired and deleted, the file to be processed is stored again, and the first version information is updated to the second version information. Therefore, in the embodiment of the invention, the file of the replaced platform can be transferred to the target platform through the response of the platform replacing instruction, and the version control is carried out in the file transfer, so that the manual operation of a user is not needed, the processing operation is simple, and the processing efficiency is improved.
Further effects of the above-mentioned non-conventional alternatives will be described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
FIG. 1 is a schematic diagram of a system architecture of a document processing system according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a main flow of a document processing method according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of yet another system architecture of a document processing system in accordance with an embodiment of the present invention;
FIG. 4 is a schematic diagram of yet another major flow of a document processing method according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of another main flow of a document processing method according to an embodiment of the present invention;
FIG. 6 is a schematic diagram of the main units of a document processing apparatus according to an embodiment of the present invention;
FIG. 7 is a diagram of yet another exemplary system architecture to which embodiments of the present invention may be applied;
FIG. 8 is a schematic block diagram of a computer system suitable for use in implementing embodiments of the present invention.
Detailed Description
Exemplary embodiments of the present invention are described below with reference to the accompanying drawings, in which various details of embodiments of the invention are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
It should be noted that the embodiments and features of the embodiments may be combined with each other without conflict. According to the technical scheme, the data acquisition, storage, use, processing and the like meet relevant regulations of national laws and regulations.
The embodiment of the invention provides a file processing system which can be used for processing a file in the field of platform replacement and platform file development.
As shown in fig. 1, the original platform is a replaced platform, the target platform is a newly constructed platform, and the target platform can store and process files. The files stored in the target platform may be files corresponding to functions of each product or product, and these files may be converted into a build product (release content obtained by compiling source codes and packaging, which is generally a version package compressed by object codes and operation upgrade documents, etc.), such as codes, and then transmitted to a mainframe to run, so as to implement the functions of the corresponding product or product. A cluster is usually deployed in a mainframe, so the mainframe in fig. 1 may be a cluster master operated by the cluster, and may specifically be the mainframe. The target platform may specifically include an ICDP pipeline and a code hosting repository. The code hosting warehouse is used for storing developed files and specifically can be a Git code library; the ICDP pipeline may be used for controlling tasks in the target platform, such as file synchronization, code file generation, file transfer to a mainframe, and the like, and a specific ICDP pipeline may be a Jenkins persistent integration tool. In the embodiment of the invention, in order to realize the control of the file version in the target platform, the SVN server can be further arranged, and the target platform can interact with the original platform through the SVN server, so that the file version control can be realized through the SVN server when the file in the original platform is transferred to the target platform. The target platform can also interact with the local development platform, so that a developer can conveniently detect files from the target platform through the local development platform to modify and update the detected files, and meanwhile, the modified or developed files can be transmitted to the target platform through detection, so that the modified or developed files are stored to the target platform and then are transmitted to a large machine end through the target platform to run.
An embodiment of the present invention provides a file processing method, which may be executed by an SVN server in a system architecture shown in fig. 1, and as shown in fig. 2, the method includes:
s201: and responding to the platform replacement instruction, and sending a file acquisition request to the replaced platform to acquire the file identification and the first version information of the file to be processed in the replaced platform.
After the platform replacement instruction is triggered, the file in the original platform can be transferred, and the SVN server can acquire the file to be processed in the replaced platform, the file identifier of the file to be processed and the first version information by sending a file acquisition request to the replaced platform.
It should be noted that the file may be a file developed by a developer, such as a model file. The version information may include a version identifier of the file to be processed, and may also include a modification record of the file during each version upgrade of the file, and the update content of the version upgrade file may be determined by the modification record.
S202: and inquiring second version information of the file to be processed from the data synchronized with the target platform based on the file identification, and acquiring a modification record with the maximum time corresponding to the second version information so as to judge whether the first version information comprises the modification record.
For the file to be processed, the proxy hosting platform of the SVN server or the target platform may store the corresponding file and version information, and in order to control the file version, the SVN server or the target platform needs to sequentially update each file version, that is, only one version of the updated file is corresponding to one version of the updated file on the basis of one version of the file. Since the version information can store the modification records when each version is updated, whether the acquired file to be processed is updated on the basis of storing the latest version in the SVN server or the target platform can be determined through comparison of the modification records. For example, for a file, the latest version stored in the SVN server or the target platform is a, the acquired version of the file is B, and if B is updated on the basis of a, the latest modification record in a is stored in B; if B is not updated on A basis, then B will not store the latest modified record in A. Therefore, in this step, second version information of the file to be processed may be queried, where the second version information may be latest version information of the file to be processed stored in the SVN server or the target platform. The modified record with the maximum time corresponding to the second version information is the latest modified record corresponding to the second version information.
S203: if so, storing the file to be processed, and updating the first version information into second version information; if not, inquiring and deleting the file corresponding to the second version information, storing the file to be processed, and updating the first version information into the second version information.
If the version information of the file to be processed is the version information of the file to be processed, the file to be processed is determined to be modified on the basis of the version information of the file stored in the target platform, and the file to be processed can be directly stored. If not, the first version information does not include the modification record, and then the file to be processed acquired from the original platform is determined not to be modified on the basis of the file version stored in the target platform, and at this time, the version conflict of the file to be processed can be determined. In the embodiment of the invention, a processing mode of version conflict can be preset, namely, the file corresponding to the second version information is deleted, the file to be processed is stored at the same time, and the first version information is updated to the second version information.
In the embodiment of the invention, the files stored in the SVN server and the version information of the files can be periodically synchronized to the code hosting warehouse. Specifically, file synchronization can be controlled through an ICDP pipeline, the ICDP pipeline periodically triggers the ICDP pipeline, and the SVN server can acquire files stored in the preset period in response to the received file synchronization instruction, so as to call a preset API interface in the code hosting warehouse, and synchronize the files stored in the preset period to the code hosting warehouse of the target platform.
In the embodiment of the invention, the file of the replaced platform can be transferred to the target platform through the response of the platform replacing instruction, and the version control is carried out in the file transfer, so that the manual operation of a user is not needed, the processing operation is simple, and the processing efficiency is improved.
It should be noted that, for the target platform, the script needs to be configured. The method comprises the steps of storing a plurality of tool jar packages in an original platform, editing the scripts which cannot be stored, and performing re-editing, wherein the scripts which cannot be stored can be stored as much as possible in the original platform, for example, a perl language is used, functions are implemented according to the original scripts, codes are re-encoded, and a code structure is optimized, so that the scripts can be operated on linux or windows environments in a cross-platform mode.
With reference to the embodiment shown in fig. 1, fig. 3 is a schematic diagram illustrating a file transfer between a local development platform and a target platform. As shown in fig. 3, the local development platform takes the VMD development environment as an example, so the developed file is a VMD model file, and the local development platform can interact with the SVN server in the target platform through the VMD development environment to implement check-in and check-out of the file. And simultaneously, the SVN server can synchronize files in the SVN server to the proxy hosting warehouse through a GIT-SVN command. For example, the SVN server may set a timing task by configuring a crontab table in linux, pre-configure a synchronization script rsyncremoteprepo.sh, write the shell script rsyncremoteprepo.sh to adapt to SVN operation in a remote SVN server through a GIT-SVN command in a GIT version tool, and synchronize a corresponding file to a code hosting repository.
The following describes a file processing method in an embodiment of the present invention in detail with reference to a system architecture shown in fig. 3, and as shown in fig. 4, the method includes:
s401: and receiving a file check-in request sent by the client, and acquiring the file identifier and the third version information of the check-in file in the check-in request.
The file check-in request includes a file identifier and version information of the checked-in file, i.e. third version information. The file check-in request can be triggered when a user requests to store a file to a target platform after developing or modifying the file through a local development platform. In the step, the client can be an SVN client, which runs in a local development environment and can perform data interaction with an SVN server in a target platform.
S402: and inquiring fourth version information of the checked-in file based on the file identifier of the checked-in file, and acquiring a modification record with the maximum time corresponding to the fourth version information so as to judge whether the third version information comprises the modification record.
In this step, the currently stored version information, that is, the fourth version information, may be queried based on the file identifier of the checked-in file, so as to determine whether the version conflict exists by comparing the version information with the third version information.
S403: if so, storing the check-in file, and updating the third version information into fourth version information; if not, inquiring and deleting the file corresponding to the fourth version information, storing the checked file, and updating the third version information into the fourth version information.
If yes, the check-in file can be directly stored, and the fourth version information is updated to the third version information, so that the version information of the check-in file of the new version can be stored conveniently. If not, the third version information does not include the modification record, and then the version conflict generated by the checked-in file can be determined, so that the file corresponding to the fourth version information is deleted, the checked-in file is stored, and the fourth version information is updated to the third version information.
In the embodiment of the invention, when the file version is determined to have conflict, a file conflict prompt message can be sent to the client to prompt a user whether to execute file storage, and then after a file storage instruction sent by the client is received, the file corresponding to the fourth version information can be inquired and deleted in response to the file storage instruction.
Furthermore, in the embodiment of the present invention, a client corresponding to each file may be further stored to determine which client the file is checked in, and when the file is deleted, file deletion prompt information is sent to the client corresponding to the file to prompt that the file checked in by the user is deleted.
In the embodiment of the invention, the version control of the checked-in file is realized through the SVN server in the target platform, the manual operation of a user is not needed, the processing operation is simple, and the file processing efficiency is improved.
The following describes a file processing method in an embodiment of the present invention in detail with reference to a system architecture shown in fig. 3, and as shown in fig. 5, the method includes:
s501: and receiving a file detection request sent by the client, and acquiring a file identifier in the file detection request to inquire the corresponding detected file.
The user can acquire the file from the target platform through the client to modify and upgrade the file, and at this time, the user can send a file retrieval request to the SVN server, where the file retrieval request includes a file identifier of the file to be retrieved. After receiving the file retrieval request, the SVN server may query the corresponding retrieved file based on the file identifier in the file retrieval request.
S502: it is determined whether the detected file is locked.
In order to avoid that the same file is modified by a plurality of users at the same time, the file needs to be locked after being detected, and whether the detected file is locked needs to be judged after receiving a file detection request. If yes, the fact that the user is modified by other users is indicated, and the user can not be detected any more; if not, it is said to be detectable.
Specifically, in the embodiment of the present invention, the file may be locked by setting a status tag, that is, after the file is detected, the current status tag is set as a detected status for the file, and after the detected file is stored, the current status tag of the detected status of the file may be deleted. Therefore, in this step, the current status tag of the detected file is queried to determine whether the current status tag of the detected file is in the detected status, so as to determine whether the detected file is locked. If the current state label of the detected file is the detected state, determining that the detected file is locked; and if the current state label of the detected file is not in the detected state, determining that the detected file is not locked.
S503: if so, sending a prompt message which cannot be detected to the client; and if not, sending the detected file and the fifth version information to the client.
After the detected file is determined not to be locked, the detected file and the fifth version information can be sent to the client, so that a user can modify the detected file conveniently; after determining that the checked-out file is locked, a notification message that the checked-out file cannot be checked out may be sent to the client to notify the user that the checked-out file cannot be modified.
In the embodiment of the invention, the version control of the checked-in file is realized through the SVN server in the target platform, the manual operation of a user is not needed, the processing operation is simple, and the file processing efficiency is improved.
In order to solve the problems in the prior art, an embodiment of the present invention provides a file processing apparatus 600, as shown in fig. 6, where the apparatus 600 includes:
an obtaining unit 601, configured to send a file obtaining request to a replaced platform in response to a platform replacement instruction, so as to obtain a file identifier and first version information of a file to be processed in the replaced platform;
a determining unit 602, configured to query, based on the file identifier, second version information of the file to be processed from data synchronized with a target platform, and obtain a modified record with the maximum time corresponding to the second version information, so as to determine whether the modified record is included in the first version information;
a storage unit 603, configured to store the to-be-processed file and update the first version information to the second version information if the file is not stored in the storage unit; if yes, inquiring and deleting the file corresponding to the second version information, storing the file to be processed, and updating the first version information into the second version information.
It should be understood that the manner of implementing the embodiment of the present invention is the same as the manner of implementing the embodiment shown in fig. 2, and the description thereof is omitted.
In an implementation manner of the embodiment of the present invention, the obtaining unit 601 is further configured to receive a file check-in request sent by a client, and obtain a file identifier and third version information of a check-in file in the check-in request;
the determining unit 602 is further configured to query, based on the file identifier of the checked-in file, fourth version information of the checked-in file, and obtain a modification record with the maximum time corresponding to the fourth version information, so as to determine whether the third version information includes the modification record;
the storage unit 603 is further configured to store the check-in file and update the third version information to the fourth version information if the check-in file is not stored; if yes, inquiring and deleting the file corresponding to the fourth version information, storing the detected file, and updating the third version information into the fourth version information.
In another implementation manner of the embodiment of the present invention, the obtaining unit 601 is further configured to receive a file retrieval request sent by the client, and obtain a file identifier in the file retrieval request to query a corresponding retrieved file;
the judging unit 602 is further configured to judge whether the detected file is locked;
the apparatus 600 further comprises:
a sending unit, configured to send, if yes, a notification message that cannot be detected to the client; and if not, sending the detected file and the fifth version information to the client.
In another implementation manner of the embodiment of the present invention, the determining unit 602 is specifically configured to:
inquiring the current state label of the detected file to judge whether the current state label of the detected file is in a detected state;
if yes, determining that the detected file is locked; if not, determining that the detected file is not locked.
In another implementation manner of the embodiment of the present invention, the storage unit 603 is specifically configured to:
sending a file conflict prompt message to the client;
and receiving a file storage instruction sent by the client, and inquiring and deleting the file corresponding to the fourth version information in response to the file storage instruction.
In another implementation manner of the embodiment of the present invention, the obtaining unit 601 is further configured to obtain an identifier of a check-in client of a file corresponding to the fourth version information, so as to query corresponding client address information;
the sending unit is further configured to send file deletion prompt information based on the client address information.
In another implementation manner of the embodiment of the present invention, the apparatus 600 further includes:
a generating unit for acquiring the stored files to generate corresponding program files;
the sending unit is further configured to send the program file to a corresponding cluster host, so that the cluster host runs the program file.
In another implementation manner of the embodiment of the present invention, the apparatus 600 further includes:
and the synchronization unit is used for responding to a file synchronization instruction triggered by a target platform, acquiring files stored in a preset period, calling a preset API (application program interface) interface, and synchronizing the files stored in the preset period to the target platform.
It should be understood that the manner of implementing the embodiment of the present invention is the same as the manner of implementing the embodiment shown in fig. 2, and the description thereof is omitted.
In the embodiment of the present invention, after a platform replacement instruction is triggered, a file acquisition request may be sent to a replaced platform to acquire a file identifier and first version information of a file to be processed in the replaced platform, and then second version information corresponding to the file to be processed in a target platform is acquired to determine whether a version conflict exists through the first version information and the second version information, that is, the second version information of the file to be processed is queried, and a modification record with the maximum time corresponding to the second version information is acquired to determine whether the first version information includes a modification record; if the first version information comprises the acquired modification record, which indicates that the file to be processed is modified on the basis of the version stored in the target platform, the file to be processed can be directly stored, and the first version information is updated to the second version information; if the first version information does not include the acquired modification record, which indicates that the file to be processed is not modified based on the version stored in the target platform, and a version conflict is generated, the file corresponding to the second version information can be inquired and deleted, the file to be processed is stored again, and the first version information is updated to the second version information. Therefore, in the embodiment of the invention, the file of the replaced platform can be transferred to the target platform through the response of the platform replacing instruction, and the version control is carried out in the file transfer, so that the manual operation of a user is not needed, the processing operation is simple, and the processing efficiency is improved.
According to an embodiment of the present invention, an electronic device and a readable storage medium are also provided.
The electronic device of the embodiment of the invention comprises: at least one processor; and a memory communicatively coupled to the at least one processor; the memory stores instructions executable by the processor, and the instructions are executed by the at least one processor to cause the at least one processor to execute the file processing method provided by the embodiment of the invention.
Fig. 7 shows an exemplary system architecture 700 to which the file processing method or the file processing apparatus of the embodiments of the present invention can be applied.
As shown in fig. 7, the system architecture 700 may include terminal devices 701, 702, 703, a network 704, and a server 705. The network 704 serves to provide a medium for communication links between the terminal devices 701, 702, 703 and the server 705. Network 704 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
A user may use the terminal devices 701, 702, 703 to interact with a server 705 over a network 704, to receive or send messages or the like. Various client applications may be installed on the terminal devices 701, 702, 703.
The terminal devices 701, 702, 703 may be, but are not limited to, smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 705 may be a server that provides various services, and may analyze and process data such as a received product information query request, and feed back a processing result (for example, product information — just an example) to the terminal device.
It should be noted that the file processing method provided by the embodiment of the present invention is generally executed by the server 705, and accordingly, the file processing apparatus is generally disposed in the server 705.
It should be understood that the number of terminal devices, networks, and servers in fig. 7 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to FIG. 8, a block diagram of a computer system 800 suitable for use in implementing embodiments of the present invention is shown. The computer system illustrated in FIG. 8 is only one example and should not impose any limitations on the scope of use or functionality of embodiments of the invention.
As shown in fig. 8, the computer system 800 includes a Central Processing Unit (CPU)801 that can perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)802 or a program loaded from a storage section 808 into a Random Access Memory (RAM) 803. In the RAM 803, various programs and data necessary for the operation of the system 800 are also stored. The CPU 801, ROM 802, and RAM 803 are connected to each other via a bus 804. An input/output (I/O) interface 805 is also connected to bus 804.
The following components are connected to the I/O interface 805: an input portion 806 including a keyboard, a mouse, and the like; an output section 807 including a signal such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage portion 808 including a hard disk and the like; and a communication section 809 including a network interface card such as a LAN card, a modem, or the like. The communication section 809 performs communication processing via a network such as the internet. A drive 810 is also connected to the I/O interface 805 as necessary. A removable medium 811 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 810 as necessary, so that a computer program read out therefrom is mounted on the storage section 808 as necessary.
In particular, according to the embodiments of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program can be downloaded and installed from a network through the communication section 809 and/or installed from the removable medium 811. The computer program executes the above-described functions defined in the system of the present invention when executed by the Central Processing Unit (CPU) 801.
It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present invention, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a unit, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present invention may be implemented by software or hardware. The described units may also be provided in a processor, and may be described as: a processor includes an acquisition unit, a judgment unit, and a storage unit. The names of these units do not in some cases constitute a limitation to the unit itself, and for example, the acquiring unit may also be described as a "unit of a file acquiring function".
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be separate and not incorporated into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to perform the file processing method provided by the present invention. As another aspect, the present invention further provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the computer program implements the file processing method provided by the embodiment of the present invention.
The above-described embodiments should not be construed as limiting the scope of the invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions can occur, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (16)

1. A file processing method, comprising:
responding to a platform replacement instruction, and sending a file acquisition request to a replaced platform to acquire a file identifier and first version information of a file to be processed in the replaced platform;
based on the file identification, inquiring second version information of the file to be processed from data synchronous with a target platform, and acquiring a modification record with the maximum time corresponding to the second version information so as to judge whether the first version information comprises the modification record;
if so, storing the file to be processed, and updating the first version information into the second version information; if not, inquiring and deleting the file corresponding to the second version information, storing the file to be processed, and updating the first version information into the second version information.
2. The method of claim 1, further comprising:
receiving a file check-in request sent by a client, and acquiring a file identifier and third version information of a check-in file in the check-in request;
inquiring fourth version information of the checked-in file based on the file identifier of the checked-in file, and acquiring a modification record with the maximum time corresponding to the fourth version information so as to judge whether the third version information comprises the modification record;
if so, storing the check-in file, and updating the third version information into the fourth version information; if not, inquiring and deleting the file corresponding to the fourth version information, storing the detected file, and updating the third version information into the fourth version information.
3. The method of claim 2, further comprising, before receiving the file check-in request sent by the client:
receiving a file detection request sent by the client, and acquiring a file identifier in the file detection request to query a corresponding detected file;
determining whether the detected file is locked;
if so, sending a prompt message which cannot be detected to the client; and if not, sending the detected file and the fifth version information to the client.
4. The method of claim 3, wherein determining whether the detected file is locked comprises:
inquiring the current state label of the detected file to judge whether the current state label of the detected file is in a detected state;
if yes, determining that the detected file is locked; if not, determining that the detected file is not locked.
5. The method according to claim 2, wherein querying and deleting the file corresponding to the fourth version information comprises:
sending a file conflict prompt message to the client;
and receiving a file storage instruction sent by the client, and inquiring and deleting the file corresponding to the fourth version information in response to the file storage instruction.
6. The method according to claim 5, further comprising, after querying the file corresponding to the fourth version information:
acquiring a check-in client identifier of a file corresponding to the fourth version information to inquire corresponding client address information;
and sending file deletion prompt information based on the client address information.
7. The method of claim 1, further comprising:
acquiring a stored file to generate a corresponding program file;
and sending the program file to a corresponding cluster host to enable the cluster host to operate the program file.
8. The method of claim 1, further comprising:
and responding to a file synchronization instruction triggered by a target platform, acquiring files stored in a preset period to call a preset API (application program interface) interface, and synchronizing the files stored in the preset period to the target platform.
9. A document processing apparatus, characterized by comprising:
the system comprises an acquisition unit, a storage unit and a processing unit, wherein the acquisition unit is used for responding to a platform replacement instruction and sending a file acquisition request to a replaced platform so as to acquire a file identifier and first version information of a file to be processed in the replaced platform;
a determining unit, configured to query, based on the file identifier, second version information of the file to be processed from data synchronized with a target platform, and obtain a modified record with the maximum time corresponding to the second version information, so as to determine whether the modified record is included in the first version information;
the storage unit is used for storing the file to be processed and updating the first version information into the second version information if the file to be processed is not stored; if yes, inquiring and deleting the file corresponding to the second version information, storing the file to be processed, and updating the first version information into the second version information.
10. The apparatus according to claim 9, wherein the obtaining unit is further configured to receive a file check-in request sent by a client, and obtain a file identifier and third version information of a file checked in the check-in request;
the determining unit is further configured to query, based on the file identifier of the checked-in file, fourth version information of the checked-in file, and obtain a modification record with the maximum time corresponding to the fourth version information, so as to determine whether the third version information includes the modification record;
the storage unit is further configured to store the check-in file and update the third version information to the fourth version information if the check-in file is not checked; if yes, inquiring and deleting the file corresponding to the fourth version information, storing the detected file, and updating the third version information into the fourth version information.
11. The apparatus according to claim 10, wherein the obtaining unit is further configured to receive a file retrieval request sent by the client, and obtain a file identifier in the file retrieval request to query a corresponding retrieved file;
the judging unit is also used for judging whether the detected file is locked or not;
the device further comprises:
a sending unit, configured to send, if yes, a notification message that cannot be detected to the client; and if not, sending the detected file and the fifth version information to the client.
12. The apparatus according to claim 11, wherein the determining unit is specifically configured to:
inquiring the current state label of the detected file to judge whether the current state label of the detected file is in a detected state;
if yes, determining that the detected file is locked; if not, determining that the detected file is not locked.
13. The apparatus according to claim 10, wherein the storage unit is specifically configured to:
sending a file conflict prompt message to the client;
and receiving a file storage instruction sent by the client, and inquiring and deleting the file corresponding to the fourth version information in response to the file storage instruction.
14. An electronic device, comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-8.
15. A computer-readable medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1-8.
16. A computer program product comprising a computer program, characterized in that the program realizes the method according to any of claims 1-8 when executed by a processor.
CN202111599667.4A 2021-12-24 2021-12-24 File processing method and device, electronic equipment and storage medium Pending CN114281786A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111599667.4A CN114281786A (en) 2021-12-24 2021-12-24 File processing method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111599667.4A CN114281786A (en) 2021-12-24 2021-12-24 File processing method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114281786A true CN114281786A (en) 2022-04-05

Family

ID=80875071

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111599667.4A Pending CN114281786A (en) 2021-12-24 2021-12-24 File processing method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114281786A (en)

Similar Documents

Publication Publication Date Title
CN109120678B (en) Method and apparatus for service hosting of distributed storage system
CN108196915B (en) Code processing method and device based on application container engine and storage medium
US11169792B2 (en) Method and apparatus for generating patch
CN113760324A (en) Method and device for constructing micro front-end application
CN111782235A (en) Data upgrading and querying method and device
CN110888639A (en) Business code compiling and packaging method and device
CN113138768B (en) Application package generation method and device, electronic equipment and readable storage medium
CN107526838B (en) Method and device for database cluster capacity expansion
CN107818027B (en) Method and device for switching main name node and standby name node and distributed system
CN113296828A (en) Method, server and system for issuing application
CN112596854A (en) Method and device for continuously integrating running of assembly line
CN116737662A (en) Method, device, electronic equipment and storage medium for processing business data
CN112084254A (en) Data synchronization method and system
CN110580216B (en) Application lifting method and device
CN114281786A (en) File processing method and device, electronic equipment and storage medium
CN115982148A (en) Database table processing method and device, electronic equipment and storage medium
CN115794637A (en) Method, device, equipment and computer readable medium for automatic test
CN112988583A (en) Method and device for testing syntax compatibility of database
CN113778527A (en) Method and apparatus for controlling state of pipeline task
CN112835609A (en) Method and device for modifying dependent package download address
CN113761075A (en) Method, device, equipment and computer readable medium for switching databases
CN113127443A (en) Method and device for updating cache data
CN113741951A (en) Local packaging method and device
CN113535221A (en) Method and device for managing application version
CN113138975A (en) Data migration method and device

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