Image update processing method, device and storage medium

Through long connections with websocket technology, the server automatically updates large-screen images, solving the problem of long-term and slow image update processing in the existing technology, and real-time and efficient image updates are achieved.

CN115766845BActive Publication Date: 2024-08-27CHINA UNITED NETWORK COMM GRP CO LTD +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202211453718.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-21
Publication Date
2024-08-27
Estimated Expiration
2042-11-21

AI Technical Summary

Technical Problem

The existing large-screen visualization technology is time-consuming and slow in image update processing, and requires manual development and update, affecting the efficiency of real-time dynamic changes.

Method used

Using a long connection based on websocket technology, the server monitors the image identification and file content to be changed by the client, automatically processes the image file content changes, and notifies the client to synchronously update through address information to avoid frequent requests and resource usage by the client. .

Benefits of technology

Real-time and efficient updates of large-screen images are realized, which reduces development time and improves update efficiency, and automated processing reduces manual intervention.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115766845B
    Figure CN115766845B
Patent Text Reader

Abstract

The present application provides a method, device and storage medium for image update processing, which monitors and obtains the identifier of the image to be changed from the client, and the file content to be changed corresponding to the identifier of the image to be changed, and determines whether to change the original image file content corresponding to the obtained identifier of the image to be changed according to the file content to be changed. If it is determined to change the original image file content, the original image file content is changed according to the file content to be changed, and the original image file content after the change is compiled and packaged, and the address information corresponding to the file content to be changed is obtained, and the address information is sent to the client, so that the client can obtain the file content to be changed according to the address information, so as to change the original image displayed on the large screen. The present application can automatically change the image, thereby improving the efficiency of image change processing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing, and in particular to a method, device and storage medium for processing image updates. Background Art

[0002] In the era of big data, more and more companies are aware of the importance of data resources. Large-screen data visualization technology has emerged. Using large-screen visualization to display the results of data analysis so that the results of data analysis can be obtained intuitively, which is conducive to companies formulating strategic plans more scientifically and reasonably.

[0003] At present, large-screen visualization technology is implemented in the order of the program development cycle, that is, first the demand analysis is carried out, then the code is written and compiled to the testing stage, etc., until the program is released and then the program is put into use, in order to complete the processing of the image displayed on the visualization large screen. Similarly, when the image displayed on the visualization large screen needs to be updated, it is also necessary to go through the development and processing of the relevant program, which makes the update processing of the image displayed on the visualization large screen time-consuming and inefficient, which makes how to achieve real-time dynamic changes in the image displayed on the visualization large screen a hot topic in this field. Summary of the invention

[0004] The present application provides an image update processing method, device and storage medium to solve the problem of long image update processing cycle and low efficiency.

[0005] In a first aspect, the present application provides a method for processing image update, comprising:

[0006] Listening and obtaining the identifier of the image to be changed from the client, and the file content to be changed corresponding to the identifier of the image to be changed;

[0007] Determining whether to modify the original image file content corresponding to the obtained identifier of the image to be modified according to the file content to be modified;

[0008] If it is determined that the original image file content is to be changed, the original image file content is changed according to the file content to be changed, and the obtained original image file content after the change is compiled and packaged, and address information corresponding to the file content to be changed is obtained;

[0009] The address information is sent to the client, so that the client can obtain the file content to be changed according to the address information, so as to change the original image displayed on the large screen.

[0010] In an optional specific implementation, the determining whether to modify the original image file content corresponding to the obtained identifier of the image to be modified according to the file content to be modified includes:

[0011] In the original image file content corresponding to the identifier of the image to be changed, a module in the original image corresponding to the file content to be changed is determined, and it is determined whether the file content to be changed is the same as the file content in the module.

[0012] In an optional specific implementation, if it is determined to change the content of the original image file, then according to the file content to be changed, changing the content of the original image file includes:

[0013] If it is determined that they are not the same, the module is determined to be an expired module, the expired module is deleted, and a module corresponding to the file content to be modified is added.

[0014] In an optional specific implementation, the method further includes:

[0015] A dependent module that has a dependency relationship with the expired module is obtained, and the content in the dependent module is modified using the file content to be modified.

[0016] In an optional specific implementation, the method further includes:

[0017] Obtaining a heartbeat packet request sent by the client, wherein the heartbeat packet request includes: the client identifier and a timestamp;

[0018] According to the heartbeat packet request, in a cache or database of pre-stored heartbeat packet requests, search for the time of the latest heartbeat packet request corresponding to the client identifier according to a preset time, calculate a first difference between the current search time and the time of the latest heartbeat packet request, and determine whether the first difference is greater than or equal to the first difference threshold;

[0019] If the first difference is greater than or equal to the first difference threshold, it is determined that the client is offline, and a websocket technology is used to re-establish a connection with the client.

[0020] In a second aspect, the present application provides an image update processing device, comprising:

[0021] An acquisition module, used for monitoring and acquiring the identifier of the image to be modified from the client, and the file content to be modified corresponding to the identifier of the image to be modified;

[0022] A processing module, used for determining whether to modify the original image file content corresponding to the obtained identifier of the image to be modified according to the file content to be modified;

[0023] The processing module is further configured to, if it is determined that the original image file content is to be changed, change the original image file content according to the file content to be changed, compile and package the acquired original image file content after the change, and obtain address information corresponding to the file content to be changed;

[0024] The processing module is further used to send the address information to the client, so that the client can obtain the file content to be changed according to the address information, so as to change the original image displayed on the large screen.

[0025] In an optional specific implementation, the processing module is specifically used to:

[0026] In the original image file content corresponding to the identifier of the image to be changed, a module in the original image corresponding to the file content to be changed is determined, and it is determined whether the file content to be changed is the same as the file content in the module.

[0027] In an optional specific implementation manner, the processing module is further configured to:

[0028] If it is determined that they are not the same, the module is determined to be an expired module, the expired module is deleted, and a module corresponding to the file content to be modified is added.

[0029] In an optional specific implementation, the processing module is further used to:

[0030] A dependent module that has a dependency relationship with the expired module is obtained, and the content in the dependent module is modified using the file content to be modified.

[0031] In an optional specific implementation, the processing module is further used to:

[0032] Obtaining a heartbeat packet request sent by the client, wherein the heartbeat packet request includes: the client identifier and a timestamp;

[0033] According to the heartbeat packet request, in a cache or database of pre-stored heartbeat packet requests, search for the time of the latest heartbeat packet request corresponding to the client identifier according to a preset time, calculate a first difference between the current search time and the time of the latest heartbeat packet request, and determine whether the first difference is greater than or equal to the first difference threshold;

[0034] If the first difference is greater than or equal to the first difference threshold, it is determined that the client is offline, and a websocket technology is used to re-establish a connection with the client.

[0035] On the third side, the present application provides a server, including: at least one processor and a memory;

[0036] The memory stores computer-executable instructions;

[0037] The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor performs the method as described in any of the preceding items.

[0038] Fourthly, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions. When a processor executes the computer-executable instructions, the method described in any of the preceding items is implemented.

[0039] The present application provides a method, device and storage medium for processing image updates, which monitors and obtains the identifier of an image to be changed from a client, and the file content to be changed corresponding to the identifier of the image to be changed; determines whether to change the original image file content corresponding to the obtained identifier of the image to be changed according to the file content to be changed; if it is determined to change the original image file content, the original image file content is changed according to the file content to be changed, and the obtained original image file content after the change is compiled and packaged, and the address information corresponding to the file content to be changed is obtained; the address information is sent to the client, so that the client can obtain the file content to be changed according to the address information, so as to change the original image displayed on the large screen.

[0040] Compared with the existing technology, based on websocket technology, when the server changes the image displayed on the visualization screen, it will immediately send the change message to the client that has a long connection with the server; correspondingly, the client responds to the change message sent by the server to make the change. By automating the change of the visualization screen image, it no longer relies on technicians to manually change the visualization screen image, so as to achieve real-time and efficient changes to the image displayed on the visualization screen. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0042] Figure 1 A schematic diagram of a method for image update processing provided by the present application;

[0043] Figure 2 A schematic diagram of another image update processing method provided by the present application;

[0044] Figure 3 A schematic diagram of another image update processing method provided by the present application;

[0045] Figure 4 A schematic diagram of the structure of an image update processing device provided in the present application. DETAILED DESCRIPTION

[0046] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments made by ordinary technicians in this field under the enlightenment of the embodiments belong to the scope of protection of the present application.

[0047] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0048] In the era of big data, more and more companies are aware of the importance of data resources. Large-screen data visualization technology has emerged. Using large-screen visualization to display the results of data analysis so that the results of data analysis can be obtained intuitively, which is conducive to companies formulating strategic plans more scientifically and reasonably.

[0049] At present, the images displayed on the visualization screen are all realized through program development, that is, first the demand analysis is carried out, then the code is written and compiled to the testing stage, until the program is released and then put into use. Such an implementation process takes a long time and is inefficient in updating and adjusting the images displayed on the visualization screen. This makes how to realize real-time dynamic changes in the images displayed on the visualization screen a hot topic in this field.

[0050] Normally, to change the image displayed on the visualization screen, technical personnel are required to develop and update the image displayed on the visualization screen on the server side, and then refresh the client used to display the image on the screen. This processing method is similar to the development process and also requires a long update and development time, which leads to low efficiency in updating the image displayed on the visualization screen.

[0051] In order to improve the efficiency of changing the image displayed on the visualization large screen, the existing technology mainly adopts real-time update technology to solve the problem of slow image change efficiency of the visualization large screen. Since real-time update technologies such as polling and long polling are based on the client sending a "whether to update" request to the server before corresponding processing can be performed, if there is no update, the client may continue to send "whether to update" requests or not receive a response to the request for a long time, resulting in more resources occupied and slow processing efficiency, thereby affecting the processing efficiency of other processes.

[0052] In summary, based on the technical problems mentioned above, the inventive concept of the present application is: how to design a processing method that can update images in real time and efficiently.

[0053] Based on this, the present application adopts the long connection websocket technology which takes up relatively few resources. Without the need for the client to send a "whether to update" request, an "update processing" message can be sent after the update processing occurs on the server. This allows the client and the server to automatically update the image displayed on the visualization screen almost synchronously, thereby improving the efficiency of the update processing of the image on the visualization screen.

[0054] The technical solution of the present application is described in detail below through specific embodiments. It should be noted that the following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.

[0055] Figure 1 A flowchart of an image update processing method provided by this application is shown in FIG. Figure 1 As shown, the processing method comprises:

[0056] Step 101: monitor and obtain the identifier of the image to be modified from the client, and the file content to be modified corresponding to the identifier of the image to be modified.

[0057] In this embodiment, the client and the server associated with the client establish a persistent connection relationship based on the websocket technology. Under this persistent connection relationship, when the client does not send a relevant request to the server, the server can still send a request to the client in real time. Specifically, the server can be a server capable of processing massive data, and the client can be a mobile terminal such as a computer or a tablet.

[0058] In addition, it should be noted that the execution subject in this embodiment may specifically be a server.

[0059] Specifically, the server may periodically monitor whether a file upload event occurs. Optionally, the file upload event may be for relevant technical personnel to upload the image displayed on the visualization screen, that is, the code file related to the original image, to the open source distributed version control system git through the client, and the code file related to the original image specifically refers to a module in the original image, such as the pie chart component in the original image.

[0060] Among them, all the code files corresponding to the original image have their unique identifiers, such as the naming names of the code files. Correspondingly, the above-mentioned related code files also have their corresponding identifiers, that is, the image identifiers to be changed.

[0061] Then, the server will trigger the processing method provided in this embodiment. Specifically, the server obtains the image identifier to be changed in git, and obtains the file content to be changed corresponding to the image identifier to be changed, so as to continue to execute step 102 to update the original image.

[0062] Step 102: Determine whether to modify the original image file content corresponding to the obtained identifier of the image to be modified according to the file content to be modified.

[0063] In this embodiment, in order to ensure the accuracy of the server-side processing, the server needs to obtain the file content of the original image corresponding to the image identifier to be changed, and compare it with the content of the file to be changed to determine whether the contents of the two files are consistent. For example, the server retrieves the content of the two files, such as code, and compares the content of the two files to determine whether there is file content in the original image that is the same as the file content of the file to be changed. In other words, it is to determine whether there is code in all the codes of the original image that is the same as the code of the file to be changed. If it does not exist, the file of the original image corresponding to the image identifier to be changed can be modified using the content of the file to be changed, that is, the file content of the original image corresponding to the obtained identifier of the image to be changed is modified.

[0064] More specifically, the server may perform the change processing according to the following steps 103 to 104.

[0065] Step 103: If it is determined to modify the original image file content, modify the original image file content according to the file content to be modified, compile and package the modified original image file content, and obtain address information corresponding to the file content to be modified.

[0066] In this embodiment, the server replaces the content of the original image file corresponding to the image identifier to be updated with the file content to be changed in git to obtain the original image file content after the change; then, compiles and packages the original image file content after the change.

