CN111859082A - Identification analysis method and device - Google Patents

Identification analysis method and device Download PDF

Info

Publication number
CN111859082A
CN111859082A CN202010460754.0A CN202010460754A CN111859082A CN 111859082 A CN111859082 A CN 111859082A CN 202010460754 A CN202010460754 A CN 202010460754A CN 111859082 A CN111859082 A CN 111859082A
Authority
CN
China
Prior art keywords
thread
terminal equipment
request
service request
thread pool
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010460754.0A
Other languages
Chinese (zh)
Inventor
李晓东
张翼
王伟
张宁宁
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fuxi Technology (Heze) Co.,Ltd.
Shandong Fuxi think tank Internet Research Institute
Original Assignee
Fuxi Technology Heze 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 Fuxi Technology Heze Co ltd filed Critical Fuxi Technology Heze Co ltd
Priority to CN202010460754.0A priority Critical patent/CN111859082A/en
Publication of CN111859082A publication Critical patent/CN111859082A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/953Querying, e.g. by the use of web search engines
    • 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/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities
    • H04L63/083Network architectures or network communication protocols for network security for authentication of entities using passwords
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities
    • H04L63/0876Network architectures or network communication protocols for network security for authentication of entities based on the identity of the terminal or configuration, e.g. MAC address, hardware or software configuration or device fingerprint

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Computing Systems (AREA)
  • Computer Security & Cryptography (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Software Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Power Engineering (AREA)
  • Telephonic Communication Services (AREA)

Abstract

The invention is applicable to the technical field of communication, and particularly relates to an identification analysis method and device, wherein the method comprises the following steps: receiving a connection request sent by terminal equipment through a main thread, and establishing connection with the terminal equipment according to the connection request; receiving a service request sent by terminal equipment for establishing connection through a main thread; judging whether an idle thread exists in a first thread pool, and if the idle thread exists, acquiring a service request sent by the terminal equipment from the main thread through the first thread pool; acquiring the service request from the first thread pool through the second thread pool and processing the service request to obtain a request processing result; the identifier analysis method processes different requests of the terminal device through the two thread pools, and can process a large number of service requests of the terminal device by using fewer threads, thereby reducing the memory occupied by the system and improving the availability of the system.

Description

Identification analysis method and device
Technical Field
The present invention relates to the field of communications technologies, and in particular, to an identifier parsing method and apparatus.
Background
The Handle mark is composed of digits, letters, symbols, characters and the like of a designated character set in a prefix/suffix mode, is used for marking the digital object marks of people, objects and data, and is inquired, registered and managed through a Handle mark analysis system. For example, a user may connect to the Handle identity resolution system by making a request through Handle identity registrar servers deployed around the world to obtain the server address of the prefix owner of the Handle identity owned by the user.
When an existing Handle identification analysis system receives a request of a terminal device, a main thread establishes a network connection and starts a thread, so that the network connection is handed to the thread to process the request of the terminal device, and response content of a processing result is returned to the network connection of the terminal device.
However, when the amount of requests from the terminal device increases, the existing system generally employs receiving and processing of multi-thread services, each thread requires a certain memory space, and more threads and memory spaces will cause memory overflow, which affects the availability of the system.
Disclosure of Invention
The embodiment of the invention provides an identification analyzing method and device, and aims to solve the problems that in the prior art, when the request amount of terminal equipment is increased, more threads need to be established, so that the required memory is increased, and the system availability is poor.
In a first aspect, an embodiment of the present application provides an identifier resolution method, where the method includes:
receiving a connection request sent by terminal equipment through a main thread, and establishing connection with the terminal equipment according to the connection request;
receiving a service request sent by terminal equipment for establishing connection through a main thread;
judging whether an idle thread exists in a first thread pool, and if the idle thread exists, acquiring a service request sent by the terminal equipment from the main thread through the first thread pool;
acquiring the service request from the first thread pool through the second thread pool and processing the service request to obtain a request processing result;
and sending the request processing result to the terminal equipment.
Optionally, the receiving, by the main thread, a service request sent by a terminal device that establishes a connection includes:
receiving an authentication request sent by terminal equipment for establishing connection through a main thread;
determining whether the terminal equipment passes the safety authentication according to the authentication request;
and acquiring a service request sent by the terminal equipment passing the security authentication through the main thread.
Optionally, the obtaining and processing the service request from the first thread pool through the second thread pool includes:
Generating an identification association task according to the service request, wherein the identification association task comprises an identification analysis task, an identification registration task and an identification attribute adding task;
respectively sending the identification analysis task, the identification registration task and the identification attribute adding task to corresponding logic processing units;
and acquiring a task processing result of each logic processing unit.
Optionally, the method further includes:
and sending the processing result to a database storage unit, and storing the processing result through the database storage unit.
Optionally, the method further includes:
and sending a heartbeat message to the terminal equipment, receiving a heartbeat response returned by the terminal equipment, and disconnecting the terminal equipment if the heartbeat response returned by the terminal equipment is not received within the preset time.
Optionally, the method further includes:
and acquiring the maximum accessible connection request number, and stopping responding to the connection request of the terminal equipment when the connection request number of the terminal equipment is greater than the maximum connection request number.
In a second aspect, an embodiment of the present invention provides an identifier resolution apparatus, where the apparatus includes: the system comprises a main thread receiving module, a first thread pool processing module, a second thread pool processing module and a result sending module;
The main thread receiving module is used for receiving a connection request sent by the terminal equipment and establishing connection with the terminal equipment according to the connection request; and the service request is used for receiving the service request sent by the terminal equipment for establishing the connection;
the first thread pool processing module is used for judging whether an idle thread exists in the first thread pool, and if the idle thread exists, acquiring a service request sent by the terminal equipment from the main thread through the first thread pool;
the second thread pool processing module is used for acquiring the service request from the first thread pool and processing the service request to acquire a request processing result;
and the result sending module is used for sending the request processing result to the terminal equipment.
In a third aspect, an embodiment of the present invention provides a server, including: at least one processor and memory;
the memory stores computer-executable instructions;
the at least one processor executing the memory-stored computer-executable instructions causes the at least one processor to perform the identity resolution method of any of the first aspects.
In a fourth aspect, an embodiment of the present invention provides an identifier resolution system, where the system includes a server and a terminal device.
In a fifth aspect, an embodiment of the present invention provides a computer-readable storage medium, where computer-executable instructions are stored, and when a processor executes the computer-executable instructions, the identifier resolution method according to any one of the above first aspects is implemented.
According to the method and the device for analyzing the identifier, the connection request sent by the terminal equipment is received through the main thread, and connection is established with the terminal equipment according to the connection request; receiving a service request sent by terminal equipment for establishing connection through a main thread; judging whether an idle thread exists in a first thread pool, and if the idle thread exists, acquiring a service request sent by the terminal equipment from the main thread through the first thread pool; acquiring the service request from the first thread pool through the second thread pool and processing the service request to obtain a request processing result; sending the request processing result to the terminal equipment; the invention respectively processes different requests of the terminal equipment through the two thread pools, realizes that the authentication requests and the service requests of a plurality of users can be processed in a time-sharing way by using the same thread without establishing a thread for each terminal equipment, thereby greatly reducing the memory occupied by the thread, solving the problem of memory overflow and improving the feasibility of the system.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
Fig. 1 is a schematic view of an application scenario of identifier resolution according to an embodiment of the present invention;
fig. 2 is a schematic flow chart of an identifier resolution method according to an embodiment of the present invention;
fig. 3 is a schematic flow chart of an identifier resolution method according to another embodiment of the present invention;
fig. 4 is a schematic flowchart of an identifier resolution method according to yet another embodiment of the present invention;
fig. 5 is a schematic structural diagram of an identifier resolution apparatus according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of an identifier resolution system according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of a server according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The terms "first," "second," "third," "fourth," and the like in the description and in the claims, as well as in the drawings, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are, for example, capable of operation in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Fig. 1 is a schematic view of an application scenario of identifier resolution according to an embodiment of the present invention, as shown in fig. 1, where 110 denotes a terminal device, and 120 denotes a server, where the terminal device 110 is configured to input a connection request, an authentication request, and a service request of a user, and receive a request processing result returned by the server 120; the server 120 is configured to process the received connection request, authentication request, and service request from the terminal device, and send a processing result to the terminal device.
In this embodiment, the Terminal device includes, but is not limited to, a Mobile Station (MS), a Mobile Terminal (Mobile Terminal), a Mobile phone (Mobile Telephone), a handset (handset), a portable device (portable device), and the like, and the Terminal device may communicate with one or more core networks through a Radio Access Network (RAN), for example, the Terminal device may be a Mobile phone (or referred to as a "cellular" phone), a computer with a wireless communication function, and the Terminal device may also be a portable, pocket, hand-held, computer-embedded, or vehicle-mounted Mobile device or device.
In the prior art, when processing a request of a terminal device, a Handle identifier parsing system establishes a network connection for each terminal device, starts a process, and processes the request of each terminal device through each process. In fact, when the identifier parsing method in the above manner is adopted in the face of a large number of requests of the terminal device, a large number of network connections and threads need to be established, and the running of the threads also needs a memory as a support, so that the memory occupied by the system is greatly increased, and when the memory occupied amount is increased to a certain value, the memory overflows, thereby affecting the availability of the system.
In order to solve the problem that the existing Handle identification analysis system occupies a large memory, the invention is provided with two thread pools, namely: the first thread pool and the second thread pool process the authentication request from the terminal equipment through the first thread pool, after the authentication request is completed, the thread in the first thread pool is changed into an idle state from a working state, the thread in the idle state can receive the service request of the terminal equipment and deliver the service request of the terminal equipment to the second thread pool for processing, and therefore the thread in the first thread pool can process the authentication request and the service request from the terminal equipment in different time periods, the requests of a large number of terminal equipment can be processed by adopting fewer threads, the occupation of the threads on a memory can be reduced, and the feasibility of a system is improved.
The following describes the technical solution of the present invention and how to solve the above technical problems with specific examples. The following several specific embodiments may be combined with each other, and details of the same or similar concepts or processes may not be repeated in some embodiments. Embodiments of the present invention will be described below with reference to the accompanying drawings.
Fig. 2 is a schematic flowchart of an identifier parsing method according to an embodiment of the present invention, where the method of this embodiment may be executed by an identifier parsing apparatus, and the identifier parsing apparatus may be arranged in the server in fig. 1 in a form of software and/or hardware. As shown in fig. 2, the method of this embodiment may include:
s201: and receiving a connection request sent by the terminal equipment through the main thread, and establishing connection with the terminal equipment according to the connection request.
In this embodiment, the main thread may acquire, in real time or periodically, the connection request sent by the terminal device. In an optional implementation manner, when the terminal device starts the identifier resolution system, the system may automatically send a connection request, and after receiving the connection request, the main thread establishes a connection channel between the main thread and the terminal device. The main thread can also acquire connection requests sent by the terminal equipment at preset intervals and establish connection channels with the terminal equipment respectively. Wherein the number of connection channels corresponds to the number of terminal devices. The connection channel may transmit, but is not limited to: and the authentication request and the service request are sent by the terminal equipment.
For example: and acquiring a connection request every 3s, and when the connection requests of the terminal equipment A, the terminal equipment B and the terminal equipment C are received in 3s, respectively establishing a connection channel A, a connection channel B and a connection channel C among the terminal equipment A, the terminal equipment B and the terminal equipment C by the main thread. The preset interval may be reasonably set according to actual conditions, which is not specifically limited in this embodiment.
S202: and receiving a service request sent by the terminal equipment for establishing the connection through the main thread.
In this embodiment, after the terminal device establishes a connection with the main thread, the terminal device may send a service request to the main thread through the connection channel. The service request refers to an operation processing request for the identifier, for example, when a deletion operation needs to be performed on the identifier attribute, the service request is to delete the identifier attribute. The main thread can receive the service request of the terminal equipment which has established the connection, but can not receive the service request of the terminal equipment which has not established the connection.
S203: and judging whether an idle thread exists in a first thread pool, and if so, acquiring a service request sent by the terminal equipment from the main thread through the first thread pool.
In this embodiment, the idle thread refers to that the current thread does not execute a task and is in an idle state; the opposite of an idle thread is a worker thread, i.e., the current thread is in a task-executing state. And if the current thread task is completely executed, the state of the thread is converted into an idle state from a working state.
In this embodiment, a certain number of threads may be preset in the first thread pool, and the greater and fewer the number of threads may affect the performance of the system, and when the number of threads is too small, a large number of requests of the terminal device may not be processed, and when the number of threads is too large, too much memory may be occupied, and the performance is poor. In practical application, the number of threads can be set according to the performance of the processor and the number of terminal devices.
When receiving the service request, the first thread pool does not completely receive the service request transmitted by the main thread, but needs to receive the service request according to the state of the thread in the first thread pool, and can receive the request of the terminal device when the idle state exists. Specifically, when a main thread sends N service requests, a first thread pool needs to judge the state of each thread in the pool first, and when more than or equal to N idle threads exist in the first thread pool, the first thread pool can receive the N service requests from the main thread; when M (M < N) idle threads exist in the first thread pool, the first thread pool may receive M service requests from the main thread, and the remaining (N-M) service requests may be received when the first thread pool has threads in an idle state. For example: when the main thread sends a service request, 5 threads in the first thread pool are all working threads, the first thread pool cannot receive the service request sent by the main thread, and the service request cannot be received until at least one of the 5 working threads in the first thread pool is an idle thread.
S204: and acquiring the service request from the first thread pool through a second thread pool, and processing the service request to obtain a request processing result.
In this embodiment, a service request sent by a terminal device is processed by a second thread pool, where the second thread pool first receives the service request sent by the first thread pool, and processes the service request by using a corresponding service processing unit to obtain a request processing result. For example: when the terminal equipment needs to analyze the Handle identification, the second thread pool firstly obtains the service request of the analysis operation from the first thread pool, and the service request processing unit is used for processing the service request of the analysis operation to obtain an identification analysis result.
S205: and sending the request processing result to the terminal equipment.
In this embodiment, after the second thread pool obtains the request processing result, the request processing result needs to be returned to the terminal device. Specifically, the request processing result may be sent to the terminal device through the second thread pool, or an output port may be redefined, and the output port obtains the request processing result from the second thread pool and returns the request processing result to the terminal device.
For example: when the request is to analyze the handle identifier 10.3866/pku. whxb201803024, the second thread pool analyzes the identifier, and the analysis result is obtained as follows: and the handle is marked as an academic paper, and the result is directly sent to the terminal equipment or transmitted to the terminal equipment through an output port.
In the identifier parsing method provided in this embodiment, a connection request sent by a terminal device is received through a main thread, a connection is established with the terminal device according to the connection request, a service request sent by the terminal device for establishing the connection is received through the main thread, whether an idle thread exists in a first thread pool is determined, if an idle thread exists, the service request sent by the terminal device is obtained from the main thread through a first thread pool, the service request is obtained from the first thread pool through a second thread pool and processed, a request processing result is obtained, and the request processing result is sent to the terminal device. According to the invention, different requests of the terminal equipment are respectively processed through the two thread pools, so that the requests of a large number of terminal equipment can be processed by adopting fewer threads without establishing a thread for each terminal equipment, thus the memory occupied by the threads is greatly reduced, the problem of memory overflow is solved, and the feasibility of the system is improved.
Fig. 3 is a second flowchart of the identifier parsing method according to the embodiment of the present invention, and as shown in fig. 3, on the basis of the above embodiment, the step S202 of the method according to the embodiment includes a step S301, a step S302, and a step S303.
Step S301, an authentication request sent by the terminal equipment for establishing the connection is received through the main thread.
In this embodiment, the authentication request is used to verify the identity of the terminal device that sent the authentication request, where the authentication request includes user information, and the authentication information may be a user name and a password, or may be a user code and a password; and realizing the identity recognition of the terminal equipment through the authentication information.
In addition, the request sent by the terminal device is not limited to the authentication request, and may include an initialization request. For example, when the terminal device uses the analysis system for the first time, the initial setting can be performed on the parameters of the system, so that the system can conform to the use habit of the client.
Step S302, determining whether the terminal equipment passes the safety authentication according to the authentication request.
In this embodiment, security verification needs to be performed on the terminal device before receiving the service request sent by the terminal device, and when the terminal device meets the security authentication requirement, the security authentication request of the terminal device is passed. Specifically, when the terminal device sends an authentication request, the main thread sends the authentication request to the first thread pool, and the first thread pool processes the authentication request according to the state of the thread. Specifically, whether an idle thread exists in a first thread pool or not is judged, and the authentication request is received when the idle thread exists; denying receipt of the authentication request when there is no idle thread. In order to reduce the occupation of the threads in the first thread pool, after the first thread pool receives the authentication request, the authentication request is sent to an authentication module for security authentication.
Specifically, after the authentication request is obtained, whether a user name or a user code in the authentication information exists in the system is judged, if yes, whether a password in the authentication information is consistent with a password stored in the system and corresponding to the user name or the user code is judged, if yes, the security authentication is successful, and otherwise, the security authentication fails. And when the user name or the user code does not exist in the system, returning a message that the user name or the user code does not exist to the terminal equipment.
Step S303, a service request sent by the terminal equipment passing the security authentication is obtained through the main thread.
In this embodiment, after the terminal device passes the security authentication, the main thread can receive the service request from the terminal device, so that the security of the identifier resolution system can be ensured according to different operation permissions of different clients.
Fig. 4 is a flowchart of a third method for analyzing an identifier according to an embodiment of the present invention, as shown in fig. 4, based on the foregoing embodiment, step S204 of the method according to the embodiment includes step S401, step S402, and step S403.
Step S401, generating an identification association task according to the service request, wherein the identification association task comprises an identification analysis task, an identification registration task and an identification attribute adding task.
In this embodiment, after the second thread pool obtains the service request, the service request may be classified according to the type of the service request, and after the service request is classified, the service may be quickly sent to the corresponding logical processing unit, so that the processing speed of the service request is increased. The identification association task includes, but is not limited to, an identification parsing task, an identification registration task, an identification attribute adding task, and the like.
And step S402, respectively sending the identification analysis task, the identification registration task and the identification attribute adding task to corresponding logic processing units.
And a plurality of logic processing units are arranged in the second thread pool and are respectively used for processing different service requests. Here, the logical processing unit includes, but is not limited to, an identification resolution processing unit, an identification registration processing unit, an added identification attribute processing unit, and the like. When the second thread pool receives a request for adding the identification attribute task, the task is sent to the identification attribute adding processing unit.
And step S403, acquiring a task processing result of each logic processing unit.
After each logical processing unit in the second thread pool completes processing the identifier association task, the processing result may be obtained, for example, when the identifier association task is an identifier resolution task, the identifier resolution logical unit processes the task, and returns the meaning represented by the identifier to the second thread pool. Such as: analyzing the Handle identifier 10.3866/PKU.WHXB201803024, and returning the meaning of the identifier, namely the academic paper, to the second thread pool.
In the conventional identifier parsing method, when an authentication request and a service request of a terminal device are processed, a BIO (blocking Input output) model is used, and under the model architecture of the BIO, data transmission is in a synchronous blocking mode, where synchronization refers to that after a request is sent and called, the call is not returned until a call result is not obtained. Blocking here means that the current thread will be suspended before the request results are returned and the current request will block the current thread.
In the conventional identifier parsing method, a network connection is established for each terminal device and a thread is started when a request is processed, each thread can only serve one terminal device, and when the terminal device does not send an authentication request or a service request, the thread can also occupy a memory (i.e., a blocking processing mode) all the time and wait for the terminal device to send the request.
When the identification analysis method of the invention processes the authentication request and the service request of the terminal equipment, an NIO (Non-blocking Input Output) model is adopted, under the NIO model architecture, the data transmission adopts an asynchronous Non-blocking mode, wherein the asynchronous mode is opposite to the synchronous mode, which means that the call is directly returned after the request call is sent; non-blocking is used herein in contrast to blocking, which means that the terminal device does not block the current thread until it has no result.
Specifically, a first thread pool and a second thread pool are adopted to separately process an authentication request and a service request sent by terminal equipment, threads between the first thread pool and a main process have the characteristic of multiplexing, when one thread finishes processing a current request, a working state is converted into an idle state, and the thread in the idle state can continuously process the authentication request or the service request from other terminal equipment. Therefore, the asynchronous non-blocking working mode adopted in the invention enables one thread between the first thread pool and the main thread to simultaneously process the requests of a plurality of terminal devices, and solves the problems of large occupied memory and low system feasibility caused by adopting multiple threads in the traditional analysis method.
In this embodiment, the method may further include: and sending the processing result to a database storage unit, and storing the processing result through the database storage unit.
In this embodiment, after the second thread pool obtains the request processing result, the request processing result may be sent to the database storage unit for saving, and the request processing result may be called from the database storage unit when the client accesses next time. Or, a large amount of hot spot data can be stored in the database storage unit, and when the hot spot data needs to be queried and processed, the query and data transmission through an external database are not needed, and the query and data transmission only need to be performed in the database of the current system. Compared with an external database, the method can improve the data query speed, accelerate the processing speed of the service request and improve the use experience of the user.
On the basis of the foregoing embodiment, the method of this embodiment may include: and sending a heartbeat message to the terminal equipment, receiving a heartbeat response returned by the terminal equipment, and disconnecting the terminal equipment if the heartbeat response returned by the terminal equipment is not received within the preset time.
In this embodiment, the data transmission and reception between the terminal device and the server are implemented based on SOCKET, but when the SOCKET is disconnected, the data transmission between the terminal device and the server is interrupted. To ensure efficient transmission of data, the state of the socket may be determined by sending heartbeat packets and receiving heartbeat replies. Specifically, the number of heartbeats may be set, for example, to 2. The time for sending the heartbeat packet can be set, and the heartbeat packet can be sent to the terminal equipment at preset intervals or sent to the terminal equipment at fixed time points. For example, a heartbeat packet is sent every two hours; or at 8 a.m.: 00. 9 in the morning: 00. 10 in the morning: and 00, respectively sending a heartbeat packet to the terminal equipment at three time points. The preset interval and the fixed time point may be reasonably set according to actual conditions, which is not specifically limited in this embodiment.
When the terminal device receives the heartbeat packet, a fixed message is replied to the server to indicate that the socket between the terminal device and the server is not disconnected, when the terminal device does not reply the message to the server within the preset time, the server judges that the socket of the terminal device is disconnected and closes the network connection of the terminal device, and when the terminal device needs to send request information to the server, the network connection with the server needs to be established again.
According to the method, the heartbeat packet is sent to the terminal equipment, the connection state between the terminal equipment and the server can be detected, and the network connection can be closed or reestablished according to the detection result, so that the reliability of the system operation is ensured.
On the basis of the foregoing embodiment, the method of this embodiment may include: and acquiring the maximum accessible connection request number, and stopping responding to the connection request of the terminal equipment when the connection request number of the terminal equipment is greater than the maximum connection request number.
In this embodiment, the maximum number of requests of the accessible terminal device may also be set according to the performance of the server, for example: the maximum request number of the accessible terminal equipment is set to be ten thousand, and when the connection request number of the terminal equipment exceeds ten thousand, the server refuses to receive the connection request of the terminal equipment, so that the problem of system paralysis caused by the connection of a large number of terminal equipment at a certain time can be prevented. The maximum number of connection requests is related to physical conditions such as the memory of the server and the performance of the processor.
Fig. 5 is a schematic structural diagram of an identifier resolution apparatus according to an embodiment of the present invention, and as shown in fig. 5, the identifier resolution apparatus 500 according to this embodiment may include: a main thread receiving module 501, a first thread pool processing module 502, a second thread pool processing module 503 and a result sending module 504.
The main thread receiving module 501 is configured to receive a connection request sent by a terminal device, and establish a connection with the terminal device according to the connection request; and the terminal equipment is used for receiving the service request sent by the terminal equipment for establishing the connection.
The first thread pool processing module 502 is configured to determine whether an idle thread exists in a first thread pool, and if an idle thread exists, obtain, from the main thread, a service request sent by the terminal device through the first thread pool.
A second thread pool processing module 503, configured to obtain the service request from the first thread pool, and process the service request to obtain a request processing result.
A result sending module 504, configured to send the request processing result to the terminal device.
The identifier resolution device provided in the embodiment of the present invention can implement the identifier resolution method according to the embodiment shown in fig. 2 and fig. 3, and the implementation principle and the technical effect are similar, which are not described herein again.
Fig. 6 is a schematic structural diagram of the identifier resolution system according to the embodiment of the present invention, as shown in the drawing, the terminal device 601 may be multiple terminal devices, a connection channel needs to be established between each terminal device and the main thread 602, and the main thread 602 may establish connection with the terminal device 601 according to a connection request after receiving the connection request sent by the terminal device 601. After the connection is established, the terminal device 601 may send an authentication request or a service request to the first thread pool 603 through the main thread 602, where a preset number of threads may be established between the first thread pool 603 and the main thread 602, and when the first thread pool 603 receives the authentication request or the service request sent by the main thread 602, it is required to check thread states of the preset number first, to determine whether there is an idle thread, and when there is an idle thread, it may receive the authentication request or the service request. When the first thread pool 603 receives the authentication request, the authentication request is sent to the authentication module 604 for processing, and the authentication module 604 processes the authentication request and sends the authentication result to the first thread pool 603. When the terminal device passing the security authentication sends a service request to the first thread pool 603, the first thread pool 603 directly sends the service request to the second thread pool 605, and processes the service request through different logical processing units in the second thread pool 605. When the second thread pool 605 finishes processing the service request, a request processing result is obtained, the second thread pool 605 may send the request processing result to the first thread pool 603, and the first thread pool 603 returns the request processing result to the corresponding terminal device through the main thread.
In addition, the identifier resolution system may further include a database storage unit 606, and after the second thread pool 605 obtains the request processing result, the result may be stored in the database storage unit, and when the client accesses the request processing result next time, the request processing result may be called from the database storage unit.
Fig. 7 is a schematic diagram of a server according to an embodiment of the present invention. As shown in fig. 7, the server 700 provided in the present embodiment includes: at least one processor 701 and a memory 702. The processor 701 and the memory 702 are connected by a bus 703.
In a specific implementation process, the at least one processor 701 executes computer-executable instructions stored in the memory 702, so that the at least one processor 701 executes the identifier resolution method in the foregoing method embodiment.
For a specific implementation process of the processor 701, reference may be made to the above method embodiments, which implement principles and technical effects similar to each other, and details of this embodiment are not described herein again.
In the embodiment shown in fig. 7, it should be understood that the Processor may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of a method disclosed in connection with the present invention may be embodied directly in a hardware processor, or in a combination of the hardware and software modules within the processor.
The memory may comprise high speed RAM memory and may also include non-volatile storage NVM, such as at least one disk memory.
The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, an Extended ISA (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, the buses in the figures of the present invention are not limited to only one bus or one type of bus.
The embodiment of the present invention further provides a computer-readable storage medium, where a computer execution instruction is stored in the computer-readable storage medium, and when a processor executes the computer execution instruction, the identifier resolution method of the above method embodiment is implemented.
The computer-readable storage medium may be implemented by any type of volatile or non-volatile memory device or combination thereof, such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disk. Readable storage media can be any available media that can be accessed by a general purpose or special purpose computer.
An exemplary readable storage medium is coupled to the processor such the processor can read information from, and write information to, the readable storage medium. Of course, the readable storage medium may also be an integral part of the processor. The processor and the readable storage medium may reside in an Application Specific Integrated Circuits (ASIC). Of course, the processor and the readable storage medium may also reside as discrete components in the apparatus.
Those of ordinary skill in the art will understand that: all or a portion of the steps of implementing the above-described method embodiments may be performed by hardware associated with program instructions. The aforementioned program may be stored in a computer-readable storage medium. When executed, the program performs steps comprising the method embodiments described above; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and 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 still be modified, or some or all of the 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 (10)

1. An identifier resolution method applied to a server, the method comprising:
receiving a connection request sent by terminal equipment through a main thread, and establishing connection with the terminal equipment according to the connection request;
receiving a service request sent by terminal equipment for establishing connection through a main thread;
judging whether an idle thread exists in a first thread pool, and if the idle thread exists, acquiring a service request sent by the terminal equipment from the main thread through the first thread pool;
acquiring the service request from the first thread pool through a second thread pool and processing the service request to obtain a request processing result;
and sending the request processing result to the terminal equipment.
2. The identity resolution method according to claim 1, wherein the receiving, by the main thread, the service request sent by the terminal device that establishes the connection includes:
receiving an authentication request sent by terminal equipment for establishing connection through a main thread;
determining whether the terminal equipment passes the safety authentication according to the authentication request;
and acquiring a service request sent by the terminal equipment passing the security authentication through the main thread.
3. The identifier resolution method according to claim 1, wherein the obtaining and processing the service request from the first thread pool through the second thread pool comprises:
Generating an identification association task according to the service request, wherein the identification association task comprises an identification analysis task, an identification registration task and an identification attribute adding task;
respectively sending the identification analysis task, the identification registration task and the identification attribute adding task to corresponding logic processing units;
and acquiring a task processing result of each logic processing unit.
4. The identity resolution method of claim 3, further comprising:
and sending the processing result to a database storage unit, and storing the processing result through the database storage unit.
5. The identity resolution method of claim 4, further comprising:
and sending a heartbeat message to the terminal equipment, receiving a heartbeat response returned by the terminal equipment, and disconnecting the terminal equipment if the heartbeat response returned by the terminal equipment is not received within the preset time.
6. The identity resolution method of any one of claims 1-5, further comprising:
and acquiring the maximum accessible connection request number, and stopping responding to the connection request of the terminal equipment when the connection request number of the terminal equipment is greater than the maximum connection request number.
7. An identity resolution apparatus, the apparatus comprising: the system comprises a main thread receiving module, a first thread pool processing module, a second thread pool processing module and a result sending module;
the main thread receiving module is used for receiving a connection request sent by the terminal equipment and establishing connection with the terminal equipment according to the connection request; and the service request is used for receiving the service request sent by the terminal equipment for establishing the connection;
the first thread pool processing module is used for judging whether an idle thread exists in the first thread pool, and if the idle thread exists, acquiring a service request sent by the terminal equipment from the main thread through the first thread pool;
the second thread pool processing module is used for acquiring the service request from the first thread pool and processing the service request to acquire a request processing result;
and the result sending module is used for sending the request processing result to the terminal equipment.
8. A server, comprising: at least one processor and memory;
the memory stores computer-executable instructions;
the at least one processor executing the memory-stored computer-executable instructions cause the at least one processor to perform the identity resolution method of any of claims 1 to 6.
9. An identity resolution system, characterized in that the system comprises the server and the terminal device of claim 8.
10. A computer-readable storage medium having computer-executable instructions stored thereon, which when executed by a processor, implement the identity resolution method of any one of claims 1 to 6.
CN202010460754.0A 2020-05-27 2020-05-27 Identification analysis method and device Pending CN111859082A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010460754.0A CN111859082A (en) 2020-05-27 2020-05-27 Identification analysis method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010460754.0A CN111859082A (en) 2020-05-27 2020-05-27 Identification analysis method and device

Publications (1)

Publication Number Publication Date
CN111859082A true CN111859082A (en) 2020-10-30

Family

ID=72985245

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010460754.0A Pending CN111859082A (en) 2020-05-27 2020-05-27 Identification analysis method and device

Country Status (1)

Country Link
CN (1) CN111859082A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115242578A (en) * 2022-07-29 2022-10-25 招商局金融科技有限公司 VPN connection management method, device, computer equipment and storage medium

Citations (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040267916A1 (en) * 2003-06-25 2004-12-30 International Business Machines Corporation Method for improving performance in a computer storage system by regulating resource requests from clients
CN102546437A (en) * 2012-02-20 2012-07-04 南京邮电大学 Internet of things platform-oriented socket implementation method
CN103249120A (en) * 2012-02-03 2013-08-14 华为终端有限公司 Power-saving method and device for wireless fidelity WiFi access point equipment
US20130282853A1 (en) * 2012-04-20 2013-10-24 Electronics And Telecommunications Research Institute Apparatus and method for processing data in middleware for data distribution service
CN103490945A (en) * 2013-08-09 2014-01-01 上海斐讯数据通信技术有限公司 Method for detecting maximum telnet user quantity
CN103873472A (en) * 2014-03-18 2014-06-18 广州市纬志电子科技有限公司 Method for automatically having access to network
CN104980420A (en) * 2014-09-28 2015-10-14 腾讯科技(深圳)有限公司 Business processing method, device, terminal and server
US20160277969A1 (en) * 2009-10-30 2016-09-22 Pradeep J. Iyer Balancing Clients Across Bands in a Single Access Point
CN109257411A (en) * 2018-07-31 2019-01-22 平安科技(深圳)有限公司 A kind of method for processing business calls management system and computer equipment
CN109634738A (en) * 2018-10-19 2019-04-16 深圳平安财富宝投资咨询有限公司 Asynchronous processing method, server, storage medium and device based on micro services
CN110134578A (en) * 2019-05-23 2019-08-16 浙江齐治科技股份有限公司 A kind of data processing method and device
CN110515725A (en) * 2019-08-14 2019-11-29 威富通科技有限公司 Service request processing method, computer storage medium, server and system
CN110750339A (en) * 2018-07-23 2020-02-04 杭州海康威视***技术有限公司 Thread scheduling method and device and electronic equipment
CN111124702A (en) * 2019-11-22 2020-05-08 腾讯科技(深圳)有限公司 Performance data acquisition method, device and computer readable storage medium

Patent Citations (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040267916A1 (en) * 2003-06-25 2004-12-30 International Business Machines Corporation Method for improving performance in a computer storage system by regulating resource requests from clients
US20160277969A1 (en) * 2009-10-30 2016-09-22 Pradeep J. Iyer Balancing Clients Across Bands in a Single Access Point
CN103249120A (en) * 2012-02-03 2013-08-14 华为终端有限公司 Power-saving method and device for wireless fidelity WiFi access point equipment
CN102546437A (en) * 2012-02-20 2012-07-04 南京邮电大学 Internet of things platform-oriented socket implementation method
US20130282853A1 (en) * 2012-04-20 2013-10-24 Electronics And Telecommunications Research Institute Apparatus and method for processing data in middleware for data distribution service
CN103490945A (en) * 2013-08-09 2014-01-01 上海斐讯数据通信技术有限公司 Method for detecting maximum telnet user quantity
CN103873472A (en) * 2014-03-18 2014-06-18 广州市纬志电子科技有限公司 Method for automatically having access to network
CN104980420A (en) * 2014-09-28 2015-10-14 腾讯科技(深圳)有限公司 Business processing method, device, terminal and server
CN110750339A (en) * 2018-07-23 2020-02-04 杭州海康威视***技术有限公司 Thread scheduling method and device and electronic equipment
CN109257411A (en) * 2018-07-31 2019-01-22 平安科技(深圳)有限公司 A kind of method for processing business calls management system and computer equipment
WO2020024469A1 (en) * 2018-07-31 2020-02-06 平安科技(深圳)有限公司 Service processing method, calling management system and computer device
CN109634738A (en) * 2018-10-19 2019-04-16 深圳平安财富宝投资咨询有限公司 Asynchronous processing method, server, storage medium and device based on micro services
CN110134578A (en) * 2019-05-23 2019-08-16 浙江齐治科技股份有限公司 A kind of data processing method and device
CN110515725A (en) * 2019-08-14 2019-11-29 威富通科技有限公司 Service request processing method, computer storage medium, server and system
CN111124702A (en) * 2019-11-22 2020-05-08 腾讯科技(深圳)有限公司 Performance data acquisition method, device and computer readable storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
刘新强等: "用线程池解决服务器并发请求的方案设计", 《现代电子技术》 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115242578A (en) * 2022-07-29 2022-10-25 招商局金融科技有限公司 VPN connection management method, device, computer equipment and storage medium

Similar Documents

Publication Publication Date Title
EP3223549B1 (en) Wireless network access method and access apparatus, client and storage medium
CN104967997B (en) A kind of Wi-Fi cut-in method, Wi-Fi equipment, terminal device and system
CN110602691B (en) Mobile communication method and device based on block chain network
CN109688186B (en) Data interaction method, device, equipment and readable storage medium
EP3046394B1 (en) Message processing method and mme selection method and device
EP3319293A1 (en) Cross-terminal login-free method and device
US20130109351A1 (en) Authentication system, authentication method and authentication server
CN109743722B (en) Network connection processing method and device
CN109379779B (en) Dialing networking method and device, computer equipment and storage medium
CN111988824A (en) Network switching method and device, electronic equipment and storage medium
CN107172194B (en) Virtual SIM card management method and device and communication terminal
CN110798453B (en) Data processing method and device for one-key login
CN113873491A (en) Communication apparatus, system, and computer-readable storage medium
CN112788518B (en) Location service processing method and related equipment
CN111859082A (en) Identification analysis method and device
US11064344B2 (en) Physical address-based communication method, mobile terminal and communication database
CN116055403A (en) Message data transmission method, device and server
CN113365272B (en) Method and system for preventing network from being rubbed
CN111885583B (en) Network sharing method and device
CN110719586B (en) Service establishing method, device and server
CN106341861B (en) Method, server and system for identifying wireless access point
CN105163335B (en) A kind of network access management method, server, mobile terminal and system
RU2746890C1 (en) Method, device and system of access rejection, data carrier and processor
CN108076460B (en) Method and terminal for authentication
CN114051243B (en) Verification method, verification device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
TA01 Transfer of patent application right

Effective date of registration: 20201028

Address after: NO.666, Tianxiang Road, Danyang street, Heze Development Zone, Shandong Province

Applicant after: Fuxi Technology (Heze) Co.,Ltd.

Applicant after: Shandong Fuxi think tank Internet Research Institute

Address before: No. 666, Tianxiang Road, Mudan District, Heze City, Shandong Province

Applicant before: Fuxi Technology (Heze) Co.,Ltd.

TA01 Transfer of patent application right
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20201030

RJ01 Rejection of invention patent application after publication