CN112367297A - Service control method and device - Google Patents

Service control method and device Download PDF

Info

Publication number
CN112367297A
CN112367297A CN202011107712.5A CN202011107712A CN112367297A CN 112367297 A CN112367297 A CN 112367297A CN 202011107712 A CN202011107712 A CN 202011107712A CN 112367297 A CN112367297 A CN 112367297A
Authority
CN
China
Prior art keywords
service
request
server
target
service 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
CN202011107712.5A
Other languages
Chinese (zh)
Other versions
CN112367297B (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 CN202011107712.5A priority Critical patent/CN112367297B/en
Publication of CN112367297A publication Critical patent/CN112367297A/en
Application granted granted Critical
Publication of CN112367297B publication Critical patent/CN112367297B/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
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/10Network architectures or network communication protocols for network security for controlling access to devices or network resources
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities
    • H04L63/083Network architectures or network communication protocols for network security for authentication of entities using passwords
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/60Network streaming of media packets
    • 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/141Setup of application sessions
    • 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

Abstract

The application provides a business control method and a device, the method is suitable for an intelligent traffic system, the business control method of the application generates an internal unified operation code according to a request parameter carried by a first business request after receiving the first business request sent by a business request device, and then determines a protocol of a business server executing the operation command and generates a second business request corresponding to the protocol according to an operation command corresponding to the operation code, so that business request control under different protocols can be managed in a centralized manner and distributed in a unified manner, and further, business access among servers is more efficient; meanwhile, after the second service request is generated, the service identifier of the target service server is searched according to the operation code, so that the service request equipment cannot know the access address of the target service server, and the safety problem caused by direct access between the service request equipment and the service server is solved.

Description

Service control method and device
Technical Field
The application relates to the field of intelligent traffic, in particular to a service control method and device.
Background
In a traffic system, there are multiple servers for implementing different functions, such as a media server, a signaling server, a service center server, etc., and these servers operate independently of each other, but there is a need for service access between them, however, these services are usually implemented based on different protocols, languages and frameworks, and the protocol difference between a request initiator and a request receiver during actual access results in a cumbersome access process and low access efficiency, and especially when the number of servers is large, the access relationship between the servers may present a mesh structure, which is not conducive to the efficiency and the maintainability of the system, and is difficult to meet the development needs of the traffic system.
Therefore, the existing service control has the technical problem that the service access control among the servers is complex, and needs to be improved.
Disclosure of Invention
The embodiment of the application provides a service control method and device, which are used for relieving the technical problem that service access control among servers is complex in the existing service control.
In order to solve the above technical problem, an embodiment of the present application provides the following technical solutions:
the application provides a service control method, which is suitable for an intelligent traffic system, wherein the intelligent traffic system comprises at least two service request devices supporting different communication protocols, a control server, a 5G base station and at least two service servers supporting different communication protocols, the communication protocols comprise one of an http protocol, a sip protocol and a tcp/udp protocol, the service control method is applied to the control server, and the service control method comprises the following steps:
receiving a first service request sent by the service request equipment based on a first protocol, wherein the first service request carries an equipment identifier, a first protocol type identifier and a request parameter;
generating an operation code corresponding to the request parameter according to the request parameter and a preset parameter comparison table;
determining an operation command of the first service request according to the operation code, determining a target service server corresponding to the first service request and a second protocol used by the target service server according to the operation command, and generating a second service request corresponding to the first service request, wherein the second service request carries a second protocol type identifier;
according to the operation code, determining a server identifier of the target service server, an interface identifier corresponding to the operation command and a target 5G base station corresponding to the target service server, determining a long connection with the target 5G base station, sending the second service request to the target 5G base station through the long connection so as to control the target 5G base station to send the second service request to a corresponding interface of the target service server through a private line based on the second protocol according to the server identifier, the interface identifier and the second protocol type identifier, and receiving a request processing result returned by the target service server based on the second protocol;
receiving a request processing result returned by the target 5G base station through the long connection, and generating a service response corresponding to the request processing result based on the first protocol type identifier;
and returning the service response to the service request equipment based on the first protocol according to the equipment identifier and the first protocol type identifier.
Meanwhile, the present application further provides a service control device, which is suitable for an intelligent traffic system, the intelligent traffic system includes at least two service request devices supporting different communication protocols, a control server, a 5G base station, and at least two service servers supporting different communication protocols, the communication protocols include one of http protocol, sip protocol and tcp/udp protocol, the service control device is disposed in the control server, and the service control device includes:
a receiving module, configured to receive a first service request sent by the service request device based on a first protocol, where the first service request carries a device identifier, a first protocol type identifier, and a request parameter;
the code generating module is used for generating an operation code corresponding to the request parameter according to the request parameter and a preset parameter comparison table;
a request generation module, configured to determine an operation command of the first service request according to the operation code, determine, according to the operation command, a target service server corresponding to the first service request and a second protocol used by the target service server, and generate a second service request corresponding to the first service request, where the second service request carries a second protocol type identifier;
a determining module, configured to determine, according to the operation code, a server identifier of the target service server, an interface identifier corresponding to the operation command, and a target 5G base station corresponding to the target service server, determine a long connection with the target 5G base station, send the second service request to the target 5G base station through the long connection, so as to control the target 5G base station to send the second service request to a corresponding interface of the target service server through a dedicated line based on the second protocol according to the server identifier, the interface identifier, and the second protocol type identifier, and receive a request processing result returned by the target service server based on the second protocol;
a response generation module, configured to receive a request processing result returned by the target 5G base station through the long connection, and generate a service response corresponding to the request processing result based on the first protocol type identifier;
and the returning module is used for returning the service response to the service request equipment based on the first protocol according to the equipment identifier and the first protocol type 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 execute the application program in the memory to perform the operation in the service control method.
Has the advantages that: the application provides a service control method and a device, the method is suitable for an intelligent traffic system, the intelligent traffic system comprises at least two service request devices supporting different communication protocols, a control server, a 5G base station and at least two service servers supporting different communication protocols, the communication protocols comprise one of an http protocol, a sip protocol and a tcp/udp protocol, and the service control method is applied to the control server. According to the service control method, after a first service request sent by service request equipment is received, no matter which one of an http protocol, a sip protocol and a tcp/udp protocol is based on the first service request, an internal unified operation code is generated according to a request parameter carried by the first service request, then according to an operation command corresponding to the operation code, a protocol of a service server executing the operation command is determined, and a second service request corresponding to the protocol is generated, so that service request control under different protocols can be managed in a centralized manner and distributed in a unified manner, management and maintenance difficulties caused by differences of communication protocols when direct requests are made between the service request equipment and the service server are relieved, and service access among the servers is more efficient; meanwhile, after the second service request is generated, the service identifier of the target service server is searched according to the operation code, so that the service request equipment cannot know the access address of the target service server, and the safety problem caused by direct access between the service request equipment and the service server is solved. In addition, the information transmission is carried out through the 5G base station, the speed is high, and the service access 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 service control system according to an embodiment of the present application.
Fig. 2 is a flowchart illustrating a service control method according to an embodiment of the present application.
Fig. 3 is a schematic diagram of a first model of a service control method according to an embodiment of the present application.
Fig. 4 is a schematic diagram of a second model of a service control method according to an embodiment of the present application.
Fig. 5 is a schematic diagram of a third model of a service control method according to an embodiment of the present application.
Fig. 6 is a schematic diagram of a fourth model of a service control method according to an embodiment of the present application.
Fig. 7 is a schematic diagram illustrating a comparison of access modes between servers in the prior art and the present application.
Fig. 8 is a schematic structural diagram of a service control 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 at least two service request devices supporting different communication protocols, a control server, a 5G base station and at least two service servers supporting different communication protocols, wherein the communication protocols comprise one of an http protocol, a sip protocol and a tcp/udp protocol.
The embodiment of the application provides a service control method and device and electronic equipment. The service control device 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 service control system according to an embodiment of the present application, 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 application scenario includes a service request device 11, a control server 12, a 5G base station 13, and a service server 14; wherein:
the service request device 11 includes, but is not limited to, a tablet Computer, a notebook Computer, a Personal Computer (PC), a micro processing box, or other devices;
the control server 12 and the service server 14 comprise local servers and/or remote servers and the like;
the 5G base station 13 includes a radio transceiver station for information transfer with terminals through a communication switching center in a certain radio coverage area.
The service request device 11, the control server 12, the 5G base station 13 and the service server 14 are located in a wireless network or a wired network, the service request device 11 is connected to the control server 12 based on a first protocol, the service server 14 is accessed to the control server 12 based on a second protocol, and the control server 12 is connected to the 5G base station 13 based on the 5G protocol, so as to implement data interaction between the four devices, where:
the control server 12 receives a first service request sent by the service request device 11 based on a first protocol, then generates an operation code corresponding to the request parameter according to the request parameter carried in the first service request, determines an operation command of the first service request according to the operation code, then determines a corresponding target service server and a second protocol used by the target service server according to the operation command, and generates a second service request corresponding to the first service request, wherein the second service request carries a second protocol type identifier; then according to the operation code, determining a server identifier of the target service server, an interface identifier corresponding to the operation command and a target 5G base station corresponding to the target service server, sending a second service request to the target 5G base station through long connection with the target 5G base station so as to control the target 5G base station to send the second service request to a corresponding interface of the target service server through a private line based on a second protocol, and receiving a request processing result returned by the target service server based on the second protocol; then, receiving a request processing result returned by the target 5G base station through long connection, and generating a service response corresponding to the request processing result based on the first protocol type identifier; and finally, returning a service response to the service request device 11 based on the first protocol according to the device identifier and the first protocol type 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 flow chart of a service control method according to an embodiment of the present application, where the method includes:
s201: and receiving a first service request sent by service request equipment based on a first protocol, wherein the first service request carries an equipment identifier, a first protocol type identifier and a request parameter.
In an intelligent traffic system, there are a plurality of servers, each of which operates independently of the other to perform its own work task. The server can include a media server, a signaling server, a service center server, etc., wherein the media server is used for collecting, caching, scheduling and transmitting and playing media contents, such as forwarding and playing videos, the signaling server is used for managing sessions and connections, such as sending signaling and receiving responses to other servers, and the service center server is used for providing interfaces for a system front-end client and a system external client, so that the system front-end client and the system external client can obtain and operate data stored by the system, and functions of user query, mechanism query, equipment query, etc. can be realized under the framework. The servers maintain good operation of the system together, although the functions executed by the servers are different, under normal circumstances, there will be a service access requirement between different servers, for example, a media server may send a service request to a signaling server, request the signaling server to send a signaling, the signaling server may also initiate a service request to a service center server, request the service center server to query an account and a password of a user, and the like. When a service access relation needs to be established between two servers, one of the servers serves as a service request device to send out a service request, and the other server serves as a service server to receive the service request, namely the roles of the servers in the system are not fixed, and each server can serve as the service request device and also can serve as the service server.
The intelligent traffic system comprises a video monitoring system, the service request equipment can be a server inside the video monitoring system or a server outside the video monitoring system, and the service servers are all servers inside the video monitoring system. In the service control method, the server in the video monitoring system or other external servers can be used as service request equipment to send out the service request.
For different service request devices, due to different functions, the development can be performed based on different communication protocols, languages and frameworks, and various types of information which can be received and sent by the service request devices can be performed only based on the communication protocols of the service request devices. For a media server, the media server supports a tcp/udp protocol, a service request sent by the media server and a received service response are only in a tcp/udp format and need to be sent based on the tcp/udp protocol during transmission, for a signaling server, the media server supports a sip protocol, the service request sent by the media server and the received service response are only in a sip format and need to be sent based on the sip protocol during transmission, for a service center server, the media server supports an http protocol, the service request sent by the media server and the received service response are only in an http format and need to be sent based on the http protocol during transmission.
When the service request equipment wants to establish a service access relation with other servers, a first service request is sent based on a first protocol, the first service request carries equipment identification, first protocol type identification and request parameters, the first protocol can be one of an http protocol, a sip protocol and a tcp/udp protocol, the type of the first protocol is different according to the type of the service request equipment, the format of the first service request is a format under the corresponding first protocol, the equipment identification carried by the first service request comprises an IP address of the service request equipment, the request parameters comprise specific request content of the first service request, the first protocol type identification is a protocol type determined according to the formats of each identification and parameters in the first service request, if the first service request is a request in an http format, the identification and the parameters comprise formats of English, numbers, Chinese characters and the like, if the first service request is a request in an sip format, the identifier and the parameter may include a format of a 16-system numerical value, and according to different formats, it may be determined which of an http protocol, an sip protocol, and a tcp/udp protocol the first protocol corresponding to the first service request belongs to.
S202: and generating an operation code corresponding to the request parameter according to the request parameter and a preset parameter comparison table.
For the same service request device, when the operation that the same service request device wants to request is different, the format of the corresponding request parameter is the same, but the represented request content is different, and for different service request devices, when the operation that the same service request device wants to request is the same, the format of the corresponding request parameter is different, but the represented request content is the same. Therefore, according to the preset parameter comparison table, whether the request contents are the same or not is distinguished, the operation codes corresponding to the request parameters are generated, and the same operation codes are generated for the request parameters corresponding to the same type of request contents. For example, when both the media server and the signaling server send service requests for user query to the service center server, the media server is a first service request in tcp/udp format sent based on a tcp/udp protocol, where the carried request parameters are also parameters in tcp/udp format, and the signaling server is a first service request in sip format sent based on a sip protocol, where the carried request parameters are also parameters in sip format, although formats of the two request parameters are different, specific contents of the requests are both user queries, so in a preset parameter comparison table, request operation codes generated for the two first service requests are the same.
The operation code may be a number, a random number generated according to a preset rule, or other mapping values that may form a one-to-one correspondence with the request parameter.
For a certain request parameter, when the contents of the requests are different, the information of the request parameter is also different, where the information refers to some character strings indicating an ID, an IP address, a port address, and the like, for example, when the first service request is used to request for querying a device, the request parameter may include some information related to the device, such as a device ID, and when the request parameter is used to request for other types of operations, the request parameter may also include some other information, that is, the information of the request parameter is different for different requests, so that a unique operation code may be generated for the request parameter corresponding to all executable requests in a preset parameter comparison table, and after the first service request is received, the operation code corresponding to the request parameter is determined from the preset parameter comparison table according to the information of the request parameter carried by the first service request.
For the first service requests sent based on different protocols, when the request contents of the request parameters are different, different operation codes are generated for the first service requests, and when the request contents of the request parameters are the same, the same operation codes are generated for the first service requests.
S203: and determining an operation command of the first service request according to the operation code, determining a target service server corresponding to the first service request and a second protocol used by the target service server according to the operation command, and generating a second service request corresponding to the first service request, wherein the second service request carries a second protocol type identifier.
After generating the operation code for the first service request, the operation command of the first service request may be determined according to the operation code. Taking the operation code as the number as an example, n executable requests in the system are in a preset parameter comparison table, after a first service request is received, the request parameters are analyzed, the request is determined to be the m-th request according to the information of the request parameters, the generated operation code is m, and the operation command of the first service request is determined to be the request acquisition directory according to the operation code m.
Each server in the system has corresponding work tasks and functions, and for specific operation, the operation can be completed only by the corresponding server, but cannot be replaced by other servers. Therefore, after the operation command of the first service request is determined, according to the specific content of the operation command, it can be determined to which service server the first service request needs to be sent, that is, which service server the first service request is sent to complete the corresponding service request. When the operation command is a request for acquiring the catalog, the operation belongs to the working range of the service center server, the service center server is determined as a target service server, and when the operation command is a request for playing the video, the operation can be completed only by the media server obviously, so the media server is taken as the target service server.
Each service server has the supported protocol type, and after the target service server is determined, the protocol type of the request that can be identified by the target service server, that is, the second protocol, may be determined. It should be noted that the type of the first protocol and the type of the second protocol may be the same or different. When a media server in the video monitoring system wants to send a request to a signaling server or a service center server, the type of the first protocol is a tcp/udp protocol, and the type of the second protocol is an sip protocol or an http protocol, and when a server outside the video monitoring system sends a service request in an http format, an internal unified operation code can be generated first and then sent to the service center server supporting the http format in the video monitoring system, that is, the request sending under the same protocol and different protocols can be realized simultaneously through the conversion of the operation code.
After a second protocol of the target service server is determined, a second service request corresponding to the first service request is generated, the second service request carries a second protocol type identifier, and the request content of the second service request is the same as that of the first service request, except that the formats of the second service request and the first service request are generated based on the first protocol and the second protocol respectively. Similarly, the second protocol type identifier is also a protocol type determined according to the format of each identifier and parameter in the second service request, if the second service request is a http format request, the identifier and parameter may include english, numbers, chinese characters, and other formats, if the second service request is a sip format request, the identifier and parameter may include a 16-system numerical format, and according to the different formats, it may be determined which of the http protocol, the sip protocol, and the tcp/udp protocol the first protocol corresponding to the second service request belongs to.
S204: and according to the operation code, determining a server identifier of the target service server, an interface identifier corresponding to the operation command and a target 5G base station corresponding to the target service server, determining long connection with the target 5G base station, sending a second service request to the target 5G base station through the long connection so as to control the target 5G base station to send the second service request to a corresponding interface of the target service server through a private line based on a second protocol according to the server identifier, the interface identifier and a second protocol type identifier, and receiving a request processing result returned by the target service server based on the second protocol.
After the second service request is generated, the second service request needs to be sent to the corresponding target service server, and in the last step, the corresponding operation command is determined only according to the operation code, and then the target service server executing the operation and the second protocol thereof are determined, and then the second service request in the corresponding format is generated, but the address to which the second service request should be sent is not determined, at this time, according to the mapping relation between the operation code and the service server, parameters of the target service server, such as a server identifier and an interface identifier corresponding to the operation command, are determined, wherein the server identifier is an IP address of the target service server, and the interface identifier is an ID of the interface.
The control server stores a server parameter table, the server parameter table comprises the IP address of each service server, the protocol type of each service server and the interface identifier of each interface in each service server, the corresponding target service server can be determined according to the operation codes, and then the information such as the server identifier, the interface identifier, the protocol type and the like can be obtained from the server parameter table.
For each service server, there are multiple interfaces, each for performing different operation tasks. Because each interface correspondingly executes the same type of operation command, and the operation command corresponds to the operation code, after the operation code is generated, the interface identifier corresponding to the operation command can be determined according to the operation code, so that which interface of the target service server the second service request should be sent to is determined.
In the application, the request parameter of the first service request is firstly converted into an internally recognizable operation code, then a corresponding second service request is generated according to the operation code, and after the second service request is generated, the access address and the interface information of the target service server are obtained according to the operation code, so that the service request equipment sending the request cannot directly know the parameter information of the target service server, and the safety problem caused by direct access among the servers is solved.
The server parameter table includes information such as server identification, interface identification, and protocol type, and information of the 5G base station connected to each server. Because the transmission speed under the 5G protocol is high, a 5G base station is also arranged between the control server and the service server, and the control server firstly sends the second service request to the 5G base station and then sends the second service request to the service server through the 5G base station, so that the service access efficiency can be improved.
In a 5G scene, all service servers in a certain area are correspondingly connected with one 5G base station, service servers in different areas are correspondingly connected with different 5G base stations, connection relations are formed between the 5G base stations and the service servers, and the connection relations are stored in a server parameter table, so that a target 5G base station corresponding to a target service server can be determined according to an operation code, and long connection with the target 5G base station is further determined. After determining the long connection, the control server sends a second service request to the target 5G base station through the long connection. The long connection between the control server and the target 5G base station is transmitted based on a 5G protocol, and the second service request is a request under a second protocol, so that during transmission, the second service request is encapsulated into a first encapsulated packet, then the first encapsulated packet is sent to the target 5G base station through the long connection, and then the target 5G base station unpacks the first encapsulated packet into a second service request.
The target 5G base station is connected with the service servers by adopting a second protocol, and each service server is connected by adopting a dedicated line so as to ensure the safety of data, so that after the target 5G base station receives the second service request, the control server controls the target 5G base station to send the second service request to the target service server through the dedicated line based on the second protocol, and after the target service server processes the second service request, the request processing result is returned through the dedicated line.
S205: and receiving a request processing result returned by the target 5G base station through the long connection, and generating a service response corresponding to the request processing result based on the first protocol type identifier.
And after receiving the second service request, the target service server processes the request and returns a request processing result, wherein the request processing result comprises a state identifier, when the request is successfully processed, the identifier content of the state identifier in the returned request processing result is that the request is completed, and if the request is not successfully processed by the target service server within a preset time, the identifier content of the state identifier in the returned request processing result is that the request is overtime. After the request is successfully processed, the request processing result is also accompanied by other information such as the return time of the request processing. The request processing result sent by the target service server is sent out based on the second protocol.
The request processing result returned by the target service server is received by the target 5G base station, and then the target 5G base station returns the request processing result to the control server through the long connection with the control server. Similarly, during transmission, the target 5G base station encapsulates the request processing result into a second encapsulation packet, and then sends the second encapsulation packet to the control server through long connection, and the control server unpacks the second encapsulation packet into the request processing result.
After the control server receives a request processing result of the target service server returned by the target 5G base station, a corresponding service response is generated, the format of the service response is determined according to the first protocol type identifier, so that the protocol supported by the service response is the same as the protocol type supported by the service request equipment, and the service response can be identified by the service request equipment.
S206: and returning a service response to the service request equipment based on the first protocol according to the equipment identifier and the first protocol type identifier.
After a service response is generated, an access address of the service request equipment is determined according to the equipment identifier, the communication mode of the service request equipment is determined according to the first protocol type identifier, the service response is returned to the service request equipment based on the first protocol, the service request equipment determines whether the request is successful or not based on the specific content of the service response, the next operation is carried out when the request is successful, and when the request is failed, the details of the request are recorded, so that a technician can conveniently trace the reason of the failure.
As can be seen from the above method, in the service control method provided in this embodiment of the present application, after receiving a first service request sent by a service request device, no matter which one of an http protocol, an sip protocol, and a tcp/udp protocol is based on the first service request, an internal unified operation code is generated according to a request parameter carried by the first service request, and then according to an operation command corresponding to the operation code, a protocol of a service server executing the operation command is determined and a second service request corresponding to the protocol is generated, so that service request controls under different protocols can be centrally managed and then uniformly distributed, thereby alleviating management and maintenance difficulties caused by differences in communication protocols when a direct request is made between the service request device and the service server; meanwhile, after the second service request is generated, the service identifier of the target service server is searched according to the operation code, so that the service request equipment cannot know the access address of the target service server, and the safety problem caused by direct access between the service request equipment and the service server is solved. In addition, the information transmission is carried out through the 5G base station, the speed is high, and the service access efficiency is improved.
As shown in fig. 3, for the logic block diagram of the service control method provided in this embodiment, the overall architecture of the service control method is divided into six parts, namely, a service request 21, an access module 22, a proxy module 23, a system sub-service 24, a response module 25, and a 5G base station 26, where the service request 21 includes a service request device that issues a first service request based on a first protocol, the access module 22 receives the first service request, generates an internal unified operation code for a request parameter corresponding to the first service request, determines an operation command of the first service request according to the operation code, further determines a target service server and a second protocol supported by the target service server, and generates a second service request corresponding to the first service request, the proxy module 23 receives the second service request generated by the access module 22, finds an access address and interface information of the target service server according to a mapping relationship between the operation code and the service server, and a second service request is sent to a corresponding interface of a target service server in the system sub-service 24 through the 5G base station 26, the system sub-service 24 is a set formed by all servers in the system, a request processing result returned after the target service server processes the second service request is returned to the 5G base station 26, the 5G base station 26 sends the request processing result to the proxy module 23, the proxy module 23 sends the request processing result to the response module 25, the response module 25 generates a service response supporting the first protocol for the request processing result, and the service response is returned to the service request device in the service request 21 based on the first protocol.
As shown in fig. 4, 5 and 6, the service request 21 includes a service request device sending out a first service request based on a first protocol, where the first service request may be one of an http request 211, an sip request 212 and a tcp/udp request 213, the access module 22 includes an access controller 221, a request analyzer 222, a service list querier 223 and a request generator 224, the proxy module 23 includes a service manager 231, an http request agent 232, an sip request agent 233, a tcp/udp request agent 234 and a timing detector 235, the system sub-service 24 includes sub-services 1 to sub-services n, and the response module 25 includes a response manager 251, an http response logic 252, an sip response logic 253 and a tcp/udp response logic 254. The service control method of the present application is specifically described below with reference to fig. 3 to 6.
In the service request 21, a service request device sends out a first service request based on a first protocol, and the service request device may be a server or a terminal inside the video surveillance system or may be a server or a terminal outside the video surveillance system. According to different protocols supported by the service request device, the first service request may be one of an http request 211, an sip request 212, and a tcp/udp request 213, and the first service request carries the terminal identifier, the first protocol type identifier, and the request parameter, and is then received by the access module 22.
In the access module 22, a first service request is received, an internal unified operation code is generated for a request parameter corresponding to the first service request, then an operation command of the first service request is determined according to the operation code, a target service server and a second protocol supported by the target service server are further determined, and a second service request corresponding to the first service request is generated.
In an embodiment, before the step of generating the internal unified operation code for the request parameter corresponding to the first service request, the method further includes: performing logic judgment on the first service request based on the request effective parameter set; and if the first service request is legal, sending the first service request to a request analyzer, and if the first service request is illegal, directly returning a termination request result to the service request equipment. When a service request device sends a first service request, because the first service request carries a terminal identifier, a first protocol type identifier, a request parameter, and the like, if input of each identifier or parameter is incorrect, subsequent processing logic will be affected, when the first service request enters the access module 22, the access controller 221 first enters the access controller 221, the access controller 221 parses the first service request, and makes a logic judgment on the first service request based on a request effective parameter set, the request effective parameter set includes types of effective parameters, specific parameter values, an arrangement sequence of each parameter, and the like, if the request effective parameter set is legal, the next step is entered, the first service request is sent to the request analyzer 222, if the request effective parameter set is illegal, a termination request result is directly returned to the service request device, and specific error types can be further displayed, if the input is invalid parameters or lacks necessary parameters or identifiers, and the like, so that the service request equipment can conveniently adjust the first service request and then send the request again.
The first service request judged to be logically legitimate in the access controller 221 enters the request analyzer 222, and the request analyzer 222 generates an operation code corresponding to the request parameter. The operation code may be a number, or a random number generated according to a preset rule, or another mapping value that may form a one-to-one correspondence with the request parameter, and when the operation code is generated, the operation code may be generated according to a comparison relationship between the request parameter and the operation code in a preset parameter comparison table, and for a first service request with the same request content, no matter what protocol the service request device initiating the request issues, the same operation code is generated after entering the request analyzer 222, that is, the operation code is only related to the specific request content of the request parameter, and is not related to the format of the request parameter. The method includes the steps that unique operation codes can be generated for request parameters corresponding to all executable requests in a preset parameter comparison table, and after a first service request is received, the operation codes corresponding to the request parameters are determined from the preset parameter comparison table according to specific content of the request parameters carried by the first service request.
Through the operation, the first service request sent by the service request equipment can be converted into a uniform operation code no matter what protocol is based on, namely the operation code is only related to the request content of the request parameter and is not related to the protocol of the first service request, so that the centralized management of the multi-protocol request is realized.
After the operation code is generated, the operation command of the first service request is determined according to the operation code, and specifically, the operation command corresponding to the first service request may be determined from an operation command list stored locally according to the operation code. For first service requests sent based on different protocols, if the specific request contents of the request parameters are the same, the same operation code is generated, and the same request contents correspond to the same operation command, so that a mapping relationship can be established for the operation code and the operation command, for each operation code, the corresponding operation command exists, and after analyzing the generated operation code, the operation command corresponding to the first service request, that is, what operation the service request device wants the service server to execute can be determined.
In one embodiment, after the step of generating the operation code corresponding to the request parameter, the method further includes: according to the login parameters and the operation codes carried by the first service request, authority judgment is carried out on the first service request; if the first service request has the access authority, generating an authority identification for the first service request, and if the first service request does not have the access authority, generating a no-authority identification for the first service request. Each server in the system comprises a plurality of subordinate services, each subordinate service can log in only when a certain authority is required, when a user needs to use the function of a certain server, the user needs to log in the server based on login parameters, then the server determines which access authorities the user has according to the login parameters, and the login parameters can be a login account and a password authorized by the user or an authorization code generated according to the login account and the password after authorization. For different login accounts and passwords, the authorization range of the server is different, for example, a certain server comprises S subordinate services, the server authorizes all the subordinate services of the server after the account A logs in, the server authorizes part of the subordinate services after the account A logs in, the account B only can access part of the subordinate services authorized for the account by the server after the account B logs in, and the account B of the other part of the subordinate services has no right to access and call. Similarly, for different servers in the system, the login parameters of the user can be set differently to control the authority of the server or the subordinate service of the server which can be accessed by the user.
When the service request device sends a first service request, the service request device carries login parameters, and after the request analyzer 222 analyzes the login parameters, the current authority of the login parameters is determined, and then the authority is compared with the operation code to determine whether the first service request has the authority to access the corresponding target service server.
Assuming that the first service request has the right to access the service center server but not the right to access the signaling server, for the first service request, it means that it can request all the subordinate services of the service center server, and each subordinate service can execute its corresponding operation command. For each server, there is a specific subordinate service, and the subordinate services of the servers generally do not intersect, for example, the subordinate services of the media server include forwarding service, video playing service, etc., the subordinate services of the service center server include user query service, organization query service, etc., and the user query service and the organization query service do not belong to the media server. Therefore, after determining that the first service request has the authority to access the service center server, it may be determined which operation commands the first service request may request the subordinate service in the service center server to execute, and further it may be clear within which range the operation code generated by the request parameter of the first service request must be to access the service center server, and then the operation code actually generated by the request analyzer 222 according to the request parameter of the first service request is compared with the above range, if the actual operation code falls within the range, it is indicated that the first service request has the authority to access the service center server, and if the actual operation code is not within the range, it is indicated that the first service request does not have the authority to access the service center server.
In this scenario, a media server is used as a service request device, if a first service request is sent as a request to query user information, and after being analyzed by the request analyzer 222, an actual operation code of the first service request falls within an operation code range corresponding to a service center server, it is determined that the first service request has an authority, and the request analyzer 222 generates an authority identifier for the first service request. On the contrary, if the sent first service request is a request for sending a signaling, after being analyzed by the request analyzer 222, it is found that the actual operation code of the first service request does not fall within the operation code range corresponding to the service center server, it is determined that the first service request is not authorized, and the request analyzer 222 generates an unauthorized identifier for the first service request.
After the request analyzer 222 completes generation of the operation code, determination of the operation command, and determination of the authority, for the first service request carrying the no-authority identifier, the request analyzer 222 sends the first service request to the request generator 224, and the request generator 224 submits the request to the proxy module 23, and for the first service request carrying the authority identifier, the request analyzer 222 sends the first service request together with the analyzed result to the service list querier 223, and the service list querier 223 queries, according to the operation command corresponding to the operation code, which server the service server capable of executing the operation command is, determines the server as the target service server, and further queries to obtain which one of the http protocol, sip protocol, and tcp/udp protocol is supported by the service server, and then, the analyzed result, the sip protocol, and the tcp/udp protocol supported by the request analyzer 222 are obtained, The query result of the service inventory querier 223 and the first service request package are sent to the request generator 224.
In the request generator 224, a second service request corresponding to the first service request is generated, where the second service request carries the second protocol type identifier, and then the second service request is sent to the agent module 23. The first service request issued based on the first protocol is converted into a second service request based on the second protocol recognizable by the target service server through the conversion of the request generator 224. Through a series of processing of the access module 22, no matter which one of the http protocol, the sip protocol and the tcp/udp protocol is based on the first service request, an internal unified operation code is generated according to a request parameter carried by the first service request, and then according to an operation command corresponding to the operation code, a protocol of a service server executing the operation command is determined and a second service request corresponding to the protocol is generated, so that service request control under different protocols can be managed in a centralized manner and distributed in a unified manner, management and maintenance difficulties caused by differences of communication protocols when direct requests are made between service request equipment and the service server are relieved, and service access among the servers is more efficient.
After the second service request is sent to the agent module 23, the second service request first enters the service manager 231, and in the service manager 231, the server identifier of the target service server and the interface identifier corresponding to the operation command are determined according to the operation code, and specifically, the server identifier and the interface identifier may be obtained from a server parameter table stored locally. In the service manager 231, a mapping relationship between the operation codes and the service servers is stored, and since each service server has a specific interface, and each interface can only execute the corresponding operation command, the plurality of corresponding operation codes of the specific service server are also fixed. For example, the interface identifiers of all service servers in the system are sorted, taking that each service server includes 30 interfaces as an example, interface nos. 1 to 30 belongs to the media server, interface nos. 31 to 60 belongs to the signaling server, interface nos. 61 to 90 belongs to the service center server, each interface is used for executing a corresponding operation command, and the operation command is determined according to the generated operation code, so that the operation code corresponds to the interface identifier, according to which section among 1 to 30, 31 to 60, and 61 to 90 the operation code carried by the second service request entering the proxy module 23 falls, it can be determined which service server the request object of the second service request is, and it is taken as the target service server, and it is determined which interface of the target service server handles the corresponding second service request. Then, the information such as the IP address, communication protocol, and interface ID of the corresponding target service server is obtained in the server parameter table stored locally.
In the present application, the proxy module 23 stores various pieces of parameter information of the service server, and the access module 22 stores operation command information corresponding to an operation code, but does not store an address of an interface corresponding to the operation command. For the same server, the addresses of all the interfaces are the addresses of the server, when the addresses of the server are changed, the addresses of all the interfaces are also changed, if the corresponding interface addresses are directly searched according to the operation codes, the addresses of all the interfaces need to be stored, and once the addresses of the server are changed, the addresses of all the interfaces need to be updated, and when the number of the interfaces is large, the updating workload is huge. According to the method, only the IP address of the server is stored, the interval where the operation code is located is judged according to the mapping relation between the operation code and the service server, and then the service server to which the first service request is specifically sent is determined, and then the access address of the corresponding target service server is obtained.
The proxy module 23 stores information such as a server identifier, an interface identifier, and a protocol type, and also stores information of the 5G base station 26 connected to each server. Because the transmission speed under the 5G protocol is high, a 5G base station 26 is further arranged between the control server and each service server in the system sub-service 24, and the control server firstly sends the second service request to the 5G base station and then sends the second service request to the target service server through the 5G base station, so that the service access efficiency can be improved.
In a 5G scenario, all service servers in a certain area are correspondingly connected with one 5G base station 26, the 5G base station 26 and the service servers form connection relationships, and the connection relationships are stored in the proxy module 23, so that a target 5G base station corresponding to a target service server can be determined according to an operation code, long connections have been established between all 5G base stations 26 and a control server, and after the target 5G base station is determined, the long connections between the control server and the target 5G base station can be found and obtained from the proxy module 23.
After determining the long connection, the agent module 23 sends a second service request to the target 5G base station through the long connection. The proxy module 23 is provided with an http request proxy 232, an sip request proxy 233 and a tcp/udp request proxy 234, determines a target request proxy from the three according to a second protocol type of the second service request, and sends the second service request to the target 5G base station by the target request proxy, if the second service request is based on the http protocol, the http request proxy 232 is used for sending, if the second service request is based on the sip protocol, the sip request proxy 233 is used for sending, and if the second service request is based on the tcp/udp protocol, the tcp/udp request proxy 234 is used for sending. Because the long connection between the control server and the target 5G base station is transmitted based on the 5G protocol, and the second service request is a request under the second protocol, during transmission, the second service request is encapsulated into a first encapsulated packet, then the first encapsulated packet is sent to the target 5G base station through the long connection, and then the target 5G base station unpacks the first encapsulated packet into the second service request.
The target 5G base station is connected with the service servers by adopting a second protocol, and each service server is connected by adopting a dedicated line so as to ensure the safety of data, so that after the target 5G base station receives the second service request, the control server controls the target 5G base station to send the second service request to the target service server through the dedicated line based on the second protocol, and after the target service server processes the second service request, the request processing result is returned through the dedicated line.
In one embodiment, the step of sending the second service request to the target 5G base station through the long connection to control the target 5G base station to send the second service request to the corresponding interface of the target service server includes: acquiring a connection period between a target 5G base station and the target service server; and in the connection period, sending a second service request to the target 5G base station through the long connection so as to control the target 5G base station to send the second service request to the target service server through the private line based on a second protocol in the connection period. The target 5G base station forms a connection relationship with all service servers within a connection range thereof, for each service server, the target 5G base station has a connection channel corresponding to the service server, but the connection channels between the target 5G base station and the service servers are not communicated at all times, but the connection channels between the target 5G base station and the service servers are sequentially opened and closed according to a certain sequence, so that for each service server, there is a corresponding connection period, and only the service server and the target 5G base station can realize communication in the connection period, therefore, the connection period between the target 5G base station and the target service server needs to be obtained first, and then the target 5G base station is controlled to send a second service request to the target service server in the connection period.
In one embodiment, before the step of sending the second service request to the target 5G base station through the long connection, the method further includes: the second service request is put into the timing detector 235, and a status identifier is generated for the second service request, where the identifier content of the status identifier includes a request completion status and a request timeout status. After the second service request is sent out, the target service server usually returns the request processing result in a short time, but if the second service request is not processed for some reason, the second service request occupies the memory of the control server, which causes resource waste, and the request sender cannot respond late, which causes poor user experience. Therefore, the identification content of the status identification comprises the starting time and the expiration time of the second service request, the starting time is used for marking the sending sequence of the second service request, the control server sequentially processes the second service requests according to the starting time sequence of the second service requests, the expiration time can be the time obtained by adding a preset time value to the starting time, when the second service request does not reach the expiration time, if the request processing result is received, the second service request completion state in the identification content can display that the second service request is completed, and if the second service request has reached the expiration time and no request processing result is returned, the second service request timeout state in the identification content can display that the second service request is overtime. By setting the timing detector 235 in the agent module 23, both the overtime state and the completion state of the second service request can be notified to the request sender in time, so that the waste of processing resources can be avoided, the user experience is improved, meanwhile, the related condition of the overtime request can be recorded in time, the overtime condition is analyzed, the reason is searched, the BUG positioning and the program debugging are convenient for developers to perform BUG positioning and program debugging, and the system is maintained and upgraded subsequently.
For the first service request carrying the unauthorized identifier in the access module 22, after being sent to the proxy module 23, subsequent sending processing is not performed, but the proxy module 23 forwards the first service request to the response module 25, and the response module 25 returns a request result according to the protocol type and address of the original request. The authorized second service request is sent to the target service server through the 5G base station 26 for processing.
The system sub-service 24 includes a plurality of service servers, i.e. sub-services, which are represented by sub-services 1 to n in fig. 4 to 6, where sub-service 1 may be a media server, sub-service 2 may be a signaling server, sub-service 3 may be a service center server, and sub-service n is another server in the system. And after the target service server processes the second service request, the returned request processing result is received by the target 5G base station, and then the target 5G base station returns the request processing result to the control server through the long connection with the control server. Similarly, during transmission, the target 5G base station encapsulates the request processing result into a second encapsulation packet, and then sends the second encapsulation packet to the control server through long connection, and the control server unpacks the second encapsulation packet into the request processing result. Then, the agent module 23 encapsulates the request processing result together with the status flag and transmits the encapsulated request processing result to the response module 25.
The response manager 251 in the response module 25 receives the above-mentioned various information, then determines which of the http protocol, sip protocol and tcp/udp protocol the original protocol supported by the service request device supports according to the first protocol type identifier, and then generates a service response of the corresponding protocol, so as to ensure that the format of the service response can be identified by the service request device. Then, according to the device identifier and the first protocol type identifier, returning a service response to the service request device based on the first protocol, specifically, determining a target response logic from the http response logic 252, the sip response logic 253, and the tcp/udp response logic 254; the reuse target response logic sends a service response to the service request device based on the first protocol. If the service request device is based on http protocol transmission information, the http response logic 252 is used for sending, if the service request device is based on sip protocol transmission information, the sip response logic 253 is used for sending, and if the service request device is based on tcp/udp protocol transmission information, the tcp/udp response logic 254 is used for sending.
In addition, if the service response is not successfully sent or the first service request fails due to no permission, the response module 25 records details of the request, so that a technician can trace the reason of the failure.
As can be seen from the above embodiments, in the service control method of the present application, after receiving a first service request sent by a service request device, no matter which one of an http protocol, an sip protocol, and a tcp/udp protocol is based on the first service request, an internal unified operation code is generated according to a request parameter carried by the first service request, and then according to an operation command corresponding to the operation code, a protocol of a service server executing the operation command is determined and a second service request corresponding to the protocol is generated, so that service request controls under different protocols can be managed and distributed in a centralized manner, thereby alleviating management and maintenance difficulties caused by differences of communication protocols when a direct request is made between the service request device and the service server, and making service access between servers more efficient; meanwhile, after the second service request is generated, the service identifier of the target service server is searched according to the operation code, so that the service request equipment cannot know the access address of the target service server, and the safety problem caused by direct access between the service request equipment and the service server is solved. In addition, the information transmission is carried out through the 5G base station, the speed is high, and the service access efficiency is improved.
Fig. 7 is a schematic diagram illustrating a comparison of access manners between servers in the prior art and the present application, where a in fig. 7 is an access manner between servers in the prior art, b in fig. 7 is an access manner between servers in the present application, and fig. 7 exemplifies that a server in a system includes sub-services 1 to 5, and each sub-service represents a server.
In the prior art, access among servers forms a mesh structure, and because each server is usually realized based on different protocols, languages and frameworks, the protocol differences of a request initiator and a request receiver during actual mutual access can cause a complex access process and low access efficiency, and mesh access is usually dragged to move the whole body during system development or expansion, which is not favorable for the high efficiency and maintainability of the system. In addition, because the servers operate independently, after a user logs in one of the servers, the user can only obtain the authorization of the server, and if the user wants to access another server, the user needs to obtain the authorization of the other server again, which causes mutual repeated authorization among the servers, and is not favorable for the efficiency and the maintainability of the system.
In the method, the control server is adopted to control the services under multiple protocols, the control server adopts a control gateway form to unify the first service requests sent based on different protocols, generate internal unified operation codes and distribute the requests in a unified manner, so that the management and maintenance difficulties caused by the differences of network protocols, languages and frames when the requests are directly requested among different servers are shielded. In addition, after the first service request is subjected to authority verification, the authorized request can be directly sent to the server receiving the request without requesting authorization of the server again, and the process of request sending and receiving is greatly simplified.
In addition, in the application, the request initiator and the request receiver are not directly linked, but the request is uniformly managed and distributed in a control gateway mode, the control gateway is accessed by adopting a network protocol, is non-invasive access and can independently run without embedding a server for receiving the request, so that system maintenance is facilitated, in this case, the request initiator cannot know the real address of the request receiver, and the safety problem caused by direct access among services is prevented. Meanwhile, when the request sending condition of each server is required to be known, the real-time or historical request state of the whole system can be known only by recording at an entrance of the control gateway, and a recording point is not required to be arranged in each server, so that the operation path is convenient to trace, and the safety and the convenience are improved.
On the basis of the method in the foregoing embodiment, the present embodiment will be further described from the perspective of a service control device, please refer to fig. 8, where fig. 8 specifically describes the service control device provided in the embodiment of the present application, which may include:
a receiving module 110, configured to receive a first service request sent by a service request device based on a first protocol, where the first service request carries a device identifier, a first protocol type identifier, and a request parameter;
the code generating module 120 is configured to generate an operation code corresponding to the request parameter according to the request parameter and a preset parameter comparison table;
the request generating module 130 is configured to determine an operation command of the first service request according to the operation code, determine a target service server corresponding to the first service request and a second protocol used by the target service server according to the operation command, and generate a second service request corresponding to the first service request, where the second service request carries a second protocol type identifier;
the determining module 140 is configured to determine, according to the operation code, a server identifier of the target service server, an interface identifier corresponding to the operation command, and a target 5G base station corresponding to the target service server, determine a long connection with the target 5G base station, send a second service request to the target 5G base station through the long connection, so as to control the target 5G base station to send the second service request to a corresponding interface of the target service server through a dedicated line based on the second protocol according to the server identifier, the interface identifier, and the second protocol type identifier, and receive a request processing result returned by the target service server based on the second protocol;
a response generation module 150, configured to receive a request processing result returned by the target 5G base station through the long connection, and generate a service response corresponding to the request processing result based on the first protocol type identifier;
and a returning module 160, configured to return a service response to the service request device based on the first protocol according to the device identifier and the first protocol type identifier.
In an embodiment, the service control apparatus further includes a logic determination module, configured to perform logic determination on the first service request based on the request valid parameter set; and if the first service request is legal, sending the first service request to a request analyzer, and if the first service request is illegal, directly returning a termination request result to the service request equipment.
In one embodiment, the service control device further includes an authority judgment module, configured to perform authority judgment on the first service request according to the login parameter and the operation code carried by the first service request; if the first service request has the access authority, generating an authority identification for the first service request, and if the first service request does not have the access authority, generating a no-authority identification for the first service request.
In an embodiment, the request generating module 130 is configured to determine, according to the operation code, an operation command corresponding to the first service request from a locally stored operation command list.
In one embodiment, the determining module 140 is configured to obtain, according to the operation code, the server identifier of the target service server and the interface identifier corresponding to the operation command from a locally stored server parameter table.
In an embodiment, the service control apparatus further includes a state identifier generating module, configured to place the second service request in the timing detector, and generate a state identifier for the second service request, where identifier content of the state identifier includes a request completion state and a request timeout state.
In an embodiment, the service control apparatus further includes an updating module, configured to update the identifier content of the status identifier to be that the request is completed or the request is overtime according to the request processing result.
In one embodiment, the return module 160 includes:
the determining unit is used for determining target response logic from http response logic, sip response logic and tcp/udp response logic according to the equipment identifier and the first protocol type identifier;
and the sending unit is used for sending the service response to the service request equipment based on the first protocol by using the target response logic.
In one embodiment, the determining module 140 includes:
the acquisition unit is used for acquiring the connection period of the target 5G base station and the target service server;
and the control unit is used for sending a second service request to the target 5G base station through the long connection in the connection period so as to control the target 5G base station to send the second service request to the target service server through the private line based on a second protocol in the connection period.
Different from the prior art, the service control device provided by the application generates an internal unified operation code according to a request parameter carried by a first service request no matter which one of an http protocol, an sip protocol and a tcp/udp protocol is based on the first service request after receiving the first service request sent by a service request device, and then determines a protocol of a service server executing the operation command according to an operation command corresponding to the operation code and generates a second service request corresponding to the protocol, so that service request control under different protocols can be managed and distributed in a centralized manner, and management and maintenance difficulties caused by differences of communication protocols when a direct request is made between the service request device and the service server are relieved; meanwhile, after the second service request is generated, the service identifier of the target service server is searched according to the operation code, so that the service request equipment cannot know the access address of the target service server, and the safety problem caused by direct access between the service request equipment and the service server is solved. In addition, the information transmission is carried out through the 5G base station, the speed is high, and the service access 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 the user and various graphical user interfaces of the server, 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 a first service request sent by a service request device based on a first protocol, wherein the first service request carries a device identifier, a first protocol type identifier and a request parameter; generating an operation code corresponding to the request parameter according to the request parameter and a preset parameter comparison table; determining an operation command of the first service request according to the operation code, determining a target service server corresponding to the first service request and a second protocol used by the target service server according to the operation command, and generating a second service request corresponding to the first service request, wherein the second service request carries a second protocol type identifier; according to the operation code, determining a server identifier of a target service server, an interface identifier corresponding to an operation command and a target 5G base station corresponding to the target service server, determining long connection with the target 5G base station, sending a second service request to the target 5G base station through the long connection, so as to control the target 5G base station to send the second service request to a corresponding interface of the target service server through a private line based on a second protocol according to the server identifier, the interface identifier and a second protocol type identifier, and receiving a request processing result returned by the target service server based on the second protocol; receiving a request processing result returned by the target 5G base station through long connection, and generating a service response corresponding to the request processing result based on the first protocol type identifier; and returning a service response to the service request equipment based on the first protocol according to the equipment identifier and the first protocol type 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.
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 service control method and the service control device provided by the embodiment of the present application are introduced in detail, and a specific example is applied in the description to explain the principle and the implementation of the present application, and the description of the embodiment is only used to help understand the technical scheme and the core idea of the present 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 service control method is applicable to an intelligent traffic system, the intelligent traffic system comprises at least two service request devices supporting different communication protocols, a control server, a 5G base station and at least two service servers supporting different communication protocols, the communication protocols comprise one of an http protocol, a sip protocol and a tcp/udp protocol, the service control method is applied to the control server, and the service control method comprises the following steps:
receiving a first service request sent by the service request equipment based on a first protocol, wherein the first service request carries an equipment identifier, a first protocol type identifier and a request parameter;
generating an operation code corresponding to the request parameter according to the request parameter and a preset parameter comparison table;
determining an operation command of the first service request according to the operation code, determining a target service server corresponding to the first service request and a second protocol used by the target service server according to the operation command, and generating a second service request corresponding to the first service request, wherein the second service request carries a second protocol type identifier;
according to the operation code, determining a server identifier of the target service server, an interface identifier corresponding to the operation command and a target 5G base station corresponding to the target service server, determining a long connection with the target 5G base station, sending the second service request to the target 5G base station through the long connection so as to control the target 5G base station to send the second service request to a corresponding interface of the target service server through a private line based on the second protocol according to the server identifier, the interface identifier and the second protocol type identifier, and receiving a request processing result returned by the target service server based on the second protocol;
receiving a request processing result returned by the target 5G base station through the long connection, and generating a service response corresponding to the request processing result based on the first protocol type identifier;
and returning the service response to the service request equipment based on the first protocol according to the equipment identifier and the first protocol type identifier.
2. The service control method according to claim 1, wherein before the step of generating the operation code corresponding to the request parameter according to the request parameter and a preset parameter comparison table, the method further comprises:
performing logic judgment on the first service request based on a request effective parameter set;
and if the first service request is legal, sending the first service request to a request analyzer, and if the first service request is illegal, directly returning a termination request result to the service request equipment.
3. The service control method according to claim 1, wherein after the step of generating the operation code corresponding to the request parameter according to the request parameter and a preset parameter comparison table, the method further comprises:
according to the login parameters and the operation codes carried by the first service request, authority judgment is carried out on the first service request;
if the first service request has the access authority, generating an authority identification for the first service request, and if the first service request does not have the access authority, generating a no-authority identification for the first service request.
4. The service control method of claim 1, wherein the step of determining the operation command of the first service request according to the operation code comprises:
and determining an operation command corresponding to the first service request from a locally stored operation command list according to the operation code.
5. The service control method of claim 1, wherein the step of determining, according to the operation code, the server identifier of the target service server, the interface identifier corresponding to the operation command, and the target 5G base station corresponding to the target service server comprises:
and acquiring the server identifier of the target service server, the interface identifier corresponding to the operation command and the target 5G base station corresponding to the target service server from a locally stored server parameter table according to the operation code.
6. The traffic control method of claim 1, wherein said step of sending said second traffic request to said target 5G base station over said long connection is preceded by the step of:
and putting the second service request into a timing detector, and generating a state identifier for the second service request, wherein the identifier content of the state identifier comprises a request completion state and a request overtime state.
7. The traffic control method according to claim 6, wherein after the step of receiving the request processing result returned by the target 5G base station through the long connection, further comprising:
and updating the identification content of the state identification to be that the request is completed or the request is overtime according to the request processing result.
8. The service control method of claim 1, wherein the step of returning the service response to the service request device based on the first protocol according to the device identifier and the first protocol type identifier comprises:
determining target response logic from http response logic, sip response logic and tcp/udp response logic according to the device identifier and the first protocol type identifier;
sending the service response to the service request device based on the first protocol using the target response logic.
9. The method for obtaining the front-end device directory of claim 1, wherein the step of sending the second service request to the target 5G base station through the long connection to control the target 5G base station to send the second service request to the corresponding interface of the target service server through a dedicated line based on the second protocol according to the server identifier, the interface identifier and the second protocol type identifier comprises:
acquiring a connection period between the target 5G base station and the target service server;
and in the connection period, sending the second service request to the target 5G base station through the long connection so as to control the target 5G base station to send the second service request to the target service server through a dedicated line based on the second protocol in the connection period.
10. A traffic control apparatus, adapted to an intelligent transportation system, the intelligent transportation system including at least two service request devices supporting different communication protocols, a control server, a 5G base station, and at least two service servers supporting different communication protocols, the communication protocols including one of http protocol, sip protocol and tcp/udp protocol, the traffic control apparatus being disposed in the control server, the traffic control apparatus comprising:
a receiving module, configured to receive a first service request sent by the service request device based on a first protocol, where the first service request carries a device identifier, a first protocol type identifier, and a request parameter;
the code generating module is used for generating an operation code corresponding to the request parameter according to the request parameter and a preset parameter comparison table;
a request generation module, configured to determine an operation command of the first service request according to the operation code, determine, according to the operation command, a target service server corresponding to the first service request and a second protocol used by the target service server, and generate a second service request corresponding to the first service request, where the second service request carries a second protocol type identifier;
a determining module, configured to determine, according to the operation code, a server identifier of the target service server, an interface identifier corresponding to the operation command, and a target 5G base station corresponding to the target service server, determine a long connection with the target 5G base station, send the second service request to the target 5G base station through the long connection, so as to control the target 5G base station to send the second service request to a corresponding interface of the target service server through a dedicated line based on the second protocol according to the server identifier, the interface identifier, and the second protocol type identifier, and receive a request processing result returned by the target service server based on the second protocol;
a response generation module, configured to receive a request processing result returned by the target 5G base station through the long connection, and generate a service response corresponding to the request processing result based on the first protocol type identifier;
and the returning module is used for returning the service response to the service request equipment based on the first protocol according to the equipment identifier and the first protocol type identifier.
CN202011107712.5A 2020-10-16 2020-10-16 Service control method and device Active CN112367297B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011107712.5A CN112367297B (en) 2020-10-16 2020-10-16 Service control method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011107712.5A CN112367297B (en) 2020-10-16 2020-10-16 Service control method and device

Publications (2)

Publication Number Publication Date
CN112367297A true CN112367297A (en) 2021-02-12
CN112367297B CN112367297B (en) 2022-10-25

Family

ID=74508099

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011107712.5A Active CN112367297B (en) 2020-10-16 2020-10-16 Service control method and device

Country Status (1)

Country Link
CN (1) CN112367297B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114095585A (en) * 2022-01-21 2022-02-25 武汉中科通达高新技术股份有限公司 Data transmission method, device, storage medium and electronic equipment

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1606311A (en) * 2003-10-09 2005-04-13 冲电气工业株式会社 System and method for providing information between cooperative different protocol environment
JP2007233803A (en) * 2006-03-02 2007-09-13 Kddi Corp Proxy connection method, proxy server, and program for connecting http-compliant terminal to sip-compliant server
US20090106768A1 (en) * 2007-10-23 2009-04-23 Sri Ramanathan System and method for accessing really simple syndication (rss) enabled content using session initiation protocol (sip) signaling
CN102932351A (en) * 2012-11-01 2013-02-13 上海文广互动电视有限公司 Protocol adaptation system for media portal sub-platform
CN103107983A (en) * 2011-11-09 2013-05-15 广达电脑股份有限公司 Data management method of network system and related system thereof
CN110620721A (en) * 2019-10-25 2019-12-27 上海中通吉网络技术有限公司 Gateway equipment, application method and service system

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1606311A (en) * 2003-10-09 2005-04-13 冲电气工业株式会社 System and method for providing information between cooperative different protocol environment
JP2007233803A (en) * 2006-03-02 2007-09-13 Kddi Corp Proxy connection method, proxy server, and program for connecting http-compliant terminal to sip-compliant server
US20090106768A1 (en) * 2007-10-23 2009-04-23 Sri Ramanathan System and method for accessing really simple syndication (rss) enabled content using session initiation protocol (sip) signaling
CN103107983A (en) * 2011-11-09 2013-05-15 广达电脑股份有限公司 Data management method of network system and related system thereof
CN102932351A (en) * 2012-11-01 2013-02-13 上海文广互动电视有限公司 Protocol adaptation system for media portal sub-platform
CN110620721A (en) * 2019-10-25 2019-12-27 上海中通吉网络技术有限公司 Gateway equipment, application method and service system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
丁才成: "《基于SIP信令IP全交换远程监控系统》", 《计算机技术及其应用》 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114095585A (en) * 2022-01-21 2022-02-25 武汉中科通达高新技术股份有限公司 Data transmission method, device, storage medium and electronic equipment
CN114095585B (en) * 2022-01-21 2022-05-20 武汉中科通达高新技术股份有限公司 Data transmission method, device, storage medium and electronic equipment

Also Published As

Publication number Publication date
CN112367297B (en) 2022-10-25

Similar Documents

Publication Publication Date Title
CN102724175B (en) The telecommunication safety management framework of ubiquitous green community net control and method
CN102811335B (en) Set up the method, apparatus and system of video session
CN110677383B (en) Firewall wall opening method and device, storage medium and computer equipment
CN111935177B (en) Service control method and device
CN111327662A (en) Communication method and management device for heterogeneous Internet of things platform
CN110855680A (en) Internet of things equipment docking method and device
CN109714367B (en) Equipment access system and method based on Internet
CN112188227A (en) Streaming media data distribution method and device
CN112134866A (en) Service access control method, device, system and computer readable storage medium
CN112367297B (en) Service control method and device
CN112367296B (en) Service control method and device
CN111182074A (en) Intelligent device terminal with edge computing capability and computer-readable storage medium
CN112242972A (en) Network request processing method, device, storage medium and terminal
CN111800521A (en) Front-end equipment control method and device
CN114679436B (en) Session management method, server and computer readable storage medium
CN112367298B (en) Service control method and device
CN113596197B (en) Address switching method and device, electronic equipment and storage medium
CN111935316B (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
TWI795619B (en) Gateway device with built-in server module and communication system thereof
CN113746909A (en) Network connection method, device, electronic equipment and computer readable storage medium
CN112187810A (en) Front-end equipment control method and device
CN112291207B (en) Method and device for acquiring front-end equipment catalog
CN112188244B (en) Front-end camera real-time video-on-demand method and device and electronic equipment
CN112291210B (en) Method and device for acquiring front-end equipment catalog

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