[0067] Optionally, the server obtains the compilation status corresponding to each image identifier in the original image file after the change processing, that is, the compilation status of each module in the original image after the change processing, and detects whether the compilation status of the module corresponding to the file content to be changed is passed to determine whether the file content to be changed is valid. If it is valid, the processing continues, otherwise, the change processing is not performed. Among them, each module in the original image includes code, and the code in all modules constitutes the original image file content.

[0068] It should be noted that a hook function, i.e., a callback function, is pre-written in the content of the file to be changed. The callback function is pre-written in the content of the file to be changed by the technician, and the hook function is used to feedback the address information of the original image file content after the change processing, such as a hash value; and to retrieve the historical hash value obtained after the last change processing of the image of the visualization large screen, and generate a Js (Java script, programming language) file named with the historical hash value to store the content of the file to be changed used for this change processing; and to store the hash value obtained this time in a file in Json format, which will be used as the hash value for the next change processing.

[0069] Furthermore, when the server determines that the compilation status of the module corresponding to the file content to be changed is passed, it immediately calls the hook function in the file content to be changed and executes the hook function to obtain the hash value of the current change processing, as well as the hash value of the file content to be changed and the hash value of the next change processing.

[0070] Then, the server completes the processing of the file content to be changed, generates a message of the change processing, and based on the websocket long connection technology, sends the generated message of the change processing to the client to realize the automated change processing of the image of the visualization large screen.

[0071] Step 104: Send the address information to the client, so that the client can obtain the file content to be changed according to the address information, so as to change the original image displayed on the large screen.

[0072] In this embodiment, the server sends a change processing message carrying a hash value to the client. Optionally, the address information may specifically be: a hash value after compiling the original image file content after the change processing, and / or a Js file name carrying a historical hash value, and / or a hash value of the next change processing, so that the client can obtain the file content to be changed, thereby allowing the client to perform corresponding automated change processing almost synchronously with the server, so as to achieve efficient change of the original image displayed on the visualization large screen.

[0073] Specifically, after receiving the change processing message sent by the server, the client will send a request to the server with the address information of the file content to be changed, so as to obtain the content of the file to be changed on the server; furthermore, in order to realize the change processing of the original image displayed on the large screen, the client will send a request again. Optionally, the request can be in the form of Jsonp, that is, requesting the server to immediately execute the obtained file content to be changed, so as to realize the change and replacement of the original image displayed on the large screen on the client, such as replacing the line chart in the original image with a bar chart, and the changed original image can be displayed without the user refreshing.

[0074] In this embodiment, by monitoring and obtaining the identifier of the image to be changed from the client, and the file content to be changed corresponding to the identifier of the image to be changed, it is determined whether to change the original image file content corresponding to the obtained identifier of the image to be changed according to the file content to be changed. If it is determined to change the original image file content, the original image file content is changed according to the file content to be changed, and the obtained original image file content after the change is compiled and packaged, and the address information corresponding to the file content to be changed is obtained, and the address information is sent to the client, so that the client can obtain the file content to be changed according to the address information, so as to change the original image displayed on the large screen.

[0075] Compared with the prior art, this application is based on the websocket long connection technology. After the server detects the image identifier to be changed, it obtains the file content to be changed corresponding to the image identifier to be changed, and automatically performs the change processing after determining the file content that can be changed. At the same time, the change processing message carrying the address information is sent to the client with a long connection relationship with the server. The client determines the content to be changed according to the change processing message and performs the corresponding change processing, so that the client can achieve the change processing almost synchronously with the server. The method provided by this application can be used to automatically realize the change processing of the original image displayed on the large screen, thereby improving the efficiency of the change processing of the original image displayed on the large screen.

[0076] Figure 2 The present application provides another image update processing method flow diagram, based on the above embodiment, specifically explains whether the server changes the original image file content corresponding to the identifier of the image to be changed, such as Figure 2 As shown, the processing process is as follows:

[0077] Step 201: In the original image file content corresponding to the identifier of the image to be modified, determine the module in the original image corresponding to the file content to be modified.

[0078] Specifically, each file in the original image file stored in the server, or the different contents in each file corresponds to a module, which can be a component in the original image (statistical chart, map, etc.) or a style of the component (size, color, etc.).

[0079] It can be understood that each module in the original image file has a unique image identifier for distinguishing each module. Optionally, the specific implementation of the image identifier includes but is not limited to: a naming name.

[0080] More specifically, after obtaining the image identifier to be changed, that is, the name of the file to be changed, the server will determine the module corresponding to the file content to be changed in the file content of the original image to be changed.

[0081] Exemplarily, the name of the file to be changed obtained by the server is A, A corresponds to the pie chart statistics module in the original image, and the actual content of the A file is a bar chart statistics module.

[0082] Furthermore, the server needs to continue to execute step 202 to determine whether to perform the change process.

[0083] Step 202, determine whether the content of the file to be changed is the same as the content of the file in the module, if not, execute step 203; if the same, execute step 204.

[0084] Specifically, the server compares the content of the file to be changed with the content of the file in the module. Optionally, the content of the two files can be compared word by word, or the similarity of the content of the two files can be calculated using a similarity algorithm to determine whether the content of the two files is the same. This is essentially to determine whether the content of the file to be changed corresponding to the identified image identifier to be changed is valid, to prevent technicians from making invalid changes due to uploading the wrong version.

[0085] As shown in the example of step 202, by comparing the content of file A with the content in the module, it is determined that the contents of the two files are inconsistent, which proves that the acquired file to be changed is valid, and processing should continue according to step 203.

[0086] Step 203: If it is determined that the module is an expired module, the expired module is deleted, and a module corresponding to the file content to be modified is added.

[0087] When the server determines that the content of the file to be changed is inconsistent with the content of the file in the module, it indicates that the content of the file in the current module will be replaced by the content of the file to be changed.

[0088] Specifically, if the current module is determined to be an expired module, the expired module should be deleted. Optionally, all the contents are extracted from the file to be changed, and the contents in the expired module file are overwritten with the extracted contents, so that when the expired module is deleted, new contents are added to the expired module in the original image corresponding to the image identifier to be changed, that is, the module corresponding to the file to be changed is added.

[0089] As shown in the example above, the pie chart statistics module in the expired module is replaced with a bar chart module. Accordingly, the expired module is deleted from the server, and the module corresponding to the content of file A is added.

[0090] Optionally, the server may also directly delete the expired module and directly store the file to be modified in the file content of the original image corresponding to the image identifier to be modified.

[0091] It should be noted that the specific implementation of step 203 in this embodiment is only an example and is not limiting.

[0092] Step 204: No change is performed.

[0093] Specifically, when the server determines that the file content to be changed is consistent with the file content in the module, it indicates that the file content corresponding to the image identifier to be changed currently monitored has not made any relevant changes to the original image displayed on the large screen, that is, the file content of the original image is consistent. Therefore, no change processing is required, and the server will continue to return to the listening state.

[0094] In this embodiment, in order to prevent the changes made from being invalid, the server needs to compare the file content to be changed with the file content to be changed and the file content in the corresponding module to avoid the technician uploading the wrong file to be changed, thereby improving the processing efficiency of the large-screen image.

[0095] In an optional implementation, after the server processes the expired module, it is also necessary to process the dependent modules that have a dependency relationship with the expired module. Specifically, the dependent modules that have a dependency relationship with the expired module are obtained, and the content in the dependent module is modified using the file content to be modified.

[0096] It should be noted that since there are corresponding logical relationships between the modules corresponding to the file contents in the original image, such as the output of some modules is the input of some modules, or some modules need to reference the content in another module to be implemented, these modules with related logical relationships are mutually dependent modules.

[0097] Specifically, the server obtains the module that has a dependency relationship with the expired module in the module corresponding to the original image file content according to the dependency relationship between the modules. Since the content in the expired module or the name of a parameter in the expired module has changed, the name of the relevant content or parameter in the dependent module needs to be changed accordingly to ensure that the file content of the original image after the change can be compiled and packaged smoothly, so as to quickly complete the change process of the original image.

[0098] More specifically, the server uses the file content to be changed to modify the relevant content in the dependent module, such as replacing it, and deletes the content in the dependent module. For example, if part of the content is replaced, the part is deleted and replaced, that is, the content to be changed is deleted, and then the relevant part of the file content to be changed is added; if all the content is replaced, the dependent module can be deleted.

[0099] It should be noted that the specific implementation process of deleting expired modules or dependent modules in this embodiment should be determined according to actual conditions, and this embodiment does not specifically limit this.

[0100] In this optional embodiment, in order to ensure the accuracy of the modification process of the original image, the specific processing process for the dependent module that has a dependency relationship with the expired module is specifically explained.

[0101] Figure 3 A schematic diagram of another image update processing method provided by the present application is provided. The implementation of the aforementioned embodiments is based on the premise that the client and the server are in a long connection state. This embodiment will specifically explain how to ensure that the client and the server are in a long connection state, thereby improving the processing efficiency of the image update. Figure 3 As shown, the processing method comprises:

[0102] Step 301: Obtain a heartbeat packet request sent by a client, where the heartbeat packet request includes: a client identifier and a timestamp.

[0103] It should be noted that, since the server and the client are connected based on the websocket technology, some servers or clients may consider that maintaining a long connection for a long time will consume resources and will periodically disconnect the connection, or consider that the long connection may be interrupted in an unstable network environment, which will affect the processing efficiency of image updates. In order to prevent this from happening, this embodiment specifically explains the specific processing steps of how to reconnect when the long connection between the server and the client is disconnected.

[0104] Specifically, the server will periodically obtain the heartbeat packet request sent by the client at a preset time interval to determine the current client's online connection status. Considering that in actual scenarios, the server may be connected to multiple clients, in order to distinguish which client sent the heartbeat packet, the heartbeat packet request should include the client's identifier and the timestamp of sending the heartbeat packet request.

[0105] Among them, the above-mentioned heartbeat packet request can specifically be an empty packet including a packet header, which has no substantial request content. It is sent once at fixed intervals like a heartbeat to tell the client to maintain a long connection online. The timestamp in the corresponding heartbeat packet can be understood as the sending time of the heartbeat packet request.

[0106] Step 302: according to the heartbeat packet request, in the cache or database of pre-stored heartbeat packet requests, search for the time of the latest heartbeat packet request corresponding to the client identifier according to the preset time, and calculate the first difference between the current search time and the time of the latest heartbeat packet request.

[0107] Step 303 , determine whether the first difference is greater than or equal to the first difference threshold, if so, execute step 304 ; otherwise, execute step 305 .

[0108] Specifically, the server pre-stores a cache or database of heartbeat packet requests, which is used to record the heartbeat packet requests sent by the client, so as to analyze the situations of each client sending the heartbeat packet request, and determine whether the client is online according to the analysis result.

[0109] More specifically, after the server obtains the heartbeat packet request sent by the client, it searches for the timestamp of the latest heartbeat packet corresponding to the client identifier in the cache or database of pre-stored heartbeat packet requests based on the client identifier in the heartbeat packet request, and calculates the first difference between the current search time and the time corresponding to the timestamp of the latest heartbeat packet, so as to determine whether the current client is online based on the currently obtained first difference and the preset first difference threshold.

[0110] The preset first difference threshold is set by relevant technical personnel and is used as a basis for determining whether the client is online.

[0111] Step 304: determine that the client is offline, and re-establish a connection with the client using the websocket technology.

[0112] Specifically, the server will obtain the first difference and compare it with the preset first difference threshold. If it is greater than or equal to the first difference threshold, it indicates that the current client has not sent a corresponding heartbeat packet request to the server at the preset time interval. This may be because the client connection is offline. In order to ensure the update of the large-screen image, a reconnection process is required. Specifically, the reconnection function in the websocket can be called and executed to establish a long connection relationship with the client.

[0113] Step 305: No disconnection and reconnection processing is performed.

[0114] Specifically, when the server determines that the first difference is less than the first difference threshold, it indicates that the client has sent a heartbeat packet request at a preset time interval, and the client is online, and no reconnection process is required.

[0115] In an optional implementation, the client also needs to determine whether the server is online by the time of the heartbeat packet request responded by the server. Specifically, in order to prevent the client from falling into a state of wireless waiting for the server's response, a time threshold can be preset to prevent the client from falling into wireless waiting. Accordingly, the client needs to determine whether it has received the response information from the server within the preset time. If it has, it indicates that the server is connected online and no reconnection process is required; otherwise, reconnection process is required, and the processing steps are the same as above.

[0116] In this embodiment, in order to ensure the processing efficiency of large-screen image updates, the server and the client need to bidirectionally detect whether they are in a long connection state to prevent connection interruption due to network failure or resource occupation, further ensuring that the server and the client are in a long connection state, thereby obtaining a technical basis for executing the large-screen image update processing method.

[0117] Corresponding to the image update processing method provided by this application, Figure 4 This is a schematic diagram of an image update processing device structure provided by the present application. For the convenience of explanation, only the structure related to the present application is shown in this embodiment. Figure 4 As shown, the processing device 40 includes: an acquisition module 401 and a processing module 402.

[0118] Among them, the acquisition module 401 is used to monitor and obtain the identifier of the image to be changed from the client, and the file content to be changed corresponding to the identifier of the image to be changed; the processing module 402 is used to determine whether to change the original image file content corresponding to the obtained identifier of the image to be changed according to the file content to be changed; the processing module 402 is also used to change the original image file content according to the file content to be changed if it is determined that the original image file content is to be changed, and compile and package the obtained original image file content after the change, and obtain the address information corresponding to the file content to be changed; the processing module 402 is also used to send the address information to the client, so that the client can obtain the file content to be changed according to the address information, so as to change the original image displayed on the large screen.

[0119] Optionally, the processing module 402 is specifically configured to:

[0120] In the original image file content corresponding to the identifier of the image to be changed, a module in the original image corresponding to the file content to be changed is determined, and it is determined whether the file content to be changed is the same as the file content in the module.

[0121] Optionally, the processing module 402 is further configured to:

[0122] If it is determined that they are not the same, the module is determined to be an expired module, the expired module is deleted, and a module corresponding to the file content to be changed is added.

[0123] Optionally, the processing module 402 is further configured to:

[0124] Obtain the dependent module that has a dependency relationship with the expired module, and use the file content to be changed to modify the content in the dependent module.

[0125] Optionally, the processing module 402 is further configured to:

[0126] Get the heartbeat packet request sent by the client, which includes: client identifier and timestamp;

[0127] According to the heartbeat packet request, in the cache or database of pre-stored heartbeat packet requests, search the time of the latest heartbeat packet request corresponding to the client identifier according to the preset time, calculate the first difference between the current search time and the time of the latest heartbeat packet request, and determine whether the first difference is greater than or equal to the first difference threshold;

[0128] If the first difference is greater than or equal to the first difference threshold, it is determined that the client is offline, and the websocket technology is used to re-establish a connection with the client.

[0129] The processing device provided in the embodiment of the present application can execute the technical solution shown in the above method implementation. Its implementation principle and beneficial effects are similar and will not be repeated here.

[0130] In this embodiment, a processing device for image update is provided. The acquisition module is used to monitor and acquire the identifier of the image to be changed from the client, and the file content to be changed corresponding to the identifier of the image to be changed; the processing module is used to determine whether to change the original image file content corresponding to the obtained identifier of the image to be changed according to the file content to be changed; the processing module is also used to change the original image file content according to the file content to be changed if it is determined that the original image file content is to be changed, and compile and package the original image file content after the change, and acquire the address information corresponding to the file content to be changed; the processing module is also used to send the address information to the client, so that the client can acquire the file content to be changed according to the address information, so as to change the original image displayed on the large screen.

[0131] Compared with the prior art, this application is based on the websocket long connection technology. After the server detects the image identifier to be changed, it obtains the file content to be changed corresponding to the image identifier to be changed, and automatically performs the change processing after determining that the change processing can be performed. At the same time, the change processing message carrying the address information is sent to the client with a long connection relationship. The client determines the content to be changed according to the change processing message and performs the corresponding change processing to achieve the change processing almost synchronized with the server. Using the method provided by this application, the image displayed on the large screen is automatically changed and processed almost synchronously with the server and the client, thereby improving the efficiency of the change processing of the image displayed on the large screen.

[0132] In an optional embodiment, this embodiment also provides a server, including: at least one processor and a memory; wherein the memory stores computer-executable instructions; at least one processor executes the computer-executable instructions stored in the memory, so that at least one processor executes the method provided in any of the previous embodiments.

[0133] In an optional embodiment, this embodiment further provides a computer program product, including a computer program, which is used to implement the technical solution provided by any of the above method embodiments when the computer program is executed by a processor.

[0134] In an optional embodiment, this embodiment further provides a computer-readable storage medium, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, the method provided in any of the previous embodiments is implemented.

[0135] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A method for processing image update, characterized in that: include: Listening and obtaining the identifier of the image to be changed from the client, and the file content to be changed corresponding to the identifier of the image to be changed; Determining whether to modify the original image file content corresponding to the obtained identifier of the image to be modified according to the file content to be modified; If it is determined that the original image file content is to be changed, the original image file content is changed according to the file content to be changed, and the obtained original image file content after the change is compiled and packaged, and address information corresponding to the file content to be changed is obtained; Sending the address information to the client, so that the client can obtain the file content to be changed according to the address information, so as to change the original image displayed on the large screen; The monitoring and obtaining the identifier of the image to be changed of the client, and the file content to be changed corresponding to the identifier of the image to be changed, includes: Based on websocket technology, establish a long connection relationship with the client; Monitor whether a file upload event occurs, where the file upload event is uploading a code file related to the original image to the open source distributed version control system git; Obtaining in the git an identifier corresponding to a code file related to the original image and a file content to be changed corresponding to the identifier, wherein the identifier of the image to be changed is an identifier corresponding to the code file related to the original image; The step of changing the content of the original image file according to the content of the file to be changed includes: In the git, the content of the original image file corresponding to the image identifier to be changed is replaced with the file content to be changed, so as to obtain the original image file content after the change processing.

