CN104050284A - Asynchronous data query method and system based on single process - Google Patents

Asynchronous data query method and system based on single process Download PDF

Info

Publication number
CN104050284A
CN104050284A CN201410301906.7A CN201410301906A CN104050284A CN 104050284 A CN104050284 A CN 104050284A CN 201410301906 A CN201410301906 A CN 201410301906A CN 104050284 A CN104050284 A CN 104050284A
Authority
CN
China
Prior art keywords
file description
file
request
array
module
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
Application number
CN201410301906.7A
Other languages
Chinese (zh)
Other versions
CN104050284B (en
Inventor
曾召智
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Si Tech Information Technology Co Ltd
Original Assignee
Beijing Si Tech Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Si Tech Information Technology Co Ltd filed Critical Beijing Si Tech Information Technology Co Ltd
Priority to CN201410301906.7A priority Critical patent/CN104050284B/en
Publication of CN104050284A publication Critical patent/CN104050284A/en
Application granted granted Critical
Publication of CN104050284B publication Critical patent/CN104050284B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2453Query optimisation
    • G06F16/24534Query rewriting; Transformation
    • G06F16/24549Run-time optimisation

Landscapes

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

Abstract

The invention relates to an asynchronous data query method and system based on a single process. A long connection server side is established, requests sent by every client side are monitored by the server side, a file description set is defined to be used for storing file descriptions, an array is defined to be used for storing IDs and serial numbers of the file description set, the requests sent by the client sides are abstracted as a file description, the file description is put in the file description set, whether new requests are sent is judged, the IDs of the new requests are added to the array if the new requests are sent, the array is directly processed if no new request is sent, after each request is processed, information of the request is sent back to the corresponding client side, and then the ID and the corresponding serial number of the request are eliminated from the array of the server side. The IDs of the requests are put in the array in a file description set method, the array simply needs to be processed inside a program, and therefore idling wait of a communication program can be avoided, and query efficiency of the communication program is greatly improved; port resources are fully utilized, query efficiency is improved to a large extent, and consumption of system resources is reduced.

Description

A kind of data asynchronous query method and system based on one process
Technical field
The present invention relates to field of telecommunications, relate in particular to a kind of data asynchronous query method and system based on one process.
Background technology
In BOSS system, there is multiple inquiry mode: file mode, internal memory mode, database mode, different inquiries have different requirements in response speed.
Do not enter an item of expenditure in the accounts telephone expenses inquiry of telecommunications, require Query Result to return in a short period of time client, otherwise cause client to overstock, can cause and be difficult to estimate consequence, yet existing task processing method is request of the every initiation of client, service end is processed this request with regard to a newly-built subprocess, this has just caused main frame to have too much process, also has a lot of ossified processes to process, and causes main process equipment pressure larger.
Therefore, need to research and develop a kind of new inquiry mode and system, can be in the situation that consumption be tried one's best few system resource, the rapidly inquiry request of customer in response end.
Summary of the invention
Technical matters to be solved by this invention is to provide a kind of in the situation that few consume system resources of trying one's best, the rapidly querying method of customer in response end request.
The technical scheme that the present invention solves the problems of the technologies described above is as follows: a kind of asynchronous query method based on one process, comprises the steps:
Step 1: set up the long service end connecting, and the array of create a file in service end description collections and storage file description collections ID and its numbering;
Step 2: service end real-time listening client-requested, often receive that a request is abstracted into a file by request and describes;
Step 3: judge that whether file description collections is empty, if it is directly performs step 4, otherwise empties file description collections, execution step 4;
Step 4: file is described and put into file description collections, and the ID that now file description collections is corresponding and numbering thereof are deposited in array;
Step 5: according to the maximal value of file description collections ID in array, judge whether the description of file description collections changes, if changed, execution step 6; Otherwise directly perform step 7;
Step 6: detect file and describe whether added file description collections, if added, the ID of file set and numbering are added in array, execution step 7; Otherwise directly perform step 7;
Step 7: by a FOR circular treatment memory module, utilize query function to obtain Query Result, Query Result is returned to client;
Step 8: file description collections ID corresponding in array and numbering are deleted.
The invention has the beneficial effects as follows: realize one process asynchronous query, avoid communication program idle waiting, greatly improved the efficiency of the telephone expenses inquiry of not entering an item of expenditure in the accounts; Significantly improve search efficiency, reduced expending of system resource.
On the basis of technique scheme, the present invention can also do following improvement.
Further, the described array for the corresponding ID of storage file description collections and numbering can adopt chained list to replace.
Further, described inquiry request comprises client id and query contents information.
Another technical scheme that the present invention solves the problems of the technologies described above is as follows: a kind of data asynchronous query system based on one process, comprise several clients and a service end, described service end comprises request receiving module, file description collections, memory module, request processing module, result feedback module and data removing module;
Described request receiver module, the inquiry request that it sends for receiving each client, and send to file description collections for file description by inquiry request is abstract;
Described file description collections, the file of the inquiry request that it sends for storage resource request receiver module is described;
Described memory module, it is for ID corresponding to storage file description collections and numbering;
Described request processing module, it calls query function and obtains Query Result for circular treatment memory module, will inquire result feedback and return to module to result;
Described result is returned to module, and it feeds back to relative client for the result that request processing module is sent;
Described data removing module, it is for deleting processed file description collections ID and the numbering of memory module.
On the basis of technique scheme, the present invention can also do following improvement.
Further, described memory module can adopt array or chained list.
Further, described inquiry request comprises client id and query contents information.
Accompanying drawing explanation
Fig. 1 is the data asynchronous query method flow diagram of a kind of one process of the present invention;
Fig. 2 is the data asynchronous query system chart of a kind of one process of the present invention.
In accompanying drawing, the list of parts of each label representative is as follows:
100, client, 200, service end, 201 request receiving modules, 202, file description collections, 203, memory module, 204, request processing module, 205, result feedback module, 206, data removing module.
Embodiment
Below in conjunction with accompanying drawing, principle of the present invention and feature are described, example, only for explaining the present invention, is not intended to limit scope of the present invention.
As shown in Figure 1, a kind of data asynchronous query method based on one process, comprises the steps:
Step 1: set up the long service end connecting, and the array of create a file in service end description collections and storage file description collections ID and its numbering;
Step 2: service end real-time listening client-requested, often receive that a request is abstracted into a file by request and describes;
Step 3: judge that whether file description collections is empty, if it is directly performs step 4, otherwise empties file description collections, execution step 4;
Step 4: file is described and put into file description collections, and the ID that now file description collections is corresponding and numbering thereof are deposited in array;
Step 5: according to the maximal value of file description collections ID in array, judge whether the description of file description collections changes, if changed, execution step 6; Otherwise directly perform step 7;
Step 6: detect file and describe whether added file description collections, if added, the ID of file set and numbering are added in array, execution step 7; Otherwise directly perform step 7;
Step 7: by a FOR circular treatment memory module, utilize query function to obtain Query Result, Query Result is returned to client;
Step 8: file description collections ID corresponding in array and numbering are deleted.
Wherein, the described array for the corresponding ID of storage file description collections and numbering can adopt chained list to replace.
Wherein, described inquiry request comprises client id and query contents information.
As shown in Figure 2, a kind of data asynchronous query system based on one process, comprise several clients 100 and a service end 200, described service end comprises request receiving module 201, file description collections 202, memory module 203, request processing module 204, result feedback module 205 and data removing module 206;
Described request receiver module 201, the inquiry request that it sends for receiving each client, and by inquiry request abstract be that a file is described and sent to file description collections 202;
Described file description collections 202, its file sending for storage resource request receiver module 201 is described;
Described memory module 203, it is for the corresponding ID of storage file description collections and numbering;
Described request processing module 204, circular treatment memory module 203, calls and processes function and result is sent to result feedback module 204;
Described result is returned to module 205, and it feeds back to relative client for the result that request processing module 204 is sent;
Described data removing module 206, it is for deleting treated corresponding ID and the numbering of file description collections of memory module.
Wherein, described memory module 203 can adopt array or chained list.
Wherein, described inquiry request comprises client id and query contents information.
The present invention relates to a kind of asynchronous query method of one process, comprise the service end of setting up a long connection, the request sending in each client of the inner monitoring of service end, defining a file description collections describes for storage file, define an array for the numbering of storage file description collections ID and corresponding ID, the ID that client is sended over to request describes as a file, puts into file description collections.Judge whether new request, if had, the ID of newly request is added to array, otherwise circular treatment memory module, often handles after a request, information is returned to client and then in the array of service end, this request ID and reference numeral are deleted.Existing inquiry system is request of the every initiation of client, and service end is just set up a subprocess and processed this request, and this has just caused main frame to have too much process, also has a lot of ossified processes to process, and causes main process equipment pressure larger.The present invention can pass through the method for file description collections, and the ID of request is put into array, and inner only need of program processed this array, so just avoids communication program idle waiting, greatly improves the search efficiency of communication program; Make full use of port resource.Significantly improve search efficiency, reduced expending of system resource.
The foregoing is only preferred embodiment of the present invention, in order to limit the present invention, within the spirit and principles in the present invention not all, any modification of doing, be equal to replacement, improvement etc., within all should being included in protection scope of the present invention.

Claims (6)

1. the data asynchronous query method based on one process, is characterized in that, comprises the steps:
Step 1: set up the long service end connecting, and the array of create a file in service end description collections and storage file description collections ID and its numbering;
Step 2: service end real-time listening client-requested, often receive that a request is abstracted into a file by request and describes;
Step 3: judge that whether file description collections is empty, if it is directly performs step 4, otherwise empties file description collections, execution step 4;
Step 4: file is described and put into file description collections, and the ID that now file description collections is corresponding and numbering thereof are deposited in array;
Step 5: according to the maximal value of file description collections ID in array, judge whether the description of file description collections changes, if changed, execution step 6; Otherwise directly perform step 7;
Step 6: detect file and describe whether added file description collections, if added, the ID of file set and numbering are added in array, execution step 7; Otherwise directly perform step 7;
Step 7: by a FOR circular treatment memory module, utilize query function to obtain Query Result, Query Result is returned to client;
Step 8: file description collections ID corresponding in array and numbering are deleted.
2. a kind of data asynchronous query method based on one process according to claim 1, is characterized in that, the described array for the corresponding ID of storage file description collections and numbering can adopt chained list to replace.
3. a kind of data asynchronous query method based on one process according to claim 1, is characterized in that, described inquiry request comprises client id and query contents information.
4. the data asynchronous query system based on one process, it is characterized in that, comprise several clients and a service end, described service end comprises request receiving module, file description collections, memory module, request processing module, result feedback module and data removing module;
Described request receiver module, the inquiry request that it sends for receiving each client, and send to file description collections for file description by inquiry request is abstract;
Described file description collections, the file of the inquiry request that it sends for storage resource request receiver module is described;
Described memory module, it is for ID corresponding to storage file description collections and numbering;
Described request processing module, it calls query function and obtains Query Result for circular treatment memory module, will inquire result feedback and return to module to result;
Described result is returned to module, and it feeds back to relative client for the result that request processing module is sent;
Described data removing module, it is for deleting processed file description collections ID and the numbering of memory module.
5. a kind of data asynchronous query system based on one process according to claim 4, is characterized in that, described memory module can adopt array or chained list.
6. a kind of data asynchronous query system based on one process according to claim 4, is characterized in that, described inquiry request comprises client id and query contents information.
CN201410301906.7A 2014-06-27 2014-06-27 A kind of data asynchronous query method and system based on one process Active CN104050284B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410301906.7A CN104050284B (en) 2014-06-27 2014-06-27 A kind of data asynchronous query method and system based on one process

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410301906.7A CN104050284B (en) 2014-06-27 2014-06-27 A kind of data asynchronous query method and system based on one process

Publications (2)

Publication Number Publication Date
CN104050284A true CN104050284A (en) 2014-09-17
CN104050284B CN104050284B (en) 2017-11-10

Family

ID=51503116

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410301906.7A Active CN104050284B (en) 2014-06-27 2014-06-27 A kind of data asynchronous query method and system based on one process

Country Status (1)

Country Link
CN (1) CN104050284B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105391776A (en) * 2015-10-20 2016-03-09 上海斐讯数据通信技术有限公司 Communication method and system for long connection message
CN106933850A (en) * 2015-12-29 2017-07-07 阿里巴巴集团控股有限公司 Network data query method, device and system
CN112416322A (en) * 2020-11-20 2021-02-26 城云科技(中国)有限公司 Implementation method for acquiring previous data in data set according to self-circulation function

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1217538A1 (en) * 2000-12-22 2002-06-26 Sun Microsystems, Inc. Client capability detection in a client and server system
EP2259548A2 (en) * 2005-05-25 2010-12-08 Microsoft Corporation Data communication coordination with sequence numbers
CN102222071A (en) * 2010-04-16 2011-10-19 华为技术有限公司 Method, device and system for data synchronous processing
CN103051724A (en) * 2012-12-28 2013-04-17 北京思特奇信息技术股份有限公司 Socket synchronization method based on long connection
CN103064960A (en) * 2012-12-31 2013-04-24 华为技术有限公司 Method and equipment for database query
CN103442029A (en) * 2013-07-29 2013-12-11 广东电网公司电力科学研究院 Method and system for heterogeneous real-time historical database synchronization

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1217538A1 (en) * 2000-12-22 2002-06-26 Sun Microsystems, Inc. Client capability detection in a client and server system
EP2259548A2 (en) * 2005-05-25 2010-12-08 Microsoft Corporation Data communication coordination with sequence numbers
CN102222071A (en) * 2010-04-16 2011-10-19 华为技术有限公司 Method, device and system for data synchronous processing
CN103051724A (en) * 2012-12-28 2013-04-17 北京思特奇信息技术股份有限公司 Socket synchronization method based on long connection
CN103064960A (en) * 2012-12-31 2013-04-24 华为技术有限公司 Method and equipment for database query
CN103442029A (en) * 2013-07-29 2013-12-11 广东电网公司电力科学研究院 Method and system for heterogeneous real-time historical database synchronization

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105391776A (en) * 2015-10-20 2016-03-09 上海斐讯数据通信技术有限公司 Communication method and system for long connection message
CN106933850A (en) * 2015-12-29 2017-07-07 阿里巴巴集团控股有限公司 Network data query method, device and system
CN106933850B (en) * 2015-12-29 2020-08-07 阿里巴巴集团控股有限公司 Network data query method, device and system
CN112416322A (en) * 2020-11-20 2021-02-26 城云科技(中国)有限公司 Implementation method for acquiring previous data in data set according to self-circulation function

Also Published As

Publication number Publication date
CN104050284B (en) 2017-11-10

Similar Documents

Publication Publication Date Title
CN108897854B (en) Monitoring method and device for overtime task
CN105049268A (en) Distributed computing resource allocation system and task processing method
CN102916953A (en) Method and device for realizing concurrent service on basis of TCP (transmission control protocol) connection
CN101556678A (en) Processing method of batch processing services, system and service processing control equipment
CN103957246A (en) Dynamic load balancing method and system based on tenant sensing
CN101841565A (en) Database cluster system load balancing method and database cluster system
CN102902752A (en) Method and system for monitoring log
CN105491078B (en) Data processing method and device, SOA system in SOA system
CN106603711B (en) Communication method, system and message server
CN110851248A (en) Asynchronous task data processing method and device and computer readable storage medium
CN103177035A (en) Data query device and data query method in data base
CN104050284A (en) Asynchronous data query method and system based on single process
CN103810203A (en) Connection multiplexing method and connection multiplexing device for database management system
WO2023082681A1 (en) Data processing method and apparatus based on batch-stream integration, computer device, and medium
CN105512188A (en) Data connection method and data connection system
CN108881651A (en) Data processing method, device and equipment of call platform and storage medium
CN102456004A (en) Query control method and system of page data
CN105227386B (en) For dividing the method, apparatus and system of population statistics online user number
CN108259605B (en) Data calling system and method based on multiple data centers
CN105872082B (en) Fine granularity resource response system based on container cluster load-balancing algorithm
CN104850431B (en) Stabilized treatment method and apparatus based on FOTA upgrading
CN103744880B (en) A kind of DNA data managing methods and system based on cloud computing
CN106408490A (en) Active work order processing method and active work order processing apparatus
CN112099864A (en) Asynchronous data processing method and device
CN108965403A (en) O&M monitors establishment of connection method and terminal device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant