CN106953857B - Server-side multithread management method based on CS framework - Google Patents

Server-side multithread management method based on CS framework Download PDF

Info

Publication number
CN106953857B
CN106953857B CN201710157658.7A CN201710157658A CN106953857B CN 106953857 B CN106953857 B CN 106953857B CN 201710157658 A CN201710157658 A CN 201710157658A CN 106953857 B CN106953857 B CN 106953857B
Authority
CN
China
Prior art keywords
request
correspondingly
server
currently
classification
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.)
Active
Application number
CN201710157658.7A
Other languages
Chinese (zh)
Other versions
CN106953857A (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.)
Zhengzhou Yunhai Information Technology Co Ltd
Original Assignee
Zhengzhou Yunhai 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 Zhengzhou Yunhai Information Technology Co Ltd filed Critical Zhengzhou Yunhai Information Technology Co Ltd
Priority to CN201710157658.7A priority Critical patent/CN106953857B/en
Publication of CN106953857A publication Critical patent/CN106953857A/en
Application granted granted Critical
Publication of CN106953857B publication Critical patent/CN106953857B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/22Parsing or analysis of headers
    • 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/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • G06F9/5033Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering data affinity
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/50Indexing scheme relating to G06F9/50
    • G06F2209/5015Service provider selection

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer And Data Communications (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention provides a server-side multithread management method based on a CS framework, which comprises the following steps: A. acquiring request information sent by each client in real time; B. judging and dividing the request mode classification of each request message currently acquired in the step A; C. b, based on the classification of the request modes obtained by current division in the step B, correspondingly calling a preset corresponding thread to execute corresponding services, and correspondingly obtaining the processing results corresponding to the classification of the request modes obtained by current division in the step B; D. and correspondingly returning the corresponding processing results to the clients in the step A. The request information comprises a header protocol and a data packet. And step B, correspondingly judging the request mode classification corresponding to each request message currently acquired in the dividing step A based on the header protocol of each request message currently acquired in the step A. The invention can improve the running speed of the server and the convenience of the service expansion of the server.

Description

Server-side multithread management method based on CS framework
Technical Field
The invention relates to the technical field of computers, in particular to a server-side multithread management method based on a CS (circuit switched) architecture.
Background
Under a CS (Client/Server) architecture, if a Server (Server) needs to implement different tasks, multiple processes need to be started to respectively correspond to respective services, that is, there is a multi-thread processing at the Server, which is mainly used for processing respective request information sent by different clients, and in the prior art, different threads are usually started to respectively correspondingly process requests sent by different clients, and there is a case of starting a multi-thread processing on the same request sent by different clients, which affects the operation rate of the Server to a certain extent, and further prolongs the response time of the request to the Client to a certain extent.
In addition, in the prior art, a multithreading management scheme is provided, but the service of the server side is difficult to expand, namely if the service is added to the server side, the process is complicated, the expansion is troublesome, and once the expansion is finished, the codes are bloated.
This is a disadvantage of the prior art.
Disclosure of Invention
The technical problem to be solved by the present invention is to provide a server-side multithread management method based on a CS architecture, aiming at the defects of the prior art, so as to improve the running speed of the server side. The invention is also used for improving the convenience of the server-side service expansion.
In order to solve the technical problem, the invention provides a server-side multithread management method based on a CS framework, which comprises the following steps of;
A. acquiring request information sent by each client in real time;
B. judging and dividing the request mode classification of each request message currently acquired in the step A;
C. b, based on the classification of the request modes obtained by current division in the step B, correspondingly calling a preset corresponding thread to execute corresponding services, and correspondingly obtaining the processing results corresponding to the classification of the request modes obtained by current division in the step B;
D. and correspondingly returning the corresponding processing results currently obtained in the step C to the clients corresponding to the clients in the step A.
And B, correspondingly judging the request mode classification corresponding to the request information currently acquired in the step A based on the request information currently acquired in the step A.
Wherein, the request information comprises a header protocol and a data packet.
The method for correspondingly determining the request mode classification corresponding to each request message currently acquired in the dividing step A in the step B comprises the following steps:
p1, analyzing each request message obtained currently in step A in real time, and correspondingly obtaining the header protocol of each request message obtained currently;
p2, comparing the header protocols correspondingly obtained in the step p1 with the header protocols in the preset header protocol group, and judging the request mode classification of each request message currently obtained in the step A according to the comparison result.
Wherein, the header protocol comprises: and at least one of POST, GET and CMD.
The data packet comprises request data information and an IP port value of a client corresponding to the current data packet.
And step D, correspondingly returning the corresponding processing results currently obtained in step C to each client in step a based on the IP port value in each request message currently sent in step a.
Compared with the prior art, the invention has the advantages that:
(1) the server-side multithread management method based on the CS framework carries out request mode classification processing on each request message currently received by the server side, then classifies each currently acquired request mode, and correspondingly calls the preset corresponding thread to execute the corresponding service, thereby avoiding the occurrence of the condition that the multithread processing is required to start the same request sent by different clients, further improving the running speed of the server side to a certain extent and further shortening the response time to the client request to a certain extent;
(2) when the system is used, the head protocols of the currently acquired request information which are analyzed in real time are compared with the head protocols in a preset head protocol group, the request mode classification of the currently acquired request information is judged according to the comparison result, and then the corresponding preset threads are correspondingly called to execute corresponding services based on the currently acquired request mode classification, so that the system is convenient for the server side to manage the multithreading of the server side, is convenient for the server side to add new services, and is more practical;
(3) the invention carries out multithread management based on the request information sent by the client and is irrelevant to the design platform, thus breaking the requirement on the design platform, being convenient for cross-platform use and being more practical.
Therefore, compared with the prior art, the invention has prominent substantive features and remarkable progress, and the beneficial effects of the implementation are also obvious.
Drawings
FIG. 1 is a schematic diagram of a method flow chart of a server-side multithread management method based on a CS framework according to the present invention;
fig. 2 is a diagram illustrating a specific correspondence between request information and corresponding thread execution corresponding services according to the present invention.
Detailed Description
In order to make the technical solutions and advantages of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings.
Embodiment mode 1:
as shown in fig. 1, the server-side multithread management method based on the CS architecture of the present invention includes steps;
A. acquiring request information sent by each client in real time;
B. judging and dividing the request mode classification of each request message currently acquired in the step A;
C. b, based on the classification of the request modes obtained by current division in the step B, correspondingly calling a preset corresponding thread to execute corresponding services, and correspondingly obtaining the processing results corresponding to the classification of the request modes obtained by current division in the step B;
D. and correspondingly returning the corresponding processing results currently obtained in the step C to the clients corresponding to the clients in the step A.
For more clearly explaining the present invention, 5 request information is sent from 5 clients (client 1, client 2, client 3, client 4 and client 5) as an example, as shown in fig. 2, each client sends one request information, which is correspondingly marked as request information 1, request information 2, request information 3, request information 4 and request information 5, wherein request information 1 corresponds to request type classification 1, request information 2 corresponds to request type classification 2, request information 3 and request information 5 correspond to request type classification 3, request information 4 corresponds to request type classification 4, and request type classification 1, request type classification 2, request type classification 3 and request type classification 4 each correspond to a corresponding thread service; the request mode classification 1, the request mode classification 2, the request mode classification 3 and the request mode classification 4 are different, and corresponding thread services are different. Based on fig. 2, the present invention performs request type classification processing on each request information 1, 2, 3, 4, and 5 currently received by the server, then correspondingly invokes a preset corresponding thread to execute a corresponding service for each currently acquired request type classification 1, 2, 3, and 4, correspondingly acquires a respective processing result corresponding to each request type classification 1, 2, 3, and 4 obtained by current division, and finally returns the corresponding processing result to each corresponding client.
In summary, the present invention classifies the request modes of the request information currently received by the server, then classifies the currently obtained request modes, and correspondingly invokes the preset corresponding threads to execute the corresponding services, which avoids the occurrence of the situation that the same request sent by different clients needs to be processed by starting multiple threads, improves the operation rate of the server to a certain extent, and further reduces the response time to the client request to a certain extent.
In this embodiment, the step B determines, based on each request information currently acquired in the step a, a request type classification corresponding to each request information currently acquired in the dividing step a; the request information comprises a header protocol and a data packet. In this embodiment, the header protocol includes POST, GET, and CMD, and the packet includes request data information and an IP port value of a client corresponding to the current packet.
The method for correspondingly determining the request mode classification corresponding to each request message currently acquired in the dividing step A in the step B comprises the following steps: p1, analyzing each request message obtained currently in step A in real time, and correspondingly obtaining the header protocol of each request message obtained currently; p2, comparing the header protocols correspondingly obtained in the step p1 with the header protocols in the preset header protocol group, and judging the request mode classification of each request message currently obtained in the step A according to the comparison result. And as for the comparison result, each request message which is the same as the corresponding head protocol in the preset head protocol group corresponds to the same request mode classification, and the corresponding request mode is classified as the corresponding head protocol.
In summary, each request message described in the present invention adopts a data structure including a header protocol and a data packet, and compares the header protocol of each request message obtained in real time with each header protocol in a preset header protocol group, and determines the request mode classification of each request message obtained at present according to the comparison result, and then calls a corresponding preset thread to execute a corresponding service based on each request mode classification obtained at present, which is convenient for the server to manage its multiple threads, and is convenient for the server to add a new service, and is practical.
In addition, in this embodiment, step D returns the corresponding processing result currently obtained in step C to each client in step a based on the IP port value in each request message currently sent in step a.
In conclusion, the invention not only improves the running speed of the server to a certain extent, but also improves the convenience of the service expansion of the server to a certain extent. And is easy to implement. Is relatively practical.
In addition, the invention carries out multithread management based on the request information sent by the client and is irrelevant to the design platform, thus breaking the requirement on the design platform, being convenient for cross-platform use and being more practical.
The above embodiments are only for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may be modified or some technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.

Claims (2)

1. A server-side multithread management method based on a CS framework is characterized by comprising the following steps;
A. acquiring request information sent by each client in real time;
B. judging and dividing the request mode classification of each request message currently acquired in the step A;
C. b, based on the classification of the request modes obtained by current division in the step B, correspondingly calling a preset corresponding thread to execute corresponding services, and correspondingly obtaining the processing results corresponding to the classification of the request modes obtained by current division in the step B;
D. correspondingly returning the corresponding processing results currently obtained in the step C to the clients corresponding to the clients in the step A;
the step B correspondingly determines the request mode classification corresponding to each request information currently acquired in the dividing step a based on each request information currently acquired in the step a;
the request information comprises a header protocol and a data packet;
the method for correspondingly determining the request mode classification corresponding to each request message currently acquired in the dividing step A in the step B comprises the following steps:
p1, analyzing each request message obtained currently in step A in real time, and correspondingly obtaining the header protocol of each request message obtained currently;
p2, comparing each head protocol correspondingly obtained in the step p1 with each head protocol in a preset head protocol group, and judging the request mode classification of each request message currently obtained in the step A according to the comparison result;
wherein, the header protocol comprises at least one of POST, GET and CMD;
the data packet comprises request data information and an IP port value of a client corresponding to the current data packet.
2. The CS-architecture-based server-side multithread management method according to claim 1, wherein step D returns the corresponding processing result currently obtained in step C to each client in step a correspondingly based on the IP port value in each request message currently sent in step a.
CN201710157658.7A 2017-03-16 2017-03-16 Server-side multithread management method based on CS framework Active CN106953857B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710157658.7A CN106953857B (en) 2017-03-16 2017-03-16 Server-side multithread management method based on CS framework

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710157658.7A CN106953857B (en) 2017-03-16 2017-03-16 Server-side multithread management method based on CS framework

Publications (2)

Publication Number Publication Date
CN106953857A CN106953857A (en) 2017-07-14
CN106953857B true CN106953857B (en) 2020-03-10

Family

ID=59472478

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710157658.7A Active CN106953857B (en) 2017-03-16 2017-03-16 Server-side multithread management method based on CS framework

Country Status (1)

Country Link
CN (1) CN106953857B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106850698A (en) * 2017-04-06 2017-06-13 广东浪潮大数据研究有限公司 A kind of User space RPC agreement multithreading optimization methods and system
CN109375998B (en) * 2018-10-11 2022-07-22 上海瀚银信息技术有限公司 Processing method in high-concurrency request environment
CN112015494A (en) * 2020-08-27 2020-12-01 中国平安财产保险股份有限公司 Third-party API tool calling method, system and device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101399843A (en) * 2007-09-27 2009-04-01 中兴通讯股份有限公司 Deepened filtering method for packet
CN103763343A (en) * 2013-12-27 2014-04-30 乐视网信息技术(北京)股份有限公司 Method and device for processing service access
CN104468833A (en) * 2014-12-26 2015-03-25 北京奇虎科技有限公司 Request information unified processing method and device
CN104572290A (en) * 2013-10-11 2015-04-29 中兴通讯股份有限公司 Method and device for controlling message processing threads
CN105760234A (en) * 2016-03-17 2016-07-13 联动优势科技有限公司 Thread pool management method and device

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2023245B1 (en) * 2006-04-26 2016-02-17 Nippon Telegraph And Telephone Corporation Load control device and its method
CN101902484B (en) * 2009-05-25 2013-11-13 北京启明星辰信息技术股份有限公司 Method and system for classifying local area network http application services
CN104951357B (en) * 2014-03-28 2018-06-26 华为技术有限公司 The management method and protocol stack system of concurrent user state protocol stack
CN104133724B (en) * 2014-04-03 2015-08-19 腾讯科技(深圳)有限公司 Concurrent tasks dispatching method and device
CN104135445B (en) * 2014-07-29 2017-12-19 迈普通信技术股份有限公司 A kind of method and device of the link aggregation load balancing based on stream
CN106020954A (en) * 2016-05-13 2016-10-12 深圳市永兴元科技有限公司 Thread management method and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101399843A (en) * 2007-09-27 2009-04-01 中兴通讯股份有限公司 Deepened filtering method for packet
CN104572290A (en) * 2013-10-11 2015-04-29 中兴通讯股份有限公司 Method and device for controlling message processing threads
CN103763343A (en) * 2013-12-27 2014-04-30 乐视网信息技术(北京)股份有限公司 Method and device for processing service access
CN104468833A (en) * 2014-12-26 2015-03-25 北京奇虎科技有限公司 Request information unified processing method and device
CN105760234A (en) * 2016-03-17 2016-07-13 联动优势科技有限公司 Thread pool management method and device

Also Published As

Publication number Publication date
CN106953857A (en) 2017-07-14

Similar Documents

Publication Publication Date Title
CN106953857B (en) Server-side multithread management method based on CS framework
US9436513B2 (en) Method of SOA performance tuning
CN109218054B (en) Terminal dynamic configuration, corresponding server implementation method, device and storage medium
WO2019019652A1 (en) Push-information processing method, apparatus, computer device, and storage medium
US20140007129A1 (en) Method, apparatus and system for resource migration
US11805172B1 (en) File access service
WO2017185615A1 (en) Method for determining service status of service processing device and scheduling device
CN110868323B (en) Bandwidth control method, device, equipment and medium
WO2020034827A1 (en) Method for creating network slice, device, equipment and storage medium
CN108446300B (en) Data information scanning method and device
CN110392098B (en) Self-adaptive virtual desktop transmission method and device
CN106303563B (en) Streaming media online playing method and device, execution terminal and storage medium
US10785309B2 (en) Session monitoring method, apparatus, and system
US20220006716A1 (en) Method and managing apparatus for processing server anomalies
US10681398B1 (en) Video encoding based on viewer feedback
CN109040790B (en) Data encryption and decryption method and device and electronic equipment
CN111224891A (en) Traffic application identification system and method based on dynamic learning triples
CN109144989B (en) Data cleaning method and device
WO2017167285A1 (en) Remote-desktop video-encoding method and device
CN110471718B (en) Task processing method and device
CN112311943B (en) Data scanning optimization method, device and system and related components
CN111064636B (en) Control method, device and system for connection of front-end processor and computer equipment
CN111049779B (en) Information processing method, electronic device, and computer-readable medium
CN111159236A (en) Data processing method and device, electronic equipment and storage medium
CN107948316B (en) File synchronization method, device and equipment

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