CN107085601A - A kind of information processing method and equipment - Google Patents

A kind of information processing method and equipment Download PDF

Info

Publication number
CN107085601A
CN107085601A CN201710210254.XA CN201710210254A CN107085601A CN 107085601 A CN107085601 A CN 107085601A CN 201710210254 A CN201710210254 A CN 201710210254A CN 107085601 A CN107085601 A CN 107085601A
Authority
CN
China
Prior art keywords
index
module
accesses
task
indexwriter
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
CN201710210254.XA
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.)
Nubia Technology Co Ltd
Original Assignee
Nubia 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 Nubia Technology Co Ltd filed Critical Nubia Technology Co Ltd
Priority to CN201710210254.XA priority Critical patent/CN107085601A/en
Publication of CN107085601A publication Critical patent/CN107085601A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
    • G06F16/972Access to data in other repository systems, e.g. legacy data or dynamic Web page generation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/52Program synchronisation; Mutual exclusion, e.g. by means of semaphores
    • G06F9/526Mutual exclusion algorithms

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Storage Device Security (AREA)

Abstract

The embodiment of the invention discloses a kind of information processing method and equipment.The terminal includes:Initialization module, index accesses module and at least one first kind module;Wherein, the initialization module, for initializing during at least one first kind module, initializes the index accesses module;At least one described first kind module is corresponding with the index accesses module;The index accesses module, the index task for dispatching at least one first kind module according to default mechanism.

Description

