Nothing Special   »   [go: up one dir, main page]

CN111935316A - Method and device for acquiring front-end equipment catalog - Google Patents

Method and device for acquiring front-end equipment catalog Download PDF

Info

Publication number
CN111935316A
CN111935316A CN202011027253.XA CN202011027253A CN111935316A CN 111935316 A CN111935316 A CN 111935316A CN 202011027253 A CN202011027253 A CN 202011027253A CN 111935316 A CN111935316 A CN 111935316A
Authority
CN
China
Prior art keywords
directory
http
sip
request
synchronization request
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202011027253.XA
Other languages
Chinese (zh)
Other versions
CN111935316B (en
Inventor
王洵
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wuhan Zhongke Tongda High New Technology Co Ltd
Original Assignee
Wuhan Zhongke Tongda High New Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Wuhan Zhongke Tongda High New Technology Co Ltd filed Critical Wuhan Zhongke Tongda High New Technology Co Ltd
Priority to CN202011027253.XA priority Critical patent/CN111935316B/en
Publication of CN111935316A publication Critical patent/CN111935316A/en
Application granted granted Critical
Publication of CN111935316B publication Critical patent/CN111935316B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • H04L67/025Protocols based on web technology, e.g. hypertext transfer protocol [HTTP] for remote control or remote monitoring of applications
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1095Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/12Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/146Markers for unambiguous identification of a particular session, e.g. session cookie or URL-encoding
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Health & Medical Sciences (AREA)
  • Computing Systems (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Telephonic Communication Services (AREA)

Abstract

The application provides a front-end equipment directory obtaining method and a device, based on the method, a data server firstly sends out an http directory synchronous request based on an http protocol and converts the http directory synchronous request into an sip directory synchronous request which can be identified by front-end equipment, then the sip directory synchronous response returned by the front-end equipment is converted into an http directory synchronous response and then returned to a traffic police terminal, the traffic police terminal can complete the whole directory obtaining process only by sending out a request once on a web browser or a platform, the obtaining process is simplified, in addition, the front-end equipment directory is generated by a plurality of returned sip directory synchronous responses inside and then returned to the traffic police terminal in an http directory synchronous response mode, the front-end equipment directory with a complete structure can be directly obtained, and the technical problem that the obtained data are more split is improved.

Description

Method and device for acquiring front-end equipment catalog
Technical Field
The application relates to the field of intelligent traffic, in particular to a front-end equipment catalog obtaining method and device.
Background
In an intelligent traffic system, front-end equipment arranged in a monitoring place is developed and communicated on the basis of an sip protocol, the sip is a bidirectional protocol, and the size of single-transmission data is limited. When the system needs to perform directory synchronization operation, a request is sent to the front-end equipment, all the front-end equipment in the system returns corresponding directory data based on the request, and because the directory data volume is large, the transmission cannot be completed through the sip protocol once.
Therefore, the existing front-end equipment directory acquisition method has the technical problems of data fragmentation and complex process, and needs to be improved.
Disclosure of Invention
The embodiment of the application provides a method and a device for acquiring a front-end equipment directory, which are used for relieving the technical problems of data splitting and complex process in the conventional method for acquiring the front-end equipment directory.
In order to solve the above technical problem, an embodiment of the present application provides the following technical solutions:
the application provides a front-end equipment directory obtaining method, is applicable to wisdom traffic system, wisdom traffic system includes front-end equipment, data server and traffic police's terminal, front-end equipment is direct based on the sip agreement or connect through the platform data server, the traffic police terminal is based on the http agreement connection data server, front-end equipment directory obtaining method is applied to data server, front-end equipment directory obtaining method includes:
receiving an http directory synchronization request sent by the traffic police terminal based on an http protocol, wherein the http directory synchronization request carries a terminal identifier and a target device type identifier;
generating an sip directory synchronization request corresponding to the http directory synchronization request according to the type identifier of the target device, and binding the http directory synchronization request and the sip directory synchronization request to generate a request pair;
sending the sip directory synchronization request to the target front-end equipment corresponding to the target equipment type identification based on the sip protocol;
receiving a plurality of sip directory synchronous responses returned by the target front-end equipment based on the sip protocol, wherein the sip directory synchronous responses carry directory data, and generating a front-end equipment directory according to the received preset number of entry directory data when the number of the received directory data is equal to a preset value;
updating the processing state of the http directory synchronization request corresponding to the sip directory synchronization request as the request is processed based on the request pair;
and generating an http directory synchronous response carrying the front-end equipment directory, and returning the http directory synchronous response to the traffic police terminal based on an http protocol according to the terminal identifier.
Simultaneously, this application embodiment still provides a front end equipment directory acquisition device, is applicable to wisdom traffic system, wisdom traffic system includes front end equipment, data server and traffic police's terminal, front end equipment is direct or connect through the platform based on the sip protocol data server, the traffic police's terminal is connected based on the http protocol data server, front end equipment directory acquisition device sets up in the data server, front end equipment directory acquisition device includes:
the receiving module is used for receiving an http directory synchronization request sent by the traffic police terminal based on an http protocol, wherein the http directory synchronization request carries a terminal identifier and a target device type identifier;
the request generation module is used for generating an sip directory synchronization request corresponding to the http directory synchronization request according to the type identifier of the target device and binding the http directory synchronization request and the sip directory synchronization request to generate a request pair;
a sending module, configured to send the sip directory synchronization request to a target front-end device corresponding to the target device type identifier based on an sip protocol;
the system comprises a catalog generation module, a front-end equipment catalog generation module and a front-end equipment catalog generation module, wherein the catalog generation module is used for receiving a plurality of sip catalog synchronous responses returned by the target front-end equipment based on an sip protocol, the sip catalog synchronous responses carry catalog data, and when the number of the received catalog data is equal to a preset value, the catalog generation module generates the front-end equipment catalog according to the received preset number of item catalog data;
the updating module is used for updating the processing state of the http directory synchronization request corresponding to the sip directory synchronization request as the request is processed based on the request pair;
and the returning module is used for generating an http directory synchronous response carrying the front-end equipment directory and returning the http directory synchronous response to the traffic police terminal based on an http protocol according to the terminal identifier.
The application also provides an electronic device comprising a memory and a processor; the memory stores an application program, and the processor is configured to run the application program in the memory to perform any operation in the front-end device directory acquisition method.
Has the advantages that: the embodiment of the application provides a method and a device for acquiring a front-end equipment directory, the method is suitable for an intelligent traffic system, in the method, a data server firstly receives an http directory synchronization request sent by a traffic police terminal based on an http protocol, and the http directory synchronization request carries a terminal identifier and a target equipment type identifier; generating an sip directory synchronization request corresponding to the http directory synchronization request according to the type identifier of the target device, and binding the http directory synchronization request and the sip directory synchronization request to generate a request pair; sending an sip directory synchronization request to target front-end equipment corresponding to the type identifier of the target equipment based on an sip protocol; receiving a plurality of sip directory synchronous responses returned by target front-end equipment based on the sip protocol, wherein the sip directory synchronous responses carry directory data, and generating a front-end equipment directory according to the received preset number of entry directory data when the number of the received directory data is equal to a preset value; updating the processing state of the http directory synchronization request corresponding to the sip directory synchronization request as the request is processed based on the request pair; and generating an http directory synchronous response carrying the front-end equipment directory, and returning the http directory synchronous response to the traffic police terminal based on the http protocol according to the terminal identifier. The method and the system send out an http directory synchronous request based on an http protocol, convert the http directory synchronous request into an sip directory synchronous request which can be identified by front-end equipment, convert an sip directory synchronous response returned by the front-end equipment into an http directory synchronous response and return to the traffic police terminal, the traffic police terminal can finish the whole directory acquisition process only by sending out a request once on a web browser or a platform, the acquisition flow is simplified, in addition, a plurality of returned sip directory synchronous responses are generated into the front-end equipment directory in the internal part and then returned to the traffic police terminal in an http directory synchronous response mode, the front-end equipment directory with a complete structure can be directly acquired, and the technical problem that the acquired data are split is improved. In the protocol conversion process, by means of generating a request pair, after receiving the sip directory synchronization response, the corresponding http directory synchronization request can be quickly searched, and the http directory synchronization response can be generated and returned, so that the response is generated quickly, and the directory synchronization efficiency is improved.
Drawings
The technical solution and other advantages of the present application will become apparent from the detailed description of the embodiments of the present application with reference to the accompanying drawings.
Fig. 1 is a schematic view of a scenario of a front-end device directory synchronization system according to an embodiment of the present application.
Fig. 2 is a schematic flowchart of a front-end device directory obtaining method according to an embodiment of the present application.
Fig. 3 is a schematic diagram of a first model of a front-end device directory obtaining method according to an embodiment of the present application.
Fig. 4 is a schematic diagram of a second model of a front-end device directory obtaining method according to an embodiment of the present application.
Fig. 5 is a schematic diagram of a third model of a front-end device directory obtaining method according to an embodiment of the present application.
Fig. 6 is a schematic diagram of a fourth model of a front-end device directory obtaining method according to an embodiment of the present application.
Fig. 7 is a schematic diagram illustrating a comparison between the prior art and the front-end device for directory acquisition between the traffic police terminal and the front-end device in the present application.
Fig. 8 is a schematic structural diagram of a front-end device directory obtaining apparatus according to an embodiment of the present application.
Fig. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. It is to be understood that the embodiments described are only a few embodiments of the present application and not all 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 application.
In the embodiment of the present application, the intelligent traffic system is an integrated network system that is constructed by comprehensively applying technologies such as audio/video monitoring, communication, computer network, system integration, etc. and has functions of information acquisition, transmission, exchange, control, display, storage, processing, etc. and can realize interconnection, intercommunication, and mutual control between different devices and systems in the traffic field for the purpose of maintaining national security and social stability and preventing and fighting against illegal criminal activities. The intelligent traffic system comprises front-end equipment, a data server and a traffic police terminal, wherein the front-end equipment is directly connected with the data server or is connected with the data server through a platform based on an sip protocol, and the traffic police terminal is connected with the data server based on an http protocol.
In the embodiment of the present application, the front-end device refers to a device installed in a monitoring site in an intelligent traffic system and used for information acquisition, encoding, processing, storage, transmission, and safety control, and a platform to which the device belongs, and specifically may include a front-end camera, a Network Video Recorder (NVR), a front-end device platform, and the like.
In the embodiment of the present application, the traffic police terminal refers to a client device that is registered and authorized by the intelligent transportation system and has operation and query requirements on data and devices in the system, and may specifically include a client for traffic police and a client for developers.
The embodiment of the application provides a method and a device for acquiring a front-end equipment directory and electronic equipment. The front-end device directory synchronization apparatus may be integrated in an electronic device, and the electronic device may be a server or a terminal.
Referring to fig. 1, fig. 1 is a schematic view of a scenario of a front-end device directory synchronization system according to an embodiment of the present disclosure, where the system may include terminals and servers, and the terminals, the servers, and the terminals and the servers are connected and communicated through internet formed by various gateways, and the like, where the application scenario includes a traffic police terminal 11, a data server 12, and a front-end device 13; wherein:
the traffic police terminal 11 includes, but is not limited to, a tablet Computer, a notebook Computer, a Personal Computer (PC), a mini processing box, or other devices;
the data server 12 comprises a local server and/or a remote server and the like;
the front-end equipment 13 includes video and image acquisition equipment disposed at a monitoring site.
The traffic police terminal 11, the data server 12 and the front-end equipment 13 are located in a wireless network or a wired network, the traffic police terminal 11 is connected with the data server 12 based on an http protocol, and the front-end equipment 13 is connected with the data server 12 based on an sip protocol, so as to realize data interaction among the traffic police terminal 11, the data server 12 and the front-end equipment, wherein:
the data server 12 receives an http directory synchronization request sent by the traffic police terminal based on an http protocol, wherein the http directory synchronization request carries a terminal identifier and a target device type identifier; then generating an sip directory synchronization request corresponding to the http directory synchronization request according to the type identifier of the target device, and binding the http directory synchronization request and the sip directory synchronization request to generate a request pair; then based on sip protocol, sending sip directory synchronization request to the target front-end device corresponding to the target device type identifier; then receiving a plurality of sip directory synchronous responses returned by the target front-end equipment based on the sip protocol, wherein the sip directory synchronous responses carry directory data, and generating a front-end equipment directory according to the received preset number of entry directory data when the number of the received directory data is equal to a preset value; updating the processing state of the http directory synchronization request corresponding to the sip directory synchronization request as the request is processed based on the request pair; and finally, generating an http directory synchronous response carrying the front-end equipment directory, and returning the http directory synchronous response to the traffic police terminal based on the http protocol according to the terminal identifier.
It should be noted that the system scenario diagram shown in fig. 1 is only an example, and the server and the scenario described in the embodiment of the present application are for more clearly illustrating the technical solution of the embodiment of the present application, and do not form a limitation on the technical solution provided in the embodiment of the present application, and as a person having ordinary skill in the art knows, with the evolution of the system and the occurrence of a new service scenario, the technical solution provided in the embodiment of the present application is also applicable to similar technical problems. The following are detailed below. It should be noted that the following description of the embodiments is not intended to limit the preferred order of the embodiments.
Referring to fig. 2, fig. 2 is a schematic flowchart of a method for acquiring a directory of a front-end device according to an embodiment of the present application, where the method includes:
s201: and receiving an http directory synchronization request sent by the traffic police terminal based on an http protocol, wherein the http directory synchronization request carries a terminal identifier and a target equipment type identifier.
The front-end equipment arranged in the monitoring place is used for collecting the image and video information within the visual angle range of the front-end equipment, and the traffic police terminal carries out operations such as identification and processing of illegal criminal behaviors according to the collected information. For each front-end device, a corresponding front-end device directory is provided in the traffic police, and each directory contains information such as the installation position, the device name, the device ID and the like of the corresponding front-end device. For the traffic police system, the number, the position, and the like of the front-end devices may change with the monitoring requirements, for example, a new front-end device may be installed in a new monitoring location, or an original front-end device may be replaced in an old monitoring location, or parameters of an existing front-end device may be adjusted accordingly. For the operations of these front ends, the front-end device or the front-end device directory in the platform to which the front-end device belongs is changed, and the data in the front-end device directory stored on the side of the traffic police terminal is still old data, so that it is necessary for the traffic police terminal to send a directory synchronization request to the front-end device, and to synchronously update the front-end device directory on the side of the traffic police terminal according to the response returned after the front-end device processes, so as to keep the directories in the front-end device and the traffic police terminal consistent.
The method comprises the steps that a traffic police terminal sends an http directory synchronization request to a data server based on an http protocol, when the request is sent, a sender can be an internal person of a public security system and is used for obtaining directory information of specific types of front-end equipment of a monitoring place to determine which front-end equipment has access authority currently, information on corresponding equipment can be called to judge and process illegal behaviors, the sender can also be a developer of the front-end equipment with the access authority and is used for synchronizing the directories of the front-end equipment, and whether debugging and optimization are needed to be conducted on some relevant parameters of the system or the front-end equipment or not is determined according to a returned response. The http directory synchronization request can be sent through a video monitoring platform developed independently, or can be directly sent through a web browser and received by a data server. The request under the http protocol is a one-way channel request from the traffic police terminal to the data server.
The http directory synchronization request carries a terminal identifier and a target device type identifier, wherein the terminal identifier comprises an IP address and a port of a traffic police terminal, the target device type identifier is used for distinguishing the type of the front-end device, for example, the front-end device can be divided into a front-end camera or a network video recorder, the target device type identifier comprises a common identifier of the front-end devices belonging to the same type, for example, when the directory of all the front-end cameras is required to be inquired, the target device type identifier is a camera identifier, and when the directory of all the network video recorders is required to be inquired, the target device type identifier is a video recorder identifier. In addition, the front-end device may not be directly connected to the data server, but the front-end device platform stores the directory information of the front-end devices, so that the http directory synchronization request sent by the traffic police terminal is not received by the front-end device, but is received and processed by the front-end device platform, and accordingly, the target device type identifier includes the platform identifier of the front-end device platform.
S202: and generating an sip directory synchronization request corresponding to the http directory synchronization request according to the type identifier of the target device, and binding the http directory synchronization request and the sip directory synchronization request to generate a request pair.
After receiving the http directory synchronization request, determining all target front-end devices under the type identification from the front-end device cluster information stored in the data server according to the target device type identification carried by the http directory synchronization request, acquiring access addresses of the target front-end devices, and generating a request header in the sip directory synchronization request according to the access addresses. And then, converting each synchronous command in the http directory synchronous request into a synchronous command under an sip protocol, generating the synchronous command into a message body in the sip directory synchronous request, and combining a request head and the message body to generate the corresponding sip directory synchronous request.
After the sip directory synchronous request is generated, the http directory synchronous request and the sip directory synchronous request are bundled to generate a request pair, after a subsequent sip directory synchronous response comes, according to the corresponding relation between the sip directory synchronous response and the sip directory synchronous request, which sip request the response belongs to can be determined, and according to the one-to-one corresponding relation between the http directory synchronous request and the sip directory synchronous request in the request pair, which http request the response corresponds to can be further determined. The two are bound to generate a request pair, and after a response is obtained, the response can be timely corresponding to an original request sent by the traffic police terminal, so that the subsequent processing process of the response is accelerated.
S203: and sending an sip directory synchronization request to the target front-end equipment corresponding to the target equipment type identification based on the sip protocol.
After the sip catalog synchronous request is obtained, all front-end equipment belonging to the type is determined according to the type identification of the target equipment and is used as the target front-end equipment, then a sip session is established between the data server and the target front-end equipment, the sip catalog synchronous request is sent to the corresponding target front-end equipment, and the target front-end equipment processes the request after receiving the sip catalog synchronous request.
S204: and receiving a plurality of sip directory synchronous responses returned by the target front-end equipment based on the sip protocol, wherein the sip directory synchronous responses carry directory data, and generating the front-end equipment directory according to the received preset number of entry directory data when the number of the received directory data is equal to a preset value.
The method comprises the steps that a sip catalog synchronous request is sent between a data server and target front-end equipment based on a sip protocol, the target front-end equipment returns a plurality of sip catalog synchronous responses due to limited data transmitted under the sip protocol at a time, and the returning time of each sip catalog synchronous response is not completely the same, namely a certain time period is required for the sip catalog synchronous response to return. Each sip directory synchronization response carries directory data, and the directory data carried by each sip directory synchronization response can be one or multiple, and can be determined according to the data size of the directory data. In addition, the directory data carried in the returned sip directory synchronization response may have different return manners, for example, the directory data carried in the first returned sip directory synchronization response includes parent directory data, and the directory data carried in the later returned sip directory synchronization response includes sub-directory data, where each directory included in the parent directory data may be divided by regions, such as "xx region", and each directory included in the sub-directory data may be divided by streets, such as "xx street". For some complex directories, a plurality of levels of parent directories and sub-directories can be included to more comprehensively characterize the distribution information of all target front-end devices under the type identification of the target device, and the directory information needs to be transmitted, and the number of sip directory synchronization responses needing to be returned is increased.
Each sip directory synchronization response returned by the target front-end device can carry directory data and also carry a directory total number identifier, namely after receiving the sip directory synchronization request, all target front-end devices in the type can be determined according to the target device type identifier in the sip directory synchronization request, and then the total number of all directory data inquired under the request can be determined, and when each sip directory synchronization response is returned, the numbers can be carried. And when the counted number is consistent with the total number of the catalogues, the data server indicates that all the catalogues corresponding to the sip catalog synchronous request are sent completely, namely the catalogues are equal to a preset value.
At this time, a front-end device directory is generated according to the received preset number of entry records. The directory data carried in the sip directory synchronization response is in a format supporting the sip protocol, and because the target front-end device does not send the directory data in the sequence from the front to the back or from the large to the small when sending the directory data, or sends the directory data in the sequence but the receiving sequence is different from the sending sequence, the received all the directory data cannot directly form a front-end device directory, but needs to be subjected to format conversion and recombination to generate a front-end device directory supporting the http protocol, specifically, the directory can be in a text form.
S205: and updating the processing state of the http directory synchronization request corresponding to the sip directory synchronization request as processed request based on the request pair.
And after all the sip directory synchronization responses are returned and the front-end equipment directory is generated, the processing state of the sip directory synchronization request corresponding to the sip directory synchronization response is that the request is processed. At this time, based on the http directory synchronization request corresponding to the sip directory synchronization request, the processing state of the http directory synchronization request is also updated to be that the request is processed.
S206: and generating an http directory synchronous response carrying the front-end equipment directory, and returning the http directory synchronous response to the traffic police terminal based on the http protocol according to the terminal identifier.
When the data server detects that the processing state of the http directory synchronous request is that the request is processed, an http directory synchronous response corresponding to the http directory synchronous request is generated, the http directory synchronous response carries a front-end equipment directory supporting an http protocol, then a traffic police terminal sending the http directory synchronous request is determined according to a terminal identifier, then an http session is established between the data server and the traffic police terminal, the http directory synchronous response is returned to the traffic police terminal, and the traffic police terminal updates data of an old directory of the traffic police terminal on the basis of the front-end equipment directory carried in the received directory synchronous response, so that the directories of a monitoring place side and the traffic police terminal side are synchronized.
According to the method, the data server receives an http directory synchronization request sent by a traffic police terminal based on an http protocol, wherein the http directory synchronization request carries a terminal identifier and a target device type identifier; generating an sip directory synchronization request corresponding to the http directory synchronization request according to the type identifier of the target device, and binding the http directory synchronization request and the sip directory synchronization request to generate a request pair; sending an sip directory synchronization request to target front-end equipment corresponding to the type identifier of the target equipment based on an sip protocol; receiving a plurality of sip directory synchronous responses returned by target front-end equipment based on the sip protocol, wherein the sip directory synchronous responses carry directory data, and generating a front-end equipment directory according to the received preset number of entry directory data when the number of the received directory data is equal to a preset value; updating the processing state of the http directory synchronization request corresponding to the sip directory synchronization request as the request is processed based on the request pair; and generating an http directory synchronous response carrying the front-end equipment directory, and returning the http directory synchronous response to the traffic police terminal based on the http protocol according to the terminal identifier. The method and the system send out an http directory synchronous request based on an http protocol, convert the http directory synchronous request into an sip directory synchronous request which can be identified by front-end equipment, convert an sip directory synchronous response returned by the front-end equipment into an http directory synchronous response and return to the traffic police terminal, the traffic police terminal can finish the whole directory acquisition process only by sending out a request once on a web browser or a platform, the acquisition flow is simplified, in addition, a plurality of returned sip directory synchronous responses are generated into the front-end equipment directory in the internal part and then returned to the traffic police terminal in an http directory synchronous response mode, the front-end equipment directory with a complete structure can be directly acquired, and the technical problem that the acquired data are split is improved. In the protocol conversion process, by means of generating a request pair, after receiving the sip directory synchronization response, the corresponding http directory synchronization request can be quickly searched, and the http directory synchronization response can be generated and returned, so that the response is generated quickly, and the directory synchronization efficiency is improved.
As shown in fig. 3, the framework of the front-end device directory acquisition method is divided into several modules, the data server includes an http service module 22, a protocol scheduling module 23 and a sip proxy module 24, an http directory synchronization request 21 sent by the traffic police terminal is sent to the http service module 22, and the http service module 22 performs parameter validity judgment and duplicate checking processing on the http directory synchronization request 21 and then sends the http directory synchronization request to the protocol scheduling module 23. The protocol scheduling module 23 generates an sip directory synchronization request according to the http directory synchronization request 21 and sends the sip directory synchronization request to the sip proxy module 24, and meanwhile, the http directory synchronization request 21 and the sip directory synchronization request are bundled to generate a request pair. The sip proxy module 24 determines the target front-end device from the front-end device 25 according to the directory device type identifier in the http directory synchronization request 21, then the sip directory synchronization request is sent to the target front-end device, the target front-end device returns a plurality of sip directory responses after processing the sip directory synchronization request, each sip directory response carries directory data, the sip proxy module 24 sends each sip directory response to the protocol scheduling module 23, while the sip proxy module 24 and the protocol scheduling module 23 both count these directory data, when the counted number is equal to the preset value, all directory data corresponding to the target front-end equipment are returned, the sip proxy module 24 updates the processing status of the sip directory synchronization request to request processed, and accordingly, the processing status of the sip directory synchronization request in the request pair of the protocol scheduling module 23 is also updated to request processed. The protocol scheduling module 23 performs format conversion and reassembly on all the received directory data to generate a front-end device directory, and meanwhile, determines an http directory synchronization request 21 corresponding to the processed sip directory synchronization request according to the request, updates the processing state of the http directory synchronization request 21 to be that the request is processed, and fills the front-end device directory into the http directory synchronization request 21. At this time, the processing state of the http directory synchronization request 21 in the http service module 22 is also updated to request processed, the http service module 22 generates an http directory synchronization response 26 carrying the front-end device directory according to the http directory synchronization request 21 filled with the front-end device directory, then determines the traffic police terminal sending the http directory synchronization request 21 according to the terminal identifier in the http directory synchronization request 21, returns the http directory synchronization response 26 to the traffic police terminal based on the http protocol, and the traffic police terminal realizes the directory synchronization of the traffic police terminal side and the front-end device side according to the response.
As shown in fig. 4, fig. 5, and fig. 6, the http service module 22 includes an http service buffer 221, an http task buffer queue 222, an http response logic 223, and an http task timer 224, the protocol scheduling module 23 includes a directory assembling module 231, a scheduling task timer 232, and a sip directory response buffer queue 233, and the sip proxy module 24 includes a sip task buffer queue 241, a sip task timer 242, a user proxy client 243, and a user proxy server 244, which are specifically described below with reference to fig. 3 to fig. 6.
The traffic police terminal sends an http directory synchronization request 21 to an http service module 22, the http directory synchronization request can be sent through a video monitoring platform developed independently, or can be sent directly through a web browser, and the http directory synchronization request 21 carries a terminal identifier and a target device type identifier. The terminal identification comprises an IP address and a port of the traffic police terminal, the data server determines which terminal the received catalog synchronous response is sent to specifically according to the terminal identification, the target equipment type identification is used for distinguishing the types of the front-end equipment, for example, the front-end equipment can be divided into a front-end camera or a network hard disk video recorder, the target equipment type identification comprises a common identification of the front-end equipment belonging to the same type, the data server determines which type of the front-end equipment is required to be subjected to catalog synchronization according to the target equipment type identification so as to send http catalog synchronous requests 21 to all the target front-end equipment under the type, and therefore the traffic police terminal can obtain the catalog data of all the target front-end equipment and update the old catalog at the traffic police terminal side according to the catalog data.
After entering the http service module 22, the http directory synchronization request 21 first enters the http service buffer 221, and the http service buffer 221 performs validity judgment. The method specifically comprises the following steps: performing logic judgment on the http directory synchronization request 21 based on the synchronization request effective parameter set; if the http directory synchronization request 21 is legal, the http directory synchronization request 21 is cached to the http task cache queue 222, if the http directory synchronization request 21 is illegal, the http directory synchronization request is marked as an error, and an http response logic 223 directly returns a termination request result to the traffic police terminal, wherein the termination request result is represented as an http directory synchronization response 26 at the traffic police terminal, and the response state is illegal. When the traffic police terminal sends out the http directory synchronization request 21, the http directory synchronization request 21 is sent out in a form of inputting a website on a web browser or a platform, the http directory synchronization request 21 includes parameters such as a terminal identifier, a target device type identifier and a synchronization command, if the input of each identifier or synchronization command is wrong, subsequent processing logic is affected, therefore, after the http service buffer 221 analyzes the http directory synchronization request 21, firstly, logic judgment is made on the http directory synchronization request 21 based on a synchronization request effective parameter set, the synchronization request effective parameter set includes types of effective parameters, specific parameter values, an arrangement sequence of each parameter and the like, if legal, the next step is entered, the http directory synchronization request 21 is cached into the http task cache queue 222, if illegal, a termination request result is returned to the traffic police terminal, and a specific error type can be further displayed, if invalid parameters are input or corresponding target front-end equipment cannot be found, the http directory synchronization request 21 is input again conveniently by the traffic police terminal after being adjusted.
In one embodiment, before the step of buffering the http directory synchronization request 21 into the http task buffer queue 222, the method further includes: judging whether the http directory synchronization request 21 has the same content as a first http directory synchronization request received in a previous preset time period in the http task cache queue 222; if the contents are the same, the http directory synchronization request 21 is removed, the request start time of the first http directory synchronization request is updated to the request start time of the http directory synchronization request 21, and if the contents are different, the http directory synchronization request 21 is cached in the http task cache queue 222.
After the traffic police terminal sends the http directory synchronization request 21, if no synchronization response is received within an expected time, one or more times of refresh operations are usually performed, each time of refresh operation is to send one http directory synchronization request 21 again, and the content of each sent http directory synchronization request 21 is the same, if the data server processes each request, resource waste is caused, therefore, after the http directory synchronization request 21 is cached in the http service buffer 221, the http service buffer 221 checks the first http directory synchronization request received within a preset time period before in the http task cache queue 222, where the preset time period may be set according to the sending behavior of most request senders, for example, if most request senders start to reinitiate requests if they do not receive responses within 2 seconds after sending requests, 2 seconds may be used as the preset time period. If it is detected that all the first http directory synchronization requests entering the http task cache queue 222 within the previous preset time period are different from the content of the currently sent http directory synchronization request 21, it indicates that the currently sent http directory synchronization request 21 is a first sent request, and the first http directory synchronization request may be directly placed in the http task cache queue 222. If it is detected that there is a first http directory synchronization request having the same content as the currently entered http directory synchronization request 21 in all first http directory synchronization requests entering the http task cache queue 222 within the previous preset time period, it indicates that the currently issued http directory synchronization request 21 is a refresh request corresponding to the first http directory synchronization request, at this time, since the request time of the first http directory synchronization request is earlier than the request time of the http directory synchronization request 21, the first http directory synchronization request may have been subjected to subsequent processing, and if the http directory synchronization request 21 is reprocessed, repeated processing of the request and waste of time are caused. In addition, assuming that the time interval from the initiation of a request to the receipt of a response in the psychological expectation of the user does not exceed 5 seconds, when the user seems to resend the request once from the beginning of the refresh operation, there may be a waiting time of 5 seconds from this moment, and inside the data server, the http directory synchronization request 21 newly received is removed, and the request start time of the first http directory synchronization request is updated to the request start time of the http directory synchronization request 21, so that the request time equivalent to the original first http directory synchronization request is doubled, and the response returned within 5 seconds from this moment will not cause user experience to be bad. Therefore, by adopting the mechanism in the data server, more processing time is obtained for the old first http directory synchronization request, and the phenomenon of response timeout is also reduced, so that the user experience is improved.
After the http directory synchronization request 21 is cached in the http task cache queue 222, the http task cache queue 222 generates an http state identifier for the http directory synchronization request 21, where the identifier content of the http state identifier is a request to be processed, and then sends the http directory synchronization request 21 to the protocol scheduling module 23, specifically to the scheduling task timer 232 of the protocol scheduling module 23.
The scheduling task timer 232 determines the operation of the next step by reading the identification content of the http status flag in the http task cache queue 222. When the identification content of the http state identification is read as a request to be processed, an sip directory synchronization request corresponding to the http directory synchronization request 21 is generated in the scheduling task timer 232, and the identification content of the http state identification in the http task cache queue 222 is updated to be in processing. The scheduling task timer 232 sends the generated sip directory synchronization request to the sip proxy module 24, and at the same time, binds the http directory synchronization request 21 and the sip directory synchronization request to generate a request pair, caches the request pair to the sip directory response cache queue 233, and generates a request pair identifier for the request pair. When multiple requests may be received by the task scheduling timer 232 within a period of time, multiple request pairs are generated accordingly, and when a request pair is buffered in the sip directory response buffer queue 233, in order to distinguish the current request from other requests, a unique identifier is generated for each request pair.
The scheduling task timer 232 sends the generated sip directory synchronization request to the sip proxy module 24, specifically, to an sip task cache queue 241 sent to the sip proxy module 24, the sip task cache queue 241 generates an sip status identifier for the sip directory synchronization request, the identifier content of the sip status identifier is a request to be processed, the sip task timer 242 determines the next operation by reading the identifier content of the sip status identifier in the sip task cache queue 241, and when the identifier content of the sip status identifier is read as the request to be processed, the sip directory synchronization request is sent to the target front-end device corresponding to the target device type identifier based on an sip protocol.
The front-end devices included in the front-end device 25 are of various types, such as a front-end camera 251, a network hard disk video recorder 253, and the like, when the front-end device is directly connected to the data server, the target device type identifier may be a camera identifier or a video recorder identifier, and the sip directory synchronization request sent at this time is directly received by the camera or the video recorder of the corresponding type, that is, the target front-end device is the front-end camera 251, the network hard disk video recorder 253, and the directory data is directly returned by the corresponding camera or the video recorder. When the front-end device is connected to the data server through the platform, the target device type identifier includes a platform identifier of the front-end device platform 252, and the sip directory synchronization request sent at this time is received by the front-end device platform 252, that is, the target front-end device is the front-end device platform 252, and the directory data is returned by the platform.
The sip proxy module 24 sends an sip directory synchronization request to the target front-end device through the user proxy client 243, the target front-end device processes the request and then generates an sip directory synchronization response, the sip directory synchronization response is received by the user proxy 244, because the data transmitted in a single time under the sip protocol is limited, the target front-end device will return a plurality of sip directory synchronization responses, the time for returning each sip directory synchronization response is not exactly the same, that is, a certain period of time is required for returning the sip directory synchronization response. Each sip directory synchronization response carries directory data, and the directory data carried by each sip directory synchronization response can be one or multiple, and can be determined according to the data size of the directory data. In addition, the directory data carried in the returned sip directory synchronization response may have different return manners, for example, the directory data carried in the first returned sip directory synchronization response includes parent directory data, and the directory data carried in the later returned sip directory synchronization response includes sub-directory data, where each directory included in the parent directory data may be divided by regions, such as "xx region", and each directory included in the sub-directory data may be divided by streets, such as "xx street". For some complex directories, a plurality of levels of parent directories and sub-directories can be included to more comprehensively characterize the distribution information of all target front-end devices under the type identification of the target device, and the directory information needs to be transmitted, and the number of sip directory synchronization responses needing to be returned is increased.
Each sip directory synchronization response returned by the target front-end device can carry directory data and also carry a directory total number identifier, namely after receiving the sip directory synchronization request, all target front-end devices in the type can be determined according to the target device type identifier in the sip directory synchronization request, and then the total number of all directory data inquired under the request can be determined, and when each sip directory synchronization response is returned, the numbers can be carried.
The user agent 244 returns each received sip directory synchronization response to the sip task cache queue 241, the sip task cache queue 241 generates a response result set for the responses, counts the number of directory data in the response result set through a response counter, counts the directory data carried in each received sip directory synchronization response once until the counted number is consistent with the number of the directory total number identifiers, which indicates that all directory data corresponding to the current sip directory synchronization request have been sent, that is, equal to a preset value, and at this time, updates the identifier content of the sip state identifier in the sip task cache queue 241 to the processed request. In addition, a timeout mechanism is further disposed inside the sip task buffer queue 241, and when the maximum waiting time is exceeded in the counting process and the counted number has not reached the number of the total directory number identifiers, the identifier content of the sip state identifier in the sip task buffer queue 241 is updated to be that the request has timed out.
When the sip task cache queue 241 receives multiple sip directory synchronization responses, each time a new sip directory synchronization response is received, the sip directory synchronization response is sent to the sip directory response cache queue 233, the sip directory response cache queue 233 generates a response result set for the responses, the number of directory data is counted by a response counter, and when the counted number is equal to the number of directory total number identifications, all the received directory data are combined and format-converted to generate a front-end device directory supporting the http protocol.
The directory data carried in the sip directory synchronization response is in a format supporting the sip protocol, and because the target front-end device does not send the directory data in the order from the front to the back or from the large to the small when sending the directory data, or sends the directory data in the order but the receiving order is different from the sending order, and the front-end device directory cannot be directly formed for all the received directory data, the scheduling task timer 232 will take out the sip directory synchronization responses, remove the sip directory synchronization responses in the sip directory response cache queue 233, then send the taken out sip directory synchronization responses to the directory assembling module 231, and the directory assembling module 231 performs format conversion and recombination on the directory data carried in the sip directory synchronization responses to generate the front-end device directory supporting the http protocol, which may be a directory in a text form.
Because each sip directory synchronization response returned by the target front-end device is sent to the sip directory response cache queue 233 by the sip task cache queue 241, and after the http service module 22 sends the http directory synchronization request 21 to the protocol scheduling module 23, the identification content of the http status identification of the http directory synchronization request 21 in the http task cache queue 222 is updated to be in the request processing, the scheduling task timer 232 determines the next step operation according to the identification content of the http status identification in the http task cache queue 222, when the identification content is read to be in the request processing, it is detected whether the sip directory synchronization response is returned in the sip directory response cache queue 233, when the sip directory synchronization response is detected to be returned, it is determined which sip directory synchronization request the response corresponds to in the sip directory response cache queue 233, based on the request pair of the sip directory synchronization request, it is further determined which http directory synchronization request 21 the response corresponds to, and the two are then correlated.
In the data server, the sip directory synchronization request in the request pair of the sip directory response cache queue 233 and the sip task cache queue 241 is the same data source, so that the content and the state of the two are the same at any time, and when the identification content of the sip state identifier in the sip task cache queue 241 is updated to be the request processed, the identification content of the corresponding sip state identifier in the request pair of the sip directory response cache queue 233 is also updated to be the request processed synchronously. At this time, in the protocol scheduling module 23, the sip directory response cache queue 233 also receives all returned sip directory synchronization responses, and after all sip directory synchronization responses have been returned, the protocol scheduling module 23 updates the processing state of the http directory synchronization request corresponding to the sip directory synchronization request to be the processed request based on the request pair.
In one embodiment, the step of updating the processing state of the http directory synchronization request based on the request comprises: determining a request pair corresponding to the request pair identifier from the sip directory response cache queue 233 according to the request pair identifier; determining an http directory synchronization request 21 corresponding to the sip directory synchronization request in the request pair according to the request pair; and synchronously updating the request pair and the identification content of the http state identifier in the http task cache queue 222 into processed request. In the sending process of the http directory synchronization request 21, the scheduling task timer 232 bundles the http directory synchronization request 21 and the corresponding sip directory synchronization request to generate a request pair, generates a request pair identifier for the request pair, and then puts the request pair into the sip directory response cache queue 233. After the sip-directory-response cache queue 233 receives all the sip-directory synchronization responses, the sip-directory-response cache queue 233 can only determine which sip-directory synchronization request corresponds to the sip-directory synchronization response, but also needs to determine which http-directory synchronization request 21 corresponds to the response, so that the scheduling task timer 232 needs to determine which request pair corresponds to the request pair identifier from the sip-directory-response cache queue 233 according to the request pair identifier, and then determine the http-directory synchronization request 21 corresponding to the sip-directory synchronization request according to the request pair identifier.
In the data server, the http task cache queue 222 and the sip directory response cache queue 233 in the request pair have the same data source of the http directory synchronization request 21, so that the content and the state of the http task cache queue 222 and the sip directory response cache queue 233 at any time are the same, and when the identification content of the http state identification in the request pair of the sip directory response cache queue 233 is updated to be the request processed, the identification content of the http state identification in the http task cache queue 222 is also updated to be the request processed.
The http task timer 224 concurrently reads the processing state of the http directory synchronization request 21 in the http task cache queue 222, determines the next step operation according to the read processing state of the http directory synchronization request 21 in the http task cache queue 222, controls the http response logic 223 to read the corresponding http directory synchronization request 21 from the http task cache queue 222 after the identification content of the http status identification is read as that the request is processed, and then generates the http directory synchronization response 26 carrying the front-end device directory. When the read processing state is a timeout, an error or other returnable condition, the http response logic 223 is also controlled to generate the corresponding http directory synchronization response 26.
In an embodiment, the step of generating the http directory synchronization response 26 carrying the front-end device directory specifically includes: the scheduling task timer 232 sends the generated front-end device directory supporting the http protocol to the http task cache queue 222, the http task cache queue 222 fills the front-end device directory into the http directory synchronization request 21, and then the http response logic 223 generates the http directory synchronization response 26 carrying the front-end device directory according to the filled http directory synchronization request 21. Finally, the http response logic 223 determines which traffic police terminal sent the http directory synchronization request 21 is according to the terminal identifier, and returns the http directory synchronization response 26 to the traffic police terminal based on the http protocol, and the traffic police terminal updates the data of the old directory of the traffic police terminal based on the front-end equipment directory carried in the received http directory synchronization response 26, so that the directories of the monitoring place side and the traffic police terminal side are synchronized.
Inside the http service module 22, the http task timer 224 generates an http state identifier for requesting to-be-processed for the http directory synchronization request 21 newly entering the http task cache queue 222, and sends the http state identifier to the protocol scheduling module 23. In the protocol scheduling module 23, after the sip directory response cache queue 233 receives the sip directory synchronization response, the scheduling task timer 232 updates the content of the http status identifier in the request pair to processed, and sends the generated front-end device directory to the http service module 22. In the sip proxy module 24, the sip task timer 242 generates an sip status identifier for the sip directory synchronization request newly entering the sip task cache queue 241, sends the sip status identifier to the target front-end device, and updates the identifier content of the sip status identifier to be the request completion after all the sip directory synchronization responses are received. Namely, data communication and synchronization among the three modules are performed through respective task timers, a respective cache queue and a respective timer are maintained in each module, the timer of each module only updates the processing state of a related request in the cache queue related to the processing logic of the module, and the next operation is determined according to the processing state, so that direct communication among the modules is not performed, and the problem of difficult maintenance caused by large-scale coupling of services and codes is avoided.
According to the embodiment, the front-end equipment directory obtaining method sends out the http directory synchronization request based on the http protocol, converts the http directory synchronization request into the sip directory synchronization request which can be identified by the front-end equipment, converts the sip directory synchronization response returned by the front-end equipment into the http directory synchronization response, and returns the http directory synchronization response to the traffic police terminal. In the protocol conversion process, by means of generating a request pair, after receiving the sip directory synchronization response, the corresponding http directory synchronization request can be quickly searched, and the http directory synchronization response can be generated and returned, so that the response is generated quickly, and the directory synchronization efficiency is improved.
Fig. 7 is a schematic diagram illustrating a comparison between a prior art and a front-end device in the present application for a directory acquisition manner between a traffic police terminal and the front-end device, where a in fig. 7 is a directory acquisition manner in the prior art, and b in fig. 7 is a directory acquisition manner in the present application.
In the prior art, the traffic police terminal 11 directly sends a sip directory synchronization request to the front-end device 13, the front-end device 13 sequentially returns n sip directory synchronization responses, and then the traffic police terminal 11 assembles the returned n responses to generate the front-end device directory. On one hand, in the process, the directory data are dispersed in each response, so that the data are split, the data transmitted under the sip protocol are complex, the requirement on an assembler is high, and the directory is obtained by self-combination after the corresponding assembly principle is known. In addition, since the response received by the traffic police terminal 11 and the response sent by the front-end device 13 may be in different orders, the traffic police terminal 11 cannot accurately know the time when all data is transmitted, and the timeout management of the request is very difficult. On the other hand, when a request is sent directly based on the sip protocol, the request is usually packaged into an SDK before the SDK is used, and the SDK has language correlation, so that the SDK developed by using different languages is limited by the language when calling directory data in the front-end device, which causes calling difficulty. In addition, the traffic police terminal calls the SDK to send a request, when the SDK is updated, data on the traffic police terminal side is easily unstable, and the traffic police terminal and the SDK developer are often required to perform synchronous testing and modification, so that the whole process is more complicated.
In the application, the traffic police terminal 11 sends an http directory synchronization request to the data server 12, the data server 12 generates an sip directory synchronization request and then sends the sip directory synchronization request to the front-end device 13, then n sip directory synchronization responses returned by the front-end device 13 are received by the data server 12, format conversion and data recombination are performed inside the data server 12 to generate a complete front-end device directory, and then the data server 12 generates an http directory synchronization response carrying the front-end device directory and sends the http directory synchronization response to the traffic police terminal 11. The whole directory acquisition process can be completed by the traffic police terminal only needing to send a request once on a web browser or a platform, without knowing details of multiple requests and data processing under the sip protocol and the GBT/28181 standard based on the sip protocol, so that the system docking difficulty is greatly reduced, and the acquisition flow is simplified. In addition, after the internal part generates a front-end equipment directory by the synchronous response of the returned multiple sip directories, the front-end equipment directory with a complete structure can be directly obtained and the technical problem of splitting of the obtained data is improved, and the traffic police terminal 11 can judge whether the request is overtime according to whether the front-end equipment directory is generated. Meanwhile, the http protocol is a non-invasive protocol, and only one party is needed to carry out modification test when the interior of the data server is updated, so that the upgrading workload of the traffic police terminal side is reduced. In addition, all requests sent under the http protocol can be recorded by a host service such as a web server of tomcat/IIS and the like, and log recording is not required to be realized by self like the sip protocol, so that the traceability of user behaviors is increased, and the safety of the system is improved.
On the basis of the method in the foregoing embodiment, the present embodiment will be further described from the perspective of a front-end device directory obtaining apparatus, please refer to fig. 8, where fig. 8 specifically describes the front-end device directory obtaining apparatus provided in the embodiment of the present application, and the apparatus may include:
the receiving module 110 is configured to receive an http directory synchronization request sent by the traffic police terminal based on an http protocol, where the http directory synchronization request carries a terminal identifier and a target device type identifier;
the request generation module 120 is configured to generate an sip directory synchronization request corresponding to the http directory synchronization request according to the type identifier of the target device, and bundle the http directory synchronization request and the sip directory synchronization request to generate a request pair;
a sending module 130, configured to send an sip directory synchronization request to a target front-end device corresponding to the target device type identifier based on an sip protocol;
the catalog generation module 140 is configured to receive multiple sip catalog synchronous responses returned by the target front-end device based on the sip protocol, where the sip catalog synchronous responses carry catalog data, and generate a front-end device catalog according to the received entry catalog data in a preset number when the number of the received catalog data is equal to a preset value;
the updating module 150 is configured to update, based on the request pair, a processing state of the http directory synchronization request corresponding to the sip directory synchronization request to be that the request is processed;
and the returning module 160 is configured to generate an http directory synchronization response carrying the front-end device directory, and return the http directory synchronization response to the traffic police terminal based on the http protocol according to the terminal identifier.
In an embodiment, the front-end device directory obtaining apparatus further includes a first identifier generating module, where after the receiving module 110 receives the http directory synchronization request, the first identifier generating module is configured to cache the http directory synchronization request to the http task cache queue; generating an http state identifier for the http directory synchronization request, wherein the identifier content of the http state identifier is to-be-processed; and sending the http directory synchronization request to a scheduling task timer.
In one embodiment, the front-end device directory obtaining device further comprises a duplication checking module, before the first identifier generating module caches the http directory synchronization request to the http task cache queue, the duplication checking module is configured to determine whether the http directory synchronization request is the same as a first http directory synchronization request received in a previous preset time period in the http task cache queue; and if the contents are the same, removing the http directory synchronization request, updating the request starting time of the first http directory synchronization request to the request starting time of the http directory synchronization request, and if the contents are different, caching the http directory synchronization request to an http task cache queue.
In an embodiment, the front-end device directory obtaining apparatus further includes a request pair identifier generating module, configured to, after the request generating module 120 generates the request pair, cache the request pair to the sip directory response cache queue, and generate a request pair identifier for the request pair.
In one embodiment, the sending module 130 includes:
the first sending unit is used for sending the sip directory synchronization request to the sip task cache queue;
the identification generation unit is used for generating an sip state identification for the sip directory synchronization request, and the identification content of the sip state identification is to be processed;
and the second sending unit is used for sending the sip directory synchronization request to the target front-end equipment corresponding to the target equipment type identification based on the sip protocol.
In one embodiment, the catalog generation module 140 includes:
the receiving unit is used for receiving a plurality of sip directory synchronization responses returned by the target front-end equipment based on the sip protocol, wherein the sip directory synchronization responses carry directory data and directory total number identifiers;
the counting unit is used for counting the number of the directory data carried in each sip directory synchronous response according to the receiving sequence;
and the generating unit is used for combining and converting formats of all the received directory data when the counted number is equal to the total number of the directory identifiers, so as to generate the front-end equipment directory supporting the http protocol.
In one embodiment, the generation unit is used for synchronously updating the identification content of the sip state identification in the sip task cache queue and the request pair into processed requests when the number of the counts is equal to the number of the total directory identifications; and combining and converting the format of all the received directory data to generate a front-end equipment directory supporting the http protocol.
In one embodiment, the update module 150 includes:
a request pair determining unit, configured to determine, according to the request pair identifier, a request pair corresponding to the request pair identifier from the sip directory response cache queue;
the request determining unit is used for determining an http directory synchronization request corresponding to the sip directory synchronization request in the request pair according to the request pair;
and the identification updating unit is used for synchronously updating the identification content of the http state identification in the request pair and the http task cache queue into processed request.
In one embodiment, the return module 160 includes:
the filling unit is used for filling the front-end equipment directory into the http directory synchronization request after the identification content of the http state identification in the http task cache queue is updated to be the request processed;
and the response generation unit is used for generating an http directory synchronization response carrying the front-end equipment directory according to the filled http directory synchronization request.
Different from the prior art, the front-end equipment directory acquisition device provided by the application receives an http directory synchronization request sent by a traffic police terminal based on an http protocol, wherein the http directory synchronization request carries a terminal identifier and a target equipment type identifier; generating an sip directory synchronization request corresponding to the http directory synchronization request according to the type identifier of the target device, and binding the http directory synchronization request and the sip directory synchronization request to generate a request pair; sending an sip directory synchronization request to target front-end equipment corresponding to the type identifier of the target equipment based on an sip protocol; receiving a plurality of sip directory synchronous responses returned by target front-end equipment based on the sip protocol, wherein the sip directory synchronous responses carry directory data, and generating a front-end equipment directory according to the received preset number of entry directory data when the number of the received directory data is equal to a preset value; updating the processing state of the http directory synchronization request corresponding to the sip directory synchronization request as the request is processed based on the request pair; and generating an http directory synchronous response carrying the front-end equipment directory, and returning the http directory synchronous response to the traffic police terminal based on the http protocol according to the terminal identifier. The method and the system send out an http directory synchronous request based on an http protocol, convert the http directory synchronous request into an sip directory synchronous request which can be identified by front-end equipment, convert an sip directory synchronous response returned by the front-end equipment into an http directory synchronous response and return to the traffic police terminal, the traffic police terminal can finish the whole directory acquisition process only by sending out a request once on a web browser or a platform, the acquisition flow is simplified, in addition, a plurality of returned sip directory synchronous responses are generated into the front-end equipment directory in the internal part and then returned to the traffic police terminal in an http directory synchronous response mode, the front-end equipment directory with a complete structure can be directly acquired, and the technical problem that the acquired data are split is improved. In the protocol conversion process, by means of generating a request pair, after receiving the sip directory synchronization response, the corresponding http directory synchronization request can be quickly searched, and the http directory synchronization response can be generated and returned, so that the response is generated quickly, and the directory synchronization efficiency is improved.
Accordingly, embodiments of the present application also provide an electronic device, as shown in fig. 9, which may include components such as a radio frequency circuit 901, a memory 902 including one or more computer-readable storage media, an input unit 903, a display unit 904, a sensor 905, an audio circuit 906, a WiFi module 907, a processor 908 including one or more processing cores, and a power supply 909. Those skilled in the art will appreciate that the electronic device configuration shown in fig. 9 does not constitute a limitation of the electronic device and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components. Wherein:
the rf circuit 901 may be used for receiving and transmitting signals during information transmission and reception or during a call, and in particular, receives downlink information of a base station and then sends the received downlink information to the one or more processors 908 for processing; in addition, data relating to uplink is transmitted to the base station. The memory 902 may be used to store software programs and modules, and the processor 908 executes various functional applications and data processing by operating the software programs and modules stored in the memory 902. The input unit 903 may be used to receive input numeric or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.
The display unit 904 may be used to display information input by or provided to a user and various graphical user interfaces of the electronic device, which may be made up of graphics, text, icons, video, and any combination thereof.
The electronic device may also include at least one sensor 905, such as light sensors, motion sensors, and other sensors. The audio circuitry 906 includes a speaker that can provide an audio interface between a user and the electronic device.
WiFi belongs to short-distance wireless transmission technology, and the electronic equipment can help a user to send and receive e-mails, browse webpages, access streaming media and the like through the WiFi module 907, and provides wireless broadband internet access for the user. Although fig. 9 shows the WiFi module 907, it is understood that it does not belong to the essential constitution of the electronic device, and may be omitted entirely as needed within the scope not changing the essence of the application.
The processor 908 is a control center of the electronic device, connects various parts of the entire cellular phone using various interfaces and lines, and performs various functions of the electronic device and processes data by operating or executing software programs and/or modules stored in the memory 902 and calling data stored in the memory 902, thereby performing overall monitoring of the cellular phone.
The electronic device also includes a power supply 909 (e.g., a battery) that provides power to the various components, which may preferably be logically coupled to the processor 908 via a power management system, such that the power management system may be used to manage charging, discharging, and power consumption.
Although not shown, the electronic device may further include a camera, a bluetooth module, and the like, which are not described in detail herein. Specifically, in this embodiment, the processor 908 in the electronic device loads an executable file corresponding to a process of one or more application programs into the memory 902 according to the following instructions, and the processor 908 executes the application programs stored in the memory 902, so as to implement the following functions:
receiving an http directory synchronization request sent by a traffic police terminal based on an http protocol, wherein the http directory synchronization request carries a terminal identifier and a target equipment type identifier; generating an sip directory synchronization request corresponding to the http directory synchronization request according to the type identifier of the target device, and binding the http directory synchronization request and the sip directory synchronization request to generate a request pair; sending an sip directory synchronization request to target front-end equipment corresponding to the type identifier of the target equipment based on an sip protocol; receiving a plurality of sip directory synchronous responses returned by target front-end equipment based on the sip protocol, wherein the sip directory synchronous responses carry directory data, and generating a front-end equipment directory according to the received preset number of entry directory data when the number of the received directory data is equal to a preset value; updating the processing state of the http directory synchronization request corresponding to the sip directory synchronization request as the request is processed based on the request pair; and generating an http directory synchronous response carrying the front-end equipment directory, and returning the http directory synchronous response to the traffic police terminal based on the http protocol according to the terminal identifier.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and parts that are not described in detail in a certain embodiment may refer to the above detailed description, and are not described herein again.
It will be understood by those skilled in the art that all or part of the steps of the methods of the above embodiments may be performed by instructions or by associated hardware controlled by the instructions, which may be stored in a computer readable storage medium and loaded and executed by a processor.
To this end, the present application provides a storage medium, in which a plurality of instructions are stored, and the instructions can be loaded by a processor to implement the following functions:
receiving an http directory synchronization request sent by a traffic police terminal based on an http protocol, wherein the http directory synchronization request carries a terminal identifier and a target equipment type identifier; generating an sip directory synchronization request corresponding to the http directory synchronization request according to the type identifier of the target device, and binding the http directory synchronization request and the sip directory synchronization request to generate a request pair; sending an sip directory synchronization request to target front-end equipment corresponding to the type identifier of the target equipment based on an sip protocol; receiving a plurality of sip directory synchronous responses returned by target front-end equipment based on the sip protocol, wherein the sip directory synchronous responses carry directory data, and generating a front-end equipment directory according to the received preset number of entry directory data when the number of the received directory data is equal to a preset value; updating the processing state of the http directory synchronization request corresponding to the sip directory synchronization request as the request is processed based on the request pair; and generating an http directory synchronous response carrying the front-end equipment directory, and returning the http directory synchronous response to the traffic police terminal based on the http protocol according to the terminal identifier.
The above operations can be implemented in the foregoing embodiments, and are not described in detail herein.
Wherein the storage medium may include: read Only Memory (ROM), Random Access Memory (RAM), magnetic or optical disks, and the like.
Since the instructions stored in the storage medium can execute the steps in any method provided in the embodiments of the present application, the beneficial effects that can be achieved by any method provided in the embodiments of the present application can be achieved, for details, see the foregoing embodiments, and are not described herein again.
The method and the device for acquiring the front-end device directory provided by the embodiment of the application are introduced in detail, a specific example is applied in the description to explain the principle and the implementation of the application, and the description of the embodiment is only used for helping to understand the technical scheme and the core idea of the application; those of ordinary skill in the art will understand that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications or substitutions do not depart from the spirit and scope of the present disclosure as defined by the appended claims.

Claims (10)

1. A front-end equipment directory obtaining method is characterized by being applicable to a smart traffic system, the smart traffic system comprises front-end equipment, a data server and a traffic police terminal, the front-end equipment is directly connected with the data server or is connected with the data server through a platform based on an sip protocol, the traffic police terminal is connected with the data server based on an http protocol, the front-end equipment directory obtaining method is applied to the data server, and the front-end equipment directory obtaining method comprises the following steps:
receiving an http directory synchronization request sent by the traffic police terminal based on an http protocol, wherein the http directory synchronization request carries a terminal identifier and a target device type identifier;
generating an sip directory synchronization request corresponding to the http directory synchronization request according to the type identifier of the target device, and binding the http directory synchronization request and the sip directory synchronization request to generate a request pair;
sending the sip directory synchronization request to the target front-end equipment corresponding to the target equipment type identification based on the sip protocol;
receiving a plurality of sip directory synchronous responses returned by the target front-end equipment based on the sip protocol, wherein the sip directory synchronous responses carry directory data, and generating a front-end equipment directory according to the received preset number of entry directory data when the number of the received directory data is equal to a preset value;
updating the processing state of the http directory synchronization request corresponding to the sip directory synchronization request as the request is processed based on the request pair;
and generating an http directory synchronous response carrying the front-end equipment directory, and returning the http directory synchronous response to the traffic police terminal based on an http protocol according to the terminal identifier.
2. The method for obtaining the front-end device directory according to claim 1, wherein after the step of receiving the http directory synchronization request sent by the traffic police terminal based on the http protocol, the method includes:
caching the http directory synchronization request to an http task cache queue;
generating an http state identifier for the http directory synchronization request, wherein the identifier content of the http state identifier is to-be-processed;
and sending the http directory synchronization request to a scheduling task timer.
3. The method for obtaining the front-end device directory of claim 2, wherein before the step of buffering the http directory synchronization request into the http task buffer queue, the method further comprises:
judging whether the http directory synchronization request is the same as the first http directory synchronization request received in the http task cache queue within the previous preset time period;
and if the contents are the same, removing the http directory synchronization request, updating the request start time of the first http directory synchronization request to the request start time of the http directory synchronization request, and if the contents are different, caching the http directory synchronization request to the http task cache queue.
4. The front-end device directory retrieval method of claim 2, wherein the step of bundling the http directory synchronization request with the sip directory synchronization request to generate a request pair is followed by:
and caching the request pair to a sip directory response cache queue, and generating a request pair identifier for the request pair.
5. The front-end device directory acquisition method of claim 4, wherein the step of sending the sip directory synchronization request to the target front-end device corresponding to the target device type identifier based on an sip protocol comprises:
sending the sip directory synchronization request to a sip task cache queue;
generating an sip state identifier for the sip directory synchronization request, wherein the identifier content of the sip state identifier is to be processed;
and sending the sip directory synchronization request to the target front-end equipment corresponding to the target equipment type identification based on a sip protocol.
6. The front-end device directory acquisition method of claim 5, wherein the step of receiving a plurality of sip directory synchronization responses returned by the target front-end device based on an sip protocol, the sip directory synchronization responses carrying directory data, and generating a front-end device directory according to the received preset number of entry directory data when the number of the received directory data is equal to a preset value, comprises:
receiving a plurality of sip directory synchronization responses returned by the target front-end equipment based on the sip protocol, wherein the sip directory synchronization responses carry directory data and directory total number identifiers;
counting the number of directory data carried in each sip directory synchronous response according to the receiving sequence;
and when the counted number is equal to the total number of the catalog identifications, combining and converting formats of all the received catalog data to generate the front-end equipment catalog supporting the http protocol.
7. The method for obtaining the front-end device directory of claim 6, wherein when the counted number is equal to the total number of the directory identifiers, the step of combining and format converting all the received directory data to generate the front-end device directory supporting the http protocol includes:
when the counted number is equal to the total directory number identifier number, synchronously updating the identifier contents of the sip state identifier in the sip task cache queue and the request pair into processed requests;
and combining and converting the format of all the received directory data to generate a front-end equipment directory supporting the http protocol.
8. The method for obtaining the front-end device directory according to claim 7, wherein the step of updating the processing state of the http directory synchronization request corresponding to the sip directory synchronization request as the request processed based on the request pair includes:
determining a request pair corresponding to the request pair identifier from the sip directory response cache queue according to the request pair identifier;
determining an http directory synchronization request corresponding to the sip directory synchronization request in the request pair according to the request pair;
and synchronously updating the identification content of the http state identification in the request pair and the http task cache queue into processed request.
9. The method for obtaining the front-end device directory of claim 8, wherein the step of generating an http directory synchronization response carrying the front-end device directory comprises:
filling the front-end equipment directory into the http directory synchronization request after the identification content of the http state identification in the http task cache queue is updated to be a request which is processed;
and generating an http directory synchronization response carrying the front-end equipment directory according to the filled http directory synchronization request.
10. The utility model provides a front-end equipment directory obtaining device, its characterized in that is applicable to wisdom traffic system, wisdom traffic system includes front-end equipment, data server and traffic police terminal, front-end equipment is direct based on the sip agreement or connects through the platform data server, the traffic police terminal is connected based on the http protocol data server, front-end equipment directory obtaining device sets up in the data server, front-end equipment directory obtaining device includes:
the receiving module is used for receiving an http directory synchronization request sent by the traffic police terminal based on an http protocol, wherein the http directory synchronization request carries a terminal identifier and a target device type identifier;
the request generation module is used for generating an sip directory synchronization request corresponding to the http directory synchronization request according to the type identifier of the target device and binding the http directory synchronization request and the sip directory synchronization request to generate a request pair;
a sending module, configured to send the sip directory synchronization request to a target front-end device corresponding to the target device type identifier based on an sip protocol;
the system comprises a catalog generation module, a front-end equipment catalog generation module and a front-end equipment catalog generation module, wherein the catalog generation module is used for receiving a plurality of sip catalog synchronous responses returned by the target front-end equipment based on an sip protocol, the sip catalog synchronous responses carry catalog data, and when the number of the received catalog data is equal to a preset value, the catalog generation module generates the front-end equipment catalog according to the received preset number of item catalog data;
the updating module is used for updating the processing state of the http directory synchronization request corresponding to the sip directory synchronization request as the request is processed based on the request pair;
and the returning module is used for generating an http directory synchronous response carrying the front-end equipment directory and returning the http directory synchronous response to the traffic police terminal based on an http protocol according to the terminal identifier.
CN202011027253.XA 2020-09-25 2020-09-25 Method and device for acquiring front-end equipment catalog Active CN111935316B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011027253.XA CN111935316B (en) 2020-09-25 2020-09-25 Method and device for acquiring front-end equipment catalog

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011027253.XA CN111935316B (en) 2020-09-25 2020-09-25 Method and device for acquiring front-end equipment catalog

Publications (2)

Publication Number Publication Date
CN111935316A true CN111935316A (en) 2020-11-13
CN111935316B CN111935316B (en) 2020-12-22

Family

ID=73333640

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011027253.XA Active CN111935316B (en) 2020-09-25 2020-09-25 Method and device for acquiring front-end equipment catalog

Country Status (1)

Country Link
CN (1) CN111935316B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112527515A (en) * 2020-12-02 2021-03-19 厦门亿联网络技术股份有限公司 State synchronization method, device, equipment and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103227788A (en) * 2013-04-17 2013-07-31 广州市和声信息技术有限公司 Method and system realizing communication between web-based application and SIP equipment
US9294544B1 (en) * 2011-08-04 2016-03-22 Wyse Technology L.L.C. System and method for facilitating client-server communication
CN106411931A (en) * 2016-11-11 2017-02-15 安徽维德工业自动化有限公司 Networked monitoring platform of integrated service
CN106817341A (en) * 2015-11-27 2017-06-09 中国科学院沈阳计算技术研究所有限公司 A kind of Session Initiation Protocol throttling Transmission system and method towards mobile Internet
CN108924142A (en) * 2018-07-13 2018-11-30 江苏中利电子信息科技有限公司 A kind of secure voice intercommunication means of communication based on Session Initiation Protocol
CN108933926A (en) * 2018-07-02 2018-12-04 福建星网锐捷通讯股份有限公司 A kind of method and system based on SIP access Haikang fluorite video

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9294544B1 (en) * 2011-08-04 2016-03-22 Wyse Technology L.L.C. System and method for facilitating client-server communication
CN103227788A (en) * 2013-04-17 2013-07-31 广州市和声信息技术有限公司 Method and system realizing communication between web-based application and SIP equipment
CN106817341A (en) * 2015-11-27 2017-06-09 中国科学院沈阳计算技术研究所有限公司 A kind of Session Initiation Protocol throttling Transmission system and method towards mobile Internet
CN106411931A (en) * 2016-11-11 2017-02-15 安徽维德工业自动化有限公司 Networked monitoring platform of integrated service
CN108933926A (en) * 2018-07-02 2018-12-04 福建星网锐捷通讯股份有限公司 A kind of method and system based on SIP access Haikang fluorite video
CN108924142A (en) * 2018-07-13 2018-11-30 江苏中利电子信息科技有限公司 A kind of secure voice intercommunication means of communication based on Session Initiation Protocol

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
丁才成: "基于SIP信令IP全交换远程监控系统在现代畜牧业养殖基地信息监测中的应用研究", 《计算机技术及其应用》 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112527515A (en) * 2020-12-02 2021-03-19 厦门亿联网络技术股份有限公司 State synchronization method, device, equipment and storage medium

Also Published As

Publication number Publication date
CN111935316B (en) 2020-12-22

Similar Documents

Publication Publication Date Title
CN110300056B (en) Real-time response type API gateway and request processing method thereof
CN102761864B (en) Data transmission method, system and device
CN110752943B (en) Distributed fault diagnosis system and method for power transmission line
CN102377617A (en) Systems, methods, and apparatus to monitor and authenticate mobile internet activity
CN109547524B (en) User behavior storage method, device, equipment and storage medium based on Internet of things
CN111935177B (en) Service control method and device
US20220391577A1 (en) Information interaction method and apparatus, server, system, and storage medium
CN109889454A (en) A kind of the message driving means and method of micro services framework
CN103685354A (en) Method and device for testing based on RMI protocol
CN113225339B (en) Network security monitoring method and device, computer equipment and storage medium
CN111935316B (en) Method and device for acquiring front-end equipment catalog
CN104284142A (en) Communication method, device and system
CN112291209B (en) Method and device for acquiring front-end equipment catalog
CN112291207B (en) Method and device for acquiring front-end equipment catalog
CN112291210B (en) Method and device for acquiring front-end equipment catalog
CN112188245B (en) Front-end camera real-time video-on-demand method and device and electronic equipment
CN112367297B (en) Service control method and device
CN112367296B (en) Service control method and device
CN104462235A (en) Internet of Things general event service mechanism based on Restful Web Service
CN112188242B (en) Front-end camera real-time video-on-demand method and device and electronic equipment
CN112188244B (en) Front-end camera real-time video-on-demand method and device and electronic equipment
CN113065049A (en) Data capture method and device, storage medium and electronic equipment
CN112188243B (en) Front-end camera real-time video-on-demand method and device and electronic equipment
CN101783930A (en) Interaction method, device and system of television
CN107102874B (en) Application concurrent installation method and system

Legal Events

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