CN110110032A - Method and apparatus for updating index file - Google Patents
Method and apparatus for updating index file Download PDFInfo
- Publication number
- CN110110032A CN110110032A CN201810027058.3A CN201810027058A CN110110032A CN 110110032 A CN110110032 A CN 110110032A CN 201810027058 A CN201810027058 A CN 201810027058A CN 110110032 A CN110110032 A CN 110110032A
- Authority
- CN
- China
- Prior art keywords
- result
- index file
- file
- updated
- 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.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 44
- 238000012795 verification Methods 0.000 claims abstract description 92
- 230000004044 response Effects 0.000 claims abstract description 38
- 238000004590 computer program Methods 0.000 claims description 7
- 230000008901 benefit Effects 0.000 claims description 5
- 230000005540 biological transmission Effects 0.000 claims description 3
- 230000006870 function Effects 0.000 description 8
- 238000010586 diagram Methods 0.000 description 7
- 235000013399 edible fruits Nutrition 0.000 description 7
- 238000012545 processing Methods 0.000 description 7
- 230000006854 communication Effects 0.000 description 6
- 238000012360 testing method Methods 0.000 description 6
- 238000004891 communication Methods 0.000 description 5
- 238000010276 construction Methods 0.000 description 5
- 238000005516 engineering process Methods 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 3
- PEDCQBHIVMGVHV-UHFFFAOYSA-N Glycerine Chemical compound OCC(O)CO PEDCQBHIVMGVHV-UHFFFAOYSA-N 0.000 description 2
- 238000000354 decomposition reaction Methods 0.000 description 2
- 230000005291 magnetic effect Effects 0.000 description 2
- 239000004065 semiconductor Substances 0.000 description 2
- 238000007619 statistical method Methods 0.000 description 2
- 238000013497 data interchange Methods 0.000 description 1
- 238000012217 deletion Methods 0.000 description 1
- 230000037430 deletion Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000005611 electricity Effects 0.000 description 1
- 239000000835 fiber Substances 0.000 description 1
- 238000009434 installation Methods 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000012423 maintenance Methods 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 230000001360 synchronised effect Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/30—Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
- G06F16/31—Indexing; Data structures therefor; Storage structures
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The embodiment of the present application discloses the method and apparatus for updating index file.One specific embodiment of this method includes: the more new command received to the index file to be updated in destination node, wherein index data set to be updated is stored in index file to be updated;Index file after acquisition update corresponding with index file to be updated, wherein be stored with index data set after update after update in index file;File verification is carried out to index file after update, obtains file verification result;Pass through in response to the instruction file verification of file verification result, content authentication is carried out to index file after update, obtains content authentication result;Pass through in response to content authentication result instruction content authentication, index file to be updated is updated according to index file after update.The embodiment combination file verification and content authentication, verify index file to realize more fully hereinafter.
Description
Technical field
The invention relates to field of computer technology, and in particular to Internet technical field, more particularly, to more
The method and apparatus of new index file.
Background technique
With the popularity of the internet, more prominent the advantages of shopping at network.Use a network for the userbase of shopping not
Disconnected to rise, various types of shopping websites also emerge one after another.Show there is magnanimity Item Information, and Item Information on shopping website
Increased with daily thousands of speed.In order to make user may search for the object of new growth when scanning on shopping website
Product information, it is necessary to update the index file of the magnanimity Item Information in shopping website often.
Existing index file update method is usually to carry out file verification to index file after update, if file verification is logical
It crosses, then updates index file.
Summary of the invention
The embodiment of the present application proposes the method and apparatus for updating index file.
In a first aspect, the embodiment of the present application provide it is a kind of for updating the method for index file, this method comprises: receive
To the more new command of the index file to be updated in destination node, wherein be stored with index to be updated in index file to be updated
Data acquisition system;Index file after acquisition update corresponding with index file to be updated, wherein be stored in index file after update
Index data set after update;File verification is carried out to index file after update, obtains file verification result;In response to file school
It tests result instruction file verification to pass through, content authentication is carried out to index file after update, obtains content authentication result;In response to interior
Hold check results instruction content authentication to pass through, index file to be updated is updated according to index file after update.
In some embodiments, file verification is carried out to index file after update, obtains file verification result, comprising: hold
The following at least one of row determines operation: determining and whether there is default index file after updating in index file;Determine rope after updating
Whether the store path of quotation part is default store path;And whether the file size of index file is in pre- after determining update
If in file size section;Based on definitive result, file verification result is obtained.
In some embodiments, content authentication is carried out to index file after update, obtains content authentication result, comprising: obtain
It takes and scans for obtained first search using in the first default word in the updated index file and index file to be updated
As a result with the second search result, wherein search result include at least one search information;First search result and second are searched for
As a result it is parsed, the first search result and the second search result after parsing after being parsed;First search result after parsing
It is compared with the second search result after parsing, obtains the first diversity factor;By the first diversity factor and the first default diversity factor threshold value
It is compared, obtains the first comparison result;Based on the first comparison result, content authentication result is obtained.
In some embodiments, based on the one the first comparison results, content authentication result is obtained, comprising: in response to first
Comparison result indicates that the first diversity factor less than the first default diversity factor threshold value, is obtained and indexed in the updated using the second default word
Obtained third search result and the 4th search result are scanned in file and index file to be updated;Third is searched for and is tied
It is come in fruit and comes the search information of predeterminated position in the search information and the 4th search result of predeterminated position and compare, obtained
Second diversity factor;Second diversity factor is compared with the second default diversity factor threshold value, obtains the second comparison result;Based on second
Comparison result obtains content authentication result.
In some embodiments, it is based on the second comparison result, obtains content authentication result, comprising: compare in response to second
As a result indicate the second diversity factor less than the second default diversity factor threshold value, obtain in the index file under preset condition in the updated into
Row searches for obtained 5th search result;Determine that the 5th search result default result whether corresponding with preset condition is consistent;
According to definitive result, content authentication result is obtained.
In some embodiments, this method further include: do not pass through in response to the instruction file verification of file verification result or interior
Hold check results instruction content authentication not pass through, sends verification and do not pass through prompt information.
In some embodiments, this method further include: it updates and completes in response to the index file to be updated in destination node,
Determine whether destination node is leaf node;In response to determining that destination node is not leaf node, by the child node of destination node
It is arranged to destination node, and sends the more new command to the index file to be updated in destination node.
Second aspect, the embodiment of the present application provide it is a kind of for updating the device of index file, the device include: receive
Unit is configured to receive the more new command to the index file to be updated in destination node, wherein in index file to be updated
It is stored with index data set to be updated;Acquiring unit is configured to rope after acquisition update corresponding with index file to be updated
Quotation part, wherein be stored with index data set after update after update in index file;File verification unit, is configured to pair
Index file carries out file verification after update, obtains file verification result;Content authentication unit is configured in response to file school
It tests result instruction file verification to pass through, content authentication is carried out to index file after update, obtains content authentication result;It updates single
Member is configured to indicate that content authentication passes through in response to content authentication result, updates rope to be updated according to index file after update
Quotation part.
In some embodiments, file verification unit is further configured to: being executed following at least one determine and is operated: really
With the presence or absence of default index file in index file after fixed update;Whether the store path for determining index file after updating is default
Store path;And whether the file size of index file is in the big minizone of default file after determining update;Based on determination
As a result, obtaining file verification result.
In some embodiments, content authentication unit is further configured to: being obtained and is being updated using the first default word
Obtained first search result and the second search result are scanned in index file and index file to be updated afterwards, wherein
Search result includes at least one search information;First search result and the second search result are parsed, after obtaining parsing
Second search result after first search result and parsing;The first search result is carried out with the second search result after parsing after parsing
Comparison, obtains the first diversity factor;First diversity factor is compared with the first default diversity factor threshold value, first is obtained and compares knot
Fruit;Based on the first comparison result, content authentication result is obtained.
In some embodiments, content authentication unit is further configured to: in response to the first comparison result instruction first
Diversity factor obtains less than the first default diversity factor threshold value and utilizes the second default word index file and index to be updated in the updated
Obtained third search result and the 4th search result are scanned in file;Predeterminated position will be come in third search result
Search information and the 4th search result in come the search information of predeterminated position and compare, obtain the second diversity factor;By
Two diversity factoies are compared with the second default diversity factor threshold value, obtain the second comparison result;Based on the second comparison result, obtain interior
Hold check results.
In some embodiments, content authentication unit is further configured to: in response to the second comparison result instruction second
Diversity factor obtains obtained by scanning in the index file under preset condition in the updated less than the second default diversity factor threshold value
The 5th search result;Determine that the 5th search result default result whether corresponding with preset condition is consistent;According to definitive result,
Obtain content authentication result.
In some embodiments, device further include: prompt unit is configured to indicate text in response to file verification result
Part verification does not pass through or content authentication result instruction content authentication does not pass through, and sends verification and does not pass through prompt information.
In some embodiments, device further include: determination unit is configured in response to be updated in destination node
Index file, which updates, to be completed, and determines whether destination node is leaf node;Transmission unit is configured in response to determining target section
Point is not leaf node, the child node of destination node is arranged to destination node, and send to the rope to be updated in destination node
The more new command of quotation part.
The third aspect, the embodiment of the present application provide a kind of electronic equipment, which includes: one or more processing
Device;Storage device, for storing one or more programs;When one or more programs are executed by one or more processors, make
Obtain method of the one or more processors realization as described in implementation any in first aspect.
Fourth aspect, the embodiment of the present application provide a kind of computer readable storage medium, are stored thereon with computer journey
Sequence realizes the method as described in implementation any in first aspect when the computer program is executed by processor.
The method and apparatus provided by the embodiments of the present application for being used to update index file, are receiving in destination node
When the more new command of index file to be updated, index file after update corresponding with index file to be updated is obtained;Then to more
Index file carries out file verification and content authentication after new;Finally, indicating school in file verification result and content authentication result
It tests in the case where, index file to be updated is updated according to index file after update.In conjunction with file verification and content authentication, from
And it realizes and index file is verified more fully hereinafter.
Detailed description of the invention
By reading a detailed description of non-restrictive embodiments in the light of the attached drawings below, the application's is other
Feature, objects and advantages will become more apparent upon:
Fig. 1 is that the embodiment of the present application can be applied to exemplary system architecture figure therein;
Fig. 2 is the flow chart according to one embodiment of the method for updating index file of the application;
Fig. 3 is decomposition process figure the step of carrying out content authentication to index file after update in the flow chart to Fig. 2;
Fig. 4 is the structural schematic diagram according to one embodiment of the device for updating index file of the application;
Fig. 5 is adapted for the structural schematic diagram for the computer system for realizing the electronic equipment of the embodiment of the present application.
Specific embodiment
The application is described in further detail with reference to the accompanying drawings and examples.It is understood that this place is retouched
The specific embodiment stated is used only for explaining related invention, rather than the restriction to the invention.It also should be noted that in order to
Convenient for description, part relevant to related invention is illustrated only in attached drawing.
It should be noted that in the absence of conflict, the features in the embodiments and the embodiments of the present application can phase
Mutually combination.The application is described in detail below with reference to the accompanying drawings and in conjunction with the embodiments.
Fig. 1 is shown can be using the method for being used to update index file of the embodiment of the present application or for updating index text
The exemplary system architecture 100 of the device of part.
As shown in Figure 1, system architecture 100 may include first server 101, network 102 and second server 103.Net
Network 102 between first server 101 and second server 103 to provide the medium of communication link.Network 102 may include
Various connection types, such as wired, wireless communication link or fiber optic cables etc..
First server 101 can be interacted by network 102 with second server 103, to receive or send message etc..The
One server 101 can be for generate and store update after index file server.
Second server 103 can provide various services, for example, after second server 103 can be to the update got
The data such as index file carry out the processing such as analyzing, and are determined whether to update destination node according to processing result (such as check results)
In index file to be updated.
It should be noted that for updating the method for index file generally by second service provided by the embodiment of the present application
Device 103 executes, and correspondingly, the device for updating index file is generally positioned in second server 103.
It should be understood that the number of first server, network and second server in Fig. 1 is only schematical.According to
It realizes and needs, can have any number of first server, network and second server.It is stored in second server 103
Have after updating in the case where index file, system architecture 100 can be not provided with first server 101.
With continued reference to Fig. 2, it illustrates according to one embodiment of the method for updating index file of the application
Process 200.This is used to update the method for index file, comprising the following steps:
Step 201, the more new command to the index file to be updated in destination node is received.
In the present embodiment, (such as shown in FIG. 1 for updating the electronic equipment that the method for index file is run thereon
Second server 101) it can be from the first server (such as first server 103 shown in FIG. 1) or sheet for communicating with connection
Ground receives the more new command to the index file to be updated in destination node.Wherein, index number has been can store in index file
According to set, it can store directoried data set to be updated in index file to be updated and closed.
Here, first server can be the background server of certain website (such as shopping website).It is deposited in background server
Information aggregate (such as Item Information set) and the index file in the website are contained, is stored in the website in index file
Index data set corresponding to information aggregate, index data may include forward index data and inverted index data.In general,
Information aggregate in website can update often, may search for updated letter when in order to scan for user in website
Breath, it is necessary to update the index data set in index file often.
Here, second server can be merger server or searcher server, for storage of data structure rope
Quotation part, after the completion of the index file in first server updates, second server can successively update the path of tree construction
On each node in index file.
Here, destination node can be any one node on the path of tree construction, that is, destination node can be first section
Point or child node.After the completion of index file in first server updates, first server can be sent to second server
To the more new command of the index file to be updated in first node, at this point, destination node is first node;Certain in second server
After the completion of index file in a node updates, second server can send the index to be updated in the child node to the node
The more new command of file, at this point, destination node is child node.
In some optional implementations of the present embodiment, first service can be monitored by setting zookeeper
Whether the index file in each node on the path of the tree construction in index file or second server in device has updated
At.Specifically, zookeeper listen to the index file in first server update complete when, first server can be to
Second server sends the more new command to the index file to be updated in first node;Some node is listened in zookeeper
In index file update complete when, second server can send the index file to be updated in the child node to the node
More new command.Wherein, zookeeper is one distributed, the distributed application program coordination service of open source code, is based on it
Realize synchronous service, synchronization message, configuring maintenance and naming service etc., have it is reliable, expansible, distributed, can match
Set, succession the features such as.
Step 202, index file after acquisition update corresponding with index file to be updated.
In the present embodiment, after receiving to the more new command of the index file to be updated in destination node, electronics
Equipment can index after the first server for communicating with connection or local acquisition update corresponding with index file to be updated
File.Wherein, index data set after updating has been can store after update in index file.Here, if destination node is first section
Point, index file after electronic equipment can be updated from acquisition in first server;If destination node is child node, electronic equipment can
With the index file after obtaining update in the father node of destination node.
Step 203, file verification is carried out to index file after update, obtains file verification result.
In the present embodiment, based on index file after update accessed by step 202, after electronic equipment can be to update
Index file carries out file verification, to obtain file verification result.Wherein, file verification result may include being used to indicate text
The result and be used to indicate the unacceptable result of file verification that part verification passes through.As an example, can be deposited in advance in electronic equipment
Index file name is stored up, in this way, electronic equipment can determine the filename and pre-stored index file of index file after updating
Whether name is identical, if the filename of index file is identical as pre-stored index file name after updating, file verification passes through,
If the filename of index file and pre-stored index file name be not identical after updating, file verification does not pass through.In this reality
It applies in some optional implementations of example, electronic equipment can execute at least one determine and operate, and according to definitive result, obtain
To file verification result.
As an example, electronic equipment can be using some necessary index files as default index file, in this way, electric
Sub- equipment can determine after update in index file with the presence or absence of default index file, if existing in index file after updating default
Index file, then file verification verification pass through, if file verification is not there is no default index file in index file after updating
Pass through.
As another example, electronic equipment can using the store path of index file as default store path, in this way,
Electronic equipment can determine update after the store path of index file whether be default store path, if index file after updating
Store path is default store path, then file verification passes through;If the store path of index file is not default storage after updating
Path, then file verification does not pass through.
As another example, electronic equipment can be according to the big minizone of index file size default file, in this way, electronics
Equipment can determine update after the file size of index file whether be in the big minizone of default file, if indexing text after updating
The file size of part is in the big minizone of default file, then file verification passes through;If the file size of index file after updating
Outside the big minizone of default file, then file verification does not pass through.
In some optional implementations of the present embodiment, the unacceptable feelings of file verification are indicated in file verification result
Under condition, electronic equipment can send verification and not pass through prompt information.As an example, electronic equipment can be to backstage manager's
Verification is sent on terminal device not by prompt information, backstage manager, can after getting verification not by prompt information
To carry out respective handling (such as index file after deletion or manual amendment's update) to index file to be updated.
Step 204, pass through in response to the instruction file verification of file verification result, content school is carried out to index file after update
It tests, obtains content authentication result.
In the present embodiment, in the case where the instruction file verification of file verification result passes through, electronic equipment can be to more
Index file carries out content authentication after new, to obtain content authentication result.Wherein, content authentication result may include for referring to
Show the result and be used to indicate the unacceptable result of content authentication that content authentication passes through.As an example, for index text to be updated
Each of index data set to be updated in part index data to be updated, electronic equipment can be from after updates in index file
Update after index data after update corresponding with the index data to be updated is obtained in index data set, and determine this to more
Whether new index data and index data after corresponding update are identical;Then each definitive result is counted, to obtain rope to be updated
Diversity factor after quotation part and update between index file, if diversity factor is less than default diversity factor threshold value, content authentication passes through,
If diversity factor is not less than default diversity factor threshold value, content authentication result does not pass through.Wherein, diversity factor can be index to be updated
Data and the index data to be updated after corresponding update in the identical number of index data and index data set to be updated
The ratio of number.
Step 205, pass through in response to content authentication result instruction content authentication, updated according to index file after update to more
New index file.
In the present embodiment, in the case where content check results instruction content authentication passes through, electronic equipment can basis
Index file updates index file to be updated after update.Specifically, for the index data to be updated in index file to be updated
Each of set index data to be updated, electronic equipment can be from index data set after the update after update in index file
Index data after middle acquisition update corresponding with the index data to be updated, and the determination index data to be updated with it is corresponding more
Whether index data is identical after new, and if they are the same, then the index data to be updated does not need to update, if not identical, utilizes correspondence
Update after index data update (such as replacement) index data to be updated.
In some optional implementations of the present embodiment, the unacceptable feelings of content authentication are indicated in content check results
Under condition, electronic equipment can send verification and not pass through prompt information.As an example, electronic equipment can be to backstage manager's
Verification is sent on terminal device not by prompt information, backstage manager, can after getting verification not by prompt information
To carry out respective handling to index file to be updated.
In some optional implementations of the present embodiment, the index file to be updated in destination node, which updates, to be completed
In the case where, electronic equipment can determine whether destination node is leaf node;Determining that destination node is not leaf node
In the case of, the child node of destination node can be arranged to destination node by electronic equipment, and send in destination node to more
The more new command of new index file, so that electronic equipment be made to continue to execute in the embodiment of the present application for updating the side of index file
Method, the index to update the index file to be updated in new destination node, in all nodes on the path of tree construction
Until file updates completion;In the case where determining destination node is leaf node, illustrate all on the path of tree construction
Index file in node has updated completion.
The method provided by the embodiments of the present application for being used to update index file, is receiving to be updated in destination node
When the more new command of index file, index file after update corresponding with index file to be updated is obtained;Then to rope after update
Quotation part carries out file verification and content authentication;Finally, indicating that verification passes through in file verification result and content authentication result
In the case where, index file to be updated is updated according to index file after update.In conjunction with file verification and content authentication, to realize
Before updating index file index file is verified more fully hereinafter.
With further reference to Fig. 3, it illustrates carry out content authentication to index file after update in the flow chart to Fig. 2
The decomposition process 300 of step.In Fig. 3, will to after update index file carry out content authentication the step of resolve into following sub-step
It is rapid:
Step 301, it obtains using being searched in the first default word in the updated index file and index file to be updated
Obtained first search result of rope and the second search result.
In the present embodiment, (such as shown in FIG. 1 for updating the electronic equipment that the method for index file is run thereon
Second server 103) can use the first default word, index file scans in the updated, to obtain the first search knot
Fruit;Meanwhile being scanned in index file to be updated using the first default word, to obtain the second search result.Wherein,
Search result may include at least one search information., the first default word can be pre-set word.As an example,
The search terms that preset time period (such as previous moon) interior user can be inputted when scanning on certain shopping website
It is for statistical analysis, it obtains volumes of searches and comes the search terms of previous myriabit as the first default word.
Step 302, the first search result and the second search result are parsed, after being parsed the first search result and
Second search result after parsing.
It in the present embodiment, can based on the first search result acquired in step 301 and the second search result, electronic equipment
To be parsed to the first search result, to obtain the first search result after parsing;Meanwhile the second search result is solved
Analysis, thus the second search result after being parsed.In practice, due to the data scale of the first search result and the second search result
Usually it is larger, here it is possible to by the first search result and the second search result be parsed into lightweight data interchange format (such as
JSON format).Wherein, JSON (JavaScript Object Notation, JS object tag) is a kind of data of lightweight
Exchange format.It is based on a subset of ECMAScript (w3c formulate js specification), using being totally independent of programming language
Text formatting stores and indicates data.
Step 303, the first search result after parsing and the second search result after parsing are compared, obtains the first difference
Degree.
In the present embodiment, based on the second search knot after the first search result after the obtained parsing of step 302 and parsing
Fruit, electronic equipment can believe the search in the second search result after the search information and parsing after parsing in the first search result
Breath is compared, to obtain the first diversity factor.Specifically, at least one search in the first search result after parsing is believed
Every search information in breath, electronic equipment can search at least one in the search information after parsing the second search result
It is matched in rope information;Then each matching result is counted, the first diversity factor is generated.Wherein, the first diversity factor can be
The ratio of number with the search information in unsuccessful number and the first search result.
Step 304, the first diversity factor is compared with the first default diversity factor threshold value, obtains the first comparison result.
In the present embodiment, be based on obtained first diversity factor of step 303, electronic equipment can by the first diversity factor with
First default diversity factor threshold value is compared, to obtain the first comparison result.Wherein, the first comparison result may include instruction
First diversity factor is not less than the first default diversity factor threshold less than the result and the first diversity factor of instruction of the first default diversity factor threshold value
The result of value.
In some optional implementations of the present embodiment, electronic equipment can be based on the first comparison result, obtain interior
Hold check results.In general, if the first comparison result indicates that the first diversity factor is not less than the first default diversity factor threshold value, content school
It tests and does not pass through;If the first comparison result indicate the first diversity factor less than the first default diversity factor threshold value, content authentication pass through or
Person continues to execute step 305 further progress content authentication.
Step 305, indicate that the first diversity factor less than the first default diversity factor threshold value, obtains benefit in response to the first comparison result
Obtained third search result is scanned for in the second default word in the updated index file and index file to be updated
With the 4th search result.
In the present embodiment, the case where the first diversity factor is less than the first default diversity factor threshold value is indicated in the first comparison result
Under, electronic equipment can use the second default word and scan in index file in the updated, to obtain third search knot
Fruit;Meanwhile being scanned in index file to be updated using the second default word, to obtain the 4th search result.Wherein,
Search result may include at least one search information.Second default word can be pre-set word.As an example, can
With search terms that preset time period (such as previous moon) interior user is inputted when scanning on certain shopping website into
Row statistical analysis obtains the search terms of kilobit before volumes of searches comes as the second default word.
Step 306, it will be come in search information and the 4th search result that predeterminated position is come in third search result pre-
If the search information of position compares, the second diversity factor is obtained.
It in the present embodiment, can based on the obtained third search result of step 305 and the 4th search result, electronic equipment
It is pre- will be come in the search information and the 4th search result that come predeterminated position (such as first three ten) in third search result
If the search information of threshold value (such as first three ten) compares, to obtain the second diversity factor.Specifically, third is searched for
As a result each search information in the search information of predeterminated position is come in, electronic equipment can come from the 4th search result
Obtained in the search information of predeterminated position and rank with the search information and sets identical search information, and determine the search information and
Rank whether set identical search information identical;Then each definitive result is counted, the second diversity factor is generated.Wherein, second
Diversity factor can be search information with rank set come in the identical number of identical search information and third search result it is pre-
If the ratio of the number of the search information of position.
Step 307, the second diversity factor is compared with the second default diversity factor threshold value, obtains the second comparison result.
In the present embodiment, be based on obtained second diversity factor of step 306, electronic equipment can by the second diversity factor with
Second default diversity factor threshold value is compared, to obtain the second comparison result.Wherein, the second comparison result may include instruction
Second diversity factor is not less than the second default diversity factor threshold value less than the result and the second diversity factor of instruction of the second diversity factor threshold value
As a result.
In some optional implementations of the present embodiment, electronic equipment can be based on the second comparison result, obtain interior
Hold check results.In general, if the second comparison result indicates that the second diversity factor is not less than the second default diversity factor threshold value, content school
It tests and does not pass through;If the second comparison result indicate the second diversity factor less than the second default diversity factor threshold value, content authentication pass through or
Person continues to execute step 308 further progress content authentication.
Step 308, indicate that the second diversity factor less than the second default diversity factor threshold value, obtains pre- in response to the second comparison result
If obtained 5th search result is scanned in index file under the conditions of in the updated.
In the present embodiment, the case where the second diversity factor is less than the second default diversity factor threshold value is indicated in the second comparison result
Under, preset condition can be arranged in electronic equipment first, then carry out searching element in index file in the updated, to obtain the 5th
Search result.Wherein, search result may include at least one search information.Preset condition can be pre-set various items
Part.As an example, preset condition, which can be, searches for certain article in some shop of shopping website, preset condition be can also be
The article of some brand is searched on shopping website.
Step 309, determine that the 5th search result default result whether corresponding with preset condition is consistent.
In the present embodiment, it is based on obtained 5th search result of step 308, electronic equipment can determine the 5th search
As a result whether default result corresponding with preset condition is consistent.Wherein, default result is corresponding with preset condition.As an example,
If preset condition is to search for certain article in some shop of shopping website, corresponding default result is in search result
Search information is entirely the Item Information of the article in the shop;If preset condition is to search for some brand on shopping website
Article, then corresponding default result be the search information in search result be entirely the brand article Item Information.
Step 310, according to definitive result, content authentication result is obtained.
In the present embodiment, it is based on the obtained definitive result of step 309, electronic equipment can be obtained according to definitive result
To content authentication result.Specifically, if the 5th search result default result corresponding with preset condition is consistent, content authentication is logical
It crosses, if the 5th search result default result corresponding with preset condition is not consistent, content authentication does not pass through.With further reference to figure
4, as the realization to method shown in above-mentioned each figure, the reality that this application provides a kind of for updating the device of index file
Example is applied, the Installation practice is corresponding with embodiment of the method shown in Fig. 2, which specifically can be applied to various electronic equipments
In.
As shown in figure 4, the device 400 for updating index file of the present embodiment may include: receiving unit 401, obtain
Take unit 402, file verification unit 403, content authentication unit 404 and updating unit 405.Wherein, receiving unit 401, configuration
For receiving the more new command to the index file to be updated in destination node, wherein be stored in index file to be updated to
Update index data set;Acquiring unit 402 is configured to index text after obtaining update corresponding with index file to be updated
Part, wherein be stored with index data set after update after update in index file;File verification unit 403, is configured to more
Index file carries out file verification after new, obtains file verification result;Content authentication unit 404, is configured in response to file
Check results instruction file verification passes through, and carries out content authentication to index file after update, obtains content authentication result;It updates single
Member 405 is configured to indicate that content authentication passes through in response to content authentication result, be updated according to index file after update to be updated
Index file.
In the present embodiment, in the device 400 for updating index file: receiving unit 401, acquiring unit 402, file
Verification unit 403, the specific processing of content authentication unit 404 and updating unit 405 and its brought technical effect can be distinguished
With reference to step 201, step 202, step 203, the related description of step 204 and step 205 in Fig. 2 corresponding embodiment, herein
It repeats no more.
In some optional implementations of the present embodiment, file verification unit 403 can be further configured to: be held
The following at least one of row determines operation: determining and whether there is default index file after updating in index file;Determine rope after updating
Whether the store path of quotation part is default store path;And whether the file size of index file is in pre- after determining update
If in file size section;Based on definitive result, file verification result is obtained.
In some optional implementations of the present embodiment, content authentication unit 404 can be further configured to: be obtained
It takes and scans for obtained first search using in the first default word in the updated index file and index file to be updated
As a result with the second search result, wherein search result include at least one search information;First search result and second are searched for
As a result it is parsed, the first search result and the second search result after parsing after being parsed;First search result after parsing
It is compared with the second search result after parsing, obtains the first diversity factor;By the first diversity factor and the first default diversity factor threshold value
It is compared, obtains the first comparison result;Based on the first comparison result, content authentication result is obtained.
In some optional implementations of the present embodiment, content authentication unit 404 can be further configured to: be rung
It should indicate that the first diversity factor less than the first default diversity factor threshold value, is obtained using the second default word more in the first comparison result
Obtained third search result and the 4th search result are scanned in index file and index file to be updated after new;By
The search information progress that predeterminated position is come in the search information and the 4th search result of predeterminated position is come in three search results
Comparison, obtains the second diversity factor;Second diversity factor is compared with the second default diversity factor threshold value, second is obtained and compares knot
Fruit;Based on the second comparison result, content authentication result is obtained.
In some optional implementations of the present embodiment, content authentication unit 404 can be further configured to: be rung
The second diversity factor should be indicated less than the second default diversity factor threshold value in the second comparison result, obtain under preset condition in the updated
Obtained 5th search result is scanned in index file;Determine that whether corresponding with preset condition the 5th search result is pre-
If being as a result consistent;According to definitive result, content authentication result is obtained.
In some optional implementations of the present embodiment, the device 400 for updating index file can also include:
Prompt unit (not shown) is configured to indicate that file verification does not pass through or content authentication knot in response to file verification result
Fruit instruction content authentication does not pass through, and sends verification and does not pass through prompt information.
In some optional implementations of the present embodiment, the device 400 for updating index file can also include:
Determination unit (not shown) is configured to update in response to the index file to be updated in destination node and complete, determines mesh
Mark whether node is leaf node;Transmission unit (not shown) is configured in response to determining that destination node is not leaf
The child node of destination node is arranged to destination node, and sent to the index file to be updated in destination node more by node
New command.
Below with reference to Fig. 5, it illustrates the computer systems 500 for the electronic equipment for being suitable for being used to realize the embodiment of the present application
Structural schematic diagram.Electronic equipment shown in Fig. 5 is only an example, function to the embodiment of the present application and should not use model
Shroud carrys out any restrictions.
As shown in figure 5, computer system 500 includes central processing unit (CPU) 501, it can be read-only according to being stored in
Program in memory (ROM) 502 or be loaded into the program in random access storage device (RAM) 503 from storage section 508 and
Execute various movements appropriate and processing.In RAM 503, also it is stored with system 500 and operates required various programs and data.
CPU 501, ROM 502 and RAM 503 are connected with each other by bus 504.Input/output (I/O) interface 505 is also connected to always
Line 504.
I/O interface 505 is connected to lower component: the importation 506 including keyboard, mouse etc.;It is penetrated including such as cathode
The output par, c 507 of spool (CRT), liquid crystal display (LCD) etc. and loudspeaker etc.;Storage section 508 including hard disk etc.;
And the communications portion 509 of the network interface card including LAN card, modem etc..Communications portion 509 via such as because
The network of spy's net executes communication process.Driver 510 is also connected to I/O interface 505 as needed.Detachable media 511, such as
Disk, CD, magneto-optic disk, semiconductor memory etc. are mounted on as needed on driver 510, in order to read from thereon
Computer program be mounted into storage section 508 as needed.
Particularly, in accordance with an embodiment of the present disclosure, it may be implemented as computer above with reference to the process of flow chart description
Software program.For example, embodiment of the disclosure includes a kind of computer program product comprising be carried on computer-readable medium
On computer program, which includes the program code for method shown in execution flow chart.In such reality
It applies in example, which can be downloaded and installed from network by communications portion 509, and/or from detachable media
511 are mounted.When the computer program is executed by central processing unit (CPU) 501, limited in execution the present processes
Above-mentioned function.It should be noted that computer-readable medium described herein can be computer-readable signal media or
Computer readable storage medium either the two any combination.Computer readable storage medium for example can be --- but
Be not limited to --- electricity, magnetic, optical, electromagnetic, infrared ray or semiconductor system, device or device, or any above combination.
The more specific example of computer readable storage medium can include but is not limited to: have one or more conducting wires electrical connection,
Portable computer diskette, hard disk, random access storage device (RAM), read-only memory (ROM), erasable type may be programmed read-only deposit
Reservoir (EPROM or flash memory), optical fiber, portable compact disc read-only memory (CD-ROM), light storage device, magnetic memory
Part or above-mentioned any appropriate combination.In this application, computer readable storage medium, which can be, any include or stores
The tangible medium of program, the program can be commanded execution system, device or device use or in connection.And
In the application, computer-readable signal media may include in a base band or the data as the propagation of carrier wave a part are believed
Number, wherein carrying computer-readable program code.The data-signal of this propagation can take various forms, including but not
It is limited to electromagnetic signal, optical signal or above-mentioned any appropriate combination.Computer-readable signal media can also be computer
Any computer-readable medium other than readable storage medium storing program for executing, the computer-readable medium can send, propagate or transmit use
In by the use of instruction execution system, device or device or program in connection.Include on computer-readable medium
Program code can transmit with any suitable medium, including but not limited to: wireless, electric wire, optical cable, RF etc., Huo Zheshang
Any appropriate combination stated.
The calculating of the operation for executing the application can be write with one or more programming languages or combinations thereof
Machine program code, described program design language include object oriented program language-such as Java, Smalltalk, C+
+, further include conventional procedural programming language-such as " C " language or similar programming language.Program code can
Fully to execute, partly execute on the user computer on the user computer, be executed as an independent software package,
Part executes on the remote computer or executes on a remote computer or server completely on the user computer for part.
In situations involving remote computers, remote computer can pass through the network of any kind --- including local area network (LAN)
Or wide area network (WAN)-is connected to subscriber computer, or, it may be connected to outer computer (such as utilize Internet service
Provider is connected by internet).
Flow chart and block diagram in attached drawing are illustrated according to the system of the various embodiments of the application, method and computer journey
The architecture, function and operation in the cards of sequence product.In this regard, each box in flowchart or block diagram can generation
A part of one module, program segment or code of table, a part of the module, program segment or code include one or more use
The executable instruction of the logic function as defined in realizing.It should also be noted that in some implementations as replacements, being marked in box
The function of note can also occur in a different order than that indicated in the drawings.For example, two boxes succeedingly indicated are actually
It can be basically executed in parallel, they can also be executed in the opposite order sometimes, and this depends on the function involved.Also it to infuse
Meaning, the combination of each box in block diagram and or flow chart and the box in block diagram and or flow chart can be with holding
The dedicated hardware based system of functions or operations as defined in row is realized, or can use specialized hardware and computer instruction
Combination realize.
Being described in unit involved in the embodiment of the present application can be realized by way of software, can also be by hard
The mode of part is realized.Described unit also can be set in the processor, for example, can be described as: a kind of processor packet
Include receiving unit, acquiring unit, file verification unit, content authentication unit and updating unit.Wherein, the title of these units exists
The restriction to the unit itself is not constituted in the case of certain, for example, receiving unit is also described as " receiving to target section
The unit of the more new command of index file to be updated in point ".
As on the other hand, present invention also provides a kind of computer-readable medium, which be can be
Included in electronic equipment described in above-described embodiment;It is also possible to individualism, and without in the supplying electronic equipment.
Above-mentioned computer-readable medium carries one or more program, when said one or multiple programs are held by the electronic equipment
When row, so that the electronic equipment: receiving the more new command to the index file to be updated in destination node, wherein rope to be updated
Index data set to be updated is stored in quotation part;Index file after acquisition update corresponding with index file to be updated,
In, index data set after update is stored with after update in index file;File verification is carried out to index file after update, is obtained
File verification result;Pass through in response to the instruction file verification of file verification result, content authentication carried out to index file after update,
Obtain content authentication result;In response to content authentication result instruction content authentication pass through, according to after update index file update to
Update index file.
Above description is only the preferred embodiment of the application and the explanation to institute's application technology principle.Those skilled in the art
Member is it should be appreciated that invention scope involved in the application, however it is not limited to technology made of the specific combination of above-mentioned technical characteristic
Scheme, while should also cover in the case where not departing from foregoing invention design, it is carried out by above-mentioned technical characteristic or its equivalent feature
Any combination and the other technical solutions formed.Such as features described above has similar function with (but being not limited to) disclosed herein
Can technical characteristic replaced mutually and the technical solution that is formed.
Claims (13)
1. a kind of for updating the method for index file, comprising:
Receive the more new command to the index file to be updated in destination node, wherein store in the index file to be updated
There is directoried data set to be updated to close;
Obtain index file after update corresponding with the index file to be updated, wherein deposit in index file after the update
Contain index data set after updating;
File verification is carried out to index file after the update, obtains file verification result;
Pass through in response to file verification result instruction file verification, content authentication carried out to index file after the update,
Obtain content authentication result;
Pass through in response to content authentication result instruction content authentication, is updated according to index file after the update described to more
New index file.
2. it is described that file verification is carried out to index file after the update according to the method described in claim 1, wherein, it obtains
File verification result, comprising:
Following at least one determine is executed to operate:
It determines after the update in index file with the presence or absence of default index file;
Whether the store path for determining index file after the update is default store path;And
Determine whether the file size of index file after the update is in the big minizone of default file;
Based on definitive result, file verification result is obtained.
3. it is described that content authentication is carried out to index file after the update according to the method described in claim 1, wherein, it obtains
Content authentication result, comprising:
It obtains and scans for institute in index file and the index file to be updated after the update using the first default word
Obtained the first search result and the second search result, wherein search result includes at least one search information;
First search result and second search result are parsed, the first search result and parsing after being parsed
Second search result afterwards;
First search result after the parsing and the second search result after the parsing are compared, the first diversity factor is obtained;
First diversity factor is compared with the first default diversity factor threshold value, obtains the first comparison result;
Based on first comparison result, content authentication result is obtained.
4. described to be based on first comparison result according to the method described in claim 3, wherein, obtain content authentication as a result,
Include:
It indicates that first diversity factor is less than the described first default diversity factor threshold value in response to first comparison result, obtains benefit
Obtained third is scanned in index file and the index file to be updated after the update with the second default word
Search result and the 4th search result;
It is described pre- by being come in the search information and the 4th search result that come predeterminated position in the third search result
If the search information of position compares, the second diversity factor is obtained;
Second diversity factor is compared with the second default diversity factor threshold value, obtains the second comparison result;
Based on second comparison result, content authentication result is obtained.
5. described to be based on second comparison result according to the method described in claim 4, wherein, obtain content authentication as a result,
Include:
It indicates that second diversity factor is less than the described second default diversity factor threshold value in response to second comparison result, obtains pre-
If obtained 5th search result is scanned under the conditions of in the updated index file;
Determine that the 5th search result default result whether corresponding with the preset condition is consistent;
According to definitive result, content authentication result is obtained.
6. method described in one of -5 according to claim 1, wherein the method also includes:
Do not pass through in response to file verification result instruction file verification or the content authentication result indicates content authentication not
Pass through, sends verification and do not pass through prompt information.
7. method described in one of -5 according to claim 1, wherein the method also includes:
It updates and completes in response to the index file to be updated in the destination node, determine whether the destination node is leaf section
Point;
It is not leaf node in response to the determination destination node, the child node of the destination node is arranged to destination node,
And transmission is to the more new command of the index file to be updated in the destination node.
8. a kind of for updating the device of index file, comprising:
Receiving unit is configured to receive the more new command to the index file to be updated in destination node, wherein described to more
Index data set to be updated is stored in new index file;
Acquiring unit is configured to obtain index file after update corresponding with the index file to be updated, wherein it is described more
Index data set after updating is stored with after new in index file;
File verification unit is configured to carry out file verification to index file after the update, obtains file verification result;
Content authentication unit is configured to indicate that file verification passes through in response to the file verification result, after the update
Index file carries out content authentication, obtains content authentication result;
Updating unit is configured to indicate that content authentication passes through in response to the content authentication result, according to rope after the update
Quotation part updates the index file to be updated.
9. device according to claim 8, wherein the content authentication unit is further configured to:
It obtains and scans for institute in index file and the index file to be updated after the update using the first default word
Obtained the first search result and the second search result, wherein search result includes at least one search information;
First search result and second search result are parsed, the first search result and parsing after being parsed
Second search result afterwards;
First search result after the parsing and the second search result after the parsing are compared, the first diversity factor is obtained;
First diversity factor is compared with the first default diversity factor threshold value, obtains the first comparison result;
Based on first comparison result, content authentication result is obtained.
10. device according to claim 9, wherein the content authentication unit is further configured to:
It indicates that first diversity factor is less than the described first default diversity factor threshold value in response to first comparison result, obtains benefit
Obtained third is scanned in index file and the index file to be updated after the update with the second default word
Search result and the 4th search result;
It is described pre- by being come in the search information and the 4th search result that come predeterminated position in the third search result
If the search information of position compares, the second diversity factor is obtained;
Second diversity factor is compared with the second default diversity factor threshold value, obtains the second comparison result;
Based on second comparison result, content authentication result is obtained.
11. device according to claim 10, wherein the content authentication unit is further configured to:
It indicates that second diversity factor is less than the described second default diversity factor threshold value in response to second comparison result, obtains pre-
If obtained 5th search result is scanned under the conditions of in the updated index file;
Determine that the 5th search result default result whether corresponding with the preset condition is consistent;
According to definitive result, content authentication result is obtained.
12. a kind of electronic equipment, comprising:
One or more processors;
Storage device, for storing one or more programs;
When one or more of programs are executed by one or more of processors, so that one or more of processors are real
The now method as described in any in claim 1-7.
13. a kind of computer readable storage medium, is stored thereon with computer program, wherein the computer program is processed
The method as described in any in claim 1-7 is realized when device executes.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810027058.3A CN110110032B (en) | 2018-01-11 | 2018-01-11 | Method and device for updating index file |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810027058.3A CN110110032B (en) | 2018-01-11 | 2018-01-11 | Method and device for updating index file |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110110032A true CN110110032A (en) | 2019-08-09 |
CN110110032B CN110110032B (en) | 2024-04-16 |
Family
ID=67482982
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810027058.3A Active CN110110032B (en) | 2018-01-11 | 2018-01-11 | Method and device for updating index file |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110110032B (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111427612A (en) * | 2020-04-15 | 2020-07-17 | 赞同科技股份有限公司 | Method and system for checking resource index |
CN115167891A (en) * | 2022-07-07 | 2022-10-11 | 北京蓝天航空科技股份有限公司 | Data updating method, device and equipment of interface control file and storage medium |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103177082A (en) * | 2013-02-21 | 2013-06-26 | 用友软件股份有限公司 | Main server, slave server, index synchronizing system and index synchronizing method |
US9342524B1 (en) * | 2007-02-09 | 2016-05-17 | Veritas Technologies Llc | Method and apparatus for single instance indexing of backups |
CN106610854A (en) * | 2015-10-26 | 2017-05-03 | 阿里巴巴集团控股有限公司 | Model update method and device |
CN107087038A (en) * | 2017-06-29 | 2017-08-22 | 珠海市魅族科技有限公司 | A kind of method of data syn-chronization, synchronizer, device and storage medium |
-
2018
- 2018-01-11 CN CN201810027058.3A patent/CN110110032B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9342524B1 (en) * | 2007-02-09 | 2016-05-17 | Veritas Technologies Llc | Method and apparatus for single instance indexing of backups |
CN103177082A (en) * | 2013-02-21 | 2013-06-26 | 用友软件股份有限公司 | Main server, slave server, index synchronizing system and index synchronizing method |
CN106610854A (en) * | 2015-10-26 | 2017-05-03 | 阿里巴巴集团控股有限公司 | Model update method and device |
CN107087038A (en) * | 2017-06-29 | 2017-08-22 | 珠海市魅族科技有限公司 | A kind of method of data syn-chronization, synchronizer, device and storage medium |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111427612A (en) * | 2020-04-15 | 2020-07-17 | 赞同科技股份有限公司 | Method and system for checking resource index |
CN115167891A (en) * | 2022-07-07 | 2022-10-11 | 北京蓝天航空科技股份有限公司 | Data updating method, device and equipment of interface control file and storage medium |
CN115167891B (en) * | 2022-07-07 | 2023-09-05 | 北京蓝天航空科技股份有限公司 | Data updating method, device and equipment of interface control file and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN110110032B (en) | 2024-04-16 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108153901A (en) | The information-pushing method and device of knowledge based collection of illustrative plates | |
CN108459953A (en) | test method and device | |
CN109460513A (en) | Method and apparatus for generating clicking rate prediction model | |
CN108804327A (en) | A kind of method and apparatus of automatic Data Generation Test | |
CN108287927B (en) | For obtaining the method and device of information | |
CN109325213A (en) | Method and apparatus for labeled data | |
CN109934242A (en) | Image identification method and device | |
CN110019080A (en) | Data access method and device | |
CN109657251A (en) | Method and apparatus for translating sentence | |
CN110471848A (en) | A kind of method and apparatus of dynamic returned packet | |
CN109828906A (en) | UI automated testing method, device, electronic equipment and storage medium | |
CN109871693A (en) | Method and apparatus for detecting loophole | |
CN109145014A (en) | The method and apparatus for generating elastic searching request | |
CN109271556A (en) | Method and apparatus for output information | |
CN108776692A (en) | Method and apparatus for handling information | |
CN109359194A (en) | Method and apparatus for predictive information classification | |
CN109460652A (en) | For marking the method, equipment and computer-readable medium of image pattern | |
CN115757400B (en) | Data table processing method, device, electronic equipment and computer readable medium | |
CN110020358A (en) | Method and apparatus for generating dynamic page | |
CN109388551A (en) | There are the method for loophole probability, leak detection method, relevant apparatus for prediction code | |
CN109508361A (en) | Method and apparatus for output information | |
CN108170843A (en) | For obtaining the method and apparatus of data | |
CN108959087A (en) | test method and device | |
CN109614327A (en) | Method and apparatus for output information | |
CN109389660A (en) | Image generating 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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |