CN114189504B - Method and device for acquiring start-up URL, electronic equipment and storage medium - Google Patents

Method and device for acquiring start-up URL, electronic equipment and storage medium Download PDF

Info

Publication number
CN114189504B
CN114189504B CN202010859126.XA CN202010859126A CN114189504B CN 114189504 B CN114189504 B CN 114189504B CN 202010859126 A CN202010859126 A CN 202010859126A CN 114189504 B CN114189504 B CN 114189504B
Authority
CN
China
Prior art keywords
url
file
locally
parameters
streaming
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010859126.XA
Other languages
Chinese (zh)
Other versions
CN114189504A (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.)
Zhejiang Uniview Technologies Co Ltd
Original Assignee
Zhejiang Uniview Technologies 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 Zhejiang Uniview Technologies Co Ltd filed Critical Zhejiang Uniview Technologies Co Ltd
Priority to CN202010859126.XA priority Critical patent/CN114189504B/en
Publication of CN114189504A publication Critical patent/CN114189504A/en
Application granted granted Critical
Publication of CN114189504B publication Critical patent/CN114189504B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/955Retrieval from the web using information identifiers, e.g. uniform resource locators [URL]
    • G06F16/9566URL specific, e.g. using aliases, detecting broken or misspelled links
    • 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
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Databases & Information Systems (AREA)
  • Multimedia (AREA)
  • General Engineering & Computer Science (AREA)
  • Signal Processing (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Computing Systems (AREA)
  • Computer Hardware Design (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The embodiment of the application discloses a method, a device, electronic equipment and a storage medium for acquiring a start-up URL, wherein the method comprises the following steps: after receiving the information of successfully logging in the equipment, inquiring whether an adapted file exists locally; the adaptive file comprises URL formats and a start-up parameter filling mode required by the verified equipment; if so, the local URL is assembled locally at the client by using the adapted file and the identified streaming parameters, and is used as the streaming URL so as to start the media stream based on the streaming URL. In the embodiment of the application, after the client successfully logs in the device, if the adapted file exists locally, the local URL is generated locally by using the adapted file and the designated streaming parameters and is used as the streaming URL, so that the streaming URL is prevented from being acquired from the device side, the efficiency of acquiring the streaming URL is improved, and the speed of opening the media stream is improved after the media stream is opened by using the streaming URL.

Description

Method and device for acquiring start-up URL, electronic equipment and storage medium
Technical Field
The embodiment of the application relates to the technical field of video monitoring, in particular to a method and a device for acquiring a start-up URL, electronic equipment and a storage medium.
Background
With the development of IP monitoring technology, media transport protocols are widely used in NVR (Network Video Recorder ) devices, and particularly RTSP (Real Time Streaming Protocol, real-time streaming protocol) protocols, which have the characteristics of high expandability, resolution, security and real-time, have become an indispensable part of monitoring systems.
Currently, the start-up (opening of the media stream) of the RTSP protocol needs to be performed by URL (uniform resource locator), which is obtained after the client sends a URL obtaining request to the NVR device. However, this method has certain disadvantages: when the streaming is started, the URL needs to be requested to NVR equipment each time, and because the URL is limited by a network, the URL acquisition time is longer in an environment with slower network response, so that the URL acquisition efficiency is lower, and the streaming speed is further influenced.
Disclosure of Invention
The embodiment of the application provides a method, a device, electronic equipment and a storage medium for acquiring a start-up URL, so as to achieve the purpose of improving the efficiency of acquiring the start-up URL and further improving the start-up speed.
In a first aspect, an embodiment of the present application provides a method for obtaining a start-up URL, which is executed by a client, including:
After receiving the information of successfully logging in the equipment, inquiring whether an adapted file exists locally; the adaptive file comprises URL formats and a start-up parameter filling mode required by the verified equipment;
if so, entering an adapted state, locally assembling a local URL at the client by using the adapted file and the identified start-up parameters, and taking the local URL as a start-up URL so as to start up the media stream based on the start-up URL; wherein the adapted state represents the method of assembling the URL that has been obtained for verification.
In a second aspect, an embodiment of the present application provides a device for obtaining a start-up URL, configured in a client, including:
the query module is used for querying whether an adapted file exists locally or not after receiving the information of successfully logging in the equipment; the adaptive file comprises URL formats and a start-up parameter filling mode required by the verified equipment;
the URL generation module is used for locally assembling a local URL at the client by utilizing the adapted file and the identified streaming parameters if the query result is that the adapted file exists, and taking the local URL as the streaming URL so as to open the media stream based on the streaming URL; wherein the adapted state represents the method of assembling the URL that has been obtained for verification.
In a third aspect, an embodiment of the present application further provides an electronic device, including:
one or more processors;
storage means for storing one or more programs,
when the one or more programs are executed by the one or more processors, the one or more processors are caused to implement a method for obtaining a start-up URL as in any of the embodiments of the present application.
In a fourth aspect, embodiments of the present application further provide a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements a method for obtaining a start-up URL according to any embodiment of the present application.
In the embodiment of the application, after the client successfully logs in the device, if the adapted file exists locally, the local URL is generated locally by using the adapted file and the designated streaming parameters, and the local URL is used as the streaming URL, so that the streaming URL is prevented from being acquired from the device side, the efficiency of acquiring the streaming URL is improved, and the speed of opening the media stream is improved after the media stream is opened by using the streaming URL.
Drawings
FIG. 1 is a flow chart of a method for acquiring a start-up URL according to a first embodiment of the present application;
FIG. 2 is a flow chart of a method for acquiring a start-up URL according to a second embodiment of the present application;
FIG. 3 is a flow chart of a method for acquiring a start-up URL according to a third embodiment of the present application;
FIG. 4 is a logic flow diagram of a method for obtaining a start-up URL in a fourth embodiment of the present application;
fig. 5 is a schematic structural diagram of a start-up URL obtaining apparatus according to a fifth embodiment of the present application;
fig. 6 is a schematic structural view of an electronic device according to a sixth embodiment of the present application.
Detailed Description
The present application is described in further detail below with reference to the drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the application and not limiting thereof. It should be further noted that, for convenience of description, only some, but not all of the structures related to the present application are shown in the drawings.
Fig. 1 is a flowchart of a method for obtaining a start-up URL according to a first embodiment of the present application, where the present embodiment is applicable to a case of starting up a media stream based on a media transport protocol, and the method may be performed by a start-up URL obtaining apparatus, which may be implemented in a software and/or hardware manner and may be integrated in a client of an electronic device (e.g., a mobile terminal, a tablet computer, etc.).
As shown in fig. 1, the method for obtaining the start-up URL specifically includes the following steps:
S101, after receiving information of successfully logging in the equipment, inquiring whether an adapted file exists locally.
The device is optionally an encoding device which acquires, stores and manages video of each channel of camera through internet connection, for example, the device is an NVR device. The client installed in the electronic device (such as a mobile terminal, a tablet computer, etc.) can log in the device through a preset account number and a preset password, so as to view live video of any channel camera or play back monitoring video of a certain period of time on the client. In order to view live video or play back video, the client needs to acquire a start stream URL (uniform resource locator) to start a media stream, wherein the media stream includes a live stream and a play back stream, so that the efficiency of acquiring the start stream URL directly affects the speed of the client to start the media stream.
In the embodiment of the present application, in order to avoid that when a client requests a start-up URL from a device, because the network delay causes too long time for acquiring the start-up URL, the inventor creatively proposes a method for automatically generating the start-up URL locally through a locally stored adapted file, where the adapted file is based on the start-up URL acquired from the device side in advance and performs data analysis on the start-up URL, if a URL format and a parameter filling manner required by the device are obtained according to an analysis result, an adapted file is generated, otherwise, the adapted file is not generated, and the start-up URL is acquired according to the existing method. The adapted file comprises URL format and start-up parameter filling mode required by the verified device, namely the adapted file comprises a method for assembling the start-up URL, and verification is effective, so that the obtained adapted file is the method for obtaining the verified assembled URL.
In the embodiment of the present application, if a live stream is to be started, the start stream parameter includes a channel number and a stream number; if the playback stream is to be started, the stream starting parameter comprises a channel number and a stream number, and also comprises a start time and an end time; the stream number is used for representing the type of the opened live stream or the playback stream, the type of the stream comprises a main stream, an auxiliary stream, a third stream and the like, and the fact that the resolution, the mode and the like of different types of streams are different is needed to be described; the channel number is used to characterize from which channel camera the live or playback stream was turned on.
Illustratively, taking the example of opening a live stream, the open stream URL format is as follows: rtsp/(IP >: port >/unicast/< channel number >/< stream number >/live, where unicast and live are fixed fields. The filling modes of the start-up parameters comprise the modes of channel numbers and stream numbers, for example, 1 channel is represented by a numeral '0', and 2 channel is represented by 1; the primary stream is denoted by Main and the secondary stream is denoted by second.
It should be noted that, the URL formats and the start-up parameters required by different devices are different in filling modes, so that the locally pre-stored adapted files of the client side communicating with the devices are different for different devices, so that the client side can generate the start-up URL meeting the requirements of the devices according to different adapted files, thereby avoiding the compatibility problem existing when a fixed URL format is used for generating the start-up URL, for example, when the URL format is changed, format errors are caused, and finally the start-up failure is caused.
S102, if the media stream exists, entering an adapted state, locally assembling a local URL at the client by using the adapted file and the identified streaming parameters, and taking the local URL as the streaming URL so as to start the media stream based on the streaming URL.
The identified start-up parameters refer to start-up parameters specified by the user on the client. If the adapted file exists, the local URL is assembled locally at the client by utilizing the adapted file and the user-specified start-up parameters. Illustratively, for opening a live stream, the specified start-stream parameter is 1 channel (denoted by "0"), the main stream, then the generated start-stream URL: rtsp/(192.168.1.64:554/unicast/0/Main/live, where IP and port numbers are known. Further, the client opens the live stream using the local URL as a start-stream URL.
It should be noted that if the playback stream is to be started, a start time and an end time are also specified, where the start time and the end time may be represented by NTP time or UTC time. Illustratively, the start-up URL for the start-up playback stream generated locally at the client through S101-S102 is as follows: rtsp/(192.168.1.64:554/0/b 1593241643/e1593245776/replay/type1981/or/Main/; where b1593241643/e1593245776 denotes the start time/end time.
In the embodiment of the application, after the client successfully logs in the device, if the adapted file exists locally, the client enters an adapted state, wherein the adapted state represents a method for acquiring the assembly URL passing verification, the local URL is assembled locally by using the adapted file and the appointed starting parameters, the local URL is used as the starting URL, the starting URL is prevented from being acquired from the device side, the efficiency of acquiring the starting URL is improved, and the speed of starting the media stream is improved after the media stream is started by using the starting URL.
Furthermore, after the client opens the media stream based on the start-up URL, in order to ensure the accuracy of the start-up, the local URL assembled needs to be verified. Optionally, based on the identified start-up parameter, a start-up URL is obtained from the device side. In specific implementation, an ONVIF (Open Network Video Interface Forum ) protocol or an SDK mode can be utilized to combine the identified start-up parameters to obtain the start-up URL from the device side. Illustratively, a request instruction of the getURL is sent to the device based on the ONVIF protocol, where the request instruction includes a start-up parameter to be requested, and the start-up URL is determined according to feedback of the device.
Further, the start-up URL acquired from the device side is compared with the URL assembled locally through S102; if the two are identical, the method indicates that the streaming URL locally generated at the client is accurate; if the two types of files are different, for example, the URL format of the start-up URL obtained from the device side is different from the URL format of the local URL and/or the filling mode of the start-up parameter, it is determined that the adapted file stored locally in the client is inaccurate, and the media stream needs to be restarted according to the start-up URL obtained from the device side, and the adapted file is deleted. Further verification of the adaptation file is thereby achieved.
Fig. 2 is a flowchart of a method for obtaining a start-up URL according to a second embodiment of the present application, where the method is optimized based on the foregoing embodiment, and referring to fig. 2, and the method includes:
s201, after receiving information of successfully logging in the equipment, inquiring whether an adapted file exists locally.
The adaptive file comprises URL formats and a start-up parameter filling mode required by the verified equipment. If there is an adapted file locally, S202 is performed, and if there is no adapted file locally, S203 is performed.
S202, local URL is assembled locally at the client by using the adapted file and the identified start-up parameters, and the local URL is used as the start-up URL so as to start up the media stream based on the start-up URL.
The specific description may be referred to the above embodiments, and will not be repeated here.
S203, if the adapted file does not exist locally, inquiring whether the file to be adapted exists locally.
The file to be adapted comprises a URL format and a start-up parameter filling mode required by unverified equipment; that is, although the file to be adapted includes the URL format and the start-up parameter filling mode required by the device, the accuracy of the start-up URL generated based on the file to be adapted cannot be guaranteed. Thus requiring verification of the file to be adapted.
S204, if the file to be adapted exists, judging whether a current streaming task to be processed exists.
If the file to be adapted exists, entering a state to be adapted, wherein the state to be adapted represents a method for obtaining an unverified assembled URL. When the file to be adapted is verified, whether the client is in a working state at present or not needs to be judged, namely whether a to-be-processed streaming task exists at present or not is judged. If so, S205-S207 are performed, and if not, S208-S209 are performed.
S205, if the to-be-processed start-up task exists, acquiring a start-up URL from the equipment side based on the identified start-up parameter, and starting the media stream by using the start-up URL.
Because the accuracy of the starting URL generated based on the file to be adapted cannot be guaranteed, when the starting task to be processed exists, the starting URL is obtained from the equipment side based on the identified starting parameter, for example, the starting URL can be obtained from the equipment side by utilizing an ONVIF protocol or an SDK mode and combining the identified starting parameter, and then the media stream is started by utilizing the starting URL, so that the starting accuracy is guaranteed.
S206, acquiring a local URL assembled based on the file to be adapted and the identified start-up parameters.
Based on the URL format and parameter filling mode required by the equipment obtained from the file to be adapted, the local URL is assembled locally according to the starting parameters appointed by the user, and the specific assembling process is to supplement the appointed starting parameters to the appointed position of the URL format according to the parameter filling mode.
S207, comparing the start-up URL with the local URL, and processing the file to be adapted according to the comparison result.
And comparing the start-up URL with the local URL, judging whether the start-up URL is the same as the local URL, if so, indicating that the local URL assembled based on the files to be matched is inaccurate, directly deleting the files to be matched, and switching from a state to be matched to an unadapted state, wherein the unadapted state indicates that the method for assembling the URL is not obtained. It should be noted that if the comparison result is the same, multiple judgments may be performed according to the hollow matching operation in S208, and if the comparison result is the same each time, the file to be adapted is rewritten, and the state is switched from the state to be adapted to the adapted state.
S208, if the to-be-processed start-up task does not exist, repeating the idle matching operation according to the preset repetition times.
In the embodiment of the present application, when there is no streaming task, that is, when the client is in an idle state, according to a preset repetition number, idle matching operations are repeatedly executed. The purpose of repeatedly executing the idle matching operation is to verify the file to be adapted. Optionally, the idle matching operation includes: randomly determining a group of start-up parameters, and acquiring a start-up URL from the equipment side based on the start-up parameters; local URL is assembled locally at the client by utilizing the file to be adapted and the streaming parameters; specific generation process can be referred to the description of the above embodiments, and will not be repeated here; and comparing the starting URL with the local URL, and processing the file to be adapted according to the comparison result. .
S209, if the comparison result is the same, the file to be adapted passes verification, is rewritten into an adapted file, and is switched from the state to be adapted to the adapted state.
If the comparison results are the same, the URL generated by the file to be adapted is accurate, namely the file to be adapted is verified, so that the file to be adapted is rewritten into the adapted file, and the state is switched from the state to be adapted to the state to be adapted, so that the current starting URL can be generated locally by the adapted file at the client side, the current starting URL acquisition efficiency is improved, and the current starting speed is improved. It should be noted that if the comparison results are different, deleting the file to be adapted, and switching from the state to be adapted to the state not adapted, wherein the state not adapted indicates that the method of assembling the URL is not obtained.
In the embodiment of the application, if the current starting task exists in the case that only the file to be adapted exists locally, the URL is obtained from the equipment end to finish the current starting, so that the current starting accuracy is ensured. And after the streaming is successful, comparing the local URL generated by the client based on the file to be adapted with the streaming URL acquired from the equipment side to verify the effect of the file to be adapted. If the streaming task does not exist, the idle matching operation is repeatedly executed to verify the effect of generating the local URL based on the file to be adapted.
Fig. 3 is a flowchart of a method for obtaining a start-up URL according to a third embodiment of the present application, where the method is optimized based on the foregoing embodiment, and referring to fig. 3, the method includes:
s301, after receiving information of successfully logging in the equipment, inquiring whether an adapted file exists locally.
The adaptive file comprises URL formats and a start-up parameter filling mode required by the verified equipment. If yes, S302 is executed, and if no, S303 is executed.
S302, the local URL is assembled locally at the client by utilizing the adapted file and the identified streaming parameters, and the local URL is used as the streaming URL so as to open the media stream based on the streaming URL.
S303, if the adapted file does not exist locally, inquiring whether the file to be adapted exists locally.
S304, if the file to be adapted does not exist locally, judging whether a current streaming task to be processed exists.
If the streaming task exists, the slave device acquires the streaming URL of the designated parameter, and starts the media stream through the streaming URL, and the streaming URL and the parameter are reserved after the streaming is successful, so that the data analysis can be performed based on the saved streaming URL and the parameter. If no start-up task exists, S305 is performed.
S305, if no to-be-processed start-up task exists, different start-up URLs are obtained from the equipment side according to the different recognized start-up parameters.
For example, in the case of starting a live stream, if the first identified user designates that the start-up parameters are "1 channel" and "main stream", then a start-up URL including "1 channel" and "main stream" is obtained from the device side; and the second time of identification of the user-specified start-up parameters is 2 channels and main stream, acquiring start-up URLs … … comprising 0 channels and main stream from the equipment side, and so on, and respectively acquiring different start-up URLs from the equipment side according to the identified different start-up parameters. In an alternative embodiment, the different start-up URLs are obtained from locally stored start-up URLs and parameters.
S306, carrying out data analysis on the obtained different start-up URLs, determining whether to find out a method for assembling the URLs according to analysis results, and if so, generating a file to be adapted according to the analysis results.
In an alternative embodiment, the data analysis of the obtained different start-up URLs includes: comparing any two different start-up URLs to determine a fixed field and a variable field; wherein, the fixed field refers to the same field in the two start-up URLs, and the variable field refers to different fields in the two start-up URLs; and determining the corresponding relation between the change field and the start-up parameter.
For example, for the case of opening a live stream, the four-channel and main stream start URL is obtained from the device side: rtsp/192.168.1.64:554/unicast/3/Main/live; the method for acquiring the five-channel and mainstream startup URL from the equipment side comprises the following steps: rtsp/192.168.1.64:554/unicast/4/Main/live; comparing the two start-up URLs, it is known that under the condition of ensuring that the stream number is unchanged, the fixed fields are found to be IP, port numbers (192.168.1.64:554), unicast and live, and the change field is 3,4. From this, four channels are denoted by the numeral "3", five channels are denoted by the numeral "4", and the correlation of the change field and the channel number is: the change field is equal to the channel number minus 1. After the channel number appointed by the user is identified, the value of the change field can be obtained by subtracting 1.
Similarly, keeping the channel number unchanged, obtaining the starting URL of the 4-channel auxiliary stream from the equipment side is as follows: rtsp/192.168.1.64:554/unified/3/Second/live; the method comprises the steps of obtaining a 4-channel and main stream starting URL from the equipment side, wherein the starting URL comprises the following steps: rtsp/(192.168.1.64:554/unicast/3/Main/live). Comparing the two start-up URLs, it can be seen that under the condition of ensuring that the channel number is unchanged, the fixed fields are found to be IP, port numbers (192.168.1.64:554), unicast and live, and the change fields are Second and Main. From this, the relationship between the change field and the stream number is: the Main stream is represented by english Main and the auxiliary stream is represented by english Second. After the stream number appointed by the user is recognized, the stream number is directly expressed by the corresponding English.
Further, for opening the playback stream, similar to the above, referring to the above comparison process, in the case that the channel number and the stream number are determined, the correspondence between the start time and the end time of the change field is determined, for example, expressed in UTC time; as expressed in terms of time of year, month, day, minute, and second; such as expressed in NTP time, etc.
Taking the example of starting a live stream, through the above data analysis, the URL format required by the device may be obtained as follows: rtsp// < IP >: port >/unicast/< channel number >/< stream number >/live; the filling mode of the start-up parameters is as follows: the number corresponding to the channel number is the channel number designated by the user minus 1, and for the stream number, if the designated Main stream is the stream number Main, if the designated auxiliary stream is the stream number Second. Therefore, the file to be adapted can be generated according to the analyzed URL format required by the equipment and the filling mode of the start-up parameters, the file to be adapted can be subsequently verified, the verification process is referred to above, and the file to be adapted is rewritten after the verification is passed, so that the accurate local URL for start-up can be directly generated locally at the client based on the adapted file.
It should be noted that, if the fixed field, the variable field, and the correspondence between the variable field and the start-up parameter are determined according to the analysis result, generating the file to be adapted according to the analysis result includes: and determining a URL format according to the analyzed fixed field and the variation field, and determining a start-up parameter filling mode according to the corresponding relation between the variation field and the start-up parameter, so that a file to be adapted can be generated, namely a method for assembling the local URL is found.
Further, if the method for assembling the URL is not found according to the analysis result, that is, the format of the URL and/or the filling mode of the start-up parameter are not determined, directly performing an unadapted state, where the unadapted state indicates that the method for assembling the URL cannot be found, and then the start-up URL is not acquired from the device side when the media stream needs to be started.
In the embodiment of the application, in the idle state, the data analysis is performed on the acquired open-flow URL, the format of the open-flow URL and the corresponding relation between the change field and the open-flow parameter are determined according to the analysis result, and then the adaptation file is generated, so that the accurate open-flow URL can be generated locally at the client side according to the adaptation file, and the open-flow URL acquisition efficiency is improved.
Fig. 4 is a logic flow diagram of a method for obtaining a start-up URL according to a fourth embodiment of the present application, in which optimization is performed on the basis of the above embodiment, referring to fig. 4, the logic flow of the method for obtaining a start-up URL is as follows:
four states are predefined in this embodiment: the state is adapted, the state is to be adapted, the state is not adapted, and the state cannot be adapted. The adapted state refers to a specific parameter method of self-assembled URL, and is verified to be valid, namely, an adapted file exists locally; the state to be adapted refers to that a specific parameter method for self-assembling the URL is found, and the effect to be verified, namely the file to be adapted exists locally; the unadapted state refers to a specific parameter method for self-assembled URL which is not found yet; the unadapted state refers to multiple attempts to find the assembly method, but cannot be found.
Step 1:
after the client program successfully logs in the equipment, wherein the equipment is optionally NVR equipment, searching for a corresponding adapted file in a local environment, entering an adapted state if the corresponding adapted file is found, and jumping to the step 6; if not, searching a file to be adapted locally, if so, entering a state to be adapted, and jumping to the step 5; if the file to be adapted is not found, the unadapted state is entered, and the step 2 is skipped.
Step 2:
after entering an unadapted state, two conditions exist, if the client has a to-be-processed start-up task, the client is determined to be in a working state, otherwise, the client is determined to be in an idle state. In a working state, acquiring a starting URL of a designated parameter from the equipment side, starting a media stream through the starting URL, and reserving the starting URL and the parameter after the starting is successful; when the client is in an idle state, the streaming URLs of different streaming parameters are acquired from the equipment side, and data analysis is carried out by combining the URL and parameters (if any) of the streaming success before streaming, so as to determine the corresponding relation between the change field in the streaming URL and the streaming parameters and the format of the URL.
Step 3:
if the analysis is successful, namely, the URL format and the corresponding relation between the change field in the URL and the start-up parameter are determined, a file to be adapted is further generated, the state to be analyzed is entered, and the step 5 is skipped. If the URL assembling method cannot be found through analysis, namely the corresponding relation between the change field in the URL and the start-up parameter cannot be determined, and the assembling method cannot be found through multiple times of analysis, entering an unadapted state, namely jumping to the step 4, otherwise returning to a state to be analyzed (namely jumping to the step 2) to continue analysis.
Step 4:
after entering an unadapted state, the client system only acquires the start-up URL from the equipment when the start-up is needed, and the start-up URL of the equipment is not analyzed before logging in the equipment next time.
Step 5:
after entering a state to be adapted, when in a working state, acquiring a start-up URL from the equipment side, starting a media stream by using the start-up URL, and after the start-up, self-assembling the start-up URL according to a file to be adapted, and comparing whether the start-up URL acquired from the equipment side is consistent with the local self-assembled start-up URL; when in an idle state, acquiring a start-up URL from the equipment side based on randomly designated parameters, automatically assembling the URL according to the designated start-up parameters, and comparing whether the URL acquired from the equipment side is consistent with the self-assembled URL; and when the comparison finds that the file is inconsistent, deleting the file to be matched, returning to an unadapted state (i.e. jumping to the step 2), if the comparison is consistent for a plurality of times, writing the matched file, deleting the file to be matched, and entering the matched state (i.e. jumping to the step 6).
Step 6:
after entering the adapted state, when a streaming task exists, a streaming URL is assembled by itself according to the designated parameters, and the live stream or the playback stream is started by using the streaming URL. After the start-up is successful, the start-up URL is obtained from the equipment side and compared with the self-assembled start-up URL. If not, restarting the live stream or the playback stream through the streaming URL acquired from the device, deleting the adapted file, entering the unadapted state, and jumping to the step 2.
According to the method and the device, the aim of locally and automatically generating the start-up URL at the client end finally is achieved by analyzing the start-up URL format, the start-up speed is improved, switching of various states is provided, the effectiveness of the start-up URL generated by automatic assembly is guaranteed, and the error rate is reduced.
Fig. 5 is a schematic structural diagram of a start-up URL obtaining apparatus according to a fifth embodiment of the present application, where the embodiment is applicable to a case of starting up a media stream based on a media transport protocol, referring to fig. 5, the apparatus includes:
a first query module 501, configured to query whether an adapted file exists locally after receiving information of successfully logging in the device; the adaptive file comprises URL formats and a start-up parameter filling mode required by the verified equipment;
the URL generating module 502 is configured to locally assemble a local URL at the client using the adapted file and the identified start-up parameter if the query result is yes, and take the local URL as a start-up URL, so as to start up the media stream based on the start-up URL; wherein the adapted state represents the method of assembling the URL that has been obtained for verification.
On the basis of the above embodiment, optionally, the apparatus further includes:
the second query module is used for querying whether the local file to be adapted exists or not if the local file to be adapted does not exist, wherein the file to be adapted comprises a URL format and a start-up parameter filling mode required by unverified equipment;
The first start-up task judging module is used for entering a state to be adapted if the query result is in existence and judging whether a start-up task to be processed exists currently or not; wherein the to-be-adapted state represents a method in which an unverified assembled URL has been obtained;
the first start-up URL acquisition module is used for acquiring a start-up URL from the equipment side based on the identified start-up parameter if the to-be-processed start-up task exists, and starting up the media stream by using the start-up URL;
the second start-up URL acquisition module is used for acquiring a local URL assembled based on the file to be adapted and the identified start-up parameters;
and the first comparison module is used for comparing the streaming URL with the local URL and processing the file to be adapted according to the comparison result. On the basis of the above embodiment, optionally, the apparatus further includes:
the second query module is used for querying whether the local file to be adapted exists or not if the local file to be adapted does not exist, wherein the file to be adapted comprises a URL format and a start-up parameter filling mode required by unverified equipment;
the first start-up task judging module is used for entering a state to be adapted if the query result is in existence and judging whether a start-up task to be processed exists currently or not; wherein the to-be-adapted state represents a method in which an unverified assembled URL has been obtained;
The idle matching operation execution module is used for:
if the to-be-processed start-up task does not exist, repeating idle matching operation according to preset repetition times; idle matching operations, comprising:
randomly determining a group of start-up parameters, and acquiring a start-up URL from the equipment side based on the start-up parameters; local URL is assembled locally at the client by utilizing the file to be adapted and the streaming parameters;
and comparing the starting URL with the local URL, and processing the file to be adapted according to the comparison result.
On the basis of the above embodiment, optionally, the apparatus further includes:
the rewrite module is used for verifying the file to be adapted if the comparison results are the same, rewriting the file to be adapted, and switching from the state to be adapted to the adapted state;
and the deleting module is used for deleting the file to be adapted if the comparison results are different, and switching from the state to be adapted to the state not adapted, wherein the state not adapted indicates that the method for assembling the URL is not obtained.
On the basis of the above embodiment, optionally, the apparatus further includes:
the second start-up task judging module is used for judging whether a start-up task to be processed exists currently or not when the file to be adapted does not exist locally;
The third start-up URL acquisition module is used for acquiring different start-up URLs from the equipment side according to the identified different start-up parameters when the judging result is that the to-be-processed start-up task does not exist;
the URL analysis module is used for carrying out data analysis on the acquired different start-up URLs and determining whether to find out a method for assembling the URLs according to analysis results;
the file to be adapted generation module is used for generating an adapted file according to the analysis result if the judgment result is that the method for assembling the URL is found out;
and the state switching module is used for entering an unadapted state when the judgment result is that the method for assembling the URL is not found, wherein the unadapted state represents the method for finding the URL.
On the basis of the above embodiment, optionally, URL analysis is specifically used to:
comparing any two different start-up URLs to determine a fixed field and a variable field; wherein, the fixed field refers to the same field in the two start-up URLs, and the variable field refers to different fields in the two start-up URLs;
determining the corresponding relation between the change field and the start-up parameter;
correspondingly, the file generation module to be adapted is specifically configured to:
and determining a URL format according to the analyzed fixed field and the variation field, and determining a filling mode of the start-up parameter according to the corresponding relation between the variation field and the start-up parameter.
On the basis of the above embodiment, optionally, the apparatus further includes:
the URL acquisition and comparison module is used for taking the local URL as a start-up URL, acquiring the start-up URL from the equipment side based on the identified start-up parameter after starting the media stream, and comparing the start-up URL acquired from the equipment side with the local URL;
and the restarting module is used for restarting the media stream according to the starting URL acquired from the equipment side and deleting the adapted file if the starting URL is different from the local URL in URL format and/or filling mode of the starting parameters.
The start-up URL acquisition device provided by the embodiment of the application can execute the start-up URL acquisition method provided by any embodiment of the application, and has the corresponding functional modules and beneficial effects of the execution method.
Fig. 6 is a schematic structural diagram of an electronic device provided in a sixth embodiment of the present application. As shown in fig. 6, an electronic device provided in an embodiment of the present application includes: one or more processors 602 and a memory 601; the number of processors 602 in the electronic device may be one or more, one processor 602 being taken as an example in fig. 6; the memory 601 is used to store one or more programs; the one or more programs are executed by the one or more processors 602, causing the one or more processors 602 to implement the method for obtaining a start-up URL as in any of the embodiments of the present application.
The electronic device may further include: an input device 603 and an output device 604.
The processor 602, the memory 601, the input means 603 and the output means 604 in the electronic device may be connected by a bus or by other means, in fig. 6 by way of example.
The storage device 601 in the electronic device is used as a computer readable storage medium, and may be used to store one or more programs, which may be software programs, computer executable programs, and modules, such as program instructions/modules corresponding to the application control method provided in the embodiments of the present application. The processor 602 executes various functional applications of the electronic device and data processing by running software programs, instructions and modules stored in the storage device 601, i.e., implements the start-up URL acquisition method in the above-described method embodiment.
The storage device 601 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, at least one application program required for a function; the storage data area may store data created according to the use of the electronic device, etc. In addition, the memory 601 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid-state storage device. In some examples, memory 601 may further include memory located remotely from processor 602, which may be connected to the device via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The input means 603 may be used to receive entered numeric or character information and to generate key signal inputs related to user settings and function control of the electronic device. The output 604 may include a display device such as a display screen.
And, when one or more programs included in the above-described electronic device are executed by the one or more processors 602, the programs perform the following operations:
after receiving the information of successfully logging in the equipment, inquiring whether an adapted file exists locally; the adaptive file comprises URL formats and a start-up parameter filling mode required by the verified equipment;
if so, entering an adapted state, locally assembling a local URL at the client by using the adapted file and the identified start-up parameters, and taking the local URL as a start-up URL so as to start up a media stream based on the start-up URL; wherein the adapted state represents the method of assembling the URL that has been obtained for verification.
Of course, those skilled in the art will appreciate that the program(s) may also perform the associated operations in the application control method provided in any of the embodiments of the present application when the program(s) included in the electronic device described above are executed by the processor(s) 602.
In one embodiment of the present application, there is provided a computer-readable storage medium having stored thereon a computer program for executing a start-up URL obtaining method when executed by a processor, the method comprising:
after receiving the information of successfully logging in the equipment, inquiring whether an adapted file exists locally; the adaptive file comprises URL formats and a start-up parameter filling mode required by the verified equipment;
if so, entering an adapted state, locally assembling a local URL at the client by using the adapted file and the identified start-up parameters, and taking the local URL as a start-up URL so as to start up a media stream based on the start-up URL; wherein the adapted state represents the method of assembling the URL that has been obtained for verification.
In the alternative, the program may be used to perform the methods provided in any of the embodiments of the present application when executed by a processor.
Any combination of one or more computer readable media may be employed as the computer storage media of the embodiments herein. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples (a non-exhaustive list) of the computer-readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access Memory (Random Access Memory, RAM), a Read-Only Memory (ROM), an erasable programmable Read-Only Memory (Erasable Programmable Read Only Memory, EPROM), a flash Memory, an optical fiber, a portable CD-ROM, an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. A computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to: electromagnetic signals, optical signals, or any suitable combination of the preceding. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, radio Frequency (RF), and the like, or any suitable combination of the foregoing.
Computer program code for carrying out operations of the present application may be written in one or more programming languages, including an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including, for example, a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer, for example, through the internet using an internet service provider.
Note that the above is only a preferred embodiment of the present application and the technical principle applied. Those skilled in the art will appreciate that the present application is not limited to the particular embodiments described herein, but is capable of numerous obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the present application. Therefore, while the present application has been described in connection with the above embodiments, the present application is not limited to the above embodiments, but may include many other equivalent embodiments without departing from the spirit of the present application, the scope of which is defined by the scope of the appended claims.

Claims (10)

1. A method for obtaining a start-up URL, the method being performed by a client, the method comprising:
after receiving the information of successfully logging in the equipment, inquiring whether an adapted file exists locally; the adaptive file comprises URL formats and a start-up parameter filling mode required by the verified equipment; the method comprises the steps that for different devices, an adapted file locally pre-stored by a client side in communication with the device is different;
if so, entering an adapted state, locally assembling a local URL at the client by using the adapted file and the identified start-up parameters, and taking the local URL as a start-up URL so as to start up a media stream based on the start-up URL; wherein the adapted state represents a method of assembling the URL that has been obtained through verification; the identified start-up parameters refer to start-up parameters specified by the user on the client.
2. The method of claim 1, wherein if there is no adapted file locally, the method further comprises:
inquiring whether a file to be adapted exists locally, wherein the file to be adapted comprises an unverified URL format and a starting parameter filling mode required by the equipment;
if yes, entering a state to be adapted, and judging whether a current to-be-processed start-up task exists or not; wherein the to-be-adapted state represents a method in which an unverified assembled URL has been obtained;
if the to-be-processed streaming task exists, acquiring a streaming URL from the equipment side based on the identified streaming parameter, and starting the media stream by using the streaming URL;
acquiring a local URL assembled based on the file to be adapted and the identified start-up parameters;
and comparing the start-up URL with the local URL, and processing the file to be adapted according to the comparison result.
3. The method of claim 1, wherein if there is no adapted file locally, the method further comprises:
inquiring whether a file to be adapted exists locally, wherein the file to be adapted comprises an unverified URL format and a starting parameter filling mode required by the equipment;
If yes, entering a state to be adapted, and judging whether a current to-be-processed start-up task exists or not; wherein the to-be-adapted state represents a method in which an unverified assembled URL has been obtained;
if the to-be-processed start-up task does not exist, repeating idle matching operation according to preset repetition times; the idle matching operation includes:
randomly determining a group of start-up parameters, and acquiring a start-up URL from the equipment side based on the start-up parameters; local URL is assembled locally at the client by utilizing the file to be adapted and the streaming parameters;
and comparing the start-up URL with the local URL, and processing the file to be adapted according to the comparison result.
4. A method according to claim 2 or 3, wherein comparing the start-up URL with the local URL and processing the file to be adapted according to the comparison result comprises:
if the comparison result of the start-up URL and the local URL is the same, the file to be adapted passes verification, is rewritten into an adapted file, and is switched from the state to be adapted to the adapted state;
and if the comparison result of the start-up URL and the local URL is different, deleting the file to be adapted, and switching from the state to be adapted to the state not adapted, wherein the state not adapted indicates that the method for assembling the URL is not obtained.
5. A method according to claim 2 or 3, wherein if there is no file to be adapted locally, the method further comprises:
judging whether a to-be-processed start-up task exists currently or not;
if the to-be-processed start-up task does not exist, different start-up URLs are obtained from the equipment side according to the identified different start-up parameters;
data analysis is carried out on the obtained different start-up URLs, and whether a method for assembling the URLs is found out or not is determined according to analysis results;
if yes, generating a file to be adapted according to the analysis result;
if not, entering an unadapted state, wherein the unadapted state indicates that the method for assembling the URL cannot be found.
6. The method of claim 5, wherein the data analysis of the obtained different start-up URLs comprises:
comparing any two different start-up URLs to determine a fixed field and a variable field; wherein the fixed field refers to the same field in the two start-up URLs, and the variable field refers to different fields in the two start-up URLs;
determining the corresponding relation between the change field and the start-up parameter;
correspondingly, generating the file to be adapted according to the analysis result includes:
And determining a URL format according to the analyzed fixed field and the variation field, and determining a filling mode of the start-up parameter according to the corresponding relation between the variation field and the start-up parameter.
7. The method of claim 1, wherein after using the local URL as a start-up URL and starting the media stream, the method further comprises:
based on the identified start-up parameters, acquiring a start-up URL from the equipment side, and comparing the start-up URL acquired from the equipment side with the local URL;
and if the URL format and/or the filling mode of the streaming media parameters of the streaming media URL are different from those of the local URL, restarting the media stream according to the streaming media URL acquired from the equipment side, and deleting the adapted file.
8. The device for acquiring the start-up URL is characterized by being configured at a client and comprising the following components:
the query module is used for querying whether an adapted file exists locally or not after receiving the information of successfully logging in the equipment; the adaptive file comprises URL formats and a start-up parameter filling mode required by the verified equipment; the method comprises the steps that for different devices, an adapted file locally pre-stored by a client side in communication with the device is different;
The URL generation module is used for locally assembling a local URL at the client by utilizing the adapted file and the identified start-up parameters if the query result is that the adapted file exists, and taking the local URL as a start-up URL so as to start up the media stream based on the start-up URL; wherein the adapted state represents a method of assembling the URL that has been obtained through verification; the identified start-up parameters refer to start-up parameters specified by the user on the client.
9. An electronic device, comprising:
one or more processors;
storage means for storing one or more programs,
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the method of start-up URL retrieval as recited in any of claims 1-7.
10. A computer readable storage medium having stored thereon a computer program, which when executed by a processor implements a method of start-up URL retrieval according to any of claims 1 to 7.
CN202010859126.XA 2020-08-24 2020-08-24 Method and device for acquiring start-up URL, electronic equipment and storage medium Active CN114189504B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010859126.XA CN114189504B (en) 2020-08-24 2020-08-24 Method and device for acquiring start-up URL, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010859126.XA CN114189504B (en) 2020-08-24 2020-08-24 Method and device for acquiring start-up URL, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN114189504A CN114189504A (en) 2022-03-15
CN114189504B true CN114189504B (en) 2024-03-08

Family

ID=80600680

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010859126.XA Active CN114189504B (en) 2020-08-24 2020-08-24 Method and device for acquiring start-up URL, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114189504B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109101564A (en) * 2018-07-16 2018-12-28 阿里巴巴集团控股有限公司 A kind of method, apparatus and electronic equipment of page resource load simultaneously
CN110166831A (en) * 2018-07-23 2019-08-23 腾讯科技(深圳)有限公司 Reset method, apparatus, storage medium and the computer equipment of files in stream media
CN111107445A (en) * 2018-10-29 2020-05-05 浙江宇视科技有限公司 Media protocol stream optimization method and system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109101564A (en) * 2018-07-16 2018-12-28 阿里巴巴集团控股有限公司 A kind of method, apparatus and electronic equipment of page resource load simultaneously
CN110166831A (en) * 2018-07-23 2019-08-23 腾讯科技(深圳)有限公司 Reset method, apparatus, storage medium and the computer equipment of files in stream media
CN111107445A (en) * 2018-10-29 2020-05-05 浙江宇视科技有限公司 Media protocol stream optimization method and system

Also Published As

Publication number Publication date
CN114189504A (en) 2022-03-15

Similar Documents

Publication Publication Date Title
US11095710B2 (en) Detecting virtual private network usage
CN104506937A (en) Method and system for sharing processing of audios and videos
US10003633B2 (en) Method and device for resuming file download
CN109948334B (en) Vulnerability detection method and system, electronic equipment and storage medium
CN110557672B (en) Television program sharing method, television and storage medium
CN110401858B (en) Video playing method and device, electronic equipment and storage medium
CN111930709B (en) Data storage method, apparatus, electronic device, and computer readable medium
US20210195294A1 (en) Methods and systems for implementing an elastic cloud based voice search using a third-party search provider
CN112040312A (en) Split-screen rendering method, device, equipment and storage medium
CN112994982A (en) Packet capture control method, device and system of cloud-real machine and storage medium
CN114189504B (en) Method and device for acquiring start-up URL, electronic equipment and storage medium
CN112887289B (en) Network data processing method, device, computer equipment and storage medium
CN114095755A (en) Video processing method, device and system, electronic equipment and storage medium
EP3398295B1 (en) Systems and methods for bandwidth estimation in oscillating networks
CN113923056B (en) Matching authentication method and device for multi-network segment network disk, network disk and storage medium
CN115357772A (en) Data processing method and device
CN114595115A (en) Model data extraction method, system, electronic device and computer storage medium
CN113553488A (en) Method and device for updating index data in search engine, electronic equipment and medium
CN116243940A (en) Upgrading method and device of network equipment, electronic equipment and storage medium
CN115022676B (en) Video stream pushing method and device, electronic equipment and readable medium
KR100493899B1 (en) Information management system of the devices in home network and method thereof
US11250267B2 (en) Method and apparatus for processing information associated with video, electronic device, and storage medium
CN115827276A (en) Reporting method and device of embedded point information, readable storage medium and electronic equipment
WO2019227431A1 (en) Template sharing method used for generating multimedia content, apparatus and terminal device
CN117150511A (en) Trusted DCS running state query method, system, equipment and storage medium

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