2. The method according to claim 1, characterized in that The determining, according to the file content to be changed, whether to modify the original image file content corresponding to the obtained identifier of the image to be changed includes: In the original image file content corresponding to the identifier of the image to be changed, a module in the original image corresponding to the file content to be changed is determined, and it is determined whether the file content to be changed is the same as the file content in the module.

3. The method according to claim 2, characterized in that If it is determined that the original image file content is to be changed, then the original image file content is changed according to the file content to be changed, including: If it is determined that they are not the same, the module is determined to be an expired module, the expired module is deleted, and a module corresponding to the file content to be modified is added.

4. The method according to claim 3, characterized in that Also includes: A dependent module that has a dependency relationship with the expired module is obtained, and the content in the dependent module is modified using the file content to be modified.

5. The method according to any one of claims 1 to 4, characterized in that: Also includes: Obtaining a heartbeat packet request sent by the client, wherein the heartbeat packet request includes: the client identifier and a timestamp; According to the heartbeat packet request, in a cache or database of pre-stored heartbeat packet requests, search for the time of the latest heartbeat packet request corresponding to the client identifier according to a preset time, calculate a first difference between the current search time and the time of the latest heartbeat packet request, and determine whether the first difference is greater than or equal to the first difference threshold; If the first difference is greater than or equal to the first difference threshold, it is determined that the client is offline, and a websocket technology is used to re-establish a connection with the client.

6. A processing device for image update, characterized in that: include: An acquisition module, used for monitoring and acquiring the identifier of the image to be modified from the client, and the file content to be modified corresponding to the identifier of the image to be modified; A processing module, used for determining whether to modify the original image file content corresponding to the obtained identifier of the image to be modified according to the file content to be modified; The processing module is further configured to, if it is determined that the original image file content is to be changed, change the original image file content according to the file content to be changed, compile and package the acquired original image file content after the change, and obtain address information corresponding to the file content to be changed; The processing module is further used to send the address information to the client, so that the client can obtain the file content to be changed according to the address information, so as to change the original image displayed on the large screen; The acquisition module is specifically used to establish a long connection relationship with the client based on the websocket technology, and monitor whether a file upload event occurs. The file upload event is uploading a code file related to the original image to the open source distributed version control system git, and obtaining an identifier corresponding to the code file related to the original image and a file content to be changed corresponding to the identifier in the git, and the identifier of the image to be changed is the identifier corresponding to the code file related to the original image; The processing module is specifically used to replace the content of the original image file corresponding to the image identifier to be changed with the file content to be changed in the git, so as to obtain the original image file content after the change processing.

7. The device according to claim 6, characterized in that The processing module is specifically used for: In the original image file content corresponding to the identifier of the image to be changed, a module in the original image corresponding to the file content to be changed is determined, and it is determined whether the file content to be changed is the same as the file content in the module.

8. The device according to claim 7, characterized in that The processing module is further specifically used for: If it is determined that they are not the same, the module is determined to be an expired module, the expired module is deleted, and a module corresponding to the file content to be modified is added.

9. The device according to claim 8, characterized in that The processing module is further used for: A dependent module that has a dependency relationship with the expired module is obtained, and the content in the dependent module is modified using the file content to be modified.

10. The device according to any one of claims 6 to 9, characterized in that: The processing module is further used for: Obtaining a heartbeat packet request sent by the client, wherein the heartbeat packet request includes: the client identifier and a timestamp; According to the heartbeat packet request, in a cache or database of pre-stored heartbeat packet requests, search for the time of the latest heartbeat packet request corresponding to the client identifier according to a preset time, calculate a first difference between the current search time and the time of the latest heartbeat packet request, and determine whether the first difference is greater than or equal to the first difference threshold; If the first difference is greater than or equal to the first difference threshold, it is determined that the client is offline, and a websocket technology is used to re-establish a connection with the client.

11. A server, characterized in that: include: at least one processor and memory; The memory stores computer-executable instructions; The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor performs the method according to any one of claims 1 to 5.

12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and when the processor executes the computer-executable instructions, the method according to any one of claims 1 to 5 is implemented.