A kind of information processing method and equipment
Technical field
The present invention relates to the information processing technology, and in particular to a kind of information processing method and equipment.
Background technology
Current search engine uses index accesses (IndexWriter) lock mechanism, and one is often created during search process During individual AnalyzingInfixSuggester objects, a corresponding IndexWriter lock can be created, it is different AnalyzingInfixSuggester objects correspond to an IndexWriter lock respectively, and all IndexWriter locks are equal One index storage region of correspondence.Storage resource in the index storage region corresponding to same index only allows one every time and entered Journey is used.So, different IndexWriter locks corresponding different AnalyzingInfixSuggester objects to visit The problem of causing mutual exclusion during same index is asked, the collapse of search engine can be caused if problem of mutual exclusion is serious.In addition, create AnalyzingInfixSuggester objects excessively can cause the occupancy of memory source excessive, if wherein The corresponding IndexWriter locks of AnalyzingInfixSuggester objects fail timely releasing memory, also result in internal memory money The occupancy in source is excessive, and the collapse of search engine can be caused when serious.
The content of the invention
To solve existing technical problem, the embodiment of the present invention provides a kind of information processing method and equipment.
To reach above-mentioned purpose, what the technical scheme of the embodiment of the present invention was realized in:
The embodiments of the invention provide a kind of message processing device, the equipment includes:Initialization module, index accesses mould Block and at least one first kind module;Wherein,
The initialization module, for initializing during at least one first kind module, initializes the index accesses mould Block;At least one described first kind module is corresponding with the index accesses module;
The index accesses module, the index for dispatching at least one first kind module according to default mechanism is appointed Business.
In such scheme, the equipment also includes the index memory module for being used to store index information;
The index accesses module, the index task based at least one first kind module is received for working as When, the index task of at least one first kind module is dispatched according to default mechanism, so that particular type module is based on institute State index memory module and perform the index task;
Wherein, the particular type module is to be selected according to the default mechanism from least one described first kind module The type block selected.
In such scheme, the index accesses module, for the mutual exclusion mechanism scheduling according to default specific operation system The index task of at least one first kind object.
In such scheme, the equipment also includes release module, complete for the index tasks carrying when first kind module Cheng Hou, discharges the first kind module.
In such scheme, the release module is additionally operable to when the index task of at least one first kind module is equal After the completion of execution, the index accesses module is discharged.
The embodiment of the present invention additionally provides a kind of information processing method, and methods described includes:
When initializing at least one first kind object, an index accesses object is initialized;At least one described first kind Type object is corresponding with the index accesses object;
The index accesses object dispatches the index task of at least one first kind object according to default mechanism.
In such scheme, the index accesses object correspondence one indexes storage region;The index accesses object is according to pre- If the index task of mechanism scheduling at least one first kind object, including:
When receiving the index task based at least one first kind object, the index accesses object according to The index task of default mechanism scheduling at least one first kind object, so that particular type object is based on the index and deposited Storage area domain performs the index task;
Wherein, the particular type object is to be selected according to the default mechanism from least one described first kind object The type object selected.
In such scheme, the index accesses object dispatches at least one first kind object according to default mechanism Index task, including:
The index accesses object according to the mutual exclusion mechanism of default specific operation system dispatch it is described at least one first The index task of type object.
In such scheme, methods described also includes:After the completion of the index tasks carrying of first kind object, release is described First kind object.
In such scheme, methods described also includes:When the index task of at least one first kind object is performed both by After the completion of, discharge the index accesses object.
Information processing method provided in an embodiment of the present invention and equipment, the equipment include:Initialization module, index accesses Module and at least one first kind module;Wherein, the initialization module, for initializing at least one first kind module When, initialize the index accesses module;At least one described first kind module is corresponding with the index accesses module;It is described Index accesses module, the index task for dispatching at least one first kind module according to default mechanism.Using this hair The technical scheme of bright embodiment, by for (such as AnalyzingInfixSuggester pairs of at least one first kind module As) one index accesses module (such as IndexWriter locks) of configuration, by the index accesses module to it is described at least one the The index task of one type block is scheduled, and is this by changing index accesses module by existing privately owned non-static pattern Privately owned static pattern in inventive embodiments, solves IndexWriter locks different in the prior art corresponding different The problem of causing mutual exclusion when AnalyzingInfixSuggester objects are to access same index and it is likely to result in engine The problem of collapse;On the other hand, the technical scheme of the present embodiment optimizes internal storage structure, by privately owned static in the present embodiment Index accesses module reduces internal memory and used, and optimizes internal storage access efficiency, even if unique index accesses module fails in time Release does not result in serious RAM leakage yet, so as to avoid the generation of engine collapse.
Brief description of the drawings
Fig. 1 is the schematic flow sheet of the information processing method of the embodiment of the present invention one;
Fig. 2 a and Fig. 2 b are respectively one kind application frame of the information processing method with existing processing scheme of the embodiment of the present invention The contrast schematic diagram of structure;
Fig. 3 is the schematic flow sheet of the information processing method of the embodiment of the present invention two;
Fig. 4 is the schematic flow sheet of the information processing method of the embodiment of the present invention three;
Fig. 5 a and Fig. 5 b are respectively another application of the information processing method with existing processing scheme of the embodiment of the present invention The contrast schematic diagram of framework;
Fig. 6 is the composition structural representation of the message processing device of the embodiment of the present invention;
The realization, functional characteristics and advantage of the object of the invention will be described further referring to the drawings in conjunction with the embodiments.
Embodiment
It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, it is not intended to limit the present invention.
Describe to realize the mobile terminal of each embodiment of the invention referring now to accompanying drawing.In follow-up description, use For represent element such as " module ", " part " or " unit " suffix only for be conducive to the present invention explanation, itself Not specific meaning.Therefore, " module " can be used mixedly with " part ".
Embodiment one
The embodiments of the invention provide a kind of information processing method, applied to the message processing device with search engine In, described information processing equipment can be specifically the server or server cluster residing for search engine.Fig. 1 is implemented for the present invention The schematic flow sheet of the information processing method of example one;As shown in figure 1, methods described includes:
Step 301:When initializing at least one first kind object, an index accesses object is initialized;Described at least one Individual first kind object is corresponding with the index accesses object.
Step 302:The index accesses object dispatches the rope of at least one first kind object according to default mechanism Draw task.
The information processing method of the present embodiment is applied in search engine, the search specifically locked with IndexWriter In engine.Wherein, the first kind object is specifically as follows with AnalyzingInfixSuggester pairs of word association function As when user inputs keyword in the search box of search engine interface, search engine can be by described AnalyzingInfixSuggester objects obtain other keywords associated with the keyword;The index accesses pair As being specifically as follows IndexWriter objects;The IndexWriter objects are used for AnalyzingInfixSuggester The index task of object is scheduled.
In the present embodiment, at least one first kind object of establishment corresponds to an index accesses object;It is appreciated that For, when initializing first first kind object, the correspondence initialization index accesses object;In follow-up further initialization During second first kind object to n-th (n is the positive integer more than 2) individual first kind object, second first kind Object is corresponding with the index accesses object to n-th of first kind object.Fig. 2 a and Fig. 2 b are respectively the embodiment of the present invention Information processing method and existing processing scheme a kind of application architecture contrast schematic diagram;As shown in Figure 2 a, it is existing processing The application architecture of scheme, i.e., each one IndexWriter lock of AnalyzingInfixSuggester objects correspondence;It is multiple One index storage region of IndexWriter locks correspondence, it can be understood as, existing IndexWriter locks are privately owned non-static Variable.And the application architecture of the present embodiment can as shown in Figure 2 b, i.e., multiple AnalyzingInfixSuggester objects correspondences one Individual IndexWriter locks, described one index storage region of IndexWriter locks correspondence, it can be understood as, should IndexWriter locks are privately owned static variable.
In the present embodiment, the index accesses object correspondence one indexes storage region;The index accesses object is according to pre- If the index task of mechanism scheduling at least one first kind object, including:When receive based on it is described at least one the During the index task of one type object, the index accesses object dispatches at least one described first kind pair according to default mechanism The index task of elephant, so that particular type object is based on the index storage region and performs the index task;Wherein, the spy It is the type object selected according to the default mechanism from least one described first kind object to determine type object.
Using the technical scheme of the embodiment of the present invention, by least one first kind object (for example AnalyzingInfixSuggester objects) one index accesses object (such as IndexWriter locks) of configuration, pass through the rope Draw access object the index task of at least one first kind object is scheduled, by change index accesses object by Existing privately owned non-static pattern is the privately owned static pattern in the embodiment of the present invention, is solved different in the prior art IndexWriter can be caused when locking corresponding different AnalyzingInfixSuggester objects to access same index The problem of mutual exclusion and it is likely to result in the problem of engine collapses;On the other hand, the technical scheme of the present embodiment optimizes internal memory knot Structure, reduces internal memory by privately owned static index accesses object in the present embodiment and uses, optimize internal storage access efficiency, even if Unique index accesses object fails release in time and does not also result in serious RAM leakage, so as to avoid the hair of engine collapse It is raw.
Embodiment two
The embodiment of the present invention additionally provides a kind of information processing method, applied to the message processing device with search engine In, described information processing equipment can be specifically the server or server cluster residing for search engine.Fig. 3 is implemented for the present invention The schematic flow sheet of the information processing method of example two;As shown in figure 3, methods described includes:
Step 401:When initializing at least one first kind object, an index accesses object is initialized;Described at least one Individual first kind object is corresponding with the index accesses object.
Step 402:The index accesses object according to default specific operation system mutual exclusion mechanism scheduling described at least The index task of one first kind object.
The information processing method of the present embodiment is applied in search engine, the search specifically locked with IndexWriter In engine.Wherein, the first kind object is specifically as follows with AnalyzingInfixSuggester pairs of word association function As when user inputs keyword in the search box of search engine interface, search engine can be by described AnalyzingInfixSuggester objects obtain other keywords associated with the keyword;The index accesses pair As being specifically as follows IndexWriter objects;The IndexWriter objects are used for AnalyzingInfixSuggester The index task of object is scheduled.
In the present embodiment, at least one first kind object of establishment corresponds to an index accesses object;It is appreciated that For, when initializing first first kind object, the correspondence initialization index accesses object;In follow-up further initialization During second first kind object to n-th (n is the positive integer more than 2) individual first kind object, second first kind Object is corresponding with the index accesses object to n-th of first kind object.Specifically as shown in Figure 2 a, it is existing processing scheme Application architecture, i.e. one IndexWriter lock of each AnalyzingInfixSuggester objects correspondence;It is multiple One index storage region of IndexWriter locks correspondence, it can be understood as, existing IndexWriter locks are privately owned non-static Variable.And the application architecture of the present embodiment can as shown in Figure 2 b, i.e., multiple AnalyzingInfixSuggester objects correspondences one Individual IndexWriter locks, described one index storage region of IndexWriter locks correspondence, it can be understood as, should IndexWriter locks are privately owned static variable.
In the present embodiment, the index accesses object according to default specific operation system mutual exclusion mechanism scheduling described in extremely The index task of a few first kind object, (OS is operated the mutual exclusion mechanism such as OS operating systems of the specific operation system The exclusive operating system of system specific Apple Inc. research and development) mutual exclusion mechanism.Specifically, in OS operating system exclusion mechanisms, With mutual exclusion area;And the index accesses object can be scheduled based on following principle to the process for carrying index task:When Without process in mutual exclusion area, any process with access to mutual exclusion area can enter mutual exclusion area;Do not allow more than two processes same When enter mutual exclusion area;When no process mutual exclusion area and simultaneously multiple schemes calls enter mutual exclusion area when, can only allow wherein it One enters mutual exclusion area, and other processes have to wait for;The process in any entrance mutual exclusion area should be met within the limited time;Place Occupying system resources should be abandoned in the process of wait state, so that other processes have an opportunity to obtain system resource etc., certainly not It is limited to the above-mentioned principle enumerated.Then the index accesses object can dispatch at least one described first kind according to above-mentioned mutual exclusion mechanism The index task of type object, only allows the process access index storage region of an index task, so as to avoid multiple every time The problem of multiple processes of index task or an index task can cause mutual exclusion when accessing same index simultaneously, and mutual exclusion The problem of search engine collapses is caused if problem is serious.
Using the technical scheme of the embodiment of the present invention, on the one hand, by least one first kind object (for example AnalyzingInfixSuggester objects) one index accesses object (such as IndexWriter locks) of configuration, pass through the rope Draw access object the index task of at least one first kind object is scheduled, by change index accesses object by Existing privately owned non-static pattern is the privately owned static pattern in the embodiment of the present invention, is solved different in the prior art IndexWriter can be caused when locking corresponding different AnalyzingInfixSuggester objects to access same index The problem of mutual exclusion and it is likely to result in the problem of engine collapses;On the other hand, the technical scheme of the present embodiment optimizes internal memory knot Structure, reduces internal memory by privately owned static index accesses object in the present embodiment and uses, optimize internal storage access efficiency, even if Unique index accesses object fails release in time and does not also result in serious RAM leakage, so as to avoid the hair of engine collapse It is raw.On the other hand, the present embodiment dispatches at least one described first kind according to the mutual exclusion mechanism of default specific operation system The index task of object, only allows the process access index storage region of an index task, so as to avoid multiple ropes every time Draw multiple processes of task or an index task while the problem of causing mutual exclusion when accessing same index, and mutual exclusion are asked The problem of search engine collapses is caused if topic is serious.
Embodiment three
The embodiment of the present invention additionally provides a kind of information processing method, applied to the message processing device with search engine In, described information processing equipment can be specifically the server or server cluster residing for search engine.Fig. 4 is implemented for the present invention The schematic flow sheet of the information processing method of example three;As shown in figure 4, methods described includes:
Step 501:When initializing at least one first kind object, an index accesses object is initialized;Described at least one Individual first kind object is corresponding with the index accesses object.
Step 502:The index accesses object according to default specific operation system mutual exclusion mechanism scheduling described at least The index task of one first kind object.
Step 503:After the completion of the index task of at least one first kind object is performed both by, the index is discharged Access object.
The information processing method of the present embodiment is applied in search engine, the search specifically locked with IndexWriter In engine.Wherein, the first kind object is specifically as follows with AnalyzingInfixSuggester pairs of word association function As when user inputs keyword in the search box of search engine interface, search engine can be by described AnalyzingInfixSuggester objects obtain other keywords associated with the keyword;The index accesses pair As being specifically as follows IndexWriter objects;The IndexWriter objects are used for AnalyzingInfixSuggester The index task of object is scheduled.
In the present embodiment, at least one first kind object of establishment corresponds to an index accesses object;It is appreciated that For, when initializing first first kind object, the correspondence initialization index accesses object;In follow-up further initialization During second first kind object to n-th (n is the positive integer more than 2) individual first kind object, second first kind Object is corresponding with the index accesses object to n-th of first kind object.Specifically as shown in Figure 2 a, it is existing processing scheme Application architecture, i.e. one IndexWriter lock of each AnalyzingInfixSuggester objects correspondence;It is multiple One index storage region of IndexWriter locks correspondence, it can be understood as, existing IndexWriter locks are privately owned non-static Variable.And the application architecture of the present embodiment can as shown in Figure 2 b, i.e., multiple AnalyzingInfixSuggester objects correspondences one Individual IndexWriter locks, described one index storage region of IndexWriter locks correspondence, it can be understood as, should IndexWriter locks are privately owned static variable.
In the present embodiment, the index accesses object according to default specific operation system mutual exclusion mechanism scheduling described in extremely The index task of a few first kind object, (OS is operated the mutual exclusion mechanism such as OS operating systems of the specific operation system The exclusive operating system of system specific Apple Inc. research and development) mutual exclusion mechanism.Specifically, in OS operating system exclusion mechanisms, With mutual exclusion area;And the index accesses object can be scheduled based on following principle to the process for carrying index task:When Without process in mutual exclusion area, any process with access to mutual exclusion area can enter mutual exclusion area;Do not allow more than two processes same When enter mutual exclusion area;When no process mutual exclusion area and simultaneously multiple schemes calls enter mutual exclusion area when, can only allow wherein it One enters mutual exclusion area, and other processes have to wait for;The process in any entrance mutual exclusion area should be met within the limited time;Place Occupying system resources should be abandoned in the process of wait state, so that other processes have an opportunity to obtain system resource etc., certainly not It is limited to the above-mentioned principle enumerated.Then the index accesses object can dispatch at least one described first kind according to above-mentioned mutual exclusion mechanism The index task of type object, only allows the process access index storage region of an index task, so as to avoid multiple every time The problem of multiple processes of index task or an index task can cause mutual exclusion when accessing same index simultaneously, and mutual exclusion The problem of search engine collapses is caused if problem is serious.
In the present embodiment, after the completion of the index tasks carrying of first kind object, the first kind object is discharged.And After the completion of the index task of at least one first kind object is performed both by, the index accesses object is discharged, so as to release Put the corresponding memory source of the index accesses object.
Fig. 5 a and Fig. 5 b are respectively another application of the information processing method with existing processing scheme of the embodiment of the present invention The contrast schematic diagram of framework;As shown in Figure 5 a, it is the application architecture of existing processing scheme, wherein, due to each AnalyzingInfixSuggester objects correspond to an IndexWriter lock;Then each After the completion of AnalyzingInfixSuggester target tasks are performed, the correspondence release AnalyzingInfixSuggester The corresponding IndexWriter locks of object.So, it is likely that bring causes because IndexWriter locks fail timely releasing memory Memory source occupancy it is excessive, the problem of collapse of search engine can be caused when serious.And the application architecture of the present embodiment can As shown in Figure 5 b, i.e., multiple one IndexWriter lock of AnalyzingInfixSuggester objects correspondence, all AnalyzingInfixSuggester objects have been performed both by after task, release IndexWriter locks, use privately owned static variable The use of internal memory is reduced, failing release in time even if IndexWriter locks does not result in serious RAM leakage yet, more will not Engine is caused to collapse.
Using the technical scheme of the embodiment of the present invention, on the one hand, by least one first kind object (for example AnalyzingInfixSuggester objects) one index accesses object (such as IndexWriter locks) of configuration, pass through the rope Draw access object the index task of at least one first kind object is scheduled, by change index accesses object by Existing privately owned non-static pattern is the privately owned static pattern in the embodiment of the present invention, is solved different in the prior art IndexWriter can be caused when locking corresponding different AnalyzingInfixSuggester objects to access same index The problem of mutual exclusion and it is likely to result in the problem of engine collapses;On the other hand, the technical scheme of the present embodiment optimizes internal memory knot Structure, reduces internal memory by privately owned static index accesses object in the present embodiment and uses, optimize internal storage access efficiency, even if Unique index accesses object fails release in time and does not also result in serious RAM leakage, so as to avoid the hair of engine collapse It is raw.On the other hand, the present embodiment dispatches at least one described first kind according to the mutual exclusion mechanism of default specific operation system The index task of object, only allows the process access index storage region of an index task, so as to avoid multiple ropes every time Draw multiple processes of task or an index task while the problem of causing mutual exclusion when accessing same index, and mutual exclusion are asked The problem of search engine collapses is caused if topic is serious.
Example IV
The embodiment of the present invention additionally provides a kind of message processing device.Fig. 6 is the message processing device of the embodiment of the present invention Composition structural representation;As shown in fig. 6, the equipment includes:Initialization module 61, index accesses module 62 and at least one First kind module 63;Wherein,
The initialization module 61, for initializing during at least one first kind module 63, initializes the index and visits Ask module 62;At least one described first kind module 63 is corresponding with the index accesses module 62;
The index accesses module 62, the rope for dispatching at least one first kind module 63 according to default mechanism Draw task.
The present embodiment equipment has search engine, the search engine specifically locked with IndexWriter.Wherein, it is described First kind module 63 is specifically as follows with word association function AnalyzingInfixSuggester objects, when user is searching When inputting keyword in the search box of rope engine interface, search engine can pass through described AnalyzingInfixSuggester pairs As obtaining other keywords associated with the keyword;The index accesses module 62 is specifically as follows IndexWriter Object;The IndexWriter objects are used to be scheduled the index task of AnalyzingInfixSuggester objects.
In the present embodiment, at least one first kind module 63 of establishment corresponds to an index accesses module 62.As schemed Be the application architecture of existing processing scheme shown in 2a, i.e., each AnalyzingInfixSuggester objects correspondence one IndexWriter locks;Multiple one index storage region of IndexWriter locks correspondence, it can be understood as, it is existing IndexWriter locks are privately owned nonstatic variables.And the application architecture of the present embodiment can be that is, multiple as shown in Figure 2 b One IndexWriter lock of AnalyzingInfixSuggester objects correspondence, IndexWriter locks one rope of correspondence Draw storage region, it can be understood as, IndexWriter locks are privately owned static variable.
In the present embodiment, the equipment also includes the index memory module for being used to store index information;The index accesses Module 62, for when receiving the index task based at least one first kind module 63, being adjusted according to default mechanism The index task of degree at least one first kind module 63, so that particular type module is based on the index memory module and held The row index task;Wherein, the particular type module is from least one described first kind according to the default mechanism The type block selected in module 63.
Using the technical scheme of the embodiment of the present invention, by least one first kind module 63 (for example AnalyzingInfixSuggester objects) one index accesses module 62 (such as IndexWriter locks) of configuration, by this The index task of at least one first kind module 63 is scheduled described in 62 pairs of index accesses module, by changing index accesses Module 62 is the privately owned static pattern in the embodiment of the present invention by existing privately owned non-static pattern, solves prior art Middle different IndexWriter locks corresponding different AnalyzingInfixSuggester objects to access same index When the problem of can cause mutual exclusion and be likely to result in the problem of engine collapses;On the other hand, the technical scheme optimization of the present embodiment Internal storage structure, reduces internal memory by privately owned static index accesses module 62 in the present embodiment and uses, and optimizes internal memory visit Efficiency is asked, failing release in time even if unique index accesses module 62 does not result in serious RAM leakage yet, so as to avoid The generation of engine collapse.
Embodiment five
The embodiment of the present invention additionally provides a kind of message processing device.As shown in figure 8, the equipment includes:Initialize mould Block 61, index accesses module 62 and at least one first kind module 63;Wherein,
The initialization module 61, for initializing during at least one first kind module 63, initializes the index and visits Ask module 62;At least one described first kind module 63 is corresponding with the index accesses module 62;
The index accesses module 62, at least one described in the mutual exclusion mechanism scheduling according to default specific operation system The index task of individual first kind module 63.
The present embodiment equipment has search engine, the search engine specifically locked with IndexWriter.Wherein, it is described First kind module 63 is specifically as follows with word association function AnalyzingInfixSuggester objects, when user is searching When inputting keyword in the search box of rope engine interface, search engine can pass through described AnalyzingInfixSuggester pairs As obtaining other keywords associated with the keyword;The index accesses module 62 is specifically as follows IndexWriter Object;The IndexWriter objects are used to be scheduled the index task of AnalyzingInfixSuggester objects.
In the present embodiment, at least one first kind module 63 of establishment corresponds to an index accesses module 62.Specifically As shown in Figure 2 a, be the application architecture of existing processing scheme, i.e., each AnalyzingInfixSuggester objects correspondence one IndexWriter locks;Multiple one index storage region of IndexWriter locks correspondence, it can be understood as, it is existing IndexWriter locks are privately owned nonstatic variables.And the application architecture of the present embodiment can be that is, multiple as shown in Figure 2 b One IndexWriter lock of AnalyzingInfixSuggester objects correspondence, IndexWriter locks one rope of correspondence Draw storage region, it can be understood as, IndexWriter locks are privately owned static variable.
In the present embodiment, the index accesses module 62 dispatches described according to the mutual exclusion mechanism of default specific operation system The index task of at least one first kind module 63, the mutual exclusion mechanism such as OS operating systems (OS of the specific operation system The exclusive operating system of operating system specific Apple Inc. research and development) mutual exclusion mechanism.Specifically, in OS operating system exclusion mechanisms In, with mutual exclusion area;And the index accesses module 62 can be adjusted based on following principle to the process for carrying index task Degree:When without process, in mutual exclusion area, any process with access to mutual exclusion area can enter mutual exclusion area;Do not allow it is more than two enter Journey enters mutual exclusion area simultaneously;When no process mutual exclusion area and simultaneously multiple schemes calls enter mutual exclusion area when, it can only be allowed One of enter mutual exclusion area, other processes have to wait for;The process in any entrance mutual exclusion area should be expired within the limited time Foot;The process being waited for should abandon occupying system resources, so that other processes have an opportunity to obtain system resource etc., when So it is not limited to the above-mentioned principle enumerated.Then the index accesses module 62 can be dispatched according to above-mentioned mutual exclusion mechanism it is described at least one The index task of first kind module 63, only allows the process access index storage region of an index task, so as to keep away every time Exempt from multiple processes of multiple index tasks or an index task while the problem of causing mutual exclusion when accessing same index, And problem of mutual exclusion it is serious if cause the problem of search engine collapses.
Using the technical scheme of the embodiment of the present invention, on the one hand, by least one first kind module 63 (for example AnalyzingInfixSuggester objects) one index accesses module 62 (such as IndexWriter locks) of configuration, by this The index task of at least one first kind module 63 is scheduled described in 62 pairs of index accesses module, by changing index accesses Module 62 is the privately owned static pattern in the embodiment of the present invention by existing privately owned non-static pattern, solves prior art Middle different IndexWriter locks corresponding different AnalyzingInfixSuggester objects to access same index When the problem of can cause mutual exclusion and be likely to result in the problem of engine collapses;On the other hand, the technical scheme optimization of the present embodiment Internal storage structure, reduces internal memory by privately owned static index accesses module 62 in the present embodiment and uses, and optimizes internal memory visit Efficiency is asked, failing release in time even if unique index accesses module 62 does not result in serious RAM leakage yet, so as to avoid The generation of engine collapse.On the other hand, the present embodiment according to default specific operation system mutual exclusion mechanism scheduling described in extremely The index task of a few first kind module 63, only allows the process access index storage region of an index task every time, So as to avoid multiple processes of multiple index tasks or an index task while mutual exclusion can be caused when accessing same index The problem of, and the problem of search engine collapses is caused if problem of mutual exclusion is serious.
Embodiment six
The embodiment of the present invention additionally provides a kind of message processing device.As shown in fig. 6, the equipment includes:Initialize mould Block 61, index accesses module 62 and at least one first kind module 63;Wherein,
The initialization module 61, for initializing during at least one first kind module 63, initializes the index and visits Ask module 62;At least one described first kind module 63 is corresponding with the index accesses module 62;
The index accesses module 62, at least one described in the mutual exclusion mechanism scheduling according to default specific operation system The index task of individual first kind module 63;
The equipment also includes release module, for being held when the index task of at least one first kind module 63 After the completion of row, the index accesses module 62 is discharged.
The equipment of the present embodiment has in search engine, the search engine specifically locked with IndexWriter.Wherein, The first kind module 63 is specifically as follows with word association function AnalyzingInfixSuggester objects, works as user When inputting keyword in the search box of search engine interface, search engine can be by described AnalyzingInfixSuggester objects obtain other keywords associated with the keyword;The index accesses mould Block 62 is specifically as follows IndexWriter objects;The IndexWriter objects be used for pair The index task of AnalyzingInfixSuggester objects is scheduled.
In the present embodiment, at least one first kind module 63 of establishment corresponds to an index accesses module 62.Specifically As shown in Figure 2 a, be the application architecture of existing processing scheme, i.e., each AnalyzingInfixSuggester objects correspondence one IndexWriter locks;Multiple one index storage region of IndexWriter locks correspondence, it can be understood as, it is existing IndexWriter locks are privately owned nonstatic variables.And the application architecture of the present embodiment can be that is, multiple as shown in Figure 2 b One IndexWriter lock of AnalyzingInfixSuggester objects correspondence, IndexWriter locks one rope of correspondence Draw storage region, it can be understood as, IndexWriter locks are privately owned static variable.
In the present embodiment, the index accesses module 62 dispatches described according to the mutual exclusion mechanism of default specific operation system The index task of at least one first kind module 63, the mutual exclusion mechanism such as OS operating systems (OS of the specific operation system The exclusive operating system of operating system specific Apple Inc. research and development) mutual exclusion mechanism.Specifically, in OS operating system exclusion mechanisms In, with mutual exclusion area;And the index accesses module 62 can be adjusted based on following principle to the process for carrying index task Degree:When without process, in mutual exclusion area, any process with access to mutual exclusion area can enter mutual exclusion area;Do not allow it is more than two enter Journey enters mutual exclusion area simultaneously;When no process mutual exclusion area and simultaneously multiple schemes calls enter mutual exclusion area when, it can only be allowed One of enter mutual exclusion area, other processes have to wait for;The process in any entrance mutual exclusion area should be expired within the limited time Foot;The process being waited for should abandon occupying system resources, so that other processes have an opportunity to obtain system resource etc., when So it is not limited to the above-mentioned principle enumerated.Then the index accesses module 62 can be dispatched according to above-mentioned mutual exclusion mechanism it is described at least one The index task of first kind module 63, only allows the process access index storage region of an index task, so as to keep away every time Exempt from multiple processes of multiple index tasks or an index task while the problem of causing mutual exclusion when accessing same index, And problem of mutual exclusion it is serious if cause the problem of search engine collapses.
In the present embodiment, the release module is additionally operable to after the completion of the index tasks carrying of first kind module 63, released Put the first kind module 63.And after the completion of the index task of at least one first kind module 63 is performed both by, release The index accesses module 62 is put, so as to discharge the corresponding memory source of the index accesses module 62.
As shown in Figure 5 a, it is the application architecture of existing processing scheme, wherein, due to each AnalyzingInfixSuggester objects correspond to an IndexWriter lock;Then each After the completion of AnalyzingInfixSuggester target tasks are performed, the correspondence release AnalyzingInfixSuggester The corresponding IndexWriter locks of object.So, it is likely that bring causes because IndexWriter locks fail timely releasing memory Memory source occupancy it is excessive, the problem of collapse of search engine can be caused when serious.And the application architecture of the present embodiment can As shown in Figure 5 b, i.e., multiple one IndexWriter lock of AnalyzingInfixSuggester objects correspondence, all AnalyzingInfixSuggester objects have been performed both by after task, release IndexWriter locks, use privately owned static variable The use of internal memory is reduced, failing release in time even if IndexWriter locks does not result in serious RAM leakage yet, more will not Engine is caused to collapse.
Using the technical scheme of the embodiment of the present invention, on the one hand, by least one first kind module 63 (for example AnalyzingInfixSuggester objects) one index accesses module 62 (such as IndexWriter locks) of configuration, by this The index task of at least one first kind module 63 is scheduled described in 62 pairs of index accesses module, by changing index accesses Module 62 is the privately owned static pattern in the embodiment of the present invention by existing privately owned non-static pattern, solves prior art Middle different IndexWriter locks corresponding different AnalyzingInfixSuggester objects to access same index When the problem of can cause mutual exclusion and be likely to result in the problem of engine collapses;On the other hand, the technical scheme optimization of the present embodiment Internal storage structure, reduces internal memory by privately owned static index accesses module 62 in the present embodiment and uses, and optimizes internal memory visit Efficiency is asked, failing release in time even if unique index accesses module 62 does not result in serious RAM leakage yet, so as to avoid The generation of engine collapse.On the other hand, the present embodiment according to default specific operation system mutual exclusion mechanism scheduling described in extremely The index task of a few first kind module 63, only allows the process access index storage region of an index task every time, So as to avoid multiple processes of multiple index tasks or an index task while mutual exclusion can be caused when accessing same index The problem of, and the problem of search engine collapses is caused if problem of mutual exclusion is serious.
In the embodiment of the present invention, initialization module 61, at least one first kind module 63, index in the equipment are visited Module 62 and release module are asked, in actual applications can be by central processing unit (CPU, the Central in the equipment Processing Unit), digital signal processor (DSP, Digital Signal Processor), micro-control unit (MCU, Microcontroller Unit) or programmable gate array (FPGA, Field-Programmable Gate Array) realization.
It should be noted that herein, term " comprising ", "comprising" or its any other variant are intended to non-row His property is included, so that process, method, article or device including a series of key elements not only include those key elements, and And also including other key elements being not expressly set out, or also include for this process, method, article or device institute inherently Key element.In the absence of more restrictions, the key element limited by sentence "including a ...", it is not excluded that including this Also there is other identical element in process, method, article or the device of key element.
The embodiments of the present invention are for illustration only, and the quality of embodiment is not represented.
, can be by it in several embodiments provided herein, it should be understood that disclosed apparatus and method Its mode is realized.Apparatus embodiments described above are only schematical, for example, the division of the unit, is only A kind of division of logic function, can have other dividing mode, such as when actually realizing:Multiple units or component can be combined, or Another system is desirably integrated into, or some features can be ignored, or do not perform.In addition, shown or discussed each composition portion Coupling point each other or direct-coupling or communication connection can be the INDIRECT COUPLINGs of equipment or unit by some interfaces Or communication connection, can be electrical, machinery or other forms.
The above-mentioned unit illustrated as separating component can be or may not be it is physically separate, it is aobvious as unit The part shown can be or may not be physical location, you can positioned at a place, can also be distributed to multiple network lists In member;Part or all of unit therein can be selected to realize the purpose of this embodiment scheme according to the actual needs.
In addition, each functional unit in various embodiments of the present invention can be fully integrated into a processing unit, also may be used Be each unit individually as a unit, can also two or more units it is integrated in a unit;It is above-mentioned Integrated unit can both be realized in the form of hardware, it would however also be possible to employ hardware adds the form of SFU software functional unit to realize.
One of ordinary skill in the art will appreciate that:Realizing all or part of step of above method embodiment can pass through Programmed instruction related hardware is completed, and foregoing program can be stored in a computer read/write memory medium, the program Upon execution, the step of including above method embodiment is performed;And foregoing storage medium includes:It is movable storage device, read-only Memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disc or Person's CD etc. is various can be with the medium of store program codes.
Or, if the above-mentioned integrated unit of the present invention is realized using in the form of software function module and is used as independent product Sale in use, can also be stored in a computer read/write memory medium.Understood based on such, the present invention is implemented The part that the technical scheme of example substantially contributes to prior art in other words can be embodied in the form of software product, The computer software product is stored in a storage medium, including some instructions are to cause a computer equipment (can be with It is personal computer, server or network equipment etc.) perform all or part of each of the invention embodiment methods described. And foregoing storage medium includes:Movable storage device, ROM, RAM, magnetic disc or CD etc. are various can be with store program codes Medium.
The foregoing is only a specific embodiment of the invention, but protection scope of the present invention is not limited thereto, any Those familiar with the art the invention discloses technical scope in, change or replacement can be readily occurred in, should all be contained Cover within protection scope of the present invention.Therefore, protection scope of the present invention should be based on the protection scope of the described claims.

