CN109617974A - A kind of request processing method, device and server - Google Patents
A kind of request processing method, device and server Download PDFInfo
- Publication number
- CN109617974A CN109617974A CN201811575054.5A CN201811575054A CN109617974A CN 109617974 A CN109617974 A CN 109617974A CN 201811575054 A CN201811575054 A CN 201811575054A CN 109617974 A CN109617974 A CN 109617974A
- Authority
- CN
- China
- Prior art keywords
- data
- access
- queues
- result
- access data
- 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
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/60—Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
Abstract
The embodiment of the invention provides a kind of request processing methods, which comprises receives multiple data access requests that terminal is sent;Obtain the access data that the multiple data access request carries respectively;Acquired access data are put into and are merged in set of queues;Generate the corresponding data result of each access data stored in the merging set of queues.It can be seen that, the technical solution provided through the embodiment of the present invention, server can concurrently handle multiple data access requests, it is such rather than the relevant technologies, server can only handle a data access request simultaneously, to improve the efficiency of server process data access request, and server resource is rationally utilized, reduces the waste of server resource.
Description
Technical field
The present invention relates to Internet technical fields, more particularly to a kind of request processing method, device and server.
Background technique
With the development of science and technology, more and more users are by user terminal access data, for example, user passes through use
Family terminal searching information, viewing video etc..
Wherein, user passes through the process of user terminal access data substantially are as follows: user is sent out by user terminal to server
Send data access request;After server receives data access request, the access data of data access request carrying are extracted;Clothes
Business device generates the corresponding data result of the access request, and the corresponding data result of the data result is sent to the user terminal.
But in the related technology, if server receives multiple data access requests simultaneously, server can only be located simultaneously
A data access request is managed, and other data access requests need to wait.Therefore, the effect of server process data access request
Rate is lower, can not rationally utilize server resource, cause the waste of server resource.
Summary of the invention
The embodiment of the present invention is designed to provide a kind of request processing method, device and server, to improve server
The efficiency of data access request is handled, and rationally utilizes server resource, reduces the waste of server resource.Particular technique side
Case is as follows:
In a first aspect, being applied to server, the method packet the embodiment of the invention provides a kind of request processing method
It includes:
Receive multiple data access requests that terminal is sent;
Obtain the access data that the multiple data access request carries respectively;
Acquired access data are put into and are merged in set of queues;
Generate the corresponding data result of each access data stored in the merging set of queues.
Optionally, after described the step of obtaining the access data that the multiple data access request carries respectively, institute
State method further include:
Generate the Data Identification of acquired access data, wherein the Data Identification of any access data is based on reception
It is generated at the time of to the data access request for carrying the access data;
Correspondingly, described be put into acquired access data the step merged in set of queues, comprising:
The Data Identification of acquired access data and acquired access data is put into and is merged in set of queues.
Optionally, in the step for generating the corresponding data result of each access data for merging and storing in set of queues
Before rapid, the method also includes:
Judge whether the quantity for the access data stored in the merging set of queues is greater than preset quantity;
If it is, generating the corresponding data knot of the preset quantity access data store in the merging set of queues, described
Fruit;
If it has not, after preset time, judge again the access data stored in the merging set of queues quantity whether
It is executed described in generating greater than preset quantity if the quantity for merging the access data stored in set of queues is greater than preset quantity
Merge the step of store in the set of queues, preset quantity accesses data corresponding data result;If the merging queue
The quantity for the access data stored in group is less than preset quantity, executes and generates each access number for merging and storing in set of queues
The step of according to corresponding data result.
Optionally, described to generate the corresponding number of the preset quantity access data store in the merging set of queues, described
The step of according to result, comprising:
Based on the Data Identification for each access data stored in the merging set of queues, from the merging set of queues really
Determine preset quantity target access data;
Generate the corresponding data result of the target access data.
Optionally, in the step for generating the corresponding data result of each access data for merging and storing in set of queues
After rapid, the method also includes:
For the corresponding data result of each access data, the corresponding Data Identification of the data result is determined;And by the number
It is sent to target terminal according to result, the target terminal is the terminal for sending request of data corresponding with the Data Identification.
Second aspect, the embodiment of the invention also provides a kind of request processing unit, described device includes:
Request receiving module, for receiving multiple data access requests of terminal transmission;
Data acquisition module, the access data carried respectively for obtaining the multiple data access request;
Data storage module merges in set of queues for being put into acquired access data;
Result-generation module, for generating the corresponding data knot of each access data stored in the merging set of queues
Fruit.
Optionally, described device further include:
Identifier generation module, for obtaining what the multiple data access request carried respectively in the data acquisition module
After accessing data, the Data Identification of acquired access data is generated, wherein the Data Identification of any access data is to be based on
It receives generated at the time of the data access request for carrying the access data;
Correspondingly, the data storage module, is specifically used for:
The Data Identification of acquired access data and acquired access data is put into and is merged in set of queues.
Optionally, described device further include:
Quantity judgment module, for generating each access stored in the merging set of queues in the result-generation module
Before the corresponding data result of data, judge whether the quantity for the access data stored in the merging set of queues is greater than present count
Amount;
If the judging result of quantity judgment module be it is yes, trigger the result-generation module and generate in the merging set of queues
Storage, described preset quantity accesses the corresponding data result of data;
If the judging result of quantity judgment module be it is no, after preset time, trigger the quantity judgment module and sentence again
Whether the quantity for the access data stored in the merging set of queues of breaking is greater than preset quantity, if storing in the merging set of queues
The quantity of access data be greater than preset quantity, trigger the result-generation module and execute to generate and stored in the merging set of queues
, the preset quantity access data corresponding data result the step of;If described merge the access number stored in set of queues
According to quantity be less than preset quantity, trigger the result-generation module and execute generating each visit for merging and storing in set of queues
The step of asking data corresponding data result.
Optionally, the result-generation module, is specifically used for:
Based on the Data Identification for each access data stored in the merging set of queues, from the merging set of queues really
Determine preset quantity target access data;
Generate the corresponding data result of the target access data.
Optionally, described device further include:
As a result sending module, for generating each access stored in the merging set of queues in the result-generation module
After the corresponding data result of data, for the corresponding data result of each access data, the corresponding number of the data result is determined
According to mark;And the data result is sent to target terminal, the target terminal is to send data corresponding with the Data Identification
The terminal of request.
The third aspect, the embodiment of the invention also provides a kind of server, including processor, communication interface, memory and
Communication bus, wherein processor, communication interface, memory complete mutual communication by communication bus;
Memory, for storing computer program;
Processor when for executing the program stored on memory, realizes request processing method described in first aspect.
Fourth aspect, it is described computer-readable to deposit the embodiment of the invention also provides a kind of computer readable storage medium
It is stored with computer program in storage media, is realized at request described in first aspect when the computer program is executed by processor
Reason method.
Technical solution provided in an embodiment of the present invention receives multiple data access requests that terminal is sent;Obtain multiple numbers
The access data carried respectively according to access request;Acquired access data are put into and are merged in set of queues;It generates and merges queue
The corresponding data result of each access data stored in group.As it can be seen that the technical solution provided through the embodiment of the present invention, service
Device can concurrently handle multiple data access requests, such rather than the relevant technologies, and server can only handle a number simultaneously
According to access request, to improve the efficiency of server process data access request, and server resource is rationally utilized, reduces
The waste of server resource.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below
There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this
Some embodiments of invention for those of ordinary skill in the art without creative efforts, can be with
It obtains other drawings based on these drawings.
Fig. 1 is a kind of flow chart of request processing method provided by the embodiment of the present invention;
Fig. 2 is the flow chart of another kind request processing method provided by the embodiment of the present invention;
Fig. 3 is the flow chart of another kind request processing method provided by the embodiment of the present invention;
Fig. 4 receives server for a kind of user terminal, request provided by the embodiment of the present invention, merges server, batch
The interaction schematic diagram of processing server and processing result storage server;
Fig. 5 is a kind of schematic diagram for requesting processing unit provided by the embodiment of the present invention;
Fig. 6 is a kind of structural schematic diagram of server provided by the embodiment of the present invention.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete
Site preparation description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on
Embodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts every other
Embodiment shall fall within the protection scope of the present invention.
In order to improve the efficiency of server process data access request, server resource is rationally utilized, reduces server money
The waste in source, the embodiment of the invention provides a kind of request processing method, device and servers.
It is introduced in a first aspect, being provided for the embodiments of the invention a kind of request processing method first below.
It should be noted that a kind of executing subject of request processing method provided in an embodiment of the present invention is server.Its
In, the quantity of server can be one, be also possible to more.That is, at a kind of request provided in an embodiment of the present invention
The executing subject of reason method can be an individual server, be also possible to server cluster, this is all reasonable.
As shown in Figure 1, a kind of request processing method provided in an embodiment of the present invention, may include steps of:
S110 receives multiple data access requests that terminal is sent.
In practical applications, server can receive multiple data access requests simultaneously, alternatively, server is a certain shorter
Time interval in receive multiple data access requests.It is asked for example, server receives 20 data access in 10 milliseconds
It asks.
For example, there are three terminal, respectively terminal A, terminal B and terminal C.At a time, user A can pass through
Terminal A sends data access request 1 to server;User B can send data access request 2 to server by terminal B;With
Family C can by terminal C to server send data access request 3, then, server receive simultaneously data access request 1,
Data access request 2 and data access request 3 these three data access requests.
S120 obtains the access data that multiple data access requests carry respectively.
Server is after receiving multiple data access requests, the access number of available each data access request carrying
According to.Wherein, access data can be a word, a word or one section of word, this is all reasonable.Wherein, data access request
The access data of middle carrying are access number determining according to the demand of user, that the embodiment of the present invention carries data access request
According to being not specifically limited.
For example, still by S110 for example for, it is assumed that the application scenarios be machine translation.User A wants
Translate a word;User B wants one sentence of translation;User C wants one section of word of translation.So, data access request 1 carries
Access data be a word, data access request 2 carry access data be a sentence;Data access request 3 carries
Access data be one section words.
Acquired access data are put into and merge in set of queues by S130.
Wherein, merge set of queues for storing multiple access data, the server as executing subject can be to depositing in
The multiple access data merged in set of queues carry out batch processing.Also, merges set of queues and can be and operate in as executing master
Module in the server of body can also be the module operated in another server, this is all reasonable.
After getting the access data that multiple data access requests carry respectively, these access data can be put into conjunction
And in set of queues, so that in a subsequent step, batch processing can be carried out to these access data, it can generate simultaneously
These corresponding data results of access data.
In one embodiment, the time that server can be reached according to the corresponding data access request of access data is first
These access data are successively put into and are merged in set of queues by sequence afterwards.
For example, there are three data access request, respectively data access request 1, data access request 2 and data are visited
It asks request 3, and carries access data 1 in data access request 1;Access data 2 are carried in data access request 2;Data
Access data 3 are carried in access request 3.The chronological order of these three data access requests arrival server are as follows: data
Access request 1, data access request 2 and data access request 3.It is possible to which accessing data 1 is first put into merging set of queues
In, then access data 2 are put into again and are merged in set of queues, finally access data 3 are put into and are merged in set of queues.
S140 generates the corresponding data result of each access data for merging and storing in set of queues.
After the access data for carrying multiple data access requests respectively are put into and merge set of queues, server can be with
The each access data for merging and storing in set of queues are handled simultaneously, and generate each access number stored in the merging set of queues
According to corresponding data result.
It will be appreciated by persons skilled in the art that the CPU or GPU of server can execute batch operation, i.e. server
CPU or GPU can generate simultaneously and merge the corresponding data result of each access data stored in set of queues.
Technical solution provided in an embodiment of the present invention receives multiple data access requests that terminal is sent;Obtain multiple numbers
The access data carried respectively according to access request;Acquired access data are put into and are merged in set of queues;It generates and merges queue
The corresponding data result of each access data stored in group.As it can be seen that the technical solution provided through the embodiment of the present invention, service
Device can concurrently handle multiple data access requests, such rather than the relevant technologies, and server can only handle a number simultaneously
According to access request, to improve the efficiency of server process data access request, and server resource is rationally utilized, reduces
The waste of server resource.
The embodiment of the invention also provides a kind of request processing methods, as shown in Fig. 2, the method may include:
S210 receives multiple data access requests that terminal is sent.
S220 obtains the access data that multiple data access requests carry respectively.
Wherein, the step S210-S220 in embodiment illustrated in fig. 2 and the step S110-S120 phase in embodiment illustrated in fig. 1
Together, therefore, no longer step S210-S220 is repeated herein.
S230 generates the Data Identification of acquired access data, wherein the Data Identification of any access data is to be based on
It receives generated at the time of the data access request for carrying the access data.
It can be each data access request after getting the access identities that multiple data access requests carry respectively
The access identities carried respectively generate Data Identification.The Data Identification may include: the IP for sending the terminal of data access request
Address, sends the user identifier of the user of data access request, and the embodiment of the present invention is not specifically limited Data Identification.
Also, the Data Identification of any access data can be based on receiving the data access for carrying the access data
It is generated at the time of request.For example, there are three data access requests, respectively data access request 1, data access request
2 and data access request 3, and access data 1 are carried in data access request 1;Access number is carried in data access request 2
According to 2;Access data 3 are carried in data access request 3.The chronological order of these three data access requests arrival server
Are as follows: data access request 1, data access request 2 and data access request 3.It is possible to which the Data Identification for accessing data 1 can
Think 01, it can be 03 that the Data Identification for accessing data 2, which with 02, can access the Data Identification of data 3,.
The Data Identification of acquired access data and acquired access data is put into and merges in set of queues by S240.
In the Data Identification for getting access data and each access data that multiple data access requests carry respectively
Later, can by access number accordingly and access data Data Identification be put into merge set of queues in.
It is understood that in merging set of queues, the corresponding Data Identification of each access data, that is to say, that visit
Ask that data and Data Identification have one-to-one relationship.Still by taking exemplifications set out in step S230 as an example, the merging set of queues
It may include two column, first list shows that Data Identification, secondary series indicate access number evidence.So, first number of first row is permissible
It is 01, first number of secondary series can be to be access number according to 1;Second number of first row can be with for 02, and second of secondary series
Number can be access number according to 2;The third number of first row can be 03, and the third number of secondary series can be access number according to 3.
S250 generates the corresponding data result of each access data for merging and storing in set of queues.
After the access data for carrying multiple data access requests respectively are put into and merge set of queues, server can be with
The each access data for merging and storing in set of queues are handled simultaneously, and generate each access number stored in the merging set of queues
According to corresponding data result.
It is understood that the corresponding data of each access data are as a result, and the corresponding data of each access data
Mark, it is seen then that access data, Data Identification and data result three have corresponding relationship, also, Data Identification and data access
Request also has corresponding relationship, and therefore, data access request and data result also have corresponding relationship, i.e., implements through the invention
The scheme that example provides, can accurately obtain the corresponding data result of data access request.
S260 determines the corresponding Data Identification of the data result for the corresponding data result of each access data;And it will
The data result is sent to target terminal, and the target terminal is the terminal for sending request of data corresponding with the Data Identification.
It, can for the corresponding data result of each access data after obtaining the corresponding data result of each access data
According to the corresponding relationship of data result and Data Identification, to determine the corresponding Data Identification of the data result, and by the data knot
Fruit is sent to target terminal, so that data result can be received by sending the terminal of data access request.Also, through the invention
The technical solution that embodiment provides, server can handle the multiple access data for merging and storing in set of queues simultaneously, and generate
The corresponding data result of multiple access data stored in the merging set of queues.Therefore, terminal can quickly obtain data knot
Fruit, i.e. user can rapidly view data result, and not have to as the prior art, and user needs to wait longer time
Data result can just be viewed.
It should be noted that in practical applications, the server as executing subject is after obtaining data result, Ke Yizhu
It is dynamic that data result is sent to target terminal, alternatively, target terminal can be to the server request data knot as executing subject
Fruit, this is all reasonable.
Also, the server as executing subject, can be by the data after data result is sent to target terminal
As a result it deletes, or saves the data result, this is all reasonable.
Technical solution provided in an embodiment of the present invention receives multiple data access requests that terminal is sent;Obtain multiple numbers
The access data carried respectively according to access request;Acquired access data are put into and are merged in set of queues;It generates and merges queue
The corresponding data result of each access data stored in group.As it can be seen that the technical solution provided through the embodiment of the present invention, service
Device can concurrently handle multiple data access requests, such rather than the relevant technologies, and server can only handle a number simultaneously
According to access request, to improve the efficiency of server process data access request, and server resource is rationally utilized, reduces
The waste of server resource.
The embodiment of the invention also provides a kind of request processing methods, as shown in figure 3, the method may include:
S310 receives multiple data access requests that terminal is sent.
S320 obtains the access data that multiple data access requests carry respectively.
S330 generates the Data Identification of acquired access data, wherein the Data Identification of any access data is to be based on
It receives generated at the time of the data access request for carrying the access data.
The Data Identification of acquired access data and acquired access data is put into and merges in set of queues by S340.
Wherein, the step S310-S320 in embodiment illustrated in fig. 3 and the step S110-S120 phase in embodiment illustrated in fig. 1
Together, therefore, no longer step S310-S320 is repeated herein.Step S330-S340 and Fig. 2 institute in embodiment illustrated in fig. 3
Show that the step S230-S240 in embodiment is identical, therefore, no longer step S330-S340 is repeated herein.
S350, judges whether the quantity for merging the access data stored in set of queues is greater than preset quantity;If it is, executing
It is default to judge whether the quantity for merging the access data stored in set of queues is greater than if it has not, executing step S370 by step S360
Quantity;If the quantity for merging the access data stored in set of queues is greater than preset quantity, step S360 is executed, if the conjunction
And the quantity for the access data stored in set of queues is less than preset quantity, executes step S380.
Primary at most processing preset quantity access data can be set in server, wherein server can be according to reality
Need to be arranged the size of the preset quantity.Specifically, if server needs to improve the efficiency of response data access request, that
, the lesser preset quantity of numerical value can be set in server;If server needs while responding multiple data access and ask
It asks, then, the biggish preset quantity of numerical value can be set in server.The embodiment of the present invention does not do the size of preset quantity
It is specific to limit.
Also, if it is judged that the quantity for merging the access data stored in set of queues is greater than preset quantity, illustrate to service
Therefore device cannot handle the access data for merging and storing in set of queues simultaneously can execute step S360;Similarly, if sentenced
The disconnected quantity for merging the access data stored in set of queues out is less than preset quantity, illustrates that server can be handled simultaneously and merges team
The access data stored in column group, still, in practical applications, server, can for the more efficient resource using its own
Not to be immediately performed step S380, but step S370 is executed, judges that the quantity for merging the access data stored in set of queues is
It is no to be greater than preset quantity;If the quantity for merging the access data stored in set of queues is greater than preset quantity, step is executed
S360 executes step S380 if the quantity for merging the access data stored in set of queues is less than preset quantity.
Wherein, the size of preset time can be set according to the actual situation, for example, the size of the preset time can be with
It is 10 milliseconds, the embodiment of the present invention is not specifically limited the size of preset time.
S360 is generated and is merged store in set of queues, the corresponding data result of preset quantity access data.
Server, which can be chosen, merges store in set of queues, preset quantity access data, and generates these access number
According to corresponding data result.
In one embodiment, it generates and merges store in set of queues, the corresponding data of preset quantity access data
As a result the step of may include:
Based on the Data Identification for merging each access data stored in set of queues, determined from the merging set of queues pre-
If quantity target access data;
Generate the corresponding data result of target access data.
In this embodiment, since the Data Identification of any access data is to be based on receiving carrying the access data
Data access request at the time of it is generated, that is to say, that the Data Identification of each access data merged in set of queues can
At the time of reaching server to characterize the corresponding data access request of each access data.The data access for first reaching server is asked
It asks, corresponding access data, which are also introduced into, to be merged in set of queues, according to the original for the first in first out for merging set of queues processing data
Then, it can determine that preset quantity is introduced into the access data of merging set of queues in set of queues from merging, and generate this present count
Amount is introduced into the data result for merging the access data of set of queues.
S380 generates the corresponding data result of each access data for merging and storing in set of queues.
Quantity due to merging the access data stored in set of queues is less than preset quantity, illustrates that server can be located simultaneously
Reason merges the access data stored in set of queues, and therefore, each access number for merging and storing in set of queues can be generated in server
According to corresponding data result.
Technical solution provided in an embodiment of the present invention receives multiple data access requests that terminal is sent;Obtain multiple numbers
The access data carried respectively according to access request;Acquired access data are put into and are merged in set of queues;It generates and merges queue
The corresponding data result of each access data stored in group.As it can be seen that the technical solution provided through the embodiment of the present invention, service
Device can concurrently handle multiple data access requests, such rather than the relevant technologies, and server can only handle a number simultaneously
According to access request, to improve the efficiency of server process data access request, and server resource is rationally utilized, reduces
The waste of server resource.
In order to which scheme description is clear and scheme is complete, the embodiment of the present invention is provided below in conjunction with specific example
Request processing method be described in detail.
It is assumed that the application scenarios of the specific example are machine translation.As shown in figure 4, can be to there are three user terminal
Request receives server and sends data access request, these three user terminals are respectively as follows: user terminal 1, user terminal 2 and user
Terminal 3.Wherein, user terminal 1 receives server to request and sends data access request 1;User terminal 2 receives service to request
Device sends data access request 2;User terminal 3 receives server to request and sends data access request 3.
Request receive server after receiving three data access requests, can extract respectively data access request 1,
The access data that data access request 2 and data access request 3 carry, and be respectively that these three access data generate data mark
Know.The access data that data access request 1 carries are a word, and the Data Identification of the word is Data Identification 1;Data access request
The 2 access data carried are a sentence, and the Data Identification of the sentence is Data Identification 2;The access that data access request 3 carries
Data are one section of word, and the Data Identification of this section words is Data Identification 3.
Request receives server for word and Data Identification 1;Sentence and Data Identification 2;One section of word is put respectively with Data Identification 2
Enter into the merging set of queues merged in server;
Processing result storage server can receive server from acquisition Data Identification 1, Data Identification 2 and data to request
Mark 3.
Merge server and the word, sentence and the one section of word that merge in set of queues are sent to batch processing server.At batch
After reason server receives word, sentence and one section of word, word, sentence and one section of word can be translated simultaneously.
Specifically, the process of bulk service device translation word can be with are as follows: encode word, i.e., convert vector for word;Through
Neural network is crossed to be decoded vector to get the corresponding translation of word is arrived.
The process of bulk service device translation of the sentence can be with are as follows: encodes sentence, i.e., converts vector for sentence;By
Vector is decoded to arrive the corresponding translation of sentence by neural network.
The process that bulk service device translates one section of word can be with are as follows: each sentence in this section words encoded, i.e., it will be every
A sentence is converted into a vector;And obtained each vector composition matrix will be converted, matrix is carried out by neural network
Decoding talks about corresponding translation to get to the section.Alternatively, the process that bulk service device translates one section of word can be with are as follows: directly to this
Section words are encoded, i.e., convert a vector for the short words;The vector is decoded by neural network, obtains this section words
Corresponding translation.For example, one section of word includes 5 words, and bulk service device, can be by this 5 word point when translating this section words
It is not converted into a vector to get to 5 vectors, this 5 vectors is then formed into a matrix, and by neural network to this
Matrix is decoded, it can is obtained this section and is talked about corresponding translation.
Bulk service device, can after obtaining the corresponding translation of word, the corresponding translation of sentence and the corresponding translation of one section of word
The corresponding translation of word, the corresponding translation of sentence and the corresponding translation of one section of word are sent to processing result storage service
Device.Processing result storage server can be by the storage corresponding with Data Identification 1 of the corresponding translation of word;By the corresponding translation of sentence with
The corresponding storage of Data Identification 2;By the storage corresponding with Data Identification 3 of the corresponding translation of one section of word.
The corresponding translation of word can be sent to request and receive server by processing result storage server, and then request to receive
The corresponding translation of word can be sent to the user terminal 1 by server;Similarly, processing result storage server can also be by sentence
Corresponding translation sends request and receives server, and then reception server is requested the corresponding translation of sentence can be sent to user
Terminal 2;The corresponding translation of one section of word can also be sent request and receive server by processing result storage server, and then request to connect
Receiving server can be sent to the corresponding translation of one section of word to user terminal 3.To user terminal 1, user terminal 2 and use
Family terminal 3 can quickly obtain corresponding translation.
Certainly, in practical applications, processing result storage server can be actively corresponding by the corresponding translation of word, sentence
Translation and the corresponding translation of one section of word are sent to request and receive server.Alternatively, request reception server can also be actively to place
It manages result storage server and sends inquiry request, Data Identification can be carried in the inquiry request;Processing result storage server
After receiving the inquiry request, processing result corresponding with Data Identification can be sent to request and receive server, and then asked
Ask reception server processing result can be sent to target terminal user.For example, the data mark carried in inquiry request
Knowing is Data Identification 1, then, the corresponding translation of word is sent to request and receives server by processing result storage server, in turn
Request receives server and the corresponding translation of word is sent to the user terminal 1.
Second aspect, the embodiment of the invention also provides a kind of request processing units, as shown in figure 5, described device includes:
Request receiving module 510, for receiving multiple data access requests of terminal transmission;
Data acquisition module 520, the access data carried respectively for obtaining the multiple data access request;
Data storage module 530 merges in set of queues for being put into acquired access data;
Result-generation module 540, for generating the corresponding data of each access data stored in the merging set of queues
As a result.
Technical solution provided in an embodiment of the present invention receives multiple data access requests that terminal is sent;Obtain multiple numbers
The access data carried respectively according to access request;Acquired access data are put into and are merged in set of queues;It generates and merges queue
The corresponding data result of each access data stored in group.As it can be seen that the technical solution provided through the embodiment of the present invention, service
Device can concurrently handle multiple data access requests, such rather than the relevant technologies, and server can only handle a number simultaneously
According to access request, to improve the efficiency of server process data access request, and server resource is rationally utilized, reduces
The waste of server resource.
Optionally, described device further include:
Identifier generation module, for obtaining what the multiple data access request carried respectively in the data acquisition module
After accessing data, the Data Identification of acquired access data is generated, wherein the Data Identification of any access data is to be based on
It receives generated at the time of the data access request for carrying the access data;
Correspondingly, the data storage module, is specifically used for:
The Data Identification of acquired access data and acquired access data is put into and is merged in set of queues.
Optionally, described device includes:
Quantity judgment module, for generating each access stored in the merging set of queues in the result-generation module
Before the corresponding data result of data, judge whether the quantity for the access data stored in the merging set of queues is greater than present count
Amount;
If the judging result of quantity judgment module be it is yes, trigger the result-generation module and generate in the merging set of queues
Storage, described preset quantity accesses the corresponding data result of data;
If the judging result of quantity judgment module be it is no, after preset time, trigger the quantity judgment module and sentence again
Whether the quantity for the access data stored in the merging set of queues of breaking is greater than preset quantity, if storing in the merging set of queues
The quantity of access data be greater than preset quantity, trigger the result-generation module and execute to generate and stored in the merging set of queues
, the preset quantity access data corresponding data result the step of;If described merge the access number stored in set of queues
According to quantity be less than preset quantity, trigger the result-generation module and execute generating each visit for merging and storing in set of queues
The step of asking data corresponding data result.
Optionally, the result-generation module, is specifically used for:
Based on the Data Identification for each access data stored in the merging set of queues, from the merging set of queues really
Determine preset quantity target access data;
Generate the corresponding data result of the target access data.
Optionally, described device further include:
As a result sending module, for generating each access stored in the merging set of queues in the result-generation module
After the corresponding data result of data, for the corresponding data result of each access data, the corresponding number of the data result is determined
According to mark;And the data result is sent to target terminal, the target terminal is to send data corresponding with the Data Identification
The terminal of request.
The third aspect, the embodiment of the invention also provides a kind of servers, as shown in fig. 6, including processor 601, communication
Interface 602, memory 603 and communication bus 604, wherein processor 601, communication interface 602, memory 603 are total by communication
Line 604 completes mutual communication,
Memory 603, for storing computer program;
Processor 601 when for executing the program stored on memory 603, is realized at request described in first aspect
Reason method.
The communication bus that above-mentioned server is mentioned can be Peripheral Component Interconnect standard (Peripheral Component
Interconnect, PCI) bus or expanding the industrial standard structure (Extended Industry Standard
Architecture, EISA) bus etc..The communication bus can be divided into address bus, data/address bus, control bus etc..For just
It is only indicated with a thick line in expression, figure, it is not intended that an only bus or a type of bus.
Communication interface is for the communication between above-mentioned server and other equipment.
Memory may include random access memory (Random Access Memory, RAM), also may include non-easy
The property lost memory (Non-Volatile Memory, NVM), for example, at least a magnetic disk storage.Optionally, memory may be used also
To be storage device that at least one is located remotely from aforementioned processor.
Above-mentioned processor can be general processor, including central processing unit (Central Processing Unit,
CPU), network processing unit (Network Processor, NP) etc.;It can also be digital signal processor (Digital Signal
Processing, DSP), it is specific integrated circuit (Application Specific Integrated Circuit, ASIC), existing
It is field programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic device, discrete
Door or transistor logic, discrete hardware components.
Technical solution provided in an embodiment of the present invention receives multiple data access requests that terminal is sent;Obtain multiple numbers
The access data carried respectively according to access request;Acquired access data are put into and are merged in set of queues;It generates and merges queue
The corresponding data result of each access data stored in group.As it can be seen that the technical solution provided through the embodiment of the present invention, service
Device can concurrently handle multiple data access requests, such rather than the relevant technologies, and server can only handle a number simultaneously
According to access request, to improve the efficiency of server process data access request, and server resource is rationally utilized, reduces
The waste of server resource.
Fourth aspect, the embodiment of the invention provides a kind of computer readable storage medium, the computer-readable storage
Dielectric memory contains computer program, and the processing of request described in first aspect is realized when the computer program is executed by processor
Method.
Technical solution provided in an embodiment of the present invention receives multiple data access requests that terminal is sent;Obtain multiple numbers
The access data carried respectively according to access request;Acquired access data are put into and are merged in set of queues;It generates and merges queue
The corresponding data result of each access data stored in group.As it can be seen that the technical solution provided through the embodiment of the present invention, service
Device can concurrently handle multiple data access requests, such rather than the relevant technologies, and server can only handle a number simultaneously
According to access request, to improve the efficiency of server process data access request, and server resource is rationally utilized, reduces
The waste of server resource.
It should be noted that, in this document, relational terms such as first and second and the like are used merely to a reality
Body or operation are distinguished with another entity or operation, are deposited without necessarily requiring or implying between these entities or operation
In any actual relationship or order or sequence.Moreover, the terms "include", "comprise" or its any other variant are intended to
Non-exclusive inclusion, so that the process, method, article or equipment including a series of elements is not only wanted including those
Element, but also including other elements that are not explicitly listed, or further include for this process, method, article or equipment
Intrinsic element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that
There is also other identical elements in process, method, article or equipment including the element.
Each embodiment in this specification is all made of relevant mode and describes, same and similar portion between each embodiment
Dividing may refer to each other, and each embodiment focuses on the differences from other embodiments.Especially for device,
For server, storage medium embodiment, since it is substantially similar to the method embodiment, so be described relatively simple, it is related
Place illustrates referring to the part of embodiment of the method.
The foregoing is merely illustrative of the preferred embodiments of the present invention, is not intended to limit the scope of the present invention.It is all
Any modification, equivalent replacement, improvement and so within the spirit and principles in the present invention, are all contained in protection scope of the present invention
It is interior.
Claims (12)
1. a kind of request processing method, which is characterized in that be applied to server, which comprises
Receive multiple data access requests that terminal is sent;
Obtain the access data that the multiple data access request carries respectively;
Acquired access data are put into and are merged in set of queues;
Generate the corresponding data result of each access data stored in the merging set of queues.
2. the method according to claim 1, wherein being taken respectively in the multiple data access request of acquisition
After the step of access data of band, the method also includes:
Generate the Data Identification of acquired access data, wherein the Data Identification of any access data is to be based on receiving taking
It is generated at the time of data access request with the access data;
Correspondingly, described be put into acquired access data the step merged in set of queues, comprising:
The Data Identification of acquired access data and acquired access data is put into and is merged in set of queues.
3. according to the method described in claim 2, it is characterized in that, being stored in the generation merging set of queues each
Before the step of accessing data corresponding data result, the method also includes:
Judge whether the quantity for the access data stored in the merging set of queues is greater than preset quantity;
If it is, generating the corresponding data result of the preset quantity access data store in the merging set of queues, described;
If it has not, judging whether the quantity for the access data stored in the merging set of queues is greater than again after preset time
Preset quantity executes if the quantity for merging the access data stored in set of queues is greater than preset quantity and generates the merging
The step of preset quantity stored in set of queues, described access data corresponding data result;If in the merging set of queues
The quantity of the access data of storage is less than preset quantity, executes and generates each access data pair for merging and storing in set of queues
The step of data result answered.
4. according to the method described in claim 3, it is characterized in that, it is described generate it is described merge set of queues in store, it is described
Preset quantity accesses the step of data corresponding data result, comprising:
Based on the Data Identification for each access data stored in the merging set of queues, determined from the merging set of queues pre-
If quantity target access data;
Generate the corresponding data result of the target access data.
5. according to the method described in claim 2, it is characterized in that, being stored in the generation merging set of queues each
After the step of accessing data corresponding data result, the method also includes:
For the corresponding data result of each access data, the corresponding Data Identification of the data result is determined;And by the data knot
Fruit is sent to target terminal, and the target terminal is the terminal for sending request of data corresponding with the Data Identification.
6. a kind of request processing unit, which is characterized in that described device includes:
Request receiving module, for receiving multiple data access requests of terminal transmission;
Data acquisition module, the access data carried respectively for obtaining the multiple data access request;
Data storage module merges in set of queues for being put into acquired access data;
Result-generation module, for generating the corresponding data result of each access data stored in the merging set of queues.
7. device according to claim 6, which is characterized in that described device further include:
Identifier generation module, for obtaining the access that the multiple data access request carries respectively in the data acquisition module
After data, the Data Identification of acquired access data is generated, wherein the Data Identification of any access data is based on reception
It is generated at the time of to the data access request for carrying the access data;
Correspondingly, the data storage module, is specifically used for:
The Data Identification of acquired access data and acquired access data is put into and is merged in set of queues.
8. device according to claim 7, which is characterized in that described device further include:
Quantity judgment module, for generating each access data stored in the merging set of queues in the result-generation module
Before corresponding data result, judge whether the quantity for the access data stored in the merging set of queues is greater than preset quantity;
If the judging result of quantity judgment module be it is yes, trigger the result-generation module and generate and stored in the merging set of queues
, the corresponding data result of the preset quantity access data;
If the judging result of quantity judgment module be it is no, after preset time, trigger the quantity judgment module and judge institute again
Whether the quantity for stating the access data stored in merging set of queues is greater than preset quantity, if described merge the visit stored in set of queues
Ask that the quantity of data is greater than preset quantity, trigger the result-generation module execute generate it is described merge it is being stored in set of queues,
The step of preset quantity access data corresponding data result;If the access data stored in the merging set of queues
Quantity is less than preset quantity, triggers the result-generation module and executes each access number for generating and storing in the merging set of queues
The step of according to corresponding data result.
9. device according to claim 8, which is characterized in that the result-generation module is specifically used for:
Based on the Data Identification for each access data stored in the merging set of queues, determined from the merging set of queues pre-
If quantity target access data;
Generate the corresponding data result of the target access data.
10. device according to claim 7, which is characterized in that described device further include:
As a result sending module, for generating each access data stored in the merging set of queues in the result-generation module
After corresponding data result, for the corresponding data result of each access data, the corresponding data mark of the data result is determined
Know;And the data result is sent to target terminal, the target terminal is to send request of data corresponding with the Data Identification
Terminal.
11. a kind of server, which is characterized in that including processor, communication interface, memory and communication bus, wherein processing
Device, communication interface, memory complete mutual communication by communication bus;
Memory, for storing computer program;
Processor when for executing the program stored on memory, realizes any method and step of claim 1-5.
12. a kind of computer readable storage medium, which is characterized in that be stored with computer in the computer readable storage medium
Program realizes claim 1-5 any method and step when the computer program is executed by processor.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811575054.5A CN109617974B (en) | 2018-12-21 | 2018-12-21 | Request processing method and device and server |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811575054.5A CN109617974B (en) | 2018-12-21 | 2018-12-21 | Request processing method and device and server |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109617974A true CN109617974A (en) | 2019-04-12 |
CN109617974B CN109617974B (en) | 2021-12-28 |
Family
ID=66011036
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811575054.5A Active CN109617974B (en) | 2018-12-21 | 2018-12-21 | Request processing method and device and server |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109617974B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112131021A (en) * | 2020-09-21 | 2020-12-25 | 上海博泰悦臻电子设备制造有限公司 | Access request processing method and device |
Citations (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6345243B1 (en) * | 1998-05-27 | 2002-02-05 | Lionbridge Technologies, Inc. | System, method, and product for dynamically propagating translations in a translation-memory system |
US20030185227A1 (en) * | 2002-03-29 | 2003-10-02 | International Business Machines Corporation | Secondary queue for sequential processing of related queue elements |
US20090234635A1 (en) * | 2007-06-29 | 2009-09-17 | Vipul Bhatt | Voice Entry Controller operative with one or more Translation Resources |
CN103810159A (en) * | 2012-11-14 | 2014-05-21 | 阿里巴巴集团控股有限公司 | Machine translation data processing method, system and terminal |
US20140362697A1 (en) * | 2013-06-06 | 2014-12-11 | Christophe DESNOYER | Process for managing a queue of data |
CN105162837A (en) * | 2015-07-30 | 2015-12-16 | 四川长虹电器股份有限公司 | Method and system for improving I/O throughput rate in massive data storage environment |
CN105282244A (en) * | 2015-09-29 | 2016-01-27 | 华为技术有限公司 | Data processing method and device, server and controller |
WO2016206336A1 (en) * | 2015-06-25 | 2016-12-29 | 武汉传神信息技术有限公司 | File extraction and restoration method favorable for translation work |
CN106657193A (en) * | 2015-11-02 | 2017-05-10 | 腾讯科技(深圳)有限公司 | Request processing method, request processing device, terminal device and server |
CN107066463A (en) * | 2016-10-28 | 2017-08-18 | 阿里巴巴集团控股有限公司 | Data processing method, device and server |
CN107872398A (en) * | 2017-06-25 | 2018-04-03 | 平安科技(深圳)有限公司 | High concurrent data processing method, device and computer-readable recording medium |
CN108965365A (en) * | 2017-05-27 | 2018-12-07 | 腾讯科技(北京)有限公司 | A kind of data processing method and terminal, computer storage medium |
-
2018
- 2018-12-21 CN CN201811575054.5A patent/CN109617974B/en active Active
Patent Citations (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6345243B1 (en) * | 1998-05-27 | 2002-02-05 | Lionbridge Technologies, Inc. | System, method, and product for dynamically propagating translations in a translation-memory system |
US20030185227A1 (en) * | 2002-03-29 | 2003-10-02 | International Business Machines Corporation | Secondary queue for sequential processing of related queue elements |
US20090234635A1 (en) * | 2007-06-29 | 2009-09-17 | Vipul Bhatt | Voice Entry Controller operative with one or more Translation Resources |
CN103810159A (en) * | 2012-11-14 | 2014-05-21 | 阿里巴巴集团控股有限公司 | Machine translation data processing method, system and terminal |
US20140362697A1 (en) * | 2013-06-06 | 2014-12-11 | Christophe DESNOYER | Process for managing a queue of data |
WO2016206336A1 (en) * | 2015-06-25 | 2016-12-29 | 武汉传神信息技术有限公司 | File extraction and restoration method favorable for translation work |
CN105162837A (en) * | 2015-07-30 | 2015-12-16 | 四川长虹电器股份有限公司 | Method and system for improving I/O throughput rate in massive data storage environment |
CN105282244A (en) * | 2015-09-29 | 2016-01-27 | 华为技术有限公司 | Data processing method and device, server and controller |
CN106657193A (en) * | 2015-11-02 | 2017-05-10 | 腾讯科技(深圳)有限公司 | Request processing method, request processing device, terminal device and server |
CN107066463A (en) * | 2016-10-28 | 2017-08-18 | 阿里巴巴集团控股有限公司 | Data processing method, device and server |
CN108965365A (en) * | 2017-05-27 | 2018-12-07 | 腾讯科技(北京)有限公司 | A kind of data processing method and terminal, computer storage medium |
CN107872398A (en) * | 2017-06-25 | 2018-04-03 | 平安科技(深圳)有限公司 | High concurrent data processing method, device and computer-readable recording medium |
Non-Patent Citations (1)
Title |
---|
孙加东等: "基于结构对齐的统计机器翻译模型", 《通信学报》 * |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112131021A (en) * | 2020-09-21 | 2020-12-25 | 上海博泰悦臻电子设备制造有限公司 | Access request processing method and device |
CN112131021B (en) * | 2020-09-21 | 2024-01-12 | 博泰车联网科技(上海)股份有限公司 | Access request processing method and device |
Also Published As
Publication number | Publication date |
---|---|
CN109617974B (en) | 2021-12-28 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108881448B (en) | API request processing method and device | |
JP6626211B2 (en) | Method and apparatus for processing short link and short link server | |
KR20220079958A (en) | Blockchain message processing method and device, computer and readable storage medium | |
KR20210065959A (en) | Methods and devices for discovering analytical functions | |
CN105337786B (en) | A kind of server performance detection method, device and equipment | |
CN111432158B (en) | Load balancing method and device for media nodes, storage medium and electronic device | |
CN105897888B (en) | Client connection method and system | |
CN110830564A (en) | CDN scheduling method, device, system and computer readable storage medium | |
US20170171147A1 (en) | Method and electronic device for implementing domain name system | |
CN104618388B (en) | Fast registration login method and corresponding resetting server, information server | |
WO2019019676A1 (en) | Service number assigning method and device, computer apparatus, and storage medium | |
CN110311855B (en) | User message processing method and device, electronic equipment and storage medium | |
CN111859127A (en) | Subscription method and device of consumption data and storage medium | |
CN102970391B (en) | Inquiry of the domain name processing method, server and system | |
CN113453025A (en) | Data acquisition method and device | |
CN111190727A (en) | Asynchronous memory destructuring method and device, computer equipment and storage medium | |
US20190158584A1 (en) | Load balancing method and related apparatus | |
CN102859970A (en) | Values represented as internet protocol addresses | |
CN109617974A (en) | A kind of request processing method, device and server | |
CN110708293B (en) | Method and device for distributing multimedia service | |
CN112398845A (en) | Data transmission method, data transmission device, data transmission system and electronic equipment | |
CN109493304A (en) | A kind of image processing method and device | |
CN113596105B (en) | Content acquisition method, edge node and computer readable storage medium | |
CN107277088B (en) | High-concurrency service request processing system and method | |
US20190311143A1 (en) | System for monitoring and extracting public information which belongs to users registered on social networks and which is stored on servers and data clouds of social networks |
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 |