CN109542851A - File updating method, apparatus and system - Google Patents

File updating method, apparatus and system Download PDF

Info

Publication number
CN109542851A
CN109542851A CN201811462578.3A CN201811462578A CN109542851A CN 109542851 A CN109542851 A CN 109542851A CN 201811462578 A CN201811462578 A CN 201811462578A CN 109542851 A CN109542851 A CN 109542851A
Authority
CN
China
Prior art keywords
file
identifier
client
server
update
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
CN201811462578.3A
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.)
Beijing Kingsoft Cloud Network Technology Co Ltd
Beijing Kingsoft Cloud Technology Co Ltd
Original Assignee
Beijing Kingsoft Cloud Network Technology Co Ltd
Beijing Kingsoft Cloud 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 Beijing Kingsoft Cloud Network Technology Co Ltd, Beijing Kingsoft Cloud Technology Co Ltd filed Critical Beijing Kingsoft Cloud Network Technology Co Ltd
Priority to CN201811462578.3A priority Critical patent/CN109542851A/en
Publication of CN109542851A publication Critical patent/CN109542851A/en
Pending legal-status Critical Current

Links

Landscapes

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

Abstract

The present invention provides a kind of file updating methods, apparatus and system, are related to the technical field of data update, this method comprises: receiving the first identifier symbol for the first file that client is sent;It is accorded with according to first identifier and the corresponding relationship between pre-stored the file information and identifier judges whether the first file has update;In the case where judging result is that the first file has update, the more new data of the first file is sent to client, so that client is updated the first file according to more new data.File updating method provided by the invention, apparatus and system, it can effectively judge the consistency of active client Software Version data and server-side, and then realize effective update of client software edition data, it not only increases client data and updates efficiency, it helps improve the Experience Degree of user.

Description

File updating method, apparatus and system
Technical field
The present invention relates to data update method fields, more particularly, to a kind of file updating method, apparatus and system.
Background technique
Client and server-side are during service interaction, when as larger such as user dictionary data, due to originals such as network transmissions Because will affect front end user experience, to solve big dictionary data in the performance issue of network transmission, generally using slow in client Depositing the mode of dictionary data, data interaction efficiency is lower and the poor problem of user experience to alleviate.
Currently, the cache way that uses of most of client software for XML (eXtensible Markup Language, Extensible markup language) file stores or local file database mode, although biggish data volume can be cached, for slow The consistency of deposit data is also difficult to detect and handle, and reduces the Experience Degree that client data updates efficiency and user.
Summary of the invention
In view of this, the purpose of the present invention is to provide a kind of file updating method, apparatus and system, to alleviate above-mentioned skill Art problem.
In a first aspect, this method is applied to server-side the embodiment of the invention provides a kind of file updating method, comprising: Receive the first identifier symbol for the first file that client is sent;According to first identifier symbol and pre-stored the file information and mark Corresponding relationship between symbol judges whether the first file has update;It, will in the case where judging result is that the first file has update The more new data of first file is sent to client, so that client is updated the first file according to more new data.
With reference to first aspect, the embodiment of the invention provides the first possible embodiments of first aspect, wherein on It states whether the corresponding relationship accorded with according to first identifier and between pre-stored the file information and identifier judges the first file Before having update, this method further include: receive the incremental data of file;The identifier of file is generated according to incremental data;It will mark The file information associated storage for knowing symbol and file, obtains corresponding relationship.
The possible embodiment of with reference to first aspect the first, the embodiment of the invention provides second of first aspect Possible embodiment, wherein above-mentioned according to first identifier symbol and the corresponding relationship between pre-stored file and identifier Judge the first file whether to have the step of update to include: to search the first file letter corresponding with first identifier symbol according to corresponding relationship Breath;The second identifier symbol of the first file is obtained according to the first the file information and corresponding relationship;Judge first identifier symbol and the second mark Whether consistent know symbol;It is under first identifier symbol accords with unanimous circumstances with second identifier, to determine that the first file has more in judging result Newly.
The possible embodiment of second with reference to first aspect, the embodiment of the invention provides the third of first aspect Possible embodiment, wherein the step of above-mentioned more new data by the first file is sent to client includes: to obtain described the The corresponding more new data of two identifiers;Second identifier is accorded with into corresponding more new data and is sent to client.
The third possible embodiment with reference to first aspect, the embodiment of the invention provides the 4th kind of first aspect Possible embodiment, wherein above-mentioned to accord with second identifier corresponding after more new data is sent to client, this method is also It include: the third identifier for receiving client and sending;Wherein, third identifier is first that client is generated according to more new data The identifier of file;Judge whether third identifier is accorded with second identifier consistent;It is third identifier and second in judging result Under identifier unanimous circumstances, determines that the first file updates and complete.
With reference to first aspect, the embodiment of the invention provides the 5th kind of possible embodiments of first aspect, wherein After the first identifier symbol for receiving the first file that client is sent, the above method further include: in the first identifier symbol received In the case where for null value, the first file is sent to client.
With reference to first aspect and first to the 5th kind of possible embodiment of first aspect, the embodiment of the present invention mention The 6th kind of possible embodiment of first aspect is supplied, wherein above-mentioned identifier is MD5 value.
Second aspect, the embodiment of the invention provides a kind of file updating method, this method is applied to client, comprising: The corresponding first identifier symbol of the first file is sent to server-side, so that server-side is according to first identifier symbol and pre-stored file Corresponding relationship between information and identifier judges whether the first file has update;In the case where the first file has update, connect Receive the more new data for the first file that server-side returns;The first file is updated according to more new data.
In conjunction with second aspect, the embodiment of the invention provides the first possible embodiments of second aspect, wherein on It states after being updated according to more new data to the first file, this method further include: the first file is generated according to more new data Third identifier;Third identifier is sent to server-side, so that server-side determines whether the first file updates completion.
In conjunction with second aspect, the embodiment of the invention provides second of possible embodiments of second aspect, wherein on It states after being updated according to more new data to the first file, the above method further include: more will be saved in client by new data Memory Mapping File, in order to which client loads more new data.
It is mentioned in conjunction with second aspect and first and second kinds of possible embodiments of second aspect, the embodiment of the present invention The third possible embodiment of second aspect is supplied, wherein above-mentioned identifier is MD5 value.
The third aspect, the embodiment of the invention provides a kind of file updating device, which is set to server-side, comprising: First receiving module, the first identifier symbol of the first file for receiving client transmission;First judgment module, for according to the Corresponding relationship between one identifier and pre-stored the file information and identifier judges whether the first file has update;First The more new data of first file is sent to client in the case where judging result is that the first file has update by update module, So that client is updated the first file according to more new data.
In conjunction with the third aspect, the embodiment of the invention provides the first possible embodiments of the third aspect, wherein on State device further include: incremental data receiving module, for according to first identifier symbol and pre-stored the file information and mark Before corresponding relationship between symbol judges whether the first file has update, the incremental data of file is received;First generation module is used In the identifier for generating file according to incremental data;Memory module, for by the file information associated storage of identifier and file, Obtain corresponding relationship.
In conjunction with the third aspect, the embodiment of the invention provides second of possible embodiments of the third aspect, wherein on It states first judgment module to be used for: the first the file information corresponding with first identifier symbol is searched according to corresponding relationship;According to the first text Part information and corresponding relationship obtain the second identifier symbol of the first file;Judge whether first identifier symbol is accorded with second identifier consistent; It is under first identifier symbol accords with unanimous circumstances with second identifier, to determine that the first file has update in judging result.
In conjunction with second of possible embodiment of the third aspect, the embodiment of the invention provides the third of the third aspect Possible embodiment, wherein above-mentioned first update module is used for: it obtains second identifier and accords with corresponding more new data;By second The corresponding more new data of identifier is sent to client.
In conjunction with the third possible embodiment of the third aspect, the embodiment of the invention provides the 4th kind of the third aspect Possible embodiment, wherein above-mentioned apparatus further include: the second receiving module, for second identifier to be accorded with corresponding update Data are sent to after client, receive the third identifier that client is sent;Wherein, third identifier is client according to more The identifier for the first file that new data generates;Second judgment module, for judge third identifier and second identifier symbol whether Unanimously;Determining module is that third identifier and second identifier accord under unanimous circumstances for place judging result, determines the first text Part, which updates, to be completed.
In conjunction with the third aspect, the embodiment of the invention provides the 5th kind of possible embodiments of the third aspect, wherein on State device further include: sending module, for receiving after receiving the first identifier symbol for the first file that client is sent First identifier symbol be null value in the case where, to client send the first file.
Fourth aspect, the embodiment of the invention provides a kind of file updating device, which is set to client, comprising: First sending module, for sending the corresponding first identifier symbol of the first file to server-side, so that server-side is according to first identifier Symbol and the corresponding relationship between pre-stored the file information and identifier judge whether the first file has update;Data reception Block, for receiving the more new data for the first file that server-side returns in the case where the first file has update;Second updates mould Block, for being updated according to more new data to the first file.
In conjunction with fourth aspect, the embodiment of the invention provides the first possible embodiments of fourth aspect, wherein on State device further include: the second generation module, for after being updated to the first file according to more new data, according to updating number According to the third identifier for generating the first file;Second sending module, for third identifier to be sent to server-side, so that service It holds and determines whether the first file updates completion.
In conjunction with fourth aspect, the embodiment of the invention provides second of possible embodiments of fourth aspect, wherein on State device further include: loading module, for after being updated according to more new data to the first file, more new data to be saved To the Memory Mapping File of client, in order to which client loads more new data.
5th aspect, the embodiment of the invention provides a kind of file more new system, which includes client and server-side, Client and server-side communicate to connect;Wherein, server-side is provided with device described in the third aspect;Client is provided with four directions Device described in face.
6th aspect, the embodiment of the invention provides a kind of server, the server includes: processor and memory; Wherein, the memory, for storing computer program;The processor, for executing the journey stored on the memory When sequence, any method and step of above-mentioned first aspect is realized.
7th aspect, the embodiment of the invention provides a kind of computer storage mediums, for storing computer program instructions, When computer executes the computer program instructions, such as first aspect and the described in any item methods of second aspect are executed.
The embodiment of the present invention bring it is following the utility model has the advantages that
A kind of file updating method provided in an embodiment of the present invention, apparatus and system can be sent receive client The first file first identifier symbol when, according to first identifier symbol pre-stored the file information and identifier between it is corresponding Relationship judges that the first identifier accords with whether corresponding first file has update, and when there is update by the more new data of the first file It is sent to client, so that client is updated current first file according to more new data, is accorded with above by first identifier Judge whether that the process updated can effectively judge the consistency of current first file and server-side, and then realizes client first Effective update of file not only increases client data and updates efficiency, it helps improves the Experience Degree of user.
Other features and advantages of the present invention will illustrate in the following description, also, partly become from specification It obtains it is clear that understand through the implementation of the invention.The objectives and other advantages of the invention are in specification, claims And specifically noted structure is achieved and obtained in attached drawing.
To enable the above objects, features and advantages of the present invention to be clearer and more comprehensible, preferred embodiment is cited below particularly, and cooperate Appended attached drawing, is described in detail below.
Detailed description of the invention
It, below will be to specific in order to illustrate more clearly of the specific embodiment of the invention or technical solution in the prior art Embodiment or attached drawing needed to be used in the description of the prior art be briefly described, it should be apparent that, it is described below Attached drawing is some embodiments of the present invention, for those skilled in the art, without creative efforts, It is also possible to obtain other drawings based on these drawings.
Fig. 1 is a kind of flow chart of file updating method provided in an embodiment of the present invention;
Fig. 2 is the flow chart of another file updating method provided in an embodiment of the present invention;
Fig. 3 is the flow chart of another file updating method provided in an embodiment of the present invention;
Fig. 4 is a kind of structural schematic diagram of file updating device provided in an embodiment of the present invention;
Fig. 5 is the structural schematic diagram of another file updating device provided in an embodiment of the present invention;
Fig. 6 is the structural schematic diagram of another file updating device provided in an embodiment of the present invention;
Fig. 7 is the structural schematic diagram of another file updating device provided in an embodiment of the present invention;
Fig. 8 is a kind of interaction schematic diagram of file more new system provided in an embodiment of the present invention.
Specific embodiment
In order to make the object, technical scheme and advantages of the embodiment of the invention clearer, below in conjunction with attached drawing to the present invention Technical solution be clearly and completely described, it is clear that described embodiments are some of the embodiments of the present invention, rather than Whole embodiments.Based on the embodiments of the present invention, those skilled in the art institute without making creative work The every other embodiment obtained, shall fall within the protection scope of the present invention.
Currently, the cache way that most of client software uses is XML file storage or local file database mode. Wherein, the mode of XML file storage refers to that client-side data cache saves as XML file, the version that server-side passes through control file This record realizes the synchronization of Software Version data, when increasing or modifying server-side dictionary data, while updating client software Version number, client judge whether server-side version and local are consistent, and caching is updated when inconsistent.
But no matter this mode modifies the size of data volume when judging to have update every time, and full dose is all needed to update number According to cannot achieve the update of incremental data.Also, XML file can be edited in client computer, lead to data safety risk It is high;Moreover, it judges that the process of version updating is usually to pass through third-party version file to realize, poor fault tolerance, so that The detection processing of consistency can not be carried out when local cache file is lost but version file is consistent.In addition, the visitor of this mode Family end data renewal time and server-side update having time are poor, and the data updated within this time difference will lead to client and can not obtain It takes, also, client updates efficiency speed and depends on data cached size, it is difficult to which solve single file causes when updating caching Whole system speed decline the problem of.
And local file database mode refers to that client, can using document data bank mode memory buffers file data Realize incremental mode more new data, if only partial data updates, data, which are updated, only needs the modification of more new increment with downloading Data.But this mode similarly has that client data updates and server-side updates having time difference, also, client End data is buffered on user computer, is vulnerable to maliciously distort, and client is caused in turn result in using the data of mistake Serious traffic issues;Since it relies on local file database, it is also difficult to verify the consistency of dictionary file data;Cause When client data mistake, can not be repaired by the automatic mode of system there are the problem of.In addition, local file database mode Round-trip processing data interaction request is needed repeatedly, a large amount of bandwidth waste is caused, meanwhile, client also can not parallel processing table pass Connection, so that client data renewal speed is slower, reduces the Experience Degree of user.
Based on this, a kind of file updating method provided in an embodiment of the present invention, apparatus and system can be effectively relieved above-mentioned Technical problem.
For convenient for understanding the present embodiment, first to a kind of file updating method disclosed in the embodiment of the present invention into Row is discussed in detail.
In a kind of possible embodiment, the embodiment of the invention provides a kind of file updating method, this method applications In server-side, a kind of flow chart of file updating method as shown in Figure 1, method includes the following steps:
Step S102 receives the first identifier symbol for the first file that client is sent;
Wherein, client is also referred to as user terminal, refers to corresponding with server-side, provides the application journey of local service for client Therefore sequence usually can all establish specific communication connection with server-side, to guarantee the normal operation of application program.
In general, above-mentioned first file can be the cache file of client, which can be client software Cache file, such as client software edition data or logon data.Client is starting, or is produced by application program When certain raw business, it can be interacted with server-side, at this point, available the first file of active client of client is corresponding First identifier symbol, such as the first identifier symbol of local cache file, are then sent to server-side for first identifier symbol.
Wherein, above-mentioned first identifier symbol is usually that client is based on active client file or cache file generation Identifier, also, the first identifier symbol in the embodiment of the present invention is usually MD5 value, for example, the MD5 value of local cache file, tool Body, MD5 (Message-Digest Algorithm) value is a kind of Cryptographic Hash Function being widely used, and be can produce out The hashed value (hash value) of one 128 (16 byte), for ensuring that information transmission is complete consistent.Also, the life of MD5 value Algorithm can be converted at process by irreversible character string, generate this by local cache file as a big text information The unique MD5 informative abstract of ground cache file, the uniqueness of the MD5 value can make server-side effectively judge client software version Whether notebook data has update.Specifically deterministic process can be realized by following steps S104.
Step S104, accords with according to first identifier and the corresponding relationship between pre-stored the file information and identifier judges Whether the first file has update;
In actual use, server-side can in advance save the file information of client, record corresponding client The file information and the corresponding identifier of this document information etc. are held, in order in the first identifier for receiving client transmission Fu Shi, judges whether the first file of client has update.
For example, when first file is client local cache file, and the local cache file is client software version When notebook data, the file information that server-side pre-saves can be the information of client software edition data, such as latest edition number According to, and relative to more new data etc. of the latest edition data, also, for each client software version, there is it Corresponding identifier, between the first identifier that server-side is sent according to client and the file information and identifier Corresponding relationship judge whether the first file has update.
Step S106 sends the more new data of the first file in the case where judging result is that the first file has update To client, so that client is updated the first file according to more new data.
A kind of file updating method provided in an embodiment of the present invention, apparatus and system can be sent receive client The first file first identifier symbol when, according to first identifier symbol pre-stored the file information and identifier between it is corresponding Relationship judges that the first identifier accords with whether corresponding first file has update, and when there is update by the more new data of the first file It is sent to client, so that client is updated current first file according to more new data, is accorded with above by first identifier Judge whether that the process updated can effectively judge the consistency of current first file and server-side, and then realizes client first Effective update of file not only increases client data and updates efficiency, it helps improves the Experience Degree of user.
In actual use, using above-mentioned first file as client local cache file, and, which includes It is illustrated for client software edition data, at this point, corresponding between above-mentioned pre-stored the file information and identifier Relationship generally includes: client software version number, the more new data of client software edition data and the corresponding relationship of identifier, Therefore, file updating method described in the embodiment of the present invention further include server-side establish it is corresponding between the file information and identifier The process of relationship, the process is usually according to the corresponding pass between first identifier symbol and pre-stored the file information and identifier System judges whether the first file has progress before update, and specifically, which generally includes following steps:
(1) incremental data of file is received;
Wherein, if above-mentioned first file is client local cache file, and, which includes client Software Version data, at this point, the increase data can be the incremental data of client software edition data;Specifically, the increment Data can be client software developer be directed to active client software provide more new data, as processing business and updates data, Function optimization data etc..
(2) identifier of above-mentioned file is generated according to incremental data;
(3) by the file information associated storage of identifier and file, above-mentioned corresponding relationship is obtained.
For ease of understanding, equally illustrate so that increased data are client software edition datas as an example, specifically, server-side After receiving incremental data, the corresponding client software version number of the incremental data can be extracted, in general, client software version It number may include that the principal mark of client software version is known and the sub-mark of client software version;The corresponding visitor of different incremental datas Principal mark in the software version number of family end is sensible same, and sub-mark is different;For example, version V4.0.1, therein 4.0 can be known with principal mark, Last number 1 indicates sub-mark;The corresponding identifier of different clients software version number is different, for example, V4.0.1 pairs The identifier answered is first identifier symbol, if V4.0.1 version updating, there is new incremental data, after being updated to V4.0.2 version, The file information of the file information and V4.0.1 version comprising incremental data is different at this time, so that the file of V4.0.2 version The identifier of information and the identifier of the file information of V4.0.1 version are different.Therefore, it can be saved in server-side each The identifier of the corresponding the file information of version and the version file information, so establish above-mentioned the file information and identifier it Between corresponding relationship.
When specific implementation, above-mentioned identifier generallys use MD5 value, the uniqueness of MD5 value, so that the text of above-mentioned different editions The corresponding MD5 value of part information is the unique information for indicating the file information.Therefore, server-side can judge according to above-mentioned corresponding relationship First identifier accords with whether corresponding first file has update.
Based on above-mentioned corresponding relationship, above-mentioned steps S104 can be realized by process once: according to corresponding relationship search with First identifier accords with corresponding first the file information;The second identifier of the first file is obtained according to the first the file information and corresponding relationship Symbol;Judge whether first identifier symbol is accorded with second identifier consistent;It is that first identifier symbol is consistent with second identifier symbol in judging result In the case where, determine that the first file has update.
In actual use, the corresponding relationship between above-mentioned the file information and identifier can be presented in table form, When server-side receives first identifier symbol, the first identifier can be searched in the table and accords with corresponding first the file information, into And the corresponding second identifier symbol of the first the file information is found, since second identifier symbol is usually current first the file information Therefore newest identifier can accord with according to the second identifier and find corresponding more new data.
Based on this, the embodiment of the invention also provides another file updating methods, to the judgement renewal process of server-side It is described.In order to make it easy to understand, table 1 shows a kind of corresponding relationship of form, as shown in table 1:
Table 1
Specifically, it is illustrated by taking above-mentioned table 1 as an example.The flow chart of another file updating method as shown in Figure 2, with The following steps are included:
Step S202 receives the first identifier symbol for the first file that client is sent;
Step S204 searches the first the file information corresponding with first identifier symbol according to corresponding relationship;
It, can be according to table 1 after server-side receives MD1 by taking the received first identifier symbol of server-side is MD1 as an example Corresponding relationship find the corresponding first the file information V1.0.1 of MD1, which is usually the version of current file information Number.
Step S206 is accorded with according to the second identifier that the first the file information and corresponding relationship obtain the first file;Judge first Whether identifier accords with consistent with second identifier;If so, terminating;If not, executing step S208;
It specifically, as shown in Table 1, can after the first the file information V1.0.1 that server side searches are MD1 to first identifier symbol , but V1.0.2 that sub-mark different sensible same with the principal mark of V1.0.1 is found with the corresponding relationship according to shown in table 1, and The corresponding second identifier of V1.0.2 accords with MD2, since MD2 is different from MD1, server-side may determine that first identifier at this time Symbol accords with inconsistent with second identifier.Therefore, step S208 can be continued to execute.
If the received first identifier symbol of server-side is MD3, and server-side is right according to shown in table 1 in step S202 It should be related to that finding the current corresponding newest identifier of MD3 corresponding version number V2.0.1 and version number V2.0.1 is also MD3.At this point, server-side may determine that first identifier symbol is consistent with second identifier symbol at this time, therefore, server-side can be tied The more new technological process of Shu Dangqian.
Step S208 determines that the first file has update;
Step S210 obtains second identifier and accords with corresponding more new data;
Specifically, which is the data for formed after packing storage to the incremental data of the first file, in general, For the ease of getting the more new data, it can be associated with the more new data of packing storage in the above correspondence relationship.
It, can be according to above-mentioned after server-side receives MD1 equally by taking the received first identifier symbol of server-side is MD1 as an example Corresponding relationship shown in table 1 finds corresponding V1.0.1, and gets the corresponding newest identifier (second identifier of V1.0.1 Symbol) MD2, so that it is available corresponding relative to first identifier symbol MD1 to the corresponding second identifier symbol MD2 of second identifier symbol MD2 More new data Data1, then execute step S212.
Second identifier is accorded with corresponding more new data and is sent to client by step S212;
In general, related protocol, such as Protocol Buffer agreement can be used after client receives more new data, Data sequence will be updated and turn to cache file, meanwhile, the corresponding new MD5 value (identifier) of cache file is submitted to clothes again It is engaged in end, being continued to judge whether the current client software edition data of client is newest cache file by server-side.Wherein, The mode that update data sequence is turned to cache file in client, can be easy to implement the communication in server-side and client Journey, specifically, client can such as carry out data operating after the update Data Serialization received to more new data It updates, updated MD5 value is submitted to server-side etc. again, further, the sequence that server-side can send client again After changing data progress unserializing, then subsequent operation is carried out, the specific mode that serializes can be realized with reference to the relevant technologies, this hair Bright embodiment is not limited this.
It is above-mentioned by the way of Data Serialization, it can be ensured that the storages of data efficiently and formats, and guarantees more new data Preservation and load efficiency.Specifically, since the more new data is usually soft relative to the corresponding client of first identifier symbol The more new data of part edition data, therefore, when client carries out more active client Software Version data according to more new data The identifier (e.g., MD5 value) obtained after new is that the newest identifier of client software corresponding with server version number is It is consistent.
But, it is contemplated that in client renewal process, also can presence service end receive client software version simultaneously The case where incremental data of data, therefore, file updating method provided in an embodiment of the present invention further include that client verifies again The process of active client Software Version data verifies local cache file again, avoids current cache file may not It is newest cache file.Specifically, the process verified again can be realized by following step S214~step S220.
Step S214 receives the third identifier that client is sent;
Wherein, which is the identifier for the file information that client is generated according to above-mentioned more new data, is updated The file information afterwards generally includes original the file information, and more new data.
Specifically, which is also possible to MD5 value.
Step S216 judges whether third identifier is accorded with second identifier consistent;If so, executing step S220;If It is no, execute step S218;
Second identifier is accorded with corresponding more new data and is sent to client, return step S214 by step S218;
Step S220 determines that the first file updates and completes.
The above-mentioned process verified again to client software edition data, can be effectively ensured active client software version Data are the data of recent renewal.It is also possible to realize the synchronized update of the data at client and server-side, realize parallel Processing, saves renewal time when individually carrying out data update to server-side and client, improves the efficiency of processing.
In addition, exception, or the packet loss event due to caused by network problem are downloaded for more new data, by verifying again Process, client, which also can be carried out, automatically corrects reparation, and when file modification or damage to ensure more new data can synchronized update.
Further, if the first identifier symbol that client is sent is null value, that is, in step S102 or S202, server-side In the case where the data of the first identifier symbol received are null value, the first file is sent to client.Wherein, first identifier accords with For null value may be since the case where active client Software Version data is emptied or client is formatted, is caused, At this point, server-side can send the first file, such as whole client software edition datas to client, also, service at this time Hold the first file sent, the corresponding data of usually newest client software version number, when ensuring file modification or damage It can synchronized update.
In alternatively possible embodiment, the embodiment of the invention also provides another file updating method, the party Method is applied to client, the flow chart of another file updating method as shown in Figure 3, method includes the following steps:
Step S302 sends the corresponding first identifier symbol of the first file to server-side, so that server-side is according to first identifier Symbol and the corresponding relationship between pre-stored the file information and identifier judge whether the first file has update;
Step S304 receives the more new data for the first file that server-side returns in the case where the first file has update;
Step S306 is updated the first file according to more new data.
Further, after client is updated the first file according to more new data, the above method further include: according to More new data generates the third identifier of the first file, third identifier is sent to server-side, so that server-side determines first Whether file updates completion, realizes the process verified again to the first file (e.g., data cached etc.) of client.
In addition, being carried out according to more new data to the first file to improve client to the loading efficiency of more new data After update, the above method further includes the Memory Mapping File that more new data is saved in client, in order to which client is to more New data is loaded.Specifically, the more new data received for client, can further using memory formatted file into Row storage, for example, client more can will be stored as Memory Mapping File by new data, leads to the application program in client It crosses memory pointer to access to the file of more new data, accelerates treatment effeciency.
To sum up, file updating method provided in an embodiment of the present invention has the advantages that
(1) identifier of file has uniqueness, as first identifier symbol, second identifier symbol or third identifier use The form of MD5 value, it can be ensured that can synchronized update when file modification or damage;
(2) file uses Data Serialization mode, it is ensured that the storage of data is efficient and formats, and guarantees data cached preservation With the efficiency of load;
(3) it can realize to automatically correct by way of verifying again when data download exception or network problem packet loss and repair It is multiple;
(4) parallel processing is realized in client and server-side, promote the efficiency of processing.
Corresponding to the file updating method that above embodiment provides, the embodiment of the invention also provides a kind of updates of file Device, this document updating device can be set in server-side, a kind of structural schematic diagram of file updating device as shown in Figure 4, The device includes:
First receiving module 40, the first identifier symbol of the first file for receiving client transmission;
First judgment module 42, pair for being accorded with according to first identifier and between pre-stored the file information and identifier It should be related to and judge whether the first file has update;
First update module 44, in the case where judging result is that the first file has update, by the update number of the first file According to client is sent to, so that client is updated the first file according to more new data.
Further, Fig. 5 is shown in the structural schematic diagram of another file updating device, in addition to structure shown in Fig. 4, on State device further include:
Incremental data receiving module 46, for according to first identifier symbol and pre-stored the file information and identifier it Between corresponding relationship judge whether the first file has update before, receive the incremental data of file;
First generation module 48, for generating the identifier of file according to incremental data;
Memory module 50, for obtaining corresponding relationship for the file information associated storage of identifier and file.
In actual use, above-mentioned first judgment module is used for:
The first the file information corresponding with first identifier symbol is searched according to corresponding relationship;According to the first the file information and correspondence The second identifier of the first file of Relation acquisition accords with;Judge whether first identifier symbol is accorded with second identifier consistent;It is in judging result First identifier symbol determines that the first file has update under second identifier symbol unanimous circumstances.
Above-mentioned first update module is used for:
It obtains second identifier and accords with corresponding more new data;Second identifier is accorded with into corresponding more new data and is sent to client.
Further, as shown in figure 5, above-mentioned apparatus further include:
Second receiving module 52 is received for according with second identifier corresponding after more new data is sent to client The third identifier that client is sent;Wherein, third identifier is the mark for the first file that client is generated according to more new data Know symbol;
Second judgment module 54, for judging that it is whether consistent that third identifier and second identifier accord with;
Determining module 56 is that third identifier and second identifier accord under unanimous circumstances for place judging result, determines First file, which updates, to be completed;
Sending module 58, after being accorded in the first identifier for receiving the first file that client is sent, what is received In the case that first identifier symbol is null value, the first file is sent to client.
Further, Fig. 6 also shows the structural schematic diagram of another file updating device, and this document updating device is set to Client, as shown in fig. 6, the device includes:
First sending module 60, for sending the corresponding first identifier symbol of the first file to server-side, so that server-side root It is accorded with according to first identifier and the corresponding relationship between pre-stored the file information and identifier judges whether the first file has update;
Data reception module 62, in the case where the first file has update, receiving the first file that server-side returns More new data;
Second update module 64, for being updated according to more new data to the first file.
Further, the structural schematic diagram of another file updating device as shown in Figure 7, this is set to the device of client Further include:
Second generation module 66, for after being updated to the first file according to more new data, according to more new data Generate the third identifier of the first file;
Second sending module 68, for third identifier to be sent to server-side, so that server-side determines the first file is No update is completed.
Loading module 70, for will more new data be saved in after being updated according to more new data to the first file The Memory Mapping File of client, in order to which client loads more new data.
File updating device provided in an embodiment of the present invention has identical with file updating method provided by the above embodiment Technical characteristic reach identical technical effect so also can solve identical technical problem.
The embodiment of the invention also provides a kind of file more new systems, and specifically, which includes client and server-side, Client and server-side communicate to connect;Wherein, server-side is provided with Fig. 4 or file updating device shown in fig. 5;Client setting There are Fig. 6 or file updating device shown in Fig. 7.
In order to make it easy to understand, Fig. 8 shows a kind of interaction schematic diagram of file more new system, the friendship of this document more new system Mutual process generally includes following steps:
Step S802, client send the first identifier symbol of the first file to server-side;
Step S804, server-side accord with the corresponding pass between pre-stored the file information and identifier according to first identifier System judges whether the first file has update;If so, step S806 is executed, if not, terminating.
Step S806, server-side more will be sent to client by new data;
Step S808, client receives the more new data for the first file that server-side returns, according to more new data to first File is updated;
Step S810, client generate the third identifier of the first file according to more new data;
Third identifier is sent to server-side by step S812, client;
Step S814, server-side determine whether the first file of client updates completion;If so, terminating, if not, executing Step S816;
Second identifier is accorded with corresponding more new data and is sent to client by step S816.
It is apparent to those skilled in the art that for convenience and simplicity of description, the system of foregoing description It with the specific work process of device, can refer to corresponding processes in the foregoing method embodiment, details are not described herein.
The embodiment of the invention also provides a kind of computer storage mediums to work as calculating for storing computer program instructions When machine executes the computer program instructions, the file updating method as described in above-mentioned any embodiment is executed.
The computer program product of file updating method, apparatus and system provided by the embodiment of the present invention, including storage The computer readable storage medium of program code, the instruction that said program code includes can be used for executing previous methods embodiment Described in method, specific implementation can be found in embodiment of the method, details are not described herein.
It, can be with if the function is realized in the form of SFU software functional unit and when sold or used as an independent product It is stored in a computer readable storage medium.Based on this understanding, technical solution of the present invention is substantially in other words The part of the part that contributes to existing technology or the technical solution can be embodied in the form of software products, the meter Calculation machine software product is stored in a storage medium, including some instructions are used so that a computer equipment (can be a People's computer, server or network equipment etc.) it performs all or part of the steps of the method described in the various embodiments of the present invention. And storage medium above-mentioned includes: that USB flash disk, mobile hard disk, read-only memory (ROM, Read-OnlyMemory), arbitrary access are deposited The various media that can store program code such as reservoir (RAM, Random Access Memory), magnetic or disk.
In the description of the present invention, it should be noted that term " center ", "upper", "lower", "left", "right", "vertical", The orientation or positional relationship of the instructions such as "horizontal", "inner", "outside" be based on the orientation or positional relationship shown in the drawings, merely to Convenient for description the present invention and simplify description, rather than the device or element of indication or suggestion meaning must have a particular orientation, It is constructed and operated in a specific orientation, therefore is not considered as limiting the invention.In addition, term " first ", " second ", " third " is used for descriptive purposes only and cannot be understood as indicating or suggesting relative importance.
Finally, it should be noted that above embodiments, only a specific embodiment of the invention, to illustrate skill of the invention Art scheme, rather than its limitations, scope of protection of the present invention is not limited thereto, although with reference to the foregoing embodiments to the present invention into Go detailed description, it should be understood by those skilled in the art that: anyone skilled in the art takes off in the present invention In the technical scope of dew, it can still modify to technical solution documented by previous embodiment or can readily occur in change Change or equivalent replacement of some of the technical features;And these modifications, variation or replacement, do not make relevant art Scheme essence be detached from technical solution of the embodiment of the present invention spirit and scope, should all cover protection scope of the present invention it It is interior.Therefore, protection scope of the present invention should be subject to the protection scope in claims.

Claims (19)

1. a kind of file updating method, which is characterized in that the method is applied to server-side, which comprises
Receive the first identifier symbol for the first file that client is sent;
It is accorded with according to the first identifier and the corresponding relationship between pre-stored the file information and identifier judges described first Whether file has update;
In the case where judging result is that first file has update, the more new data of first file is sent to described Client, so that the client is updated first file according to the more new data.
2. the method according to claim 1, wherein according to first identifier symbol and pre-stored file Before corresponding relationship between information and identifier judges whether first file has update, the method also includes:
Receive the incremental data of the file;
The identifier of the file is generated according to the incremental data;
By the file information associated storage of the identifier and the file, the corresponding relationship is obtained.
3. the method according to claim 1, wherein described according to first identifier symbol and pre-stored text Corresponding relationship between part and identifier judges whether first file has the step of update to include:
The first the file information corresponding with first identifier symbol is searched according to the corresponding relationship;
The second identifier symbol of first file is obtained according to first the file information and the corresponding relationship;Judge described Whether one identifier accords with consistent with the second identifier;
It is under first identifier symbol accords with unanimous circumstances with the second identifier, to determine that first file has in judging result It updates.
4. according to the method described in claim 3, it is characterized in that, the more new data by first file is sent to institute The step of stating client include:
It obtains the second identifier and accords with corresponding more new data;
The second identifier is accorded with into corresponding more new data and is sent to the client.
5. according to the method described in claim 4, it is characterized in that, being sent the second identifier is accorded with corresponding more new data After to the client, the method also includes:
Receive the third identifier that the client is sent;Wherein, the third identifier be the client according to described in more The identifier for first file that new data generates;
Judge whether the third identifier is accorded with the second identifier consistent;
In the case where judging result is the third identifier and the second identifier accords with unanimous circumstances, first file is determined more It is new to complete.
6. the method according to claim 1, wherein in the first identifier for receiving the first file that client is sent After symbol, the method also includes:
In the case where the first identifier symbol received is null value, Xiang Suoshu client sends first file.
7. method according to any one of claim 1 to 6, which is characterized in that the identifier is MD5 value.
8. a kind of file updating method, which is characterized in that the method is applied to client, which comprises
The corresponding first identifier symbol of the first file is sent to server-side, so that the server-side is according to first identifier symbol and in advance Corresponding relationship between the file information first stored and identifier judges whether first file has update;
In the case where first file has update, the more new data for the first file that the server-side returns is received;
First file is updated according to the more new data.
9. according to the method described in claim 8, it is characterized in that, being carried out according to the more new data to first file After update, the method also includes:
The third identifier of first file is generated according to the more new data;
The third identifier is sent to the server-side, so that the server-side determines whether first file has updated At.
10. according to the method described in claim 8, it is characterized in that, according to the more new data to first file into After row updates, the method also includes:
The more new data is saved in the Memory Mapping File of the client, in order to which the client is to the update number According to being loaded.
11. according to the described in any item methods of claim 8-10, which is characterized in that the identifier is MD5 value.
12. a kind of file updating device, which is characterized in that described device is set to server-side, and described device includes:
First receiving module, the first identifier symbol of the first file for receiving client transmission;
First judgment module, for according to corresponding between first identifier symbol and pre-stored the file information and identifier Relationship judges whether first file has update;
First update module, in the case where judging result is that first file has update, by the update of first file Data are sent to the client, so that the client is updated first file according to the more new data.
13. device according to claim 12, which is characterized in that described device further include:
Incremental data receiving module, for according between first identifier symbol and pre-stored the file information and identifier Corresponding relationship judge whether first file has update before, receive the incremental data of the file;
First generation module, for generating the identifier of the file according to the incremental data;
Memory module, for obtaining the corresponding relationship for the file information associated storage of the identifier and the file.
14. device according to claim 12, which is characterized in that the first judgment module is used for:
The first the file information corresponding with first identifier symbol is searched according to the corresponding relationship;
The second identifier symbol of first file is obtained according to first the file information and the corresponding relationship;Judge described Whether one identifier accords with consistent with the second identifier;
It is under first identifier symbol accords with unanimous circumstances with the second identifier, to determine that first file has in judging result It updates.
15. a kind of file updating device, which is characterized in that described device is set to client, and described device includes:
First sending module, for sending the first file corresponding first identifier symbol to server-side so that the server-side according to Whether the first identifier symbol and the corresponding relationship between pre-stored the file information and identifier judge first file There is update;
Data reception module, the first text returned in the case where first file has update, receiving the server-side The more new data of part;
Second update module, for being updated according to the more new data to first file.
16. device according to claim 15, which is characterized in that described device further include:
Second generation module, for after being updated according to the more new data to first file, according to it is described more New data generates the third identifier of first file;
Second sending module, for the third identifier to be sent to the server-side, so that described in the server-side is determining Whether the first file updates completion.
17. a kind of file more new system, which is characterized in that the system comprises client and server-side, the client and institute State server-side communication connection;
Wherein, the server-side is provided with the described in any item devices of claim 12~14;The client setting is had the right It is required that device described in 15 or 16.
18. a kind of server, which is characterized in that the server includes: processor and memory;Wherein, the memory is used In storage computer program;
The processor when for executing the program stored on the memory, realizes side as claimed in claim 1 to 7 Method step.
19. a kind of computer storage medium, which is characterized in that for storing computer program instructions, described in computer execution When computer program instructions, such as the described in any item methods of claim 1-11 are executed.
CN201811462578.3A 2018-11-30 2018-11-30 File updating method, apparatus and system Pending CN109542851A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811462578.3A CN109542851A (en) 2018-11-30 2018-11-30 File updating method, apparatus and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811462578.3A CN109542851A (en) 2018-11-30 2018-11-30 File updating method, apparatus and system

Publications (1)

Publication Number Publication Date
CN109542851A true CN109542851A (en) 2019-03-29

Family

ID=65852302

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811462578.3A Pending CN109542851A (en) 2018-11-30 2018-11-30 File updating method, apparatus and system

Country Status (1)

Country Link
CN (1) CN109542851A (en)

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110309203A (en) * 2019-07-02 2019-10-08 成都数之联科技有限公司 A kind of interactive mode and self-defining data modeling based on big data
CN110390064A (en) * 2019-07-25 2019-10-29 深圳市腾讯计算机系统有限公司 File updating method, device and system, storage medium and electronic device
CN110535907A (en) * 2019-07-26 2019-12-03 济南浪潮数据技术有限公司 Metadata synchronization method and system
CN110879815A (en) * 2019-11-26 2020-03-13 上海莉莉丝科技股份有限公司 Method, device, equipment and storage medium for upgrading game database server
CN111078632A (en) * 2019-12-27 2020-04-28 珠海金山网络游戏科技有限公司 File data management method and device
CN112256669A (en) * 2020-09-27 2021-01-22 北京三快在线科技有限公司 Data processing method and device, electronic equipment and readable storage medium
CN112486539A (en) * 2020-12-09 2021-03-12 税友软件集团股份有限公司 Application updating method, device, equipment and storage medium
CN112596956A (en) * 2020-12-28 2021-04-02 北京浪潮数据技术有限公司 File system management method, device and related components
CN113177407A (en) * 2021-06-30 2021-07-27 平安普惠企业管理有限公司 Data dictionary construction method and device, computer equipment and storage medium
CN113672268A (en) * 2021-06-18 2021-11-19 杭州玳数科技有限公司 Silent updating method and device for front-end resources and computer equipment

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102073494A (en) * 2010-12-30 2011-05-25 用友软件股份有限公司 Method and device for managing cache data
CN104216727A (en) * 2013-06-04 2014-12-17 腾讯科技(深圳)有限公司 Application upgrading method and system
CN104539696A (en) * 2014-12-26 2015-04-22 北京像素软件科技股份有限公司 Client end incremental updating method and system
CN104657170A (en) * 2013-11-25 2015-05-27 腾讯科技(上海)有限公司 Data updating method, device and system
CN105095313A (en) * 2014-05-22 2015-11-25 阿里巴巴集团控股有限公司 Data access method and equipment
CN105743974A (en) * 2016-01-26 2016-07-06 北京乐动卓越科技有限公司 Client information updating method
CN106302753A (en) * 2016-08-18 2017-01-04 福建天泉教育科技有限公司 The method and system of client-side program incremental update
CN107644071A (en) * 2017-09-18 2018-01-30 广州爱九游信息技术有限公司 Buffering updating method, device and data-storage system
CN108156015A (en) * 2016-12-06 2018-06-12 阿里巴巴集团控股有限公司 The update method and device of data
US10061834B1 (en) * 2014-10-31 2018-08-28 Amazon Technologies, Inc. Incremental out-of-place updates for datasets in data stores

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102073494A (en) * 2010-12-30 2011-05-25 用友软件股份有限公司 Method and device for managing cache data
CN104216727A (en) * 2013-06-04 2014-12-17 腾讯科技(深圳)有限公司 Application upgrading method and system
CN104657170A (en) * 2013-11-25 2015-05-27 腾讯科技(上海)有限公司 Data updating method, device and system
CN105095313A (en) * 2014-05-22 2015-11-25 阿里巴巴集团控股有限公司 Data access method and equipment
US10061834B1 (en) * 2014-10-31 2018-08-28 Amazon Technologies, Inc. Incremental out-of-place updates for datasets in data stores
CN104539696A (en) * 2014-12-26 2015-04-22 北京像素软件科技股份有限公司 Client end incremental updating method and system
CN105743974A (en) * 2016-01-26 2016-07-06 北京乐动卓越科技有限公司 Client information updating method
CN106302753A (en) * 2016-08-18 2017-01-04 福建天泉教育科技有限公司 The method and system of client-side program incremental update
CN108156015A (en) * 2016-12-06 2018-06-12 阿里巴巴集团控股有限公司 The update method and device of data
CN107644071A (en) * 2017-09-18 2018-01-30 广州爱九游信息技术有限公司 Buffering updating method, device and data-storage system

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110309203A (en) * 2019-07-02 2019-10-08 成都数之联科技有限公司 A kind of interactive mode and self-defining data modeling based on big data
CN110390064A (en) * 2019-07-25 2019-10-29 深圳市腾讯计算机系统有限公司 File updating method, device and system, storage medium and electronic device
CN110535907A (en) * 2019-07-26 2019-12-03 济南浪潮数据技术有限公司 Metadata synchronization method and system
CN110879815A (en) * 2019-11-26 2020-03-13 上海莉莉丝科技股份有限公司 Method, device, equipment and storage medium for upgrading game database server
CN111078632A (en) * 2019-12-27 2020-04-28 珠海金山网络游戏科技有限公司 File data management method and device
CN112256669A (en) * 2020-09-27 2021-01-22 北京三快在线科技有限公司 Data processing method and device, electronic equipment and readable storage medium
CN112486539A (en) * 2020-12-09 2021-03-12 税友软件集团股份有限公司 Application updating method, device, equipment and storage medium
CN112486539B (en) * 2020-12-09 2023-08-08 税友软件集团股份有限公司 Application updating method, device, equipment and storage medium
CN112596956A (en) * 2020-12-28 2021-04-02 北京浪潮数据技术有限公司 File system management method, device and related components
CN112596956B (en) * 2020-12-28 2024-02-13 北京浪潮数据技术有限公司 File system management method, device and related components
CN113672268A (en) * 2021-06-18 2021-11-19 杭州玳数科技有限公司 Silent updating method and device for front-end resources and computer equipment
CN113177407A (en) * 2021-06-30 2021-07-27 平安普惠企业管理有限公司 Data dictionary construction method and device, computer equipment and storage medium

Similar Documents

Publication Publication Date Title
CN109542851A (en) File updating method, apparatus and system
US11569982B2 (en) Blockchain compression using summary and padding blocks
CN102882974B (en) Method for saving website access resource by website identification version number
CN104283723B (en) Network access log processing method and processing device
CN103237060B (en) A kind of data object acquisition, Apparatus and system
CN106843957A (en) System firmware upgrade method and device
CN104778057A (en) Terminal system upgrading method and device, and server
CN104537013A (en) Data processing method and device
CN110647531A (en) Data synchronization method, device, equipment and computer readable storage medium
CN110727892A (en) Cache data updating method and device and electronic equipment
CN106161623A (en) Caching server, renewal server and data-updating method
CN112256989A (en) Page loading method and device based on offline package, terminal equipment and storage medium
US20160269335A1 (en) Method and apparatus for identifying changed mailboxes in an internet message access protocol (imap) list
CN104133704A (en) Software upgrading and upgrade package issuing method, device and equipment
CN105530323B (en) File upgrading method, related equipment and system
CN111737269B (en) Data query response method and device and computer readable storage medium
CN109428788B (en) Function testing method and system
CN107025122B (en) Light application access method and system
CN106293746B (en) Method and system for updating browser script
CN116501344A (en) Page updating method and device
CN115756527A (en) Client multi-language file updating method and device, electronic device and storage medium
US11599406B2 (en) Common platform for fulfilling different actions
US11409700B2 (en) Method, electronic device and computer program product for snapshot replication
CN103701844A (en) User information management method and system
CN108306728A (en) A kind of method, server and system obtaining mobile terminal identification

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20190329