Claims (10)

1. a kind of message processing device, it is characterised in that the equipment includes:Initialization module, index accesses module and at least One first kind module;Wherein,
The initialization module, for initializing during at least one first kind module, initializes the index accesses module;Institute State at least one first kind module corresponding with the index accesses module;
The index accesses module, the index task for dispatching at least one first kind module according to default mechanism.
2. equipment according to claim 1, it is characterised in that the equipment also includes the index for being used to store index information Memory module;
The index accesses module, for when receiving the index task based at least one first kind module, pressing The index task of at least one first kind module is dispatched according to default mechanism, so that particular type module is based on the index Memory module performs the index task;
Wherein, the particular type module is selected according to the default mechanism from least one described first kind module Type block.
3. equipment according to claim 1 or 2, it is characterised in that the index accesses module, for according to default spy Determine the index task of mutual exclusion mechanism scheduling at least one first kind object of operating system.
4. equipment according to claim 1, it is characterised in that the equipment also includes release module, for working as the first kind After the completion of the index tasks carrying of pattern block, the first kind module is discharged.
5. the equipment according to claim 1 or 4, it is characterised in that the release module, be additionally operable to when it is described at least one After the completion of the index task of first kind module is performed both by, the index accesses module is discharged.
6. a kind of information processing method, it is characterised in that methods described includes:
When initializing at least one first kind object, an index accesses object is initialized;At least one described first kind pair As corresponding with the index accesses object;
The index accesses object dispatches the index task of at least one first kind object according to default mechanism.
7. method according to claim 6, it is characterised in that the index accesses object correspondence one indexes storage region; The index accesses object dispatches the index task of at least one first kind object according to default mechanism, including:
When receiving the index task based at least one first kind object, the index accesses object is according to default The index task of mechanism scheduling at least one first kind object, so that particular type object is based on the index memory block Domain performs the index task;
Wherein, the particular type object is selected according to the default mechanism from least one described first kind object Type object.
8. the method according to claim 6 or 7, it is characterised in that the index accesses object is dispatched according to default mechanism The index task of at least one first kind object, including:
The index accesses object dispatches at least one described first kind according to the mutual exclusion mechanism of default specific operation system The index task of object.
9. method according to claim 6, it is characterised in that methods described also includes:When the index of first kind object After the completion of tasks carrying, the first kind object is discharged.
10. the method according to claim 6 or 9, it is characterised in that methods described also includes:When it is described at least one After the completion of the index task of one type object is performed both by, the index accesses object is discharged.
CN201710210254.XA 2017-03-31 2017-03-31 A kind of information processing method and equipment Pending CN107085601A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710210254.XA CN107085601A (en) 2017-03-31 2017-03-31 A kind of information processing method and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710210254.XA CN107085601A (en) 2017-03-31 2017-03-31 A kind of information processing method and equipment

Publications (1)

Publication Number Publication Date
CN107085601A true CN107085601A (en) 2017-08-22

Family

ID=59614929

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710210254.XA Pending CN107085601A (en) 2017-03-31 2017-03-31 A kind of information processing method and equipment

Country Status (1)

Country Link
CN (1) CN107085601A (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6029190A (en) * 1997-09-24 2000-02-22 Sony Corporation Read lock and write lock management system based upon mutex and semaphore availability
CN105511969A (en) * 2015-11-25 2016-04-20 中国船舶工业***工程研究院 Inter-process thread mutex method

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6029190A (en) * 1997-09-24 2000-02-22 Sony Corporation Read lock and write lock management system based upon mutex and semaphore availability
CN105511969A (en) * 2015-11-25 2016-04-20 中国船舶工业***工程研究院 Inter-process thread mutex method

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
杜吉梁: "中文搜索引擎的关键技术研究", 《中国优秀硕士学位论文全文数据库信息科技辑》 *
郑逢斌: "《计算机科学导论》", 31 August 2016, 河南大学出版社 *

Similar Documents

Publication Publication Date Title
Tong et al. Two-sided online micro-task assignment in spatial crowdsourcing
Apt Principles of constraint programming
Pathak et al. A generalized linear threshold model for multiple cascades
US10445323B2 (en) Association rule mining with the micron automata processor
CA2386272A1 (en) Collaborative design
JPH04319774A (en) Distributed design cad system
US20070005530A1 (en) Selecting grid executors via a neural network
Liu et al. Mapreduce-based pattern finding algorithm applied in motif detection for prescription compatibility network
Du et al. Overlapping community detection in bipartite networks
CN107343007A (en) Distributed file management method and system based on user identity and purview certification
CA2461871A1 (en) An efficient index structure to access hierarchical data in a relational database system
CN108140022B (en) Data query method and database system
Yu et al. Efficient role mining for context-aware service recommendation using a high-performance cluster
CN104350464B (en) Integration calling is virtualized to provide the access right to the resource in virtual name space
Su et al. Towards optimal decomposition of Boolean networks
CN102609313B (en) Multi-core system resource delay recycle lock realizing method and multi-core system resource delay recycle lock realizing system
CN109672623A (en) A kind of message processing method and device
Morales et al. New TNT routines for parallel computing with MPI
CN107085601A (en) A kind of information processing method and equipment
CN105849703A (en) Sorted event monitoring by context partition
Huang et al. On processor allocation in hypercube multiprocessors
Rajasekaran et al. Parallel algorithms for relational coarsest partition problems
CN110362551A (en) Building Method of Data Warehouse, device, equipment and storage medium
Hasan et al. An approach towards scalability for reconfigurable product flow line through unbalancing
Lawson Application machines: an approach to realizing understandable systems

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

Application publication date: 20170822

RJ01 Rejection of invention patent application after publication