CN108228338B - A kind of view networked resources management method and system - Google Patents
A kind of view networked resources management method and system Download PDFInfo
- Publication number
- CN108228338B CN108228338B CN201611201043.1A CN201611201043A CN108228338B CN 108228338 B CN108228338 B CN 108228338B CN 201611201043 A CN201611201043 A CN 201611201043A CN 108228338 B CN108228338 B CN 108228338B
- Authority
- CN
- China
- Prior art keywords
- thread
- task
- networked terminals
- handle
- view networked
- 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5061—Partitioning or combining of resources
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
- G06F9/5027—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2209/00—Indexing scheme relating to G06F9/00
- G06F2209/50—Indexing scheme relating to G06F9/50
- G06F2209/5011—Pool
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The present invention relates to view networking technology fields to solve the problems, such as that the prior art is high to the performance requirement of server CPU and memory more particularly to a kind of view networked resources management method and system.The above method is applied in view networking, comprising: view networked server monitors communication handle queue and inactive queue of task;Above-mentioned communication handle is initialized by the MAC Address of above-mentioned view networked server and the MAC Address of view networked terminals;Above-mentioned inactive queue of task is used to cache the resource request of view networked terminals to be processed;If listening to setting event, the idle thread enabled in thread pool is worker thread, to handle above-mentioned setting event;When disconnecting depending on networked terminals, the corresponding communication handle of above-mentioned view networked terminals is recycled.The embodiment of the present invention reduces creation and destroying threads, creation and the resource overhead for destroying communication handle, therefore reduces the performance requirement to CPU and memory, while ensure that the safety of connection.
Description
Technical field
The present invention relates to view networking technology fields, more particularly to a kind of view networked resources management method and system.
Background technique
With the fast development of the network technology, enterprise is also higher and higher to the performance requirement of high-performance server, especially
It in peak period, faces ten thousand grades of users while accessing, it is more likely that the degraded performances such as cause congestion, packet loss, processing speed slow are asked
Topic.The scheme of existing high-performance server is to be requested by way of multithreading multicore to cope with a large amount of user mostly;So
And exists and require server hardware high, especially high to the performance requirement of server CPU and memory problem.
Summary of the invention
In view of the above-mentioned problem high to the performance requirement of CPU and memory, the embodiment of the present invention is proposed in order to provide one kind
Overcome the above problem or at least is partially solved a kind of view networked resources management method and system of the above problem.
To solve the above-mentioned problems, the embodiment of the invention discloses a kind of view networked resources management method, the method is answered
For regarding in networking, comprising:
Communication handle queue and inactive queue of task are monitored depending on networked server;The communication handle is joined by the view
The MAC Address initialization of the MAC Address and view networked terminals of network server;The inactive queue of task is used to cache to be processed
View networked terminals resource request;
If listening to setting event, the idle thread enabled in thread pool is worker thread, to handle the setting thing
Part;
When disconnecting depending on networked terminals, the corresponding communication handle of the view networked terminals is recycled.
Preferably, if described listen to setting event, the idle thread enabled in thread pool is worker thread, to handle
The step of setting event includes:
If listening to the resource request of corresponding view networked terminals by communication handle, a sky in thread pool is enabled
Idle thread is worker thread, and the resource request of the view networked terminals is received and parsed through by the communication handle;
By the resource request and the encapsulation of corresponding communication handle of the view networked terminals, it is medium to be put into inactive queue of task
It is to be processed;
If listening in the inactive queue of task has task arrival, enabling in thread pool idle thread is
Worker thread handles the corresponding resource request of the task by the corresponding communication handle of the task.
Preferably, described when being disconnected depending on networked terminals, recycle the corresponding communication handle of the view networked terminals
Step includes:
If requesting by the disconnection that communication handle listens to corresponding view networked terminals, a sky in thread pool is enabled
Idle thread is worker thread to handle the disconnection request;
If confirming by the disconnection that the communication handle listens to the view networked terminals, the communication handle is recycled simultaneously
It is placed in the communication handle queue.
Preferably, the method also includes:
If the connection request for receiving view networked terminals depending on networked server, enables a free time in thread pool
Thread is worker thread, to handle the connection request;
The connection request for receiving and parsing through the view networked terminals, by the view networked terminals in the connection request
MAC Address and view networked terminals number, are compared with the information depending on networked terminals of storage, confirm the view networking eventually
The connection permission at end;
A communication handle is obtained from view connected network communication handle queue, according to the MAC Address of the view networked server
The communication handle is initialized with the MAC Address of the view networked terminals, and allow to network by communication handle return
Response.
Preferably, the method also includes:
If there is no idle thread in the thread pool, wait until there is free idle thread;Wherein, the worker thread exists
Idle thread is recovered as after being finished.
On the other hand, the embodiment of the invention also discloses a kind of view networked resources management system, the system is applied to view
In networking, comprising:
Module is monitored, for monitoring communication handle queue and inactive queue of task;The communication handle passes through the view
The MAC Address initialization of the MAC Address and view networked terminals of networked server;The inactive queue of task is used to cache wait locate
The resource request of the view networked terminals of reason;
Event processing module is set, if enabling the idle thread in thread pool is work for listening to setting event
Thread, to handle the setting event;
Communication handle recycling module, for it is corresponding to recycle the view networked terminals when disconnecting depending on networked terminals
Communication handle.
Preferably, the setting event processing module includes:
Resource request parsing module, if the resource request for listening to corresponding view networked terminals by communication handle,
Then enabling an idle thread in thread pool is worker thread, receives and parses through the view by the communication handle and networks eventually
The resource request at end;
Resource request cache module, for the resource request of the view networked terminals and corresponding communication handle to be encapsulated,
It is medium to be processed to be put into inactive queue of task;
Resource request processing module enables line if having task arrival for listening in the inactive queue of task
It is corresponding to handle the task by the corresponding communication handle of the task for worker thread for an idle thread of Cheng Chizhong
Resource request.
Preferably, the handle recycling module includes:
Request processing module is disconnected, if the disconnection for listening to corresponding view networked terminals by communication handle is requested,
Then enabling in thread pool idle thread is worker thread to handle the disconnection request;
Handle resets module, if the disconnection for listening to the view networked terminals by the communication handle confirms,
The communication handle is recycled to be placed in the communication handle queue.
Preferably, the system also includes:
Connection request processing module, if for the connection request for receiving view networked terminals depending on networked server,
The idle thread enabled in thread pool is worker thread, to handle the connection request;
Permission confirmation module is connected, for receiving and parsing through the connection request of the view networked terminals, the connection is asked
The MAC Address of the view networked terminals in asking and view networked terminals number, with the information of the view networked terminals of storage into
Row compares, and confirms the connection permission of the view networked terminals;
Communication handle obtains module, for obtaining a communication handle from view connected network communication handle queue, according to described
The communication handle is initialized depending on the MAC Address of networked server and the MAC Address of the view networked terminals, and by described logical
Letter handle returns to the response for allowing to network.
Preferably, the system also includes:
Thread management module, if waited for not having idle thread in the thread pool until there is free idle thread;Its
In, the worker thread is recovered as idle thread after being finished.
The embodiment of the present invention includes following advantages:
The characteristic of application view networking of the embodiment of the present invention, the communication sentence based on MAC Address by creation thread pool and multiplexing
Handle reduces creation and destroying threads, creation and the resource overhead for destroying communication handle, therefore reduces to CPU and memory
Performance requirement, while ensure that the safety of connection.
Detailed description of the invention
Fig. 1 is a kind of networking schematic diagram of view networking of the invention;
Fig. 2 is a kind of hardware structural diagram of node server of the invention;
Fig. 3 is a kind of hardware structural diagram of access switch of the invention;
Fig. 4 is the hardware structural diagram that a kind of Ethernet association of the invention turns gateway;
Fig. 5 a is the schematic diagram of technical solution of the embodiment of the present invention;
Fig. 5 b is another schematic diagram of technical solution of the embodiment of the present invention;
Fig. 6 is a kind of flow chart for view networked resources management method that the embodiment of the present invention one provides;
Fig. 7 is the flow chart of another view networked resources management method provided by Embodiment 2 of the present invention;
Fig. 8 is a kind of structural block diagram for view networked resources management system that the embodiment of the present invention three provides;
Fig. 9 is the structural block diagram for another view networked resources management system that the embodiment of the present invention four provides.
Specific embodiment
In order to make the foregoing objectives, features and advantages of the present invention clearer and more comprehensible, with reference to the accompanying drawing and specific real
Applying mode, the present invention is described in further detail.
It is the important milestone of network Development depending on networking, is a real-time network, can be realized HD video real-time Transmission,
Push numerous Internet applications to HD video, high definition is face-to-face.
Real-time high-definition video switching technology is used depending on networking, it can be such as high in a network platform by required service
Clear video conference, Intellectualized monitoring analysis, emergency command, digital broadcast television, delay TV, the Web-based instruction, shows video monitoring
Field live streaming, VOD program request, TV Mail, individual character records (PVR), Intranet (manages) channel by oneself, intelligent video Broadcast Control, information publication
All be incorporated into a system platform etc. services such as tens of kinds of videos, voice, picture, text, communication, data, by TV or
Computer realizes that high-definition quality video plays.
Embodiment in order to enable those skilled in the art to better understand the present invention is introduced to depending on networking below:
Depending on networking, applied portion of techniques is as described below:
Network technology (Network Technology)
Traditional ethernet (Ethernet) is improved depending on the network technology innovation networked, with potential huge on network
Video flow.(Circuit is exchanged different from simple network packet packet switch (Packet Switching) or lattice network
Switching), Streaming demand is met using Packet Switching depending on networking technology.Has grouping depending on networking technology
Flexible, the simple and low price of exchange, is provided simultaneously with the quality and safety assurance of circuit switching, it is virtually electric to realize the whole network switch type
The seamless connection of road and data format.
Switching technology (Switching Technology)
Two advantages of asynchronous and packet switch that Ethernet is used depending on networking eliminate Ethernet under the premise of complete compatible and lack
It falls into, has the end-to-end seamless connection of the whole network, direct user terminal, directly carrying IP data packet.User data is in network-wide basis
It is not required to any format conversion.It is the more advanced form of Ethernet depending on networking, is a real-time exchange platform, can be realized at present mutually
The whole network large-scale high-definition realtime video transmission that networking cannot achieve pushes numerous network video applications to high Qinghua, unitizes.
Server technology (Server Technology)
It is different from traditional server, its Streaming Media depending on the server technology in networking and unified video platform
Transmission be built upon it is connection-oriented on the basis of, data-handling capacity is unrelated with flow, communication time, single network layer energy
Enough transmitted comprising signaling and data.For voice and video business, handled depending on networking and unified video platform Streaming Media
Complexity many simpler than data processing, efficiency substantially increase hundred times or more than traditional server.
Reservoir technology (Storage Technology)
The ultrahigh speed reservoir technology of unified video platform in order to adapt to the media content of vast capacity and super-flow and
Using state-of-the-art real time operating system, the programme information in server instruction is mapped to specific hard drive space, media
Content is no longer pass through server, and moment is directly delivered to user terminal, and user waits typical time less than 0.2 second.It optimizes
Sector distribution greatly reduces the mechanical movement of hard disc magnetic head tracking, and resource consumption only accounts for the 20% of the internet ad eundem IP, but
The concurrent flow greater than 3 times of traditional disk array is generated, overall efficiency promotes 10 times or more.
Network security technology (Network Security Technology)
Depending on the structural design networked by servicing independent licence system, equipment and the modes such as user data is completely isolated every time
The network security problem that puzzlement internet has thoroughly been eradicated from structure, does not need antivirus applet, firewall generally, has prevented black
The attack of visitor and virus, structural carefree secure network is provided for user.
It services innovative technology (Service Innovation Technology)
Business and transmission are fused together by unified video platform, whether single user, private user or a net
The sum total of network is all only primary automatic connection.User terminal, set-top box or PC are attached directly to unified video platform, obtain rich
The multimedia video service of rich colorful various forms.Unified video platform is traditional to substitute with table schema using " menu type "
Complicated applications programming, considerably less code, which can be used, can be realized complicated application, realize the new business innovation of " endless ".
Networking depending on networking is as described below:
It is a kind of central controlled network structure depending on networking, which can be Tree Network, Star network, ring network etc. class
Type, but centralized control node is needed to control whole network in network on this basis.
As shown in Figure 1, being divided into access net and Metropolitan Area Network (MAN) two parts depending on networking.
The equipment of access mesh portions can be mainly divided into 3 classes: node server, access switch, terminal (including various machines
Top box, encoding board, memory etc.).Node server is connected with access switch, and access switch can be with multiple terminal phases
Even, and it can connect Ethernet.
Wherein, node server is the node that centralized control functions are played in access net, can control access switch and terminal.
Node server can directly be connected with access switch, can also directly be connected with terminal.
Similar, the equipment of metropolitan area mesh portions can also be divided into 3 classes: metropolitan area server, node switch, node serve
Device.Metropolitan area server is connected with node switch, and node switch can be connected with multiple node servers.
Wherein, node server is the node server for accessing mesh portions, i.e. node server had both belonged to access wet end
Point, and belong to metropolitan area mesh portions.
Metropolitan area server is the node that centralized control functions are played in Metropolitan Area Network (MAN), can control node switch and node serve
Device.Metropolitan area server can be directly connected to node switch, can also be directly connected to node server.
It can be seen that be entirely a kind of central controlled network structure of layering depending on networking network, and node server and metropolitan area
The network controlled under server can be the various structures such as tree-shaped, star-like, cyclic annular.
Visually claim, access mesh portions can form unified video platform (part in virtual coil), and multiple unified videos are flat
Platform can form view networking;Each unified video platform can be interconnected by metropolitan area and wide area depending on networking.
Classify depending on networked devices
1.1 embodiment of the present invention can be mainly divided into 3 classes: server depending on the equipment in networking, interchanger (including ether
Net gateway), terminal (including various set-top boxes, encoding board, memory etc.).Depending on networking can be divided on the whole Metropolitan Area Network (MAN) (or
National net, World Wide Web etc.) and access net.
1.2 equipment for wherein accessing mesh portions can be mainly divided into 3 classes: node server, access switch (including ether
Net gateway), terminal (including various set-top boxes, encoding board, memory etc.).
The specific hardware structure of each access network equipment are as follows:
Node server:
As shown in Fig. 2, mainly including Network Interface Module 201, switching engine module 202, CPU module 203, disk array
Module 204;
Wherein, Network Interface Module 201, the Bao Jun that CPU module 203, disk array module 204 are come in enter switching engine
Module 202;Switching engine module 202 look into the operation of address table 205 to the packet come in, to obtain the navigation information of packet;
And the packet is stored according to the navigation information of packet the queue of corresponding pack buffer 206;If the queue of pack buffer 206 is close
It is full, then it abandons;All pack buffer queues of 202 poll of switching engine mould, are forwarded: 1) port if meeting the following conditions
It is less than to send caching;2) the queue package counting facility is greater than zero.Disk array module 204 mainly realizes the control to hard disk, including
The operation such as initialization, read-write to hard disk;CPU module 203 is mainly responsible between access switch, terminal (not shown)
Protocol processes, to address table 205 (including descending protocol packet address table, uplink protocol package address table, data packet addressed table)
Configuration, and, the configuration to disk array module 204.
Access switch:
As shown in figure 3, mainly including Network Interface Module (downstream network interface module 301, uplink network interface module
302), switching engine module 303 and CPU module 304;
Wherein, the packet (upstream data) that downstream network interface module 301 is come in enters packet detection module 305;Packet detection mould
Whether mesh way address (DA), source address (SA), type of data packet and the packet length of the detection packet of block 305 meet the requirements, if met,
It then distributes corresponding flow identifier (stream-id), and enters switching engine module 303, otherwise abandon;Uplink network interface mould
The packet (downlink data) that block 302 is come in enters switching engine module 303;The data packet that CPU module 204 is come in enters switching engine
Module 303;Switching engine module 303 look into the operation of address table 306 to the packet come in, to obtain the navigation information of packet;
If the packet into switching engine module 303 is that downstream network interface is gone toward uplink network interface, in conjunction with flow identifier
(stream-id) packet is stored in the queue of corresponding pack buffer 307;If the queue of the pack buffer 307 is close full,
It abandons;If the packet into switching engine module 303 is not that downstream network interface is gone toward uplink network interface, according to packet
Navigation information is stored in the data packet queue of corresponding pack buffer 307;If the queue of the pack buffer 307 is close full,
Then abandon.
All pack buffer queues of 303 poll of switching engine module, are divided to two kinds of situations in embodiments of the present invention:
If the queue is that downstream network interface is gone toward uplink network interface, meets the following conditions and be forwarded: 1)
It is less than that the port sends caching;2) the queue package counting facility is greater than zero;3) token that rate control module generates is obtained;
If the queue is not that downstream network interface is gone toward uplink network interface, meets the following conditions and is forwarded:
1) it is less than to send caching for the port;2) the queue package counting facility is greater than zero.
Rate control module 208 is configured by CPU module 204, to all downlink networks in programmable interval
Interface generates token toward the pack buffer queue that uplink network interface is gone, to control the code rate of forwarded upstream.
CPU module 304 is mainly responsible for the protocol processes between node server, the configuration to address table 306, and,
Configuration to rate control module 308.
Ethernet association turns gateway:
As shown in figure 4, mainly including Network Interface Module (downstream network interface module 401, uplink network interface module
402), switching engine module 403, CPU module 404, packet detection module 405, rate control module 408, address table 406, Bao Huan
Storage 407 and physics adding module 409, physics removing module 410.
Wherein, the data packet that downstream network interface module 401 is come in enters packet detection module 405;Packet detection module 405 is examined
Ethernet physics DA, Ethernet physics SA, Ethernet length or frame type, the view networking mesh way address of measured data packet
DA, whether meet the requirements depending on networking source address SA, depending on networking data Packet type and packet length, corresponding stream is distributed if meeting
Identifier (stream-id);Then, physics DA, physics SA, length or frame are subtracted by physics removing module 410
Type (2byte), and enter corresponding receive and cache, otherwise abandon;
Downstream network interface module 401 detects the transmission caching of the port, according to the view of packet networking mesh if there is Bao Ze
Address D A knows the Ethernet physics DA of corresponding terminal, adds the Ethernet physics DA of terminal, Ethernet assists the object for turning gateway
SA, Ethernet length or frame type are managed, and is sent.
The function that Ethernet association turns other modules in gateway is similar with access switch.
Terminal:
It mainly include Network Interface Module, Service Processing Module and CPU module;For example, set-top box mainly connects including network
Mouth mold block, video/audio encoding and decoding engine modules, CPU module;Encoding board mainly includes Network Interface Module, video encoding engine
Module, CPU module;Memory mainly includes Network Interface Module, CPU module and disk array module.
The equipment of 1.3 metropolitan area mesh portions can be mainly divided into 2 classes: node server, node switch, metropolitan area server.
Wherein, node switch mainly includes Network Interface Module, switching engine module and CPU module;Metropolitan area server mainly includes
Network Interface Module, switching engine module and CPU module are constituted.
2, networking data package definition is regarded
2.1 access network data package definitions
Access net data packet mainly include following sections: destination address (DA), source address (SA), reserve bytes,
payload(PDU)、CRC。
As shown in the table, the data packet for accessing net mainly includes following sections:
DA | SA | Reserved | Payload | CRC |
Wherein:
Destination address (DA) is made of 8 bytes (byte), and first character section indicates type (such as the various associations of data packet
Discuss packet, multicast packet, unicast packet etc.), be up to 256 kinds of possibility, the second byte to the 6th byte is metropolitan area net address,
Seven, the 8th bytes are access net address;
Source address (SA) is also to be made of 8 bytes (byte), is defined identical as destination address (DA);
Reserve bytes are made of 2 bytes;
The part payload has different length according to the type of different datagrams, is if it is various protocol packages
64 bytes are 32+1024=1056 bytes if it is single group unicast packets words, are not restricted to above 2 kinds certainly;
CRC is made of 4 bytes, and calculation method follows the Ethernet CRC algorithm of standard.
2.2 Metropolitan Area Network (MAN) packet definitions
The topology of Metropolitan Area Network (MAN) is pattern, may there is 2 kinds, connection even of more than two kinds, i.e. node switching between two equipment
It can all can exceed that 2 kinds between machine and node server, node switch and node switch, node switch and node server
Connection.But the metropolitan area net address of metropolitan area network equipment is uniquely, to close to accurately describe the connection between metropolitan area network equipment
System, introduces parameter in embodiments of the present invention: label, uniquely to describe a metropolitan area network equipment.
(Multi-Protocol Label Switch, multiprotocol label are handed over by the definition of label and MPLS in this specification
Change) label definition it is similar, it is assumed that between equipment A and equipment B there are two connection, then data packet from equipment A to equipment B just
There are 2 labels, data packet also there are 2 labels from equipment B to equipment A.Label is divided into label, outgoing label, it is assumed that data packet enters
The label (entering label) of equipment A is 0x0000, and the label (outgoing label) when this data packet leaves equipment A may reform into
0x0001.The networking process of Metropolitan Area Network (MAN) is to enter network process under centralized control, also means that address distribution, the label of Metropolitan Area Network (MAN)
Distribution be all to be dominated by metropolitan area server, node switch, node server be all passively execute, this point with
The label distribution of MPLS is different, and the distribution of the label of MPLS is the result that interchanger, server are negotiated mutually.
As shown in the table, the data packet of Metropolitan Area Network (MAN) mainly includes following sections:
DA | SA | Reserved | Label | Payload | CRC |
That is destination address (DA), source address (SA), reserve bytes (Reserved), label, payload (PDU), CRC.Its
In, the format of label, which can refer to, such as gives a definition: label is 32bit, wherein high 16bit retains, only with low 16bit, its position
Set is between the reserve bytes and payload of data packet.
One of the core concepts of the embodiments of the present invention is proposed referring to Fig. 5 a and Fig. 5 b based on the above-mentioned characteristic of view networking,
The embodiment of the present invention is applied to the scene of view networked server and multiple view networked terminals, it then follows the agreement for regarding networking, by making
With reusable communication handle (above-mentioned communication handle based on view networked server MAC Address and view networked terminals MAC Address),
Reduce creation and destroy communication handle bring resource overhead, and in the thread pool by being created in server initiation
Thread monitor and safeguard the queue of reusable communication handle and inactive queue of task, equally reduce creation and destroying threads
Bring resource overhead;Further, referring to shown in Fig. 5 b, during establishing connection, by the thread in thread pool to
The view networked terminals of application connection distribute communication handle, and above-mentioned communication handle is recycled after disconnecting.
Embodiment one:
Referring to shown in Fig. 6, the embodiment of the present invention one provides a kind of view networked resources management method, and the method is applied to
In networking, including step 601-603:
Step 601: view networked server monitors communication handle queue and inactive queue of task;The communication handle passes through
The MAC Address initialization of the MAC Address and view networked terminals of the view networked server;The inactive queue of task is used to delay
Deposit the resource request of view networked terminals to be processed.
The main thread of the view networked server monitors communication handle queue and inactive queue of task;The communication handle
It is initialized by the MAC Address of the view networked server and the MAC Address of view networked terminals, the MAC Address, that is, hardware
Location, this is because what the characteristic of view networking determined, because mostly using interchanger depending on the connection in networking, and interchanger work is in number
According to link layer, and it is connection safety using the advantages of MAC Address, invalid user stealing Internet resources can be prevented;It is described wait locate
Reason task queue is used to cache the resource request of view networked terminals to be processed, and the money of high concurrent in the short time can be effectively treated
Source request.
When the view networked server initializes, need to create communication handle queue in case using, that is, Shen in advance
Please memory source, it is first that the communication handle needs the MAC Address of MAC Address and view networked terminals by regarding networked server
Beginningization.
When the view networked server initializes, it is also necessary to create thread pool by host process, can repair according to actual needs
Change the quantity of thread in created thread pool, and can determine the quantity of thread according to the core of CPU under normal circumstances, example
If core cpu number is N, then for compute-intensive applications, number of threads can be N+1, for I/O intensive type application, thread
Quantity can be 2N+1.Also to do some relevant initialization operations during creating thread pool, for example, creation it is described to
Task queue is handled, addition mutex (is equivalent to unlock and locks, for guaranteeing thread-safe, avoid two or more threads
Will not be by concurrent invocation) or semaphore (it is same to be used to guarantee thread-safe, it is used to when there is task arrival, main thread is used to call out
Worker thread in awake thread pool);Resource request can be placed in inactive queue of task thread pool during the work time, work as master
Thread, which listens in inactive queue of task, just will do it processing when having task arrival, such as can wake up the sky in thread pool
Idle thread carries out task processing.
Step 602: if listening to setting event, the idle thread enabled in thread pool is worker thread, to handle
State setting event.
If the main thread depending on networked server listens to setting event, the idle line in the thread pool is waken up
Journey, starting the idle thread is worker thread, handles the setting event by the worker thread.The setting event can be with
Event including resource request further includes the event that task reaches in inactive queue of task, can also include other events.One
As, after the worker thread is finished, being just recycled in thread pool becomes idle thread.The monitoring can pass through prison
The communication handle in the communication handle queue is listened, to listen to resource request event or connection disconnected event, can also be led to
It crosses and monitors the inactive queue of task to listen to corresponding semaphore, that is, listen to the arrival of task, i.e., can account at this time
The task is handled with cpu resource.
For example, four threads can be run simultaneously for the CPU of four cores, if listening to the resource of view networked terminals A
Request, then idle thread 1 is waken up as worker thread 1 in thread pool, i.e., will be described for parsing and caching the resource request
Resource request is encapsulated as task A with corresponding communication handle, and is placed in the inactive queue of task, then the work
Thread 1 is recovered as idle thread;And in 1 operational process of worker thread, appoint if listening in inactive queue of task
It is engaged in the arrival of B, then idle thread 2 is waken up as worker thread 2 in thread pool, and the worker thread 2 handles the task B, obtains
Corresponding resource request and communication handle are obtained, the resource request is handled, corresponding resource data can be found and by logical
Believe that handle returns to the resource data, and is recovered as idle thread after the completion of execution;If listening to inactive queue of task
The arrival of middle task A, then idle thread 3 is waken up as worker thread 3 in thread pool, to handle the task A;The thread 3
It can be the thread 2, be also possible to other threads being in idle condition;It is not intended to limit the line for parsing the resource request
The thread of journey, resource request corresponding with the task is handled is same thread.
Step 603: when disconnecting depending on networked terminals, recycling the corresponding communication handle of the view networked terminals.
When disconnecting depending on networked terminals, the view networked server recycles the corresponding communication sentence of the view networked terminals
Handle.Generally, the communication handle that the view networked terminals can be monitored by the main thread depending on networked server, listens to
Request is disconnected, the disconnection request can be handled by the thread in thread pool, and recycle the communication handle.
The embodiment of the present invention includes following advantages:
The characteristic of application view networking of the embodiment of the present invention, the communication sentence based on MAC Address by creation thread pool and multiplexing
Handle reduces creation and destroying threads, creation and the resource overhead for destroying communication handle, therefore reduces to CPU and memory
Performance requirement, while ensure that the safety of connection.
It should be noted that for simple description, therefore, it is stated as a series of action groups for embodiment of the method
It closes, but those skilled in the art should understand that, embodiment of that present invention are not limited by the describe sequence of actions, because according to
According to the embodiment of the present invention, some steps may be performed in other sequences or simultaneously.Secondly, those skilled in the art also should
Know, the embodiments described in the specification are all preferred embodiments, and the related movement not necessarily present invention is implemented
Necessary to example.
Embodiment two:
Referring to shown in Fig. 7, second embodiment of the present invention provides a kind of view networked resources management method, the method is applied to
In networking, including step 701-709:
Step 701: if the connection request for receiving view networked terminals depending on networked server, enables in thread pool
One idle thread is worker thread, to handle the connection request.
If the main thread depending on networked server receives the connection request of view networked terminals, enable in thread pool
One idle thread is worker thread, to handle the connection request;The connection request includes the MAC of the view networked terminals
Address and view networked terminals number, the view networked terminals number of the MAC Address of the view networked terminals and the view networked terminals
It is all uniquely, to be corresponded with the view networked terminals, the mark as view networked terminals.
Step 702: receiving and parsing through the connection request of the view networked terminals, the view in the connection request is joined
The MAC Address and view networked terminals number of network termination, are compared, described in confirmation with the information depending on networked terminals of storage
Depending on the connection permission of networked terminals.
The worker thread depending in networked server thread pool receives and parses through the connection request of the view networked terminals,
The MAC Address and view networked terminals number of the view networked terminals in the connection request are obtained, and is networked according to the view
The MAC Address of terminal searches the corresponding view networked terminals number of storage, or according to the view networked terminals number searching pair
The MAC Address for the view networked terminals answered, finds the corresponding information of the view networked terminals of storage in a word, and is compared,
If the MAC Address, the view networked terminals number are identical as the corresponding informance of storage, the view networked terminals are confirmed
With connection permission, step 703 is executed;If the MAC Address, it is described have any difference depending on networked terminals number, confirm
It is described not connect permission depending on networked terminals, then terminate.
Step 703: a communication handle is obtained from view connected network communication handle queue, according to the view networked server
The MAC Address of MAC Address and the view networked terminals initializes the communication handle, and returns to permission by the communication handle
The response of networking.
The worker thread depending in networked server thread pool, which obtains one from depending on connected network communication handle queue, not to be had
The communication handle being initialised, the MAC Address according to the MAC Address of the view networked server and the view networked terminals are initial
Change the communication handle, certainly, described be identified depending on networked terminals has connection permission;Then it is returned by the communication handle
Return the response for allowing to network.
Step 704: view networked server monitors communication handle queue and inactive queue of task;The communication handle passes through
The MAC Address initialization of the MAC Address and view networked terminals of the view networked server;The inactive queue of task is used to delay
Deposit the resource request of view networked terminals to be processed.
Step 705: if listening to the resource request of corresponding view networked terminals by communication handle, enabling in thread pool
An idle thread be worker thread, by the communication handle receive and parse through it is described view networked terminals resource request.
If listening to the resource request of the view networked terminals corresponding to the communication handle by communication handle, line is enabled
An idle thread of Cheng Chizhong is worker thread, and the resource of the view networked terminals is received and parsed through by the communication handle
Request.
Step 706: the resource request of the view networked terminals and corresponding communication handle being encapsulated, waiting task is put into
Queue is medium to be processed.
The worker thread encapsulates the resource request of the view networked terminals and corresponding communication handle, is put into be processed
Task queue is medium to be processed, i.e., caches the resource request.Generally, in order to cope with the demand of high concurrent, task is temporary
When to be cached to inactive queue of task medium to be processed.
Step 707: if listening in the inactive queue of task has task arrival, enabling a sky in thread pool
Idle thread is worker thread, by the corresponding communication handle of the task, handles the corresponding resource request of the task.
If the main thread depending on networked server, which listens in the inactive queue of task, task arrival, enable
An idle thread in thread pool is worker thread, and by the corresponding communication handle of the task, it is corresponding to handle the task
Resource request, such as the corresponding data of the resource request can be extracted, and by the corresponding number of the resource request
Hair is packaged according to the view networked terminals number (address of the corresponding target terminal) according to the target terminal in the resource request
It sees off;The corresponding data of the resource request can be extracted from the resource request, i.e., ask from the resource
The source terminal asked can also be also possible to other forms by described depending on extracting in networked server;By institute after the completion of task
Task is stated to delete from the inactive queue of task.
In this practical application, networking is regarded as the network with centralized control functions, including main control server and undernet
Equipment, which includes terminal, and one of the core idea depending on networking is, by notifying to exchange by main control server
Equipment is directed to when time downstream communications link of service matches table, and the table for being then based on the configuration carries out the transmission of data packet.
That is, including: depending on the communication means in networking
Main control server (the view networked server in such as embodiment of the present invention) configuration is when time downlink communication of service
Link;
By the corresponding data packet of the resource request, target terminal is sent to according to the downstream communications link.
In embodiments of the present invention, it includes: notice when the downlink of secondary service is logical that time downstream communications link of service is worked as in configuration
Believe that switching equipment involved in link matches table;
It furthermore, include: the configured table of inquiry according to downstream communications link transmission, switching equipment is received to institute
Data packet is transmitted by corresponding port.
In the concrete realization, service includes unicast communication service and Multicast Communication Service.I.e. either cast communication is still
Unicast communication can realize the communication in view networking using the above-mentioned core idea with table-table.
As previously mentioned, view networking net includes access mesh portions, in access net, which is node server,
Undernet equipment includes access switch and terminal.
For the unicast communication service in access net, the main control server configuration is when time downlink communication chain of service
The step of road, may comprise steps of:
Sub-step S11, main control server are obtained according to the resource request when time downstream communications link information of service,
Downstream communications link information includes participating in when time downstream communication ports information of the main control server of service and access switch;
Sub-step S12, downstream communication ports information of the main control server according to control server, data packet inside it
The downlink port that setting is oriented to when time data packet of service in the table of location;And believe according to the downstream communication ports of access switch
Breath, to corresponding access switch sending port configuration order;
Sub-step S13, access switch according in port configuration command data packet addressed table inside it, setting when time
The downlink port that the data packet of service is oriented to.
For the Multicast Communication Service in access net, main control server obtains the downstream communications link letter when time service
The step of breath may include following sub-step:
Sub-step S21, main control server obtain the resource request of application Multicast Communication Service, include service in resource request
The access net address of type information, service content information and target terminal;It wherein, include service number in service content information;
Sub-step S22, main control server according to the service number in preset content-address mapping table, extraction source
The access net address of terminal;
Sub-step S23, main control server obtains the corresponding multicast address of source terminal, and distributes to target terminal;And according to
According to the access net address of service type information, source terminal and target terminal, the communication link information when time multicast services is obtained.
Step 708: if being requested by the disconnection that communication handle listens to corresponding view networked terminals, enabling in thread pool
An idle thread be that worker thread is requested to handle disconnections.
If the main thread depending on networked server is networked by the view that communication handle listens to the corresponding communication handle
The disconnection of terminal is requested, then enabling in thread pool idle thread is worker thread to handle the disconnection request;Processing
The disconnection request, which can be to the view networked terminals, sends ACK message, acknowledges receipt of disconnection request.
Step 709: if being confirmed by the disconnection that the communication handle listens to the view networked terminals, recycling described logical
Letter handle is placed in the communication handle queue.
If the worker thread is confirmed by the disconnection that the communication handle listens to the view networked terminals, institute is recycled
Communication handle is stated to be placed in the communication handle queue.
Preferably, the method also includes:
Step 710: if there is no idle thread in the thread pool, waiting until there is free idle thread;Wherein, the work
Make thread and is recovered as idle thread after being finished.
If the main thread depending on networked server listens to the setting event, and does not have idle line in thread pool
Journey then needs to wait, and worker thread is waited to be recovered as the generation of idle thread after operation.
The embodiment of the present invention includes following advantages:
The characteristic of application view networking of the embodiment of the present invention, the communication sentence based on MAC Address by creation thread pool and multiplexing
Handle reduces creation and destroying threads, creation and the resource overhead for destroying communication handle, therefore reduces to CPU and memory
Performance requirement, while ensure that the safety of connection;Permission is connected by confirmation, further ensures the safety of connection;It is logical
It crosses and the limit of setting event and treatment process is limited, so that thread utilization is more efficient in thread pool;Pass through thread in thread pool
The disconnection and communication handle recycling for handling connection, improve the utilization efficiency of thread in thread pool.
Because in the preferred embodiment of the embodiment of the present invention, having made restriction to the thread management in thread pool, therefore improve
The utilization efficiency of thread in thread pool.
It should be noted that the step 701-703 and the step 704-707 not absolute context, but
Relatively independent;Similarly, the step 704-707 and the step 708-709 not absolute context, but it is opposite
It is independent;The step 705-706 and the step 707 are also relatively independent.For embodiment of the method, in order to simply retouch
It states, therefore, it is stated as a series of action combinations, but those skilled in the art should understand that, the embodiment of the present invention is not
It is limited by described sequence of movement, because according to an embodiment of the present invention, certain steps can be sequentially or same using other
Shi Jinhang.Secondly, those skilled in the art should also know that, the embodiments described in the specification are all preferred embodiments,
The actions involved are not necessarily necessary for embodiments of the present invention.
Embodiment three:
Referring to shown in Fig. 8, the embodiment of the present invention three provides a kind of view networked resources management system, and the system is applied to
Depending in networking, comprising:
Module 801 is monitored, for monitoring communication handle queue and inactive queue of task;The communication handle passes through described
Depending on the MAC Address initialization of the MAC Address and view networked terminals of networked server;The inactive queue of task be used to cache to
The resource request of the view networked terminals of processing;
Event processing module 802 is set, if enabling the idle thread in thread pool is work for listening to setting event
Make thread, to handle the setting event;
Communication handle recycling module 803, for it is corresponding to recycle the view networked terminals when disconnecting depending on networked terminals
Communication handle.
The embodiment of the present invention includes following advantages:
The characteristic of application view networking of the embodiment of the present invention, the communication sentence based on MAC Address by creation thread pool and multiplexing
Handle reduces creation and destroying threads, creation and the resource overhead for destroying communication handle, therefore reduces to CPU and memory
Performance requirement, while ensure that the safety of connection.
For device embodiment, since it is basically similar to the method embodiment, related so being described relatively simple
Place illustrates referring to the part of embodiment of the method.
Example IV:
Referring to shown in Fig. 9, the embodiment of the present invention four provides a kind of view networked resources management system, and the system is applied to
Depending in networking, comprising:
Module 801 is monitored, for monitoring communication handle queue and inactive queue of task;The communication handle passes through described
Depending on the MAC Address initialization of the MAC Address and view networked terminals of networked server;The inactive queue of task be used to cache to
The resource request of the view networked terminals of processing;
Resource request parsing module 80201, if the resource for listening to corresponding view networked terminals by communication handle
Request, then the idle thread enabled in thread pool is worker thread, receives and parses through the view by the communication handle
The resource request of networked terminals;
Resource request cache module 80202, for by it is described view networked terminals resource request and corresponding communication handle
Encapsulation, it is medium to be processed to be put into inactive queue of task;
Resource request processing module 80203 opens if having task arrival for listening in the inactive queue of task
It is worker thread with an idle thread in thread pool, by the corresponding communication handle of the task, handles the task pair
The resource request answered;
Request processing module 80301 is disconnected, if the disconnection for listening to corresponding view networked terminals by communication handle
Request, then enabling in thread pool idle thread is worker thread to handle the disconnection request;
Handle resets module 80302, if the disconnection for listening to the view networked terminals by the communication handle is true
Recognize, then recycles the communication handle and be placed in the communication handle queue;
Connection request processing module 804, if for the connection request for receiving view networked terminals depending on networked server,
The idle thread then enabled in thread pool is worker thread, to handle the connection request;
Permission confirmation module 805 is connected, for receiving and parsing through the connection request of the view networked terminals, by the connection
The MAC Address and view networked terminals number of the view networked terminals in request, the information with the view networked terminals of storage
It is compared, confirms the connection permission of the view networked terminals;
Communication handle obtains module 806, for obtaining a communication handle from view connected network communication handle queue, according to institute
The MAC Address of the MAC Address and the view networked terminals of stating view networked server initializes the communication handle, and by described
Communication handle returns to the response for allowing to network.
Preferably, the system also includes:
Thread management module 807, if waited for not having idle thread in the thread pool until there is free disengaged line
Journey;Wherein, the worker thread is recovered as idle thread after being finished.
The embodiment of the present invention includes following advantages:
The characteristic of application view networking of the embodiment of the present invention, the communication sentence based on MAC Address by creation thread pool and multiplexing
Handle reduces creation and destroying threads, creation and the resource overhead for destroying communication handle, therefore reduces to CPU and memory
Performance requirement, while ensure that the safety of connection;Permission is connected by confirmation, further ensures the safety of connection;It is logical
It crosses and the limit of setting event and treatment process is limited, so that thread utilization is more efficient in thread pool;Pass through thread in thread pool
The disconnection and communication handle recycling for handling connection, improve the utilization efficiency of thread in thread pool.
Because in the preferred embodiment of the embodiment of the present invention, having made restriction to the thread management in thread pool, therefore improve
The utilization efficiency of thread.
For device embodiment, since it is basically similar to the method embodiment, related so being described relatively simple
Place illustrates referring to the part of embodiment of the method.
All the embodiments in this specification are described in a progressive manner, the highlights of each of the examples are with
The difference of other embodiments, the same or similar parts between the embodiments can be referred to each other.
It should be understood by those skilled in the art that, the embodiment of the embodiment of the present invention can provide as method, apparatus or calculate
Machine program product.Therefore, the embodiment of the present invention can be used complete hardware embodiment, complete software embodiment or combine software and
The form of the embodiment of hardware aspect.Moreover, the embodiment of the present invention can be used one or more wherein include computer can
With in the computer-usable storage medium (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.) of program code
The form of the computer program product of implementation.
The embodiment of the present invention be referring to according to the method for the embodiment of the present invention, terminal device (system) and computer program
The flowchart and/or the block diagram of product describes.It should be understood that flowchart and/or the block diagram can be realized by computer program instructions
In each flow and/or block and flowchart and/or the block diagram in process and/or box combination.It can provide these
Computer program instructions are set to general purpose computer, special purpose computer, Embedded Processor or other programmable data processing terminals
Standby processor is to generate a machine, so that being held by the processor of computer or other programmable data processing terminal devices
Capable instruction generates for realizing in one or more flows of the flowchart and/or one or more blocks of the block diagram
The device of specified function.
These computer program instructions, which may also be stored in, is able to guide computer or other programmable data processing terminal devices
In computer-readable memory operate in a specific manner, so that instruction stored in the computer readable memory generates packet
The manufacture of command device is included, which realizes in one side of one or more flows of the flowchart and/or block diagram
The function of being specified in frame or multiple boxes.
These computer program instructions can also be loaded into computer or other programmable data processing terminal devices, so that
Series of operation steps are executed on computer or other programmable terminal equipments to generate computer implemented processing, thus
The instruction executed on computer or other programmable terminal equipments is provided for realizing in one or more flows of the flowchart
And/or in one or more blocks of the block diagram specify function the step of.
Although the preferred embodiment of the embodiment of the present invention has been described, once a person skilled in the art knows bases
This creative concept, then additional changes and modifications can be made to these embodiments.So the following claims are intended to be interpreted as
Including preferred embodiment and fall into all change and modification of range of embodiment of the invention.
Finally, it is to be noted that, herein, relational terms such as first and second and the like be used merely to by
One entity or operation are distinguished with another entity or operation, without necessarily requiring or implying these entities or operation
Between there are any actual relationship or orders.Moreover, the terms "include", "comprise" or its any other variant meaning
Covering non-exclusive inclusion, so that process, method, article or terminal device including a series of elements not only wrap
Those elements are included, but also including other elements that are not explicitly listed, or further includes for this process, method, article
Or the element that terminal device is intrinsic.In the absence of more restrictions, being wanted by what sentence "including a ..." limited
Element, it is not excluded that there is also other identical elements in process, method, article or the terminal device for including the element.
It above to a kind of view networked resources management method provided by the present invention and system, is described in detail, herein
In apply that a specific example illustrates the principle and implementation of the invention, the explanation of above example is only intended to sides
Assistant solves method and its core concept of the invention;At the same time, for those skilled in the art, think of according to the present invention
Think, there will be changes in the specific implementation manner and application range, in conclusion the content of the present specification should not be construed as pair
Limitation of the invention.
Claims (10)
1. a kind of view networked resources management method, which is characterized in that the method is applied in view networking, comprising:
Communication handle queue and inactive queue of task are monitored depending on networked server;The communication handle passes through view networking clothes
The MAC Address initialization of the MAC Address and view networked terminals of business device;
If listening to setting event, the idle thread enabled in thread pool is worker thread, to handle the setting event, institute
Stating setting event includes the event that task reaches in the event and inactive queue of task of resource request;
When disconnecting depending on networked terminals, the corresponding communication handle of the view networked terminals is recycled;
Wherein, if listening to setting event, the idle thread enabled in thread pool is worker thread, to handle the setting thing
Part, comprising:
If listening to the event of resource request, the first idle thread enabled in thread pool is the first worker thread, for solving
The resource request is analysed, and is placed in the inactive queue of task, then first worker thread is recovered as the free time
Thread;
In the first worker thread operational process, if listening to the arrival of task in inactive queue of task, line is enabled
The second idle thread of Cheng Chizhong is the second worker thread, for handling the corresponding resource request of the task, and is being executed
Idle thread is recovered as at rear second worker thread;
First worker thread is different threads from second worker thread;
Wherein, the thread pool during the work time the resource request depending on networked terminals to be processed can be placed to it is described to be processed
In task queue;
In the first worker thread operational process, if listening to the arrival of task in inactive queue of task, line is enabled
The second idle thread of Cheng Chizhong is the second worker thread, comprising: in the first worker thread operational process, works as main thread
It listens in the inactive queue of task and is handled when having task arrival, waking up the idle thread in thread pool is the second work
Make thread, carries out task processing.
2. enable in thread pool the method according to claim 1, wherein if described listen to setting event
Idle thread be worker thread, include: the step of the setting event to handle
If listening to the resource request of corresponding view networked terminals by communication handle, an idle line in thread pool is enabled
Journey is worker thread, and the resource request of the view networked terminals is received and parsed through by the communication handle;
The resource request depending on networked terminals and corresponding communication handle are encapsulated as task, are put into inactive queue of task
Etc. to be processed;
If listening in the inactive queue of task has task arrival, enabling an idle thread in thread pool is work
Thread handles the corresponding resource request of the task by the corresponding communication handle of the task.
3. the method according to claim 1, wherein described when being disconnected depending on networked terminals, described in recycling
The step of communication handle corresponding depending on networked terminals includes:
If requesting by the disconnection that communication handle listens to corresponding view networked terminals, an idle line in thread pool is enabled
Journey is worker thread to handle the disconnection request;
If being confirmed by the disconnection that the communication handle listens to the view networked terminals, recycles the communication handle and be placed in
In the communication handle queue.
4. the method according to claim 1, wherein further include:
If the connection request for receiving view networked terminals depending on networked server, enables an idle thread in thread pool
For worker thread, to handle the connection request;
The connection request for receiving and parsing through the view networked terminals, by the MAC of the view networked terminals in the connection request
Address and view networked terminals number, are compared with the information depending on networked terminals of storage, confirm the view networked terminals
Connection permission;
A communication handle is obtained from view connected network communication handle queue, according to the MAC Address of the view networked server and institute
The MAC Address for stating view networked terminals initializes the communication handle, and returns to the response for allowing to network by the communication handle.
5. the method according to claim 1, wherein further include:
If there is no idle thread in the thread pool, wait until there is free idle thread;Wherein, the worker thread is executing
After be recovered as idle thread.
6. a kind of view networked resources management system, which is characterized in that the system is applied in view networking, comprising:
Module is monitored, for monitoring communication handle queue and inactive queue of task;The communication handle is networked by the view
The MAC Address initialization of the MAC Address and view networked terminals of server;
Event processing module is set, if enabling the idle thread in thread pool is worker thread for listening to setting event,
To handle the setting event;
Communication handle recycling module, for when disconnecting depending on networked terminals, recycling the corresponding communication of the view networked terminals
Handle;
Wherein, if listening to setting event, the idle thread enabled in thread pool is worker thread, to handle the setting thing
Part, comprising:
If listening to the event of resource request, the first idle thread enabled in thread pool is the first worker thread, for solving
The resource request is analysed, and is placed in the inactive queue of task, then first worker thread is recovered as the free time
Thread;
In the first worker thread operational process, if listening to the arrival of task in inactive queue of task, line is enabled
The second idle thread of Cheng Chizhong is the second worker thread, for handling the corresponding resource request of the task, and is being executed
Idle thread is recovered as at rear second worker thread;
First worker thread is different threads from second worker thread;
Wherein, the thread pool during the work time the resource request depending on networked terminals to be processed can be placed to it is described to be processed
In task queue;
In the first worker thread operational process, if listening to the arrival of task in inactive queue of task, line is enabled
The second idle thread of Cheng Chizhong is the second worker thread, comprising: in the first worker thread operational process, works as main thread
It listens in the inactive queue of task and is handled when having task arrival, waking up the idle thread in thread pool is the second work
Make thread, carries out task processing.
7. system according to claim 6, which is characterized in that the setting event processing module includes:
Resource request parsing module, if the resource request for listening to corresponding view networked terminals by communication handle, is opened
It is worker thread with an idle thread in thread pool, the view networked terminals is received and parsed through by the communication handle
Resource request;
Resource request cache module, for the resource request depending on networked terminals and corresponding communication handle to be encapsulated as appointing
Business, it is medium to be processed to be put into inactive queue of task;
Resource request processing module enables thread pool if having task arrival for listening in the inactive queue of task
In an idle thread be that worker thread by the corresponding communication handle of the task handles the corresponding resource of the task
Request.
8. system according to claim 6, which is characterized in that the handle recycling module includes:
Request processing module is disconnected, if the disconnection for listening to corresponding view networked terminals by communication handle is requested, is opened
The disconnection request is handled with an idle thread in thread pool is worker thread;
Handle resets module, if the disconnection for listening to the view networked terminals by the communication handle confirms, recycles
The communication handle is placed in the communication handle queue.
9. system according to claim 6, which is characterized in that further include:
Connection request processing module, if being enabled for the connection request for receiving view networked terminals depending on networked server
An idle thread in thread pool is worker thread, to handle the connection request;
Permission confirmation module is connected, it, will be in the connection request for receiving and parsing through the connection request of the view networked terminals
The view networked terminals MAC Address and view networked terminals number, compared with the information depending on networked terminals of storage
It is right, confirm the connection permission of the view networked terminals;
Communication handle obtains module, for obtaining a communication handle from view connected network communication handle queue, is joined according to the view
The MAC Address of the MAC Address of network server and the view networked terminals initializes the communication handle, and passes through the communication sentence
Handle returns to the response for allowing to network.
10. system according to claim 6, which is characterized in that further include:
Thread management module, if waited for not having idle thread in the thread pool until there is free idle thread;Wherein,
The worker thread is recovered as idle thread after being finished.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201611201043.1A CN108228338B (en) | 2016-12-22 | 2016-12-22 | A kind of view networked resources management method and system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201611201043.1A CN108228338B (en) | 2016-12-22 | 2016-12-22 | A kind of view networked resources management method and system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108228338A CN108228338A (en) | 2018-06-29 |
CN108228338B true CN108228338B (en) | 2019-06-11 |
Family
ID=62656335
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201611201043.1A Active CN108228338B (en) | 2016-12-22 | 2016-12-22 | A kind of view networked resources management method and system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108228338B (en) |
Families Citing this family (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109409104B (en) * | 2018-09-20 | 2021-02-12 | 视联动力信息技术股份有限公司 | Interface display method and system |
CN109474661B (en) * | 2018-09-25 | 2021-05-14 | 视联动力信息技术股份有限公司 | Method and system for processing network request event |
CN109522110B (en) * | 2018-11-19 | 2020-03-31 | 视联动力信息技术股份有限公司 | Multitask management system and method based on video networking |
CN109525460B (en) * | 2018-11-26 | 2020-10-13 | 视联动力信息技术股份有限公司 | Method and device for monitoring number resources of video network |
CN109814996B (en) * | 2019-01-04 | 2024-03-22 | 平安科技(深圳)有限公司 | Streaming media transmission control method and device, storage medium and computer equipment |
CN110233772B (en) * | 2019-04-22 | 2021-11-19 | 视联动力信息技术股份有限公司 | Method and device for testing video networking system |
CN110474813B (en) * | 2019-08-28 | 2021-01-22 | 视联动力信息技术股份有限公司 | Network management method and video networking system |
CN110798450B (en) * | 2019-09-25 | 2022-08-23 | 视联动力信息技术股份有限公司 | Audio and video data processing method and device and storage medium |
CN110958396B (en) * | 2019-12-23 | 2021-09-21 | 视联动力信息技术股份有限公司 | Holder control method and device, electronic equipment and storage medium |
CN110933112B (en) * | 2019-12-26 | 2022-12-23 | 视联动力信息技术股份有限公司 | Network access authentication method, device and storage medium |
CN112035255A (en) * | 2020-08-28 | 2020-12-04 | 北京浪潮数据技术有限公司 | Thread pool resource management task processing method, device, equipment and storage medium |
CN112148493A (en) * | 2020-09-30 | 2020-12-29 | 武汉中科通达高新技术股份有限公司 | Streaming media task management method and device and data server |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101001290A (en) * | 2006-01-09 | 2007-07-18 | 杭州世导科技有限公司 | System for multi-media integrated accessing |
WO2007127336A2 (en) * | 2006-04-28 | 2007-11-08 | Towsend Analytics, Ltd. | Order management for electronic securities trading |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8417825B2 (en) * | 2005-03-09 | 2013-04-09 | Apple Inc. | Communications handles and proxy agents |
CN103281172B (en) * | 2013-05-13 | 2016-03-02 | 天津市天安怡和信息技术有限公司 | Pond communication means between highway electric prepaid card and encryption equipment |
-
2016
- 2016-12-22 CN CN201611201043.1A patent/CN108228338B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101001290A (en) * | 2006-01-09 | 2007-07-18 | 杭州世导科技有限公司 | System for multi-media integrated accessing |
WO2007127336A2 (en) * | 2006-04-28 | 2007-11-08 | Towsend Analytics, Ltd. | Order management for electronic securities trading |
Non-Patent Citations (1)
Title |
---|
"完成端口实现高性能服务端通信层的关键问题";廖宏建 等;《计算机应用》;20120301;第32卷(第3期);第1.2节 |
Also Published As
Publication number | Publication date |
---|---|
CN108228338A (en) | 2018-06-29 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108228338B (en) | A kind of view networked resources management method and system | |
CN108121588B (en) | A kind of method and its view networking access server of access external resource | |
CN108173804B (en) | A kind of networked by view accesses the method and view connection cat client of internet | |
CN108063741A (en) | A kind of transport protocol conversion method and apparatus | |
CN108418778A (en) | A kind of internet and method, apparatus and interactive system regarding connected network communication | |
CN108012106B (en) | A kind of method and system regarding networking monitoring source synchronous | |
CN109451264A (en) | A kind of method and system of monitoring device membership | |
CN107888401B (en) | A kind of method and system of real time monitoring view networked terminals cpu busy percentage | |
CN108173803A (en) | It is a kind of to access the method for internet and regarding connection cat server-side by regarding networking | |
CN108965224A (en) | A kind of method and apparatus of video on demand | |
CN109474715A (en) | A kind of resource allocation method and device based on view networking | |
CN109302472A (en) | A kind of view networked resources method for releasing and view networking share Platform Server | |
CN109379254A (en) | A kind of detection method and system of the network connection based on video conference | |
CN109889779A (en) | A kind for the treatment of method and apparatus of packet out-ordering | |
CN110225083A (en) | Data push method and device based on view networking | |
CN110062195A (en) | A kind of video conference cut-in method and system | |
CN109462594A (en) | A kind of data processing method and system based on view networking | |
CN110048903A (en) | A kind of association turns gateway status monitoring method and device | |
CN110049280A (en) | The treating method and apparatus of monitoring data | |
CN109640027A (en) | Call method and device | |
CN109347930A (en) | A kind of task processing method and device | |
CN109151061A (en) | A kind of date storage method and device | |
CN110505107A (en) | A kind of monitoring method and view networking management system | |
CN110417792A (en) | Communication means, system, gateway and storage medium | |
CN109617766A (en) | A kind of heartbeat treating method and apparatus |
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 | ||
CB02 | Change of applicant information |
Address after: 100000 Dongcheng District, Beijing, Qinglong Hutong 1, 1103 house of Ge Hua building. Applicant after: Video Link Power Information Technology Co., Ltd. Address before: 100000 Beijing Dongcheng District gogoa building A1103-1113 Applicant before: BEIJING VISIONVERA INTERNATIONAL INFORMATION TECHNOLOGY CO., LTD. |
|
CB02 | Change of applicant information | ||
GR01 | Patent grant | ||
GR01 | Patent grant |