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 atraffic police terminal 11, adata server 12, and a front-end device 13; wherein:
thetraffic 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;
thedata 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.
Thetraffic police terminal 11, thedata server 12 and the front-end equipment 13 are located in a wireless network or a wired network, thetraffic police terminal 11 is connected with thedata server 12 based on an http protocol, and the front-end equipment 13 is connected with thedata server 12 based on an sip protocol, so as to realize data interaction among thetraffic police terminal 11, thedata server 12 and the front-end equipment, wherein:
thedata server 12 receives an http directory synchronization request sent by the traffic police terminal on a request selection page 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: the method comprises the steps of receiving an http directory synchronization request sent by a traffic police terminal based on an http protocol, wherein the http directory synchronization request comprises a request selection page including a request type selection control and a front-end device selection control, displayed by the traffic police terminal after receiving a trigger instruction of requesting front-end equipment, determining a target request type according to selection operation of the request type selection control, determining a target device type according to selection operation of the front-end device selection control, and generating the http directory synchronization request conforming to the http protocol according to a terminal identifier of the traffic police terminal, a target device type identifier of the target device type and the target request type.
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.
After receiving a trigger instruction of requesting front-end equipment, the traffic police terminal displays a request selection page comprising a request type selection control and a front-end equipment selection control, and then performs corresponding selection operation on the request selection page to determine what type of request is to be sent to the front-end equipment in a monitoring place and to which front-end equipment or front-end equipment the request is to be sent. The method specifically comprises the following steps: generating a request category catalog according to the trigger operation aiming at the request category selection control, and determining a catalog synchronous request as a target request category according to the selection operation aiming at the request category in the request category catalog; and based on the target request category, generating a front-end equipment type catalog according to the trigger operation aiming at the front-end equipment selection control, and determining the target equipment type according to the selection operation aiming at the front-end equipment type in the front-end equipment type catalog.
When the request category selection control is triggered, a request category list corresponding to all requests which can be initiated to the front-end equipment in the system is generated, the request category can comprise a directory synchronization request, a real-time video on demand request, a front-end equipment control request and the like, then a certain request category can be selected as a target request category, the request category which is selected last time by the traffic police terminal which initiates the request can be used as a default target request category in the request category list, or the request category with higher selection frequency can be used as a default target request category. In the embodiment of the application, the catalog synchronous request is determined as a target request category.
Based on the difference of the target request types, when the front-end equipment selection control is triggered, a front-end equipment list or a front-end equipment type list is generated. If the selected target request type is a real-time video-on-demand request or a front-end device control request, such a type of request is usually used for requesting a certain front-end device in a monitoring place, and therefore a front-end device list is generated when the front-end device selection control is triggered, and if the selected target request type is a directory synchronization request, such a type of request is used for requesting all front-end devices of a certain type, and therefore a front-end device type list is generated when the front-end device selection control is triggered. According to the method and the device, because the target request type is a directory synchronization request, a front-end device type list can be generated when the front-end device selection control is triggered, the front-end device type can comprise a front-end camera, a network video recorder, a front-end device platform and the like, and after the corresponding front-end device type is selected, an http directory synchronization request which accords with an http protocol is generated according to a terminal identifier of a traffic police terminal, a target device type identifier of the target device type and the target request type.
The http directory synchronization request carries a terminal identifier and a target device type identifier, wherein the terminal identifier includes 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 hard disk video recorder, and the target device type identifier includes a common identifier of the front-end devices belonging to the same type, and if the target device type selected in the front-end device type directory is the front-end camera, it indicates that the directory of all the front-end cameras is to be queried, the target device type identifier is a camera identifier, and when the directory of all the network hard disk video recorders is to be queried, 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 directory information of the front-end devices is stored on the front-end device platform, 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 therefore, the target device type selected in the front-end device type directory is the front-end device platform, and the corresponding 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.
It can be known from the above method that, in the front-end equipment directory obtaining method provided in the embodiment of the present application, the data server first receives an http directory synchronization request sent by the traffic police terminal based on the http protocol, and converts the http directory synchronization request into an sip directory synchronization request recognizable by the front-end equipment, and then converts an sip directory synchronization response returned by the front-end equipment into an http directory synchronization response, and returns the http directory synchronization response to the traffic police terminal, the traffic police terminal only needs to send a request once on a web browser or a platform in the whole directory obtaining process, so that the obtaining process is simplified, and when a request is initiated on a request selection page, a corresponding target equipment type and a target request type can be selected only according to a selection operation, so that the operation is simple, in addition, after a plurality of sip directory synchronization responses returned from the inside are generated into a front-end equipment directory, the front-end equipment directory is returned to the traffic police terminal in an http directory synchronization response manner, so that a front-end equipment directory with a complete structure can be directly obtained, the technical problem that the acquired data are split is solved. 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, a request front-end device control 100 is arranged on a platform interface of the traffic police terminal, and when the traffic police terminal needs to initiate a request to a front-end device, and clicks the request front-end device control 100, the traffic police terminal receives a trigger instruction of the request front-end device, and displays a request selection page including a requestcategory selection control 200 and a front-enddevice selection control 300. The request front-end device control 100 and the other two controls can be arranged on different pages, that is, the request selection page can be a page generated by clicking the request front-end device control 100 on another page of the traffic police terminal; the request front-end device control 100 and the other two controls may also be arranged on the same page, when the request front-end device control 100 is not clicked, the other two controls are not displayed, and after the request front-end device control 100 is clicked, the page serves as a request selection page to display the requestcategory selection control 200 and the front-enddevice selection control 300.
After the request selection page clicks the requestcategory selection control 200, the request selection page generates arequest category directory 201 according to a trigger operation for the requestcategory selection control 200, all request categories which can be received and responded by the front-end device, such as a directory synchronization request, a real-time video on demand request, a front-end device control request and the like, can be displayed in therequest category directory 201, and then a corresponding selection operation is performed in therequest category directory 201 to determine what category of request is sent. In performing the selection operation, one request category may be selected from therequest category list 201 as a target request category each time, wherein the last selected request category or the request category with a higher selection frequency may be set as a default target request category. When therequest category list 201 includes a large number of request categories, a search or screening function may be set to narrow the search range according to information such as keywords, so as to quickly search the target request category to be selected.
After the front-enddevice selection control 300 is triggered, the corresponding directory is also displayed, but the content of the directory is determined based on the type of the target request, if the selected type of the target request is a real-time video-on-demand request or a front-end device control request, the type of the request is generally used for requesting a certain front-end device in a monitoring place, so that a front-end device list is generated when the front-enddevice selection control 300 is triggered, and if the selected type of the target request is a directory synchronization request, the type of the request is used for requesting all front-end devices of a certain type, so that a front-end device type list is generated when the front-enddevice selection control 300 is triggered. The target request type selected in fig. 3 is a directory synchronization request, and after the request selection page clicks the front-enddevice selection control 300, the request selection page generates a front-enddevice type directory 301 according to a trigger operation for the front-enddevice selection control 300, and all front-end device types corresponding to the front-end devices registered in the intelligent transportation system, such as a front-end machine type, a network hard disk video recorder type, a front-end device platform type, and the like, can be displayed in the front-enddevice type directory 301. A corresponding selection operation is then performed in the head-enddevice type directory 301 to determine to which type of all head-end devices the request is issued.
After the corresponding selection operations are performed on the requesttype selection control 200 and the front-enddevice selection control 300, and theclick determination 400 is performed, an http front-end device control request conforming to an http protocol is generated according to the terminal identifier of the traffic police terminal, the target device identifier of the target device, and the target request type. By setting the request selection page, the request initiator can send various requests only through selection operation, the operation is simple, and the requirement on request initiator is low.
As shown in fig. 4, the framework of the front-end device directory acquisition method is divided into several modules, the data server includes anhttp service module 22, aprotocol scheduling module 23 and asip proxy module 24, an httpdirectory synchronization request 21 sent by the traffic police terminal is sent to thehttp service module 22, and thehttp service module 22 performs parameter validity judgment and duplicate checking processing on the httpdirectory synchronization request 21 and then sends the http directory synchronization request to theprotocol scheduling module 23. Theprotocol scheduling module 23 generates an sip directory synchronization request according to the httpdirectory synchronization request 21 and sends the sip directory synchronization request to thesip proxy module 24, and meanwhile, the httpdirectory synchronization request 21 and the sip directory synchronization request are bundled to generate a request pair. Thesip proxy module 24 determines the target front-end device from the front-end device 25 according to the directory device type identifier in the httpdirectory 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, thesip proxy module 24 sends each sip directory response to theprotocol scheduling module 23, while thesip proxy module 24 and theprotocol 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, thesip 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 theprotocol scheduling module 23 is also updated to request processed. Theprotocol 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 httpdirectory synchronization request 21 corresponding to the processed sip directory synchronization request according to the request, updates the processing state of the httpdirectory synchronization request 21 to be that the request is processed, and fills the front-end device directory into the httpdirectory synchronization request 21. At this time, the processing state of the httpdirectory synchronization request 21 in thehttp service module 22 is also updated to request processed, thehttp service module 22 generates an httpdirectory synchronization response 26 carrying the front-end device directory according to the httpdirectory synchronization request 21 filled with the front-end device directory, then determines the traffic police terminal sending the httpdirectory synchronization request 21 according to the terminal identifier in the httpdirectory synchronization request 21, returns the httpdirectory 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. 5, 6 and 7, thehttp service module 22 includes anhttp service buffer 221, an httptask buffer queue 222, anhttp response logic 223 and anhttp task timer 224, theprotocol scheduling module 23 includes adirectory assembling module 231, ascheduling task timer 232 and a sip directoryresponse buffer queue 233, and thesip proxy module 24 includes a siptask buffer queue 241, asip task timer 242, auser proxy client 243 and auser proxy server 244, which are specifically described below with reference to fig. 4 to 7.
The traffic police terminal sends an httpdirectory synchronization request 21 to anhttp 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 httpdirectory 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 catalogsynchronous 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 thehttp service module 22, the httpdirectory synchronization request 21 first enters thehttp service buffer 221, and thehttp service buffer 221 performs validity judgment. The method specifically comprises the following steps: performing logic judgment on the httpdirectory synchronization request 21 based on the synchronization request effective parameter set; if the httpdirectory synchronization request 21 is legal, the httpdirectory synchronization request 21 is cached to the httptask cache queue 222, if the httpdirectory synchronization request 21 is illegal, the http directory synchronization request is marked as an error, and anhttp response logic 223 directly returns a termination request result to the traffic police terminal, wherein the termination request result is represented as an httpdirectory synchronization response 26 at the traffic police terminal, and the response state is illegal. When the traffic police terminal sends out the httpdirectory synchronization request 21, the httpdirectory synchronization request 21 is sent out in a form of inputting a website on a web browser or a platform, the httpdirectory 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 thehttp service buffer 221 analyzes the httpdirectory synchronization request 21, firstly, logic judgment is made on the httpdirectory 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 httpdirectory synchronization request 21 is cached into the httptask 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 httpdirectory synchronization request 21 is input again conveniently by the traffic police terminal after being adjusted.
In one embodiment, before the step of buffering the httpdirectory synchronization request 21 into the httptask buffer queue 222, the method further includes: judging whether the httpdirectory synchronization request 21 has the same content as a first http directory synchronization request received in a previous preset time period in the httptask cache queue 222; if the contents are the same, the httpdirectory 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 httpdirectory synchronization request 21, and if the contents are different, the httpdirectory synchronization request 21 is cached in the httptask cache queue 222.
After the traffic police terminal sends the httpdirectory 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 httpdirectory synchronization request 21 again, and the content of each sent httpdirectory synchronization request 21 is the same, if the data server processes each request, resource waste is caused, therefore, after the httpdirectory synchronization request 21 is cached in thehttp service buffer 221, thehttp service buffer 221 checks the first http directory synchronization request received within a preset time period before in the httptask 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 httptask cache queue 222 within the previous preset time period are different from the content of the currently sent httpdirectory synchronization request 21, it indicates that the currently sent httpdirectory synchronization request 21 is a first sent request, and the first http directory synchronization request may be directly placed in the httptask cache queue 222. If it is detected that there is a first http directory synchronization request having the same content as the currently entered httpdirectory synchronization request 21 in all first http directory synchronization requests entering the httptask cache queue 222 within the previous preset time period, it indicates that the currently issued httpdirectory 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 httpdirectory synchronization request 21, the first http directory synchronization request may have been subjected to subsequent processing, and if the httpdirectory 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 httpdirectory 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 httpdirectory 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 httpdirectory synchronization request 21 is cached in the httptask cache queue 222, the httptask cache queue 222 generates an http state identifier for the httpdirectory synchronization request 21, where the identifier content of the http state identifier is a request to be processed, and then sends the httpdirectory synchronization request 21 to theprotocol scheduling module 23, specifically to thescheduling task timer 232 of theprotocol scheduling module 23.
Thescheduling task timer 232 determines the operation of the next step by reading the identification content of the http status flag in the httptask 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 httpdirectory synchronization request 21 is generated in thescheduling task timer 232, and the identification content of the http state identification in the httptask cache queue 222 is updated to be in processing. Thescheduling task timer 232 sends the generated sip directory synchronization request to thesip proxy module 24, and at the same time, binds the httpdirectory synchronization request 21 and the sip directory synchronization request to generate a request pair, caches the request pair to the sip directoryresponse cache queue 233, and generates a request pair identifier for the request pair. When multiple requests may be received by thetask scheduling timer 232 within a period of time, multiple request pairs are generated accordingly, and when a request pair is buffered in the sip directoryresponse buffer queue 233, in order to distinguish the current request from other requests, a unique identifier is generated for each request pair.
Thescheduling task timer 232 sends the generated sip directory synchronization request to thesip proxy module 24, specifically, to an siptask cache queue 241 sent to thesip proxy module 24, the siptask 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, thesip task timer 242 determines the next operation by reading the identifier content of the sip status identifier in the siptask 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 harddisk 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 harddisk 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.
Thesip proxy module 24 sends an sip directory synchronization request to the target front-end device through theuser 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 theuser 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.
Theuser agent 244 returns each received sip directory synchronization response to the siptask cache queue 241, the siptask 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 siptask cache queue 241 to the processed request. In addition, a timeout mechanism is further disposed inside the siptask 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 siptask buffer queue 241 is updated to be that the request has timed out.
When the siptask 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 directoryresponse cache queue 233, the sip directoryresponse 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, thescheduling task timer 232 will take out the sip directory synchronization responses, remove the sip directory synchronization responses in the sip directoryresponse cache queue 233, then send the taken out sip directory synchronization responses to thedirectory assembling module 231, and thedirectory 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 directoryresponse cache queue 233 by the siptask cache queue 241, and after thehttp service module 22 sends the httpdirectory synchronization request 21 to theprotocol scheduling module 23, the identification content of the http status identification of the httpdirectory synchronization request 21 in the httptask cache queue 222 is updated to be in the request processing, thescheduling task timer 232 determines the next step operation according to the identification content of the http status identification in the httptask 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 directoryresponse 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 directoryresponse cache queue 233, based on the request pair of the sip directory synchronization request, it is further determined which httpdirectory 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 directoryresponse cache queue 233 and the siptask 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 siptask 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 directoryresponse cache queue 233 is also updated to be the request processed synchronously. At this time, in theprotocol scheduling module 23, the sip directoryresponse cache queue 233 also receives all returned sip directory synchronization responses, and after all sip directory synchronization responses have been returned, theprotocol 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 directoryresponse cache queue 233 according to the request pair identifier; determining an httpdirectory 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 httptask cache queue 222 into processed request. In the sending process of the httpdirectory synchronization request 21, thescheduling task timer 232 bundles the httpdirectory 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 directoryresponse 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 thescheduling 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 httptask cache queue 222 and the sip directoryresponse cache queue 233 in the request pair have the same data source of the httpdirectory synchronization request 21, so that the content and the state of the httptask cache queue 222 and the sip directoryresponse 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 directoryresponse cache queue 233 is updated to be the request processed, the identification content of the http state identification in the httptask cache queue 222 is also updated to be the request processed.
Thehttp task timer 224 concurrently reads the processing state of the httpdirectory synchronization request 21 in the httptask cache queue 222, determines the next step operation according to the read processing state of the httpdirectory synchronization request 21 in the httptask cache queue 222, controls thehttp response logic 223 to read the corresponding httpdirectory synchronization request 21 from the httptask cache queue 222 after the identification content of the http status identification is read as that the request is processed, and then generates the httpdirectory synchronization response 26 carrying the front-end device directory. When the read processing state is a timeout, an error or other returnable condition, thehttp response logic 223 is also controlled to generate the corresponding httpdirectory synchronization response 26.
In an embodiment, the step of generating the httpdirectory synchronization response 26 carrying the front-end device directory specifically includes: thescheduling task timer 232 sends the generated front-end device directory supporting the http protocol to the httptask cache queue 222, the httptask cache queue 222 fills the front-end device directory into the httpdirectory synchronization request 21, and then thehttp response logic 223 generates the httpdirectory synchronization response 26 carrying the front-end device directory according to the filled httpdirectory synchronization request 21. Finally, thehttp response logic 223 determines which traffic police terminal sent the httpdirectory synchronization request 21 is according to the terminal identifier, and returns the httpdirectory 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 httpdirectory synchronization response 26, so that the directories of the monitoring place side and the traffic police terminal side are synchronized.
Inside thehttp service module 22, thehttp task timer 224 generates an http state identifier for requesting to-be-processed for the httpdirectory synchronization request 21 newly entering the httptask cache queue 222, and sends the http state identifier to theprotocol scheduling module 23. In theprotocol scheduling module 23, after the sip directoryresponse cache queue 233 receives the sip directory synchronization response, thescheduling 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 thehttp service module 22. In thesip proxy module 24, thesip task timer 242 generates an sip status identifier for the sip directory synchronization request newly entering the siptask 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.
It can be known from the above embodiments that, in the front-end equipment directory acquiring method of the present application, the data server first receives an http directory synchronization request sent by the traffic police terminal based on the http protocol, and converts the http directory synchronization request into an sip directory synchronization request recognizable by the front-end equipment, and then converts an sip directory synchronization response returned by the front-end equipment into an http directory synchronization response, and returns the http directory synchronization response to the traffic police terminal, the traffic police terminal can complete the whole directory acquiring process by sending a request once on a web browser or a platform, the acquiring process is simplified, and when a request is initiated on a request selection page, the corresponding target equipment type and target request type can be selected only according to a selection operation, the operation is simple, in addition, a plurality of sip directory synchronization responses returned internally generate the front-end equipment directory, and then the front-end equipment directory is returned to the traffic police terminal in an http directory synchronization response manner, so as to directly acquire the front-end equipment directory with a complete structure, the technical problem that the acquired data are split is solved. 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. 8 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. 8 is a directory acquisition manner in the prior art, and b in fig. 8 is a directory acquisition manner in the present application.
In the prior art, thetraffic 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 thetraffic 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 thetraffic police terminal 11 and the response sent by the front-end device 13 may be in different orders, thetraffic 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, thetraffic police terminal 11 sends an http directory synchronization request to thedata server 12, thedata 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 thedata server 12, format conversion and data recombination are performed inside thedata server 12 to generate a complete front-end device directory, and then thedata server 12 generates an http directory synchronization response carrying the front-end device directory and sends the http directory synchronization response to thetraffic 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, the acquisition flow is simplified, and when a request is initiated on a request selection page, the corresponding target equipment type and the target request type can be selected only according to selection operation, and the operation is simpler. 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 thetraffic 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. 9, where fig. 9 specifically describes the front-end device directory obtaining apparatus provided in the embodiment of the present application, and the apparatus may include:
the receivingmodule 110 is configured to receive an http directory synchronization request sent by a traffic police terminal based on an http protocol, where the http directory synchronization request includes a request selection page including a request type selection control and a front-end device selection control, which is displayed after the traffic police terminal receives a trigger instruction requesting a front-end device, determine a target request type according to a selection operation for the request type selection control, determine a target device type according to a selection operation for the front-end device selection control, and generate an http directory synchronization request conforming to the http protocol according to a terminal identifier of the traffic police terminal, a target device type identifier of the target device type, and the target request type;
therequest 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 sendingmodule 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;
thecatalog 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 updatingmodule 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 returningmodule 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 receivingmodule 110 is configured to generate a request category directory according to a trigger operation for selecting a control for a request category, and determine a directory synchronization request as a target request category according to a selection operation for a request category in the request category directory; and based on the target request category, generating a front-end equipment type catalog according to the trigger operation aiming at the front-end equipment selection control, and determining the target equipment type according to the selection operation aiming at the front-end equipment type in the front-end equipment type catalog.
In an embodiment, the front-end device directory obtaining apparatus further includes a first identifier generating module, where after thereceiving 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 therequest 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 sendingmodule 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, thecatalog 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, theupdate 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, thereturn 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 catalog acquisition device provided by the application is characterized in that a data server receives an http catalog synchronous request sent by a traffic police terminal based on an http protocol, converts the http catalog synchronous request into an sip catalog synchronous request which can be identified by the front-end equipment, converts the sip catalog synchronous response returned by the front-end equipment into an http catalog synchronous response and returns the http catalog synchronous response to the traffic police terminal, the traffic police terminal can complete the whole catalog acquisition process by sending a request on a web browser or a platform, the acquisition process is simplified, the corresponding target equipment type and target request type can be selected only according to selection operation when the request is sent on a request selection page, the operation is simpler, in addition, a plurality of returned sip catalog synchronous responses are generated into a front-end equipment catalog inside and then returned to the traffic police terminal in an http catalog synchronous response mode, and the front-end equipment catalog with a complete structure can be directly acquired, the technical problem that the acquired data are split is solved. 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, an electronic device may include, as shown in fig. 10, aradio frequency circuit 901, amemory 902 including one or more computer-readable storage media, aninput unit 903, adisplay unit 904, asensor 905, anaudio circuit 906, aWiFi module 907, aprocessor 908 including one or more processing cores, and apower supply 909. Those skilled in the art will appreciate that the electronic device configuration shown in fig. 10 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:
therf 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 ormore processors 908 for processing; in addition, data relating to uplink is transmitted to the base station. Thememory 902 may be used to store software programs and modules, and theprocessor 908 executes various functional applications and data processing by operating the software programs and modules stored in thememory 902. Theinput 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.
Thedisplay 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 onesensor 905, such as light sensors, motion sensors, and other sensors. Theaudio 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 theWiFi module 907, and provides wireless broadband internet access for the user. Although fig. 10 shows theWiFi 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.
Theprocessor 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 thememory 902 and calling data stored in thememory 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 theprocessor 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, theprocessor 908 in the electronic device loads an executable file corresponding to a process of one or more application programs into thememory 902 according to the following instructions, and theprocessor 908 executes the application programs stored in thememory 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; the http directory synchronization request comprises that after the traffic police terminal receives a trigger instruction of requesting front-end equipment, a request selection page comprising a request category selection control and a front-end equipment selection control is displayed, a target request category is determined according to a selection operation aiming at the request category selection control, a target equipment type is determined according to a selection operation aiming at the front-end equipment selection control, and the http directory synchronization request conforming to an http protocol is generated according to a terminal identifier of the traffic police terminal, a target equipment type identifier of the target equipment type and the target request category; 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.
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.