Management method of screenshot task, electronic equipment and computer readable storage medium
By introducing a front-end business platform and a back-end processing platform into the service platform to manage capture tasks and obtain image data of device clusters, the problem of low credibility of captures in the existing technology is solved, and the authenticity of the capture results is achieved. sex and credibility.
Patent Information
- Application Number
- CN202411346260.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-25
- Publication Date
- 2025-01-24
AI Technical Summary
The management method of image capture task in the prior art has the problem of low credibility in image capture. The client may obtain the message of image capture success but does not actually obtain image data.
By introducing the front -end business platform and the back -end processing platform in the service platform, obtain the client's grasp request, generate the grabbing task and send it to the equipment cluster, obtain the picture data processed by the equipment cluster, generate the results of the grabbing results, return to it simultaneously Client.
The credibility of the grabbing task is improved, and the event event event events reflect the real grabbing situation, and avoid the possibility of inconsistent results that the results are not consistent with the actual situation when the drawing is abnormal.
Smart Images

Figure CN119359516A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of picture capturing technology, and in particular to a picture capturing task management method, an electronic device, and a computer-readable storage medium. Background Art
[0002] As the latest implementation and delivery model of IoT applications, the IoT cloud platform can connect the information perceived and instructions received by sensor devices in traditional IoT to the Internet, truly realize networking, and achieve massive data storage and computing through cloud computing and cloud storage technologies.
[0003] In the prior art, the current real-time video image screen is captured by an IoT video device to generate a screen image, and the image is stored so that the image can be downloaded for reference when needed. However, after the capture task is completed, sometimes a message is obtained from the client that the image capture is successful, but in reality the client does not really obtain the real image data. In other words, the existing capture task management method has the problem of low capture credibility. Summary of the invention
[0004] The main technical problem solved by the present application is to provide a management method for picture capturing tasks, an electronic device and a computer-readable storage medium, which can improve the credibility of picture capturing tasks.
[0005] To solve the above-mentioned technical problems, the first aspect of the present application provides a management method for screenshot tasks, which is applied to a service platform, wherein the service platform is connected to a client and a device cluster, and the service platform includes a front-end business platform and a back-end processing platform. The method includes: using the front-end business platform to obtain the screenshot request sent by the client, generating the screenshot task according to the screenshot request and sending it to the back-end processing platform; using the back-end processing platform to send the screenshot task to the device cluster; using the back-end processing platform to obtain the image data of the screenshot task processed by the device cluster, and generating the screenshot result event corresponding to the image data, and sending the screenshot result event to the front-end business platform; using the front-end business platform to send the screenshot result event to the client.
[0006] In order to solve the above technical problem, the second aspect of the present application provides an electronic device, which includes: a memory and a processor, wherein the memory stores program data, and the processor calls the program data to execute the method described in the first aspect.
[0007] In order to solve the above technical problem, the third aspect of the present application provides a computer-readable storage medium on which program data is stored. When the program data is executed by a processor, the method described in the first aspect is implemented.
[0008] Different from the prior art, the present application utilizes the front-end business platform to obtain the client's screenshot request, generates the corresponding screenshot task and then sends it to the back-end processing platform, and then uses the back-end processing platform to send the screenshot task to the device cluster. After the target device in the device cluster completes the screenshot task, it obtains the image data of the corresponding screenshot task, generates the corresponding screenshot result event, sends the screenshot result event to the front-end business platform, and finally uses the front-end business platform to send the screenshot result event to the client. It can be seen that the screenshot result event is generated based on the image data. If the image data is empty, the screenshot result is a screenshot failure. If the image data is not empty, the screenshot result is a screenshot success. The present application is executed through synchronous signaling, that is, after sending the screenshot request, the screenshot task must be completed on the device. The screenshot result will be returned only after the request is sent. The screenshot result is generated by the image data. Therefore, the credibility of the screenshot result event is improved, and the screenshot result will not be inconsistent with the actual screenshot. However, in order to ensure the response speed, the prior art usually adopts an asynchronous execution method, that is, after the screenshot request is issued, the device immediately returns the screenshot result, but the actual screenshot task is not completed. Although the response speed is accelerated, once an abnormal screenshot situation occurs, the returned screenshot result will be inconsistent with the actual situation. At the same time, this will also cause misunderstandings on the client. In the solution of the present application, the screenshot result event is obtained according to the actual screenshot situation, reflecting the real screenshot result. Therefore, the possibility of inconsistency with the actual situation when the screenshot is abnormal is avoided, thereby ensuring the credibility and real-time performance of the device screenshot. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. Among them:
[0010] Figure 1 It is a flowchart of an implementation method of the management method of the screenshot task of this application;
[0011] Figure 2 yes Figure 1 A schematic diagram of an implementation of a system architecture corresponding to the management method;
[0012] Figure 3 yes Figure 1 A timing diagram of an implementation method corresponding to the management method;
[0013] Figure 4 yes Figure 1 A schematic diagram of a flow chart of an implementation method after step S200;
[0014] Figure 5 yes Figure 1 A schematic flow chart of an implementation method of step S300;
[0015] Figure 6 yes Figure 5 A schematic diagram of a flow chart of an implementation method after step S310;
[0016] Figure 7 yes Figure 6 A timing diagram of an implementation method corresponding to the management method;
[0017] Figure 8 It is a flowchart of another implementation method of the management method of the screenshot task of the present application;
[0018] Fig. 9 yes Figure 8 A timing diagram of an implementation method corresponding to the management method;
[0019] Fig.10 yes Figure 8 A schematic flow chart of an implementation method of step S500;
[0020] Fig.11 yes Figure 1 A schematic flow chart of an implementation method of step S100;
[0021] Fig.12 yes Fig.11 A timing diagram of an implementation method corresponding to the management method;
[0022] Fig.13 yes Fig.11 A schematic flow chart of an implementation method of step S120;
[0023] Fig.14 This is a flowchart of another implementation method of the method for managing the screenshot task of this application;
[0024] Fig.15 It is a structural schematic diagram of an implementation method of the management device of the present application;
[0025] Fig.16 It is a structural schematic diagram of an embodiment of the electronic device of the present application;
[0026] Fig.17 It is a structural schematic diagram of an implementation method of a computer-readable storage medium of the present application. DETAILED DESCRIPTION
[0027] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments, and different implementation methods can be adaptively combined. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0028] The terms "system" and "network" are often used interchangeably in this article. The term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship. In addition, "many" in this article means two or more than two.
[0029] See also Figure 1 and Figure 2 In a first aspect, the present application provides a method for managing a capture task. The method is applied to a service platform. The service platform is connected to a client and a device cluster. The service platform includes a front-end business platform and a back-end processing platform. The method of the present application includes:
[0030] S100: Utilize the front-end service platform to obtain the image capture request sent by the client, generate an image capture task according to the image capture request, and send it to the back-end processing platform.
[0031] Specifically, the client is directly connected to the front-end business platform, that is, the front-end business platform is directly facing the client, can receive the client's request, and generate corresponding tasks according to the corresponding request. The front-end business platform is connected to the back-end processing platform downstream, and the front-end business platform will send the generated tasks to the back-end processing platform. In this step, the front-end business platform is used to obtain the screenshot request sent by the client, where the screenshot request can be a screenshot request manually sent by the user object on the client, or it can be an automatically generated screenshot request. The front-end business platform generates a screenshot task according to the screenshot request, and then sends the screenshot task to the back-end processing platform.
[0032] In one embodiment, the front-end business platform includes SaaS (Software as a Service), which is a service model that provides software applications through the Internet. A third party provides hosting for the application, which is usually accessed through the Internet. The SaaS model eliminates the need for users to install and maintain software locally, and instead transfers these responsibilities to a third party. Under the SaaS model, users no longer need to purchase and maintain the entire infrastructure of the software, but instead obtain access to cloud software through a subscription. The SaaS provider is responsible for the deployment, maintenance, and security of the software, and users can easily access and use the software through a web browser or a dedicated application.
[0033] In one embodiment, the backend processing platform includes PaaS (Platform as a Service), which is an important part of cloud computing and provides computing platform and solution services. In the typical hierarchy of cloud computing, the PaaS layer is between software as a service and infrastructure as a service. PaaS provides users with the ability to deploy and create cloud infrastructure to clients, or to obtain access to programming languages, libraries, and services. Users do not need to manage and control cloud infrastructure (including networks, servers, operating systems, or storage), but need to control the upper-level application deployment and application hosting environment.
[0034] It is understandable that when the front-end business platform is SaaS and the back-end processing platform is PaaS, the user object only needs to operate on the client side, and only needs to operate through a web browser or a dedicated application. The user object does not need to maintain software and cloud infrastructure, making it easier and faster to capture images using the object.
[0035] In one embodiment, in combination Figure 2 and Figure 3 The client sends a screenshot request, which is forwarded by the gateway service to the device signaling service of the front-end business platform. The device signaling service can send the corresponding task signaling to the back-end processing platform according to the request. In this solution, the device signaling service is equivalent to the device screenshot service. The device screenshot service sends the device screenshot task to the device access service in the back-end processing platform. The signaling sent includes the unique identifier of the screenshot task, the device identifier, and the image transfer service address.
[0036] S200: Send the image capture task to the device cluster using the backend processing platform.
[0037] Specifically, the downstream of the backend processing platform is connected to the device cluster, which includes multiple video devices connected to the Internet of Things. The video devices can be installed in different locations. The devices have unique device identifiers, so the screenshot tasks can be accurately sent to the target devices in the device cluster based on the device identifiers, where the target device refers to the device specified by the screenshot task.
[0038] In one embodiment, after receiving the capture task from the front-end business platform, the device access service of the back-end processing platform uses the back-end processing platform to send the capture task and the image storage path to the target device in the device cluster according to the device identifier associated with the capture task.
[0039] S300: Using the backend processing platform to obtain the image data of the device cluster processing the image capture task, and generating an image capture result event corresponding to the image data, and sending the image capture result event to the frontend business platform.
[0040] Specifically, after step S200, the target device in the device cluster will capture the image according to the capture task and obtain the image data, and will send a request to report the image data to the back-end processing platform. At this time, the back-end processing platform can obtain the image data of the device cluster processing the capture task, and generate the corresponding capture result event according to the image data. The capture result event includes the capture result and the image download address. The capture result includes capture success and capture failure. The back-end processing platform then sends the capture result event to the front-end business platform.
[0041] S400: Using the front-end business platform to send the capture result event to the client.
[0042] Specifically, the capture result event is pushed to the client through the front-end service platform, and the client can directly obtain the capture result of the target device in the device cluster.
[0043] In one implementation, the event access service of the front-end business platform is used to push the screenshot result event to the client.
[0044] Different from the prior art, the present application utilizes the front-end business platform to obtain the client's screenshot request, generates the corresponding screenshot task and then sends it to the back-end processing platform, and then uses the back-end processing platform to send the screenshot task to the device cluster. After the target device in the device cluster completes the screenshot task, it obtains the image data of the corresponding screenshot task, generates the corresponding screenshot result event, sends the screenshot result event to the front-end business platform, and finally uses the front-end business platform to send the screenshot result event to the client. It can be seen that the screenshot result event is generated based on the image data. If the image data is empty, the screenshot result is a screenshot failure. If the image data is not empty, the screenshot result is a screenshot success. The present application is executed through synchronous signaling, that is, after sending the screenshot request, the screenshot task must be completed on the device. The screenshot result will be returned only after the request is sent. The screenshot result is generated by the image data. Therefore, the credibility of the screenshot result event is improved, and the screenshot result will not be inconsistent with the actual screenshot. However, in order to ensure the response speed, the prior art usually adopts an asynchronous execution method, that is, after the screenshot request is issued, the device immediately returns the screenshot result, but the actual screenshot task is not completed. Although the response speed is accelerated, once an abnormal screenshot situation occurs, the returned screenshot result will be inconsistent with the actual situation. At the same time, this will also cause misunderstandings on the client. In the solution of the present application, the screenshot result event is obtained according to the actual screenshot situation, reflecting the real screenshot result. Therefore, the possibility of inconsistency with the actual situation when the screenshot is abnormal is avoided, thereby ensuring the credibility and real-time performance of the device screenshot.
[0045] See also Figure 3 and Figure 4 , after the above step S200, including:
[0046] S201: Utilize the backend processing platform to obtain the response signaling of the device cluster receiving the picture capturing task, and send the response signaling of the picture capturing task to the frontend service platform.
[0047] Specifically, after the target device in the device cluster receives the screenshot task sent by the backend processing platform, it will return a response signaling of the screenshot task before the target device starts the screenshot task. The response signaling includes information that the target device has obtained the screenshot task. The backend processing platform is used to obtain the response signaling, and the response signaling is sent to the front-end service platform to inform the front-end service platform that the target device in the device cluster has obtained the screenshot task.
[0048] In one implementation, the device access service is used to obtain a response signaling of the device capture task, and then the device access service is used to send the response signaling to the device capture service.
[0049] S202: Utilize the front-end service platform to obtain the response signaling of the screenshot task, and update the status of the screenshot task.
[0050] Specifically, the front-end business platform is used to obtain the response signaling of the device cluster screenshot task, and the status of the screenshot task is updated at the same time. The status of the screenshot task is updated to ready for screenshot and cached. It can be understood that by returning the response signaling of the screenshot task in time after the target device obtains the screenshot task, the user object can be notified that the screenshot task is ready, so that the user object can better grasp the progress of the screenshot task.
[0051] In one implementation, the device capture service is used to obtain the response signaling of the device cluster capture task, and the status of the capture task is updated at the same time, and the status is updated and cached to the storage node.
[0052] For further information, see Figure 3 and Figure 5 The above step S300 includes:
[0053] S310: Using the backend processing platform, the image data of the device cluster processing the image capture task is obtained, and the image data is stored.
[0054] Specifically, after the target device in the device cluster completes the picture capture, the target device in the device cluster reports the image data, and the image data of the target device in the device cluster processing the picture capture task is obtained through the back-end processing platform, and then the image data is stored for easy download using object calls, wherein the storage method can be local storage or cloud storage.
[0055] In one embodiment, the image transfer service of the backend processing platform is used to obtain image data of the target device in the device cluster for processing the capture task. After the image transfer service successfully obtains the image data, the file is transferred to the cloud. The cloud storage node can be a self-built cloud space or a third-party cloud storage node, and a corresponding image download link is generated. At the same time, the storage success is returned to the target device, and a capture result event is sent to the message service of the backend processing platform. After receiving the capture result event, the message service of the backend processing platform reports the capture result event to the event access service of the front-end business platform.
[0056] In one implementation, the message service can be self-built or can use third-party open source software such as Kafka, Rocketmq, and Rabbitmq.
[0057] S320: Generate a capture result event corresponding to the image data using the backend processing platform, and further send the capture result event to the frontend business platform.
[0058] Specifically, after the backend processing platform stores the image data, it is necessary to generate a corresponding capture result event, which is used to indicate the capture result, and further send the capture result to the frontend business platform.
[0059] In one embodiment, if the target device fails to capture a picture and the reported image data is empty or not reported, the backend processing platform generates a corresponding capture result event indicating the capture failure, and the backend processing platform then sends the capture result event indicating the capture failure to the frontend business platform.
[0060] In one embodiment, after the device captures the image successfully and reports the image data, the backend processing platform generates a corresponding capture result event indicating that the capture is successful, and the backend processing platform then sends the capture result event indicating that the capture is successful to the frontend business platform.
[0061] S330: Utilize the front-end business platform to update the status of the capture task according to the capture result event.
[0062] Specifically, after the front-end business platform obtains the screenshot result event sent by the back-end processing platform, the front-end business platform is used to update the status of the screenshot task and update it to the storage node through the formation of cache. The advantage of this is that it allows the user to grasp the progress of the screenshot task in real time.
[0063] See also Figure 6 and Figure 7 The above step S310 includes:
[0064] S311: Using the backend processing platform, the image data of the device cluster for processing the image capture task is obtained.
[0065] In one embodiment, after taking a local picture capture, the device first stores the picture data locally in a local storage card, then sends a picture data reporting event to the picture transfer service of the backend processing platform, and starts reporting the picture data after establishing a connection with the picture transfer service.
[0066] S312: Utilize the backend processing platform to store the image data in the cloud storage node, and generate basic information corresponding to the image data.
[0067] Specifically, after acquiring the image data, the image transfer service in the backend processing platform is used to store the image data in a cloud storage node. The number of cloud storage nodes can be multiple, and the manufacturer type can also be multiple. At the same time, the image transfer service will also generate basic information corresponding to the image data. The basic information needs to store information that uniquely identifies the image and its associated capture device, etc. The basic information includes file identification, file name, file size, file storage relative address, file storage duration, file storage manufacturer, file to which the object identifier is assigned, etc. It can be understood that the cloud storage method improves the security and reliability of device capture data, solves the problem of data loss caused by local device failure, and because the cloud storage space is easy to expand in capacity, the storage period can be longer than the local storage of the device, and there is no need to worry about data loss and overwriting due to insufficient capacity.
[0068] In one implementation, after the image data is stored in the cloud storage node, a storage success signal is obtained using the image transfer service to confirm that the image data is successfully stored in the cloud storage node.
[0069] In one implementation, the basic information corresponding to the image data is sent to a data storage service for storage using an image transfer service.
[0070] In one implementation, after the image transfer service obtains the storage success signaling, the image transfer service is used to send a response signaling to the target device in the device cluster to inform the target device that the cloud storage of the image data is completed.
[0071] S313: Generate a download link for the image data based on the basic information using the backend processing platform.
[0072] Specifically, the download link includes query parameters of basic information of the image data, and the basic information is used for subsequent verification by the user when downloading the image. Optionally, the download link may not include information of the cloud vendor, so that the user cannot perceive the cloud vendor information of the image data storage through the download link.
[0073] In one embodiment, see Figure 7 , the image data in the cloud storage node is recycled regularly. You can set a regular recycling strategy in the cloud storage node to recycle the image data at a certain time interval, which can reduce the memory occupied by historical image data.
[0074] Of course, in some other implementations, a fixed-capacity recycling strategy can also be set in the cloud storage node. When the image data reaches a certain storage capacity, the old image data is overwritten with new image data. This can also prevent the image data from filling up the cloud storage capacity.
[0075] See also Figure 8and Fig. 9 , the method of the present application also includes:
[0076] S500: Utilizing the front-end service platform to obtain a download request for picture data from a client, wherein the download request for picture data includes a download link for the picture data.
[0077] Specifically, the client can send a capture request to the front-end business platform. After the device completes the capture task, it generates a download link corresponding to the stored image data. Then the client can send a picture download request to the front-end business platform and use the front-end business platform to obtain the client's picture data download request.
[0078] S600: Using the front-end business platform to obtain the image data in the cloud storage node according to the download link of the image data.
[0079] Specifically, after the image data stored in the cloud storage node is stored, a download link will be generated. The download link and the image data have a one-to-one mapping relationship. Therefore, the corresponding image data can be directly obtained according to the download link.
[0080] S700: Use the front-end service platform to send the image data to the client.
[0081] Specifically, after the front-end service platform obtains the image data according to the download link, it is necessary to continue to send the image data to the client through the front-end service platform, thereby completing the entire process of downloading the image data.
[0082] In one embodiment, see Fig. 9 and Fig.10 The above step S500 includes:
[0083] S510: Utilize the front-end business platform to parse the download link of the image data through the image proxy service to obtain a first parameter.
[0084] Specifically, the image proxy service has the functions of access control and resource limitation, which can effectively control the download behavior of the user and improve the security of image downloading. The image proxy service also maps the real address of the captured image, shields the platform image storage strategy and storage plan from the outside, and effectively improves the security of image storage. Therefore, the image proxy service can prevent asset losses caused by external malicious attacks. The first parameter is obtained through the analysis of the image proxy service, and the first parameter can be used to query the basic information of the image data.
[0085] S520: Using the front-end business platform to obtain basic information of the image data according to the first parameter through the image proxy service.
[0086] Specifically, the data storage service stores basic information of the image data, and the first parameter can be directly used to query the basic information of the image data in the data storage service.
[0087] S530: Using the front-end business platform and the image proxy service to verify whether the download link of the image data and the basic information of the image data are normal.
[0088] Specifically, after obtaining the basic information of the image data through the first parameter, the front-end business platform verifies whether the basic information of the image data is expired or exists through the image proxy service, and whether the image is expired or exists, and determines whether to download the image data through verification.
[0089] S540: If the verification result is normal, the image data in the cloud storage node is obtained using the front-end business platform.
[0090] Specifically, if the verification result is normal, that is, the basic information of the image data is valid and the image exists, then the front-end business platform is used to obtain the image data in the cloud storage node based on the download link, and the cloud storage node returns the image data based on the download link. It should be noted that the cloud storage node is not limited to the manufacturer type. Therefore, the differences between different manufacturer types can be shielded through the image proxy service, and when downloading different image data, seamless switching of third-party cloud manufacturers can be achieved.
[0091] S550: Otherwise, the verification result is sent to the client using the front-end service platform.
[0092] Specifically, if the verification result is abnormal, that is, the basic information of the image data is invalid or does not exist, and the image is invalid or does not exist, the image cannot be downloaded through the download link. It is necessary to use the front-end business platform to send the verification result to the client to inform the client of the result that the image verification failed.
[0093] Of course, in some other implementations, the device signaling service of the front-end service platform can also be used to directly download the image data of the cloud storage node through the download link of the image data, bypassing the image proxy service.
[0094] See also Fig.11 and Fig.12 The above step S100 further includes:
[0095] S110: Utilize the front-end service platform to obtain the status of the picture capture task, and determine whether the status of the picture capture task is a terminal status, wherein the terminal status at least includes picture capture success, picture capture failure, or picture capture timeout.
[0096] Specifically, the terminal state of the screenshot task means that the task has been completed or cannot be completed further. The completed terminal state is a successful screenshot, and the terminal state that cannot be completed further is a failed screenshot or a screenshot timeout. On the contrary, the unterminated state of the screenshot task means that the task can continue to be executed. The subsequent execution steps are selected based on whether the screenshot task is in a terminal state.
[0097] S120: If the status of the screenshot task is a terminal status, the status of the screenshot task is sent to the client by using the front-end service platform.
[0098] Specifically, when the status of the screenshot task is a terminal state, the front-end business platform is used to directly return the status of the screenshot task to the client. The status and results of different status tasks can be returned according to the specific terminal states. For example, if the screenshot fails, the screenshot task failure is returned; if the screenshot is successful, the screenshot success is returned, and the download link of the picture is returned to the client; if the screenshot times out, the screenshot failure is returned.
[0099] S130: Otherwise, the front-end service platform is used to continue to execute the step of obtaining the status of the picture capturing task by using the front-end service platform and determining whether the status of the picture capturing task is a terminal state.
[0100] Specifically, when the state of the picture-grabbing task is an unfinished state, it means that the picture-grabbing task is not finished, and the query can be performed continuously in a loop.
[0101] In one embodiment, see Fig.12 After the client sends a capture request to the front-end business platform, the device capture service will initialize the capture task status in the cache service. At the same time, the device capture service executes a delayed task. The delayed task is started a certain time after the device capture service sends the device capture signaling, for example, 2s, 5s or 10s, etc., so as to avoid frequent queries. At the same time, the delayed task adopts a cyclic query method, and the time interval of the cycle can be the above-mentioned delay time. The delayed task includes the unique identifier of the capture task, the task number and the client's connection handle. The initial value of the task number is 1, and the execution number of step S110 does not exceed the preset number.
[0102] Specifically, when the screenshot task is in an unterminated state, the delay task is executed in a loop to query and determine whether the screenshot task is in a terminated state. The time of the loop execution is controlled by setting a preset number of times to avoid the screenshot task being in a state of repeated query. For the delay task, the initial value of the task number is 1, and it increases by 1 each time the query is cyclically queried. When the task number is greater than the preset number of times, the screenshot task execution is terminated. At this time, the state of the screenshot task is in a terminated state. Of course, if the execution is completed within the preset number of times, the state of the screenshot task is also in a terminated state. At this time, it is necessary to return the result of the screenshot task according to different specific situations. Regardless of whether the screenshot task is successful or not, as long as the screenshot task is in a terminated state, the state of the screenshot task will be updated in the cache service. It can be understood that this query method in the present embodiment can not only observe the task execution status in a timely manner, but also cover various abnormal scenarios.
[0103] In one embodiment, see Fig.11 and Fig.13 , the status of the capture task is capture success, after the above step S120, it also includes:
[0104] S121: Use the front-end business platform to update the status of the screenshot task.
[0105] Specifically, after the capture is successful, the status of the capture task in the cache service is updated to capture success, thereby ensuring the real-time result of the capture task.
[0106] In one implementation, the cache service can be self-built or can use third-party open source software such as Redis and Memcache.
[0107] S122: Utilize the front-end business platform to cancel the screenshot task in the task queue.
[0108] Specifically, the picture capturing task corresponding to the successful picture capturing is cancelled from the task queue to avoid repeated execution of the same picture capturing task.
[0109] In one embodiment, see Figure 3 The above process is implemented by means of message monitoring. Specifically, the message service is monitored through the capture event message queue. When the capture is successful, the corresponding capture task is cancelled from the task queue by consuming the capture event.
[0110] S123: Using the front-end service platform, a download link of the image data in the capture result is sent to the client.
[0111] Specifically, when the status of the capture task is capture success, the capture result has a download link corresponding to the image data, and the download link is sent to the client, thereby completing the entire capture task.
[0112] In one embodiment, see Fig.14 , the method of the present application also includes:
[0113] S800: When an abnormal situation occurs in at least one of the front-end service platform, the back-end processing platform, and the device cluster, an execution strategy is determined according to whether the abnormal situation is recoverable.
[0114] Specifically, after sending the capture task request, each of the front-end business platform, the back-end processing platform, and the device cluster may experience abnormal situations, for example, the target device in the device cluster is offline, the target device in the device cluster has timed out, the target device in the device cluster fails to make a picture, the target device in the device cluster fails to report a picture, the capture task of the target device in the device cluster times out, the back-end processing platform fails to store the picture, or the link returned by the front-end business platform fails, etc. The above-mentioned various abnormal situations can determine whether they can be recovered based on their specific content and adopt different execution strategies.
[0115] S900: When the abnormal situation is recoverable, execute the recovery strategy and use the front-end business platform, the back-end processing platform and the device cluster to re-execute the capture task.
[0116] Specifically, if the abnormal situation can be recovered, that is, the abnormal situation can be resolved by the front-end business platform, the back-end processing platform and the device cluster itself, the front-end business platform can be used to re-issue the screenshot request without the client manually sending it, so as to achieve recovery and complete the screenshot task without the client's perception. In some implementations, some abnormal situations may take a certain amount of time to recover (i.e., they cannot be recovered in a short time), and the front-end business platform can be used to re-issue the screenshot request. Delay for a certain period of time to ensure that the screenshot request is issued after the abnormal situation is completely recovered.
[0117] S1000: When the abnormal situation is unrecoverable, the termination strategy is executed, and the front-end business platform, the back-end processing platform and the device cluster are used to send the abnormal information related to the failure of the capture task and the abnormal situation to the client.
[0118] Specifically, if the abnormal situation cannot be recovered, that is, the abnormal situation cannot be solved by the front-end business platform, the back-end processing platform, or the device cluster itself, there is no need to try to solve it. You can directly execute the termination strategy to end the capture task, and send the capture task failure and abnormal information related to the abnormal situation, such as the abnormal error code and the abnormal error description, to the client, so as to facilitate the client to display and locate the problem. It can be seen that this application makes the execution of the capture task more flexible through different execution strategies, and the capture success rate is also higher, which can meet a variety of application scenarios.
[0119] See also Fig.15The present application also provides a management device 200, which includes a first processing module 210, a first sending module 220, a second processing module 230 and a second sending module 240 connected in sequence.
[0120] The first processing module 210 is used to: use the front-end service platform to obtain the picture capture request sent by the client, generate the picture capture task according to the picture capture request, and send it to the back-end processing platform.
[0121] The first sending module 220 is used to obtain hardware information generated by the server to be installed through self-checking, and send installation configuration information matching the hardware information to the server to be installed according to the hardware information, so that the server to be installed installs the product package according to the installation configuration information.
[0122] The second processing module 230 is used to: use the backend processing platform to obtain the image data of the device cluster processing the capture task, generate the capture result event corresponding to the image data, and send the capture result event to the front-end business platform.
[0123] The second sending module 240 is used to send the capture result event to the client by using the front-end service platform.
[0124] Among them, the management device 200 executes the method steps in any of the above-mentioned implementation modes when working. The detailed method steps can be found in the above-mentioned related content and will not be repeated here.
[0125] The management device 200 may be a device having data processing and storage functions.
[0126] See also Fig.16 , Fig.16 It is a structural diagram of an embodiment of an electronic device of the present application, wherein the electronic device 40 includes a memory 401 and a processor 402, wherein the memory 401 stores program data (not shown), and the processor 402 calls the program data to implement the method in any of the above embodiments. For descriptions of related contents, please refer to the detailed description of the above method embodiments, which will not be repeated here.
[0127] See also Fig.17 , Fig.17 It is a structural diagram of an embodiment of a computer-readable storage medium of the present application. The computer-readable storage medium 50 stores program data 500. When the program data 500 is executed by a processor, the method in any of the above embodiments is implemented. For descriptions of related contents, please refer to the detailed description of the above method embodiments, which will not be repeated here.
[0128] It should be noted that the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present implementation scheme.
[0129] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0130] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) or a processor (processor) to perform all or part of the steps of each implementation method of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program code.
[0131] The above description is only an implementation method of the present application, and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly used in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A method for managing a screenshot task, characterized in that: Applied to a service platform, the service platform is connected with a client and a device cluster, the service platform includes a front-end business platform and a back-end processing platform, and the method includes: Utilizing the front-end service platform to obtain the picture capture request sent by the client, generating the picture capture task according to the picture capture request and sending it to the back-end processing platform; Using the backend processing platform to send the image capture task to the device cluster; Using the backend processing platform to obtain the image data of the image capture task processed by the device cluster, generate an image capture result event corresponding to the image data, and send the image capture result event to the frontend business platform; The front-end service platform is used to send the capture result event to the client.
2. The method according to claim 1, characterized in that After the step of sending the image capture task to the device cluster using the backend processing platform, the method further includes: Using the backend processing platform to obtain the response signaling of the device cluster receiving the picture capturing task, and sending the response signaling of the picture capturing task to the frontend service platform; The front-end service platform is used to obtain the response signaling of the screenshot task and update the status of the screenshot task.
3. The method according to claim 1, characterized in that The steps of using the backend processing platform to obtain the image data of the device cluster processing the image capture task, generating the image capture result event corresponding to the image data, and sending the image capture result event to the frontend business platform include: Using the backend processing platform to obtain the image data of the image capture task processed by the device cluster, and storing the image data; Using the backend processing platform to generate the capture result event corresponding to the image data, and further sending the capture result event to the frontend business platform; The front-end business platform is used to update the status of the screenshot task according to the screenshot result event.
4. The method according to claim 3, characterized in that The step of using the backend processing platform to obtain the image data of the image capture task processed by the device cluster and storing the image data includes: Using the backend processing platform to obtain the image data of the image capture task processed by the device cluster; Utilizing the backend processing platform to store the image data in a cloud storage node, and generating basic information corresponding to the image data; The back-end processing platform is used to generate a download link for the image data according to the basic information.
5. The method according to claim 4, characterized in that The method further comprises: Using the front-end service platform to obtain a download request for the picture data from the client, wherein the download request for the picture data includes a download link for the picture data; Using the front-end service platform to obtain the image data in the cloud storage node according to the download link of the image data; The image data is sent to the client using the front-end service platform.
6. The method according to claim 5, characterized in that The step of using the front-end business platform to obtain the image data in the cloud storage node according to the download link of the image data includes: Utilizing the front-end business platform to parse the download link of the picture data through the picture proxy service to obtain a first parameter; Using the front-end business platform to obtain basic information of the image data according to the first parameter through the image proxy service; Using the front-end business platform to verify whether the download link of the picture data and the basic information of the picture data are normal through the picture proxy service; If the verification result is normal, the image data in the cloud storage node is obtained by using the front-end business platform; Otherwise, the front-end service platform is used to send the verification result to the client.
7. The method according to claim 1, characterized in that After the steps of using the front-end service platform to obtain the picture capture request sent by the client, generating the picture capture task according to the picture capture request and sending it to the back-end processing platform, the method includes: Using the front-end service platform to obtain the status of the picture capturing task, and determining whether the status of the picture capturing task is a terminal state, wherein the terminal state at least includes picture capturing success, picture capturing failure, or picture capturing timeout; If the state of the picture-grabbing task is a terminal state, using the front-end service platform to send the state of the picture-grabbing task to the client; Otherwise, the front-end service platform is used to continue to execute the steps of obtaining the status of the picture-grabbing task by using the front-end service platform and determining whether the status of the picture-grabbing task is a terminal state.
8. The method according to claim 7, characterized in that The number of executions of the step of using the front-end business platform to obtain the status of the screenshot task and determine whether the status of the screenshot task is a terminal state does not exceed a preset number of times.
9. The method according to claim 7, characterized in that: The state of the picture capturing task is that the picture capturing is successful. If the state of the picture capturing task is a termination state, after the step of using the front-end service platform to send the state of the picture capturing task to the client, the method further includes: Using the front-end business platform to update the status of the picture-grabbing task; Using the front-end business platform to cancel the picture-taking task in the task queue; The front-end service platform is used to send a download link of the image data in the capture result to the client.
10. The method according to claim 1, characterized in that The method further comprises: When an abnormal situation occurs in at least one of the front-end service platform, the back-end processing platform, and the device cluster, determining an execution strategy according to whether the abnormal situation is recoverable; When the abnormal situation is recoverable, a recovery strategy is executed to re-execute the image capture task using the front-end service platform, the back-end processing platform and the device cluster; When the abnormal situation is unrecoverable, a termination strategy is executed, and the front-end business platform, the back-end processing platform and the device cluster are used to send the failure of the capture task and abnormal information related to the abnormal situation to the client.
11. An electronic device, characterized in that: The electronic device comprises a processor and a memory, wherein the processor is configured to execute a computer program stored in the memory to implement the steps in the method according to any one of claims 1 to 10.
12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and the computer program can be executed by a processor to implement the steps in the method according to any one of claims 1 to 10.