Method, device and system for displaying alarm file
A technology for displaying alarms and files, which is applied in the field of communication, can solve the problem of a large waste of storage resources on the server side, and achieve the effects of avoiding a large consumption of resources and bandwidth resources on the server side, improving real-time performance, and reducing occupancy
Pending Publication Date: 2020-07-17
HANGZHOU HIKVISION DIGITAL TECH
0 Cites 3 Cited by
AI-Extracted Technical Summary
Problems solved by technology
[0005] When the browser uses the polling method to request the alarm file from the server to display the alarm file, the server needs to send the URL of the alarm file accessible on the ...
Method used
In the embodiment of the present disclosure, because the processor receives the data packet corresponding to the alarm file of the server through the long connection, the data packet corresponding to the alarm file is analyzed to obtain the alarm file, and the URL of the alarm file is generated, so according to the alarm The file URL shows the alarm file. In this way, the processor does not need to use the polling method to request the alarm file, so that the server does not need to save the alarm file, so that the storage resources occupied by the alarm file can be released after the alarm file is pushed, reducing the occupation of the storage resources of the server, and avoiding It eliminates polling and consumes a lot of server resources and bandwidth resources, and improves the real-time performance of pushing alarm files. Since the processor generates the URL of the alarm file, the alarm file can be automatically displayed according to the URL.
[0129] The service end can also obtain the alarm file whose file content belongs to the content type, encapsulate the alarm file into at least one data packet through the process of above-mentioned 204 or 205, and send the at least one data to the client through the long connection Bag. In this way, when the server receives an alarm file whose file content belongs to the subscribed content type, it can send it to the client, so that there is no need to poll the server, which improves the real-time performance of obtaining the alarm file and avoids wasting server resources and bandwidth resources. .
[0163] In the embodiment of the present application, because the client shows the alarm file and needs to be based on the URL of the alarm file, the client establishes a long connection with the server and sends the subscription request message to the server, so that the server receives Send M data packets when the content of the file belongs to the alarm file of the content type, analyze the alarm file from the M data packets, and generate the URL of the alarm file, so that the client can display the alarm file based on the generated URL, thereby improving the transmission speed. The efficiency of the alarm file also avoids the large consumption of server resources and bandwidth resources c...
Abstract
The invention relates to a method, device and system for displaying an alarm file, and belongs to the field of communication. The method comprises the following steps: receiving a data packet corresponding to an alarm file sent by a server through long connection with the server, wherein the server releases storage resources occupied by the alarm file after sending the alarm file; analyzing the data packet corresponding to the alarm file to acquire the alarm file; generating a uniform resource locator URL of the alarm file; and displaying the alarm file according to the URL of the alarm file.According to the invention, waste of storage resources of the server can be reduced.
Application Domain
TransmissionFile/folder operations +3
Technology Topic
Computer securityEngineering +3
Image
Examples
- Experimental program(1)
Example Embodiment
[0085] Exemplary embodiments will be described in detail herein, examples of which are illustrated in the accompanying drawings. Where the following description refers to the drawings, the same numerals in different drawings refer to the same or similar elements unless otherwise indicated. The implementations described in the illustrative examples below are not intended to represent all implementations consistent with this application. Rather, they are merely examples of apparatus and methods consistent with some aspects of the present application as recited in the appended claims.
[0086] see figure 1 , an embodiment of the present application provides a system for displaying an alarm file, the system comprising:
[0087] Server 1 and Client 2, Client 2 can establish a long connection with Server 1. As an example, the long connection may be a Websocket connection, and the Websocket connection is a full-duplex two-way communication connection.
[0088] As an example, the client 2 may be a browser or other applications.
[0089] The server 1 can obtain the alarm file. The file type of the alarm file can be a picture file, a video file or a text file.
[0090] Optionally, the server 1 may be a network video recorder (Network Video Recorder, nvr) or a network camera (IP CAMERA, IPC). The server 1 obtains the alarm file by itself, for example, it can obtain the alarm file by photographing itself.
[0091] Server 1 can also be a server, see figure 2 , the server 1 also establishes a connection with at least one surveillance camera 3 .
[0092] For each surveillance camera 3, the surveillance camera 3 can send alarm information to the server 1, and then send at least one alarm file to the server 1 immediately after the alarm information.
[0093] The alarm information may include at least one of the number of alarm files to be sent, the file description information of each alarm file, and the device information of the surveillance camera 3 .
[0094] The file description information of the alarm file may include file content description information of the alarm file. For example, assuming that the alarm file is a picture file, the content description information of the file may include whether the picture file is a background image or a foreground image, and whether the image in the picture file is a face image, and in the case of a face image, the face image Information such as the age of the corresponding person, whether they wear glasses or not.
[0095] The device information of the surveillance camera 3 may include the address of the surveillance camera 3 . The address may include at least one of an Internet Protocol Address (IP) address or a Media Access Control Address (MAC) address.
[0096] see image 3 , after the client 2 establishes a long connection with the server 1 (which can be a Websocket connection), it can send a subscription request message to the server 1 through the long connection. The subscription request message includes the content type and is used in the server 1 The content of the subscribed file belongs to the alarm file of this content type.
[0097] The content type can include face image or vehicle image, etc. Assuming that the content type included in the subscription request message is face image, that is, the content of the subscription file in server 1 belongs to the alarm file of the face image, that is to say, server 1 is obtaining the alarm file. When the alarm file belonging to the face image is reached, the alarm file is sent to the client 2.
[0098] The server 1 receives the subscription request message, and stores the content type included in the subscription request message. see thus Figure 4 , when the server 1 obtains the alarm information whose information content belongs to the content type, sends the alarm information to the client 2 through the long connection, and when the server 1 obtains the alarm file whose content belongs to the content type, the alarm information is sent to the client 2 through the long connection. The alarm file is encapsulated into M data packets, where M is an integer greater than or equal to 1. For each encapsulated data packet, the server 1 sends the data packet to the client 2 through the long connection, and after sending the data packet , release the storage resources occupied by the data packet. The server may also release the storage resources occupied by the alarm file after sending M data packets corresponding to the alarm file.
[0099] Optionally, when each package is encapsulated into a data packet, the server 1 sends the data packet to the client 2 through the long connection.
[0100] The client 2 can parse the received data packets to obtain an alarm file, generate a uniform resource locator (URL) of the alarm file, and display the alarm file according to the URL of the alarm file. Client 2 or server 1 can also actively request to disconnect the long connection.
[0101] The data packet includes a header and a payload portion following the header, and the payload portion includes the alarm file or a portion of the alarm file. see Figure 5 , the packet header may include a check field, a packet header length field, a file length field, a file identification field and a packet sequence number field. The check field is used to carry the preset check string, the header length field is used to carry the header length of the data packet, the file length field is used to carry the file length of the alarm file, and the file ID field is used to carry the file ID of the alarm file , the packet sequence number field is used to carry the packet sequence number of the data packet.
[0102] For the check field, the header length field, the file length field, the file identification field and the packet sequence number field are included. These fields can be arranged in various order in the packet header. An example of an arrangement order is listed in this application for description, and other arrangement orders are not listed one by one.
[0103] The example is, see Figure 5 , the length of the check field is a bytes, a is an integer greater than 1, the check field is the 0th to a-1 bytes of the packet header; the length of the packet header length field is b bytes, and b is greater than 1 Integer, the length field of the packet header is the byte a to a+b-1 of the packet header; the length of the file length field is c bytes, c is an integer greater than 1, and the length field of the file is the byte a+b to the packet header. a+b+c-1 bytes; the length of the file identification field is d bytes, d is an integer greater than 1, and the file identification field is the first a+b+c to a+b+c+d- of the packet header 1 byte; and the length of the packet sequence number field is e bytes, e is an integer greater than 1, and the packet sequence number field is the first a+b+c+d to a+b+c+d+e-1 of the packet header bytes.
[0104] see Image 6 , the header of the data packet may further include a payload length field, and the payload length field may be used to carry the length of the payload part of the data packet. The payload length field may be located between the file length field and the file identification field. The length of the payload length field is f bytes, f is an integer greater than 1, and the payload length field is the a+b+c to a+b+c+f-1th bytes of the packet header. Correspondingly, the file The identification field is the a+b+c+f to a+b+c+d+f-1 bytes of the packet header, and the packet sequence number field is the a+b+c+d+f to a+b+ of the packet header. c+d+f+e-1 bytes.
[0105] see Image 6 , the header of the data packet may further include a file type field, and the file type field may be used to carry the file type of the alarm file. The file type field may follow the packet sequence number field. The length of the file type field is g bytes, g is an integer greater than 1, and the file type field is from a+b+c+d+f+e to a+b+c+d+f+e+g of the packet header -1 byte.
[0106] For example, see Figure 7 , assuming that a is 4, b is 4, c is 4, f is 4, d is 32, e is 4, and g is 4. That is to say, the check field is the 0th to 3rd bytes of the packet header, the packet length field is the 4th to 7th bytes of the packet header, the file length field is the 8th to 11th bytes of the packet header, and the payload length field is the 8th to 11th bytes of the packet header. It is the 12th to 15th bytes of the packet header, the file identification field is the 16th to 47th bytes of the packet header, the packet sequence number field is the 48th to 51st bytes of the packet header, and the file type field is the 52nd to 55th bytes of the packet header. byte.
[0107] for Image 6 The header of the data packet shown can be defined as follows:
[0108]
[0109] The client 2 receives the M data packets sent by the server 1 through the long connection; and obtains the alarm file by analyzing the packet header of each of the M data packets.
[0110] see Figure 8 , an embodiment of the present application provides a method for displaying an alarm file, the method comprising:
[0111] Step 101: Receive data packets corresponding to the alarm file sent by the server through a long connection with the server, wherein the server releases the storage resources occupied by the alarm file after sending the alarm file.
[0112] Step 102: Obtain the alarm file by parsing the data packet corresponding to the alarm file.
[0113] Step 103: Generate a uniform resource locator URL of the alarm file.
[0114] Step 104: Display the alarm file according to the URL of the alarm file.
[0115] In the embodiment of the present application, since there is a long connection with the server, the data packet corresponding to the alarm file of the server can be received through the long connection, the data packet corresponding to the alarm file can be parsed to obtain the alarm file, and the URL of the alarm file can be generated. , so that the alarm file is displayed according to the URL of the alarm file. In this way, there is no need to use the polling method to request the alarm file, and the server can push the alarm file to the client after getting the alarm file, without saving the alarm file, so that the storage resources occupied by the alarm file can be released after the alarm file is pushed, reducing the impact on the service. It also avoids the large consumption of server resources and bandwidth resources caused by polling, and improves the real-time performance of pushing alarm files. Since the URL of the alarm file is generated, the alarm file can be automatically displayed according to the URL.
[0116] see Figure 9 , the embodiment of the present application provides another method for displaying an alarm file, the method comprising:
[0117] Step 201: The client establishes a persistent connection with the server, and sends a subscription request message to the server through the persistent connection, where the subscription request message includes the content type.
[0118] The long connection can be a Websocket connection, and the content type can include a face image or a vehicle image.
[0119] Step 202: the server receives the subscription request message, the subscription request message carries the content type, and when the server obtains the alarm information whose information content belongs to the content type, the server sends the alarm information to the client through the long connection.
[0120] After receiving the subscription request message, the server saves the content type included in the subscription request message. In this way, when the server obtains the alarm information whose information content belongs to the content type, it sends the alarm information to the client through the long connection.
[0121] Step 203: The client receives the alarm information.
[0122] Step 204: When the server obtains an alarm file whose content belongs to the content type, the server encapsulates the alarm file into M data packets.
[0123] After the server obtains the alarm information belonging to the content type, the server also obtains the alarm file whose file content belongs to the content type, and encapsulates the alarm file into M data packets.
[0124] For each data packet, the data packet may include a header and a payload portion, with the header preceding the payload portion. see Figure 5 , the packet header may include a check field, a packet header length field, a file length field, a file identification field and a packet sequence number field. The check field is used to carry the preset check string, the header length field is used to carry the header length of the data packet, the file length field is used to carry the file length of the alarm file, and the file ID field is used to carry the file ID of the alarm file , the packet sequence number field is used to carry the packet sequence number of the data packet.
[0125] optional, see Image 6 , the header of the data packet may further include a payload length field, and the payload length field may be used to carry the length of the payload part of the data packet. The payload length field may be located between the file length field and the file identification field.
[0126] optional, see Image 6 , the header of the data packet may further include a file type field, and the file type field may be used to carry the file type of the alarm file.
[0127] Step 205: The server sends the M data packets to the client through the persistent connection, and releases the storage resources occupied by the M data packets.
[0128] For the M data packets, the server sends one data packet to the client at a time on the long connection.
[0129] The server can also obtain an alarm file whose file content belongs to the content type, encapsulate the alarm file into at least one data packet through the process of 204 or 205, and send the at least one data packet to the client through the long connection. In this way, when the server receives an alarm file whose content belongs to the subscribed content type, it can send it to the client, so that there is no need to poll the server, which improves the real-time performance of obtaining the alarm file and avoids wasting server resources and bandwidth resources. .
[0130] The server can release the storage resources occupied by the M data packets after sending the M data packets. Preferably, after each data packet is sent, the storage resources occupied by the data packets can be released, thereby reducing the need for the server. Occupation of storage resources.
[0131] Step 206: The client receives the data packet, reads the check string from the header of the data packet, and reads the length of the header from the header when the check string is a preset check string.
[0132] In this step, the data packet received by the client is any one of the M data packets, and the data packet received by the client may be the first data packet of the alarm file or the last data packet of the alarm file. , or any packet between the first and last packet.
[0133] see Figure 5 , the check field is the first field in the header of the data packet, and its length is a bytes, and the second field is the header length field, and its length is b bytes.
[0134] In this step, the information of the first a bytes is read from the header of the data packet to obtain a check string, and when the check string is a preset check string, the a-th byte is read from the header of the data packet To a+b-1 bytes of information, get the header length.
[0135] Step 207: The client reads the file length of the alarm file, the file identifier of the alarm file and the packet sequence number of the data packet from the packet header according to the length of the packet header.
[0136] According to the length of the header, the client can determine the remainder of the header and the payload of the data packet, and read the remainder of the header from the data packet.
[0137] see Figure 5 , the field after the header length field is the file length field, and the length of the file length field is c bytes. That is to say, the first field of the remainder of the packet header is the file length field, and the information of bytes 0 to c-1 is read from the remainder of the packet header to obtain the file length of the alarm file.
[0138] see Figure 5 , the field after the file length field is the file identification field, and the length of the file identification field is d bytes. In this way, the information of bytes c to c+d-1 is read from the remaining part of the packet header, and the file identifier of the alarm file is obtained.
[0139] see Figure 5 , the field after the file identification field is the packet sequence number field, and the length of the packet sequence number field is e bytes. In this way, the information of bytes c+d to c+d+e-1 is read from the remaining part of the packet header to obtain the packet sequence number of the data packet.
[0140] optional, see Figure 5 , the header of the data packet may further include a payload length field, and the payload length field may be used to carry the length of the payload part of the data packet. The payload length field may be located between the file length field and the file identification field. The length of the payload length field is f bytes.
[0141] exist Figure 5 In the packet header of the data packet shown, the information of bytes 0 to c-1 is read from the remaining part of the packet header to obtain the file length of the alarm file. Read the information of bytes c to c+f-1 from the remaining part of the packet header to obtain the length of the payload part of the data packet. Read the information of bytes c+f to c+f+d-1 from the remaining part of the packet header to obtain the file identifier of the alarm file. And, the information of bytes c+f+d to c+f+d+e-1 is read from the remaining part of the packet header to obtain the packet sequence number of the data packet.
[0142] optional, see Figure 5 , the header of the data packet may further include a file type field, and the file type field may be used to carry the file type of the alarm file. The file type field may follow the packet sequence number field. The length of the file type field is g bytes.
[0143] exist Figure 5 In the header of the data packet shown, read the information of bytes c+f+d+e to c+f+d+e+g-1 from the remaining part of the header to obtain the file type of the alarm file .
[0144] Step 208: The client stores the payload part of the data packet in the storage space corresponding to the packet sequence number in the array corresponding to the file identifier.
[0145] In the process of receiving the data packets of the alarm file, the client uses an array to buffer the payload part of the received data packets belonging to the alarm file. The array corresponds to the file identifier of the alarm file, the array includes at least one storage space, each data packet belonging to the alarm file corresponds to a storage space, and the storage space corresponding to each data packet is different.
[0146] The client can be a browser and the array can be in browser memory.
[0147] In this step, according to the file identifier of the alarm file, it is determined whether the data packet is the first received data packet belonging to the alarm file; if it is the first one, an array corresponding to the file identifier is created, and in the array Save the payload part of the data packet in the storage space corresponding to the packet serial number; if it is not the first one, determine the array corresponding to the file ID, and save the payload part of the data packet in the array. in the storage space corresponding to the packet sequence number.
[0148] Optionally, before saving the payload part of the data packet into the storage space corresponding to the packet sequence number, it is also possible to compare the payload length of the data packet carried in the payload length field with the actual payload part of the data. Are the lengths equal. If they are equal, it means that there is no data loss in the payload part of the data, and the payload part of the data packet is stored in the storage space corresponding to the packet sequence number. If they are not equal, it indicates that the data is lost in the payload part of the data, and the data of the alarm file saved in the array is discarded.
[0149] Optionally, if data loss occurs in the payload part of the data packet, the payload part of the data packet can also be saved in the storage space corresponding to the packet sequence number, so that the displayed alarm file may have some content missing. For example, if the alarm file is a picture, the displayed picture contains some missing content.
[0150] Among them, the package serial number can be numbered sequentially from 1, the package serial number 1 corresponds to the first storage space in the array, the package serial number 2 corresponds to the second storage space in the data group, and so on, for other package serial numbers no longer Explain them one by one.
[0151] see Image 6 , the header of the data packet also includes the payload length of the data packet, and the array also saves the data length belonging to the alarm file. Specifically, it can be received when the first data packet belonging to the alarm file is received. , the data length belonging to the alarm file is stored in the array, and the data length is equal to the payload length of the first data packet; the received data packet belonging to the alarm file is not the first one belonging to the alarm file In the case of the data packet, after the payload part of the data packet is stored in the storage space corresponding to the packet sequence number, the data length of the alarm file and the payload length of the data packet stored in the array can also be stored. Accumulate to get the accumulated value, and replace the data length of the alarm file saved in the array with the accumulated value.
[0152] In this step, after replacing the data length of the alarm file stored in the array with the accumulated value, it is also judged whether the data length of the alarm file stored in the array is equal to the file length of the alarm file, if it is equal, Step 209 is then executed, and if not equal, the client re-executes the operations 206 to 208 when receiving the data packet.
[0153] Step 209: When the length of the data belonging to the alarm file stored in the array by the client is equal to the file length of the alarm file, the data belonging to the alarm file stored in the array is the alarm file, and the URL of the alarm file is generated.
[0154] The client provides an application programming interface (ApplicationProgrammingInterface, API) for generating URLs. The client can call the API, input the alarm file saved in the array to the API, and generate the URL of the alarm file through the API.
[0155] Optionally, when the file type of the alarm file is picture or video, the URL of the alarm file may be generated.
[0156] Optionally, the URL can be a temporary URL of the alarm file.
[0157] Optionally, after the client obtains the alarm file, it can save the alarm file in the memory of the client, and count the number of alarm files saved in the memory of the client. to delete the oldest saved alarm file. In this way, the memory of the client can be prevented from being occupied without limit and cannot be effectively released.
[0158] Optionally, a management array may be set, and the number of storage spaces included in the management array is a preset number threshold. When generating the URL of the alarm file, if there is still free storage space in the management array, the current time is used as the storage time of the generated alarm file, and the URL of the generated alarm file and the storage time are saved to a free storage space in the management array. Storage space; if there is no free storage space in the management array, find out the URL of the alarm file with the earliest storage time from the management array, delete the alarm file corresponding to the URL with the earliest storage time from the memory of the client, and clear all the storage space. Describe the storage space where the URL with the earliest storage time is located, and save the URL and storage time of the generated alarm file in the emptied storage space.
[0159] Step 210: The client displays the alarm file according to the URL of the alarm file.
[0160] When the client is a browser, since the browser displays based on the URL of pictures or videos, in order not to modify the existing logic of the browser, the URL of the alarm file is generated through the API for generating URLs, so that browsing The controller can automatically display the alarm file according to the URL.
[0161] Optionally, when the alarm file is a text file, the browser may directly display the text file without generating the URL of the text file.
[0162] Optionally, for the long connection between the client and the server, the client can actively disconnect, or the server can actively disconnect.
[0163] In the embodiment of the present application, since the display of the alarm file by the client needs to be based on the URL of the alarm file, the client establishes a long connection with the server and sends the subscription request message to the server, so that the server receives the file content after receiving the When the alarm file belongs to the content type, M data packets are sent, the alarm file is parsed from the M data packets, and the URL of the alarm file is generated, so that the client can display the alarm file based on the generated URL, thereby improving the transmission efficiency of the alarm file. Efficiency, but also avoid polling resulting in a large consumption of server resources and bandwidth resources. Compared with polling to get the corresponding URL of the alarm file in the server, due to the limited storage space of the server, once there are too many alarm files, the alarm file acquired later by the server will overwrite the alarm file acquired earlier. If it has not been polled, the overwritten alarm file cannot be pushed to the client for display, resulting in unreliable display of the alarm file. In this solution, each alarm file can be pushed and displayed to improve the reliability of the displayed alarm file. Compared with storing the alarm file on the server, the client polls to get the URL. Since this solution stores the alarm file in the memory of the client and generates the corresponding URL of the alarm file, the server does not need to store the alarm file, and pushes the alarm file. After the file is created, the storage resources occupied by the alarm file can be released, reducing the storage space occupied by the server. In addition, the header of the data packet includes a check field, a header length field, a file length field, a file identification field and a packet sequence number field. The check field is used to carry the preset check string, the header length field is used to carry the header length of the data packet, the file length field is used to carry the file length of the alarm file, and the file ID field is used to carry the file ID of the alarm file , the packet sequence number field is used to carry the packet sequence number of the data packet. In this way, based on the fields in the packet header, M data packets belonging to one alarm file can be successfully identified, and the alarm file can be parsed.
[0164] The following are apparatus embodiments of the present application, which can be used to execute the method embodiments of the present application. For details not disclosed in the device embodiments of the present application, please refer to the method embodiments of the present application.
[0165] see Figure 10 , an embodiment of the present application provides an apparatus 300 for displaying an alarm file, the apparatus 300 includes:
[0166] A receiving module 301, configured to receive data packets corresponding to the alarm file sent by the server through a long connection with the server, wherein the server sends the alarm file and releases the storage resources occupied by the alarm file;
[0167] An analysis module 302, configured to parse the data packet corresponding to the alarm file to obtain the alarm file;
[0168] generating module 303, for generating the uniform resource locator URL of the alarm file;
[0169] The display module 304 is configured to display the alarm file according to the URL of the alarm file.
[0170] Optionally, the alarm file corresponds to M data packets, where M is an integer greater than or equal to 1, and the parsing module 302 is used for:
[0171] For each data packet in the M data packets, read a check string from the packet header of the data packet;
[0172] In the case that the verification string is a preset verification string, read the packet header length from the packet header;
[0173] According to the length of the packet header, read the file length of the alarm file, the file identifier of the alarm file and the packet sequence number of the data packet from the packet header;
[0174] In the array corresponding to the file identifier, the payload part of the data packet is stored in the storage space corresponding to the packet sequence number;
[0175] When the length of the data stored in the array and belonging to the alarm file is equal to the length of the file, the data stored in the array and belonging to the alarm file is the alarm file.
[0176] Optionally, the header of the data packet further includes the payload length of the data packet,
[0177] The parsing module 302 is used for:
[0178] According to the file identifier, determine whether the data packet is the first received data packet belonging to the alarm file;
[0179] If it is the first one, create an array corresponding to the file identifier, save the payload part of the data packet in the storage space corresponding to the packet sequence number in the array, and save the data in the array the data length of the alarm file, the data length is equal to the payload length of the data packet;
[0180]If it is not the first one, determine the array corresponding to the file identifier, save the payload part of the data packet in the storage space corresponding to the packet sequence number in the array, and store the data stored in the array belonging to the The data length of the alarm file and the payload length of the data packet are accumulated to obtain an accumulated value, and the data length stored in the array is replaced with the accumulated value.
[0181] Optionally, the alarm file obtained by the analysis is stored in the memory, and the generating module 303 is used for:
[0182] According to the alarm file stored in the memory, the URL of the alarm file is generated through an application program interface API for generating a uniform resource locator URL.
[0183] Optionally, the apparatus 300 further includes: a sending module,
[0184] The sending module is configured to send a subscription request message to the server through the long connection, where the subscription request message includes a content type;
[0185] The receiving module is further configured to receive alarm information corresponding to the alarm file through the long connection, where the content of the alarm file belongs to the content type.
[0186] In the embodiment of the present application, when the display module displays the alarm file, it needs to be based on the URL of the alarm file. Due to the long connection with the server, the receiving module can receive the data packet corresponding to the alarm file of the server through the long connection. The data packet corresponding to the alarm file is parsed to obtain the alarm file. The generation module generates the URL of the alarm file through the API used to generate the URL. The display module can automatically display the alarm file according to the URL. , the alarm file can be sent to the device without saving the alarm file. After the alarm file is pushed, the storage resources occupied by the alarm file can be released, which improves the real-time nature of pushing the alarm file and reduces the occupation of the server's storage resources. It also avoids polling that consumes a lot of server-side resources and bandwidth resources.
[0187] Regarding the apparatus in the above-mentioned embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be described in detail here.
[0188] Figure 11 A structural block diagram of an electronic device 400 provided by an exemplary embodiment of the present invention is shown. The electronic device 400 may run the above-mentioned client, which may be a portable mobile terminal, such as a smart phone, a tablet computer, a notebook computer or a desktop computer. Electronic device 400 may also be referred to by other names such as user equipment, portable terminal, laptop terminal, desktop terminal, and the like.
[0189] Generally, the electronic device 400 includes: a processor 401 and a memory 402 .
[0190] The processor 401 may include one or more processing cores, such as a 4-core processor, an 8-core processor, and the like. The processor 401 may use at least one hardware form of DSP (Digital Signal Processing, digital signal processing), FPGA (Field-Programmable Gate Array, field programmable gate array), and PLA (Programmable Logic Array, programmable logic array). accomplish. The processor 401 may also include a main processor and a coprocessor. The main processor is a processor used to process data in a wake-up state, also called a CPU (Central Processing Unit, central processing unit); A low-power processor for processing data in a standby state. In some embodiments, the processor 401 may be integrated with a GPU (Graphics Processing Unit, image processor), and the GPU is used for rendering and drawing the content that needs to be displayed on the display screen. In some embodiments, the processor 401 may further include an AI (Artificial Intelligence, artificial intelligence) processor, where the AI processor is used to process computing operations related to machine learning.
[0191] Memory 402 may include one or more computer-readable storage media, which may be non-transitory. Memory 402 may also include high-speed random access memory, as well as non-volatile memory, such as one or more disk storage devices, flash storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory 402 is used to store at least one instruction, and the at least one instruction is used to be executed by the processor 401 to implement the display alarm provided by the method embodiments of the present application file method.
[0192] In some embodiments, the electronic device 400 may optionally further include: a peripheral device interface 403 and at least one peripheral device. The processor 401, the memory 402 and the peripheral device interface 403 may be connected through a bus or a signal line. Each peripheral device can be connected to the peripheral device interface 403 through a bus, a signal line or a circuit board. Specifically, the peripheral device includes: at least one of a radio frequency circuit 404 , a touch display screen 405 , a camera 406 , an audio circuit 407 , a positioning component 408 and a power supply 409 .
[0193] The peripheral device interface 403 may be used to connect at least one peripheral device related to I/O (Input/Output) to the processor 401 and the memory 402 . In some embodiments, processor 401, memory 402, and peripherals interface 403 are integrated on the same chip or circuit board; in some other embodiments, any one of processor 401, memory 402, and peripherals interface 403 or The two can be implemented on a separate chip or circuit board, which is not limited in this embodiment.
[0194] The radio frequency circuit 404 is used for receiving and transmitting RF (Radio Frequency, radio frequency) signals, also called electromagnetic signals. The radio frequency circuit 404 communicates with the communication network and other communication devices via electromagnetic signals. The radio frequency circuit 404 converts electrical signals into electromagnetic signals for transmission, or converts received electromagnetic signals into electrical signals. Optionally, the radio frequency circuit 404 includes an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a subscriber identity module card, and the like. The radio frequency circuit 404 may communicate with other terminals through at least one wireless communication protocol. The wireless communication protocol includes but is not limited to: World Wide Web, Metropolitan Area Network, Intranet, various generations of mobile communication networks (2G, 3G, 4G and 5G), wireless local area network and/or WiFi (Wireless Fidelity, Wireless Fidelity) network. In some embodiments, the radio frequency circuit 404 may further include a circuit related to NFC (Near Field Communication, short-range wireless communication), which is not limited in this application.
[0195] The display screen 405 is used for displaying UI (User Interface, user interface). The UI can include graphics, text, icons, video, and any combination thereof. When the display screen 405 is a touch display screen, the display screen 405 also has the ability to acquire touch signals on or above the surface of the display screen 405 . The touch signal may be input to the processor 401 as a control signal for processing. At this time, the display screen 405 may also be used to provide virtual buttons and/or virtual keyboards, also referred to as soft buttons and/or soft keyboards. In some embodiments, there may be one display screen 405, which is provided on the front panel of the electronic device 400; in other embodiments, there may be at least two display screens 405, which are respectively provided on different surfaces of the electronic device 400 or in a folded design. ; In still other embodiments, the display screen 405 may be a flexible display screen, disposed on a curved surface or a folding surface of the electronic device 400 . Even, the display screen 405 can also be set as a non-rectangular irregular figure, that is, a special-shaped screen. The display screen 405 can be made of materials such as LCD (Liquid Crystal Display, liquid crystal display), OLED (Organic Light-Emitting Diode, organic light emitting diode).
[0196] The camera assembly 406 is used to capture images or video. Optionally, the camera assembly 406 includes a front camera and a rear camera. Generally, the front camera is arranged on the front panel of the electronic device 400 , and the rear camera is arranged on the back of the electronic device 400 . In some embodiments, there are at least two rear cameras, which are any one of a main camera, a depth-of-field camera, a wide-angle camera, and a telephoto camera, so as to realize the fusion of the main camera and the depth-of-field camera to realize the background blur function, the main camera It is integrated with the wide-angle camera to achieve panoramic shooting and VR (Virtual Reality, virtual reality) shooting functions or other integrated shooting functions. In some embodiments, the camera assembly 406 may also include a flash. The flash can be a single color temperature flash or a dual color temperature flash. Dual color temperature flash refers to the combination of warm light flash and cold light flash, which can be used for light compensation under different color temperatures.
[0197] Audio circuitry 407 may include a microphone and speakers. The microphone is used to collect the sound waves of the user and the environment, convert the sound waves into electrical signals, and input them to the processor 401 for processing, or to the radio frequency circuit 404 to realize voice communication. For the purpose of stereo acquisition or noise reduction, there may be multiple microphones, which are respectively disposed in different parts of the electronic device 400 . The microphone may also be an array microphone or an omnidirectional collection microphone. The speaker is used to convert the electrical signal from the processor 401 or the radio frequency circuit 404 into sound waves. The loudspeaker can be a traditional thin-film loudspeaker or a piezoelectric ceramic loudspeaker. When the speaker is a piezoelectric ceramic speaker, it can not only convert electrical signals into sound waves audible to humans, but also convert electrical signals into sound waves inaudible to humans for distance measurement and other purposes. In some embodiments, audio circuitry 407 may also include a headphone jack.
[0198] The positioning component 408 is used to locate the current geographic location of the electronic device 400 to implement navigation or LBS (Location Based Service). The positioning component 408 may be a positioning component based on the GPS (Global Positioning System, global positioning system) of the United States, the Beidou system of China, or the Galileo system of Russia.
[0199] Power supply 409 is used to power various components in electronic device 400 . The power source 409 may be alternating current, direct current, disposable batteries or rechargeable batteries. When the power source 409 includes a rechargeable battery, the rechargeable battery may be a wired rechargeable battery or a wireless rechargeable battery. Wired rechargeable batteries are batteries that are charged through wired lines, and wireless rechargeable batteries are batteries that are charged through wireless coils. The rechargeable battery can also be used to support fast charging technology.
[0200] In some embodiments, the electronic device 400 also includes one or more sensors 410 . The one or more sensors 410 include, but are not limited to, an acceleration sensor 411 , a gyro sensor 412 , a pressure sensor 413 , a fingerprint sensor 414 , an optical sensor 415 and a proximity sensor 416 .
[0201] The acceleration sensor 411 can detect the magnitude of acceleration on the three coordinate axes of the coordinate system established by the electronic device 400 . For example, the acceleration sensor 411 can be used to detect the components of the gravitational acceleration on the three coordinate axes. The processor 401 may control the touch display screen 405 to display the user interface in a landscape view or a portrait view according to the gravitational acceleration signal collected by the acceleration sensor 411 . The acceleration sensor 411 can also be used for game or user movement data collection.
[0202] The gyroscope sensor 412 can detect the body direction and rotation angle of the electronic device 400 , and the gyroscope sensor 412 can cooperate with the acceleration sensor 411 to collect 3D actions of the user on the electronic device 400 . The processor 401 can implement the following functions according to the data collected by the gyro sensor 412 : motion sensing (such as changing the UI according to the user's tilt operation), image stabilization during shooting, game control, and inertial navigation.
[0203] The pressure sensor 413 may be disposed on the side frame of the electronic device 400 and/or the lower layer of the touch display screen 405 . When the pressure sensor 413 is disposed on the side frame of the electronic device 400 , the user's holding signal of the electronic device 400 can be detected, and the processor 401 can perform left and right hand identification or quick operation according to the holding signal collected by the pressure sensor 413 . When the pressure sensor 413 is disposed on the lower layer of the touch display screen 405 , the processor 401 controls the operability controls on the UI interface according to the user's pressure operation on the touch display screen 405 . The operability controls include at least one of button controls, scroll bar controls, icon controls, and menu controls.
[0204] The fingerprint sensor 414 is used to collect the user's fingerprint, and the processor 401 identifies the user's identity according to the fingerprint collected by the fingerprint sensor 414, or the fingerprint sensor 414 identifies the user's identity according to the collected fingerprint. When the user's identity is identified as a trusted identity, the processor 401 authorizes the user to perform relevant sensitive operations, including unlocking the screen, viewing encrypted information, downloading software, making payments, and changing settings. The fingerprint sensor 414 may be provided on the front, back, or side of the electronic device 400 . When the electronic device 400 is provided with physical buttons or a manufacturer's logo, the fingerprint sensor 414 may be integrated with the physical buttons or the manufacturer's logo.
[0205] Optical sensor 415 is used to collect ambient light intensity. In one embodiment, the processor 401 can control the display brightness of the touch display screen 405 according to the ambient light intensity collected by the optical sensor 415 . Specifically, when the ambient light intensity is high, the display brightness of the touch display screen 405 is increased; when the ambient light intensity is low, the display brightness of the touch display screen 405 is decreased. In another embodiment, the processor 401 may also dynamically adjust the shooting parameters of the camera assembly 406 according to the ambient light intensity collected by the optical sensor 415 .
[0206] Proximity sensor 416 , also referred to as a distance sensor, is typically provided on the front panel of electronic device 400 . Proximity sensor 416 is used to collect the distance between the user and the front of electronic device 400 . In one embodiment, when the proximity sensor 416 detects that the distance between the user and the front of the electronic device 400 gradually decreases, the processor 401 controls the touch display screen 405 to switch from the bright screen state to the off screen state; when the proximity sensor 416 When it is detected that the distance between the user and the front of the electronic device 400 gradually increases, the processor 401 controls the touch display screen 405 to switch from the off-screen state to the bright-screen state.
[0207] Those skilled in the art can understand that, Figure 11 The structures shown in the drawings do not constitute a limitation on the electronic device 400, and may include more or less components than those shown in the drawings, or combine some components, or adopt different component arrangements.
[0208] In the embodiment of the present disclosure, due to the long connection with the server, the data packet corresponding to the alarm file of the server can be received through the long connection, and the processor parses the data packet corresponding to the alarm file to obtain the alarm file, and generates the alarm file. The URL of the alarm file, so that the alarm file is displayed on the display screen according to the URL of the alarm file. In this way, the processor does not need to use the polling method to request the alarm file, and the server can push the alarm file to the electronic device after getting the alarm file, without saving the alarm file, so that the storage resources occupied by the alarm file can be released after the alarm file is pushed, reducing the Occupying the storage resources of the server, it also avoids polling that consumes a lot of resources and bandwidth resources on the server, and improves the real-time nature of pushing alarm files. Since the processor generates the URL of the alarm file, the alarm file can be automatically displayed according to the URL.
[0209] In an exemplary embodiment, the present disclosure further provides a computer-readable storage medium, where code instructions are stored in the storage medium, and the code instructions are executed by a processor to execute the display alarm file display method provided by the above embodiments. method. For example, the non-volatile computer-readable storage medium may be ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, and the like.
[0210] In the embodiment of the present disclosure, since the processor receives the data packet corresponding to the alarm file of the server through the long connection, parses the data packet corresponding to the alarm file to obtain the alarm file, and generates the URL of the alarm file, so that according to the URL of the alarm file Display the alarm file. In this way, the processor does not need to use the polling method to request the alarm file, so that the server can not save the alarm file, so that the storage resources occupied by the alarm file can be released after the alarm file is pushed, reducing the occupation of the server's storage resources, and avoiding Polling leads to a large consumption of server resources and bandwidth resources, and improves the real-time performance of pushing alarm files. Since the processor generates the URL of the alarm file, the alarm file can be automatically displayed according to the URL.
[0211] In an exemplary embodiment, the present disclosure also provides a computer program product, the computer program product comprising a computer program stored in a computer-readable storage medium, and the computer program is loaded by a processor to implement the above implementation The example provides a method to display the alarm file.
[0212] In the embodiment of the present disclosure, since the processor receives the data packet corresponding to the alarm file of the server through the long connection, the processor parses the data packet corresponding to the alarm file to obtain the alarm file, and generates the URL of the alarm file. In this way, according to the alarm file The URL to display the alarm file. In this way, the processor does not need to use the polling method to request the alarm file, so that the server can not save the alarm file, so that the storage resources occupied by the alarm file can be released after the alarm file is pushed, reducing the occupation of the storage resources of the server, and avoiding the Polling leads to a large consumption of server resources and bandwidth resources, which improves the real-time performance of pushing alarm files. Since the processor generates the URL of the alarm file, the alarm file can be automatically displayed according to the URL.
[0213] Other embodiments of the present application will readily occur to those skilled in the art upon consideration of the specification and practice of the application disclosed herein. This application is intended to cover any variations, uses or adaptations of this application that follow the general principles of this application and include common knowledge or conventional techniques in the technical field not disclosed in this application . The specification and examples are to be regarded as exemplary only, with the true scope and spirit of the application being indicated by the following claims.
[0214] It is to be understood that the present application is not limited to the precise structures described above and illustrated in the accompanying drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the application is limited only by the appended claims.
PUM


Description & Claims & Application Information
We can also present the details of the Description, Claims and Application information to help users get a comprehensive understanding of the technical details of the patent, such as background art, summary of invention, brief description of drawings, description of embodiments, and other original content. On the other hand, users can also determine the specific scope of protection of the technology through the list of claims; as well as understand the changes in the life cycle of the technology with the presentation of the patent timeline. Login to view more.
Similar technology patents
Door guard control method and system
Owner:SUZHOU KEDA TECH
Equipment management method and device
Owner:HUAWEI TECH CO LTD
Optical synthetic aperture imaging telescope array co-phase error detection method based on multi-wavelength phase modulation
Owner:INST OF OPTICS & ELECTRONICS - CHINESE ACAD OF SCI
Universal digital dual modulation-demodulation technology in wireless communication
Owner:GUIZHOU AEROSPACE TIANMA ELECTRICAL TECH
River channel water depth monitoring device
Owner:WUXI JUNDA TESTING TECH SERVICES
Classification and recommendation of technical efficacy words
- reduce occupancy
- Improve real-time performance
Method for transmitting data of passive optical network data link layer
Owner:SHANGHAI JIAO TONG UNIV +1
Image processing method and device in GPU vitualization
Owner:HUAWEI TECH CO LTD
Information processing method and device and storage medium
Owner:NETEASE HANGZHOU NETWORK
Self-lifting quick transferring platform
Owner:SHENZHEN TECHEN SCI & TECH CO LTD
System and method for positioning failures of communication network equipment based on alarm information
Owner:CHINA TELECOM CORP LTD
Six-camera around looking-based cylindrical panoramic generation device and method
Owner:NORTHEASTERN UNIV
Visual target identification and tracking method
Owner:SHANGHAI DIANJI UNIV
ROS based service robot and indoor navigation method thereof
Owner:北京海风智能科技有限责任公司
Aerial shooting traffic video frequency vehicle rapid checking method
Owner:BEIHANG